@valbuild/ui 0.63.0 → 0.63.5

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.
@@ -1,430 +0,0 @@
1
- var SA=Object.defineProperty;var kA=(e,t,n)=>t in e?SA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var st=(e,t,n)=>(kA(e,typeof t!="symbol"?t+"":t,n),n),EA=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var mv=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)};var rp=(e,t,n)=>(EA(e,t,"access private method"),n);function CA(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in e)){const i=Object.getOwnPropertyDescriptor(r,o);i&&Object.defineProperty(e,o,i.get?i:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var _A=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ri(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function OA(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var N_={exports:{}},Ie={};/**
2
- * @license React
3
- * react.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var _f=Symbol.for("react.element"),TA=Symbol.for("react.portal"),MA=Symbol.for("react.fragment"),RA=Symbol.for("react.strict_mode"),PA=Symbol.for("react.profiler"),NA=Symbol.for("react.provider"),$A=Symbol.for("react.context"),DA=Symbol.for("react.forward_ref"),AA=Symbol.for("react.suspense"),IA=Symbol.for("react.memo"),LA=Symbol.for("react.lazy"),Yw=Symbol.iterator;function jA(e){return e===null||typeof e!="object"?null:(e=Yw&&e[Yw]||e["@@iterator"],typeof e=="function"?e:null)}var $_={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},D_=Object.assign,A_={};function Rc(e,t,n){this.props=e,this.context=t,this.refs=A_,this.updater=n||$_}Rc.prototype.isReactComponent={};Rc.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Rc.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function I_(){}I_.prototype=Rc.prototype;function Kx(e,t,n){this.props=e,this.context=t,this.refs=A_,this.updater=n||$_}var qx=Kx.prototype=new I_;qx.constructor=Kx;D_(qx,Rc.prototype);qx.isPureReactComponent=!0;var Xw=Array.isArray,L_=Object.prototype.hasOwnProperty,Gx={current:null},j_={key:!0,ref:!0,__self:!0,__source:!0};function z_(e,t,n){var r,o={},i=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)L_.call(t,r)&&!j_.hasOwnProperty(r)&&(o[r]=t[r]);var a=arguments.length-2;if(a===1)o.children=n;else if(1<a){for(var l=Array(a),c=0;c<a;c++)l[c]=arguments[c+2];o.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)o[r]===void 0&&(o[r]=a[r]);return{$$typeof:_f,type:e,key:i,ref:s,props:o,_owner:Gx.current}}function zA(e,t){return{$$typeof:_f,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Yx(e){return typeof e=="object"&&e!==null&&e.$$typeof===_f}function FA(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Zw=/\/+/g;function gv(e,t){return typeof e=="object"&&e!==null&&e.key!=null?FA(""+e.key):t.toString(36)}function Vp(e,t,n,r,o){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(i){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case _f:case TA:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+gv(s,0):r,Xw(o)?(n="",e!=null&&(n=e.replace(Zw,"$&/")+"/"),Vp(o,t,n,"",function(c){return c})):o!=null&&(Yx(o)&&(o=zA(o,n+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(Zw,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",Xw(e))for(var a=0;a<e.length;a++){i=e[a];var l=r+gv(i,a);s+=Vp(i,t,n,l,o)}else if(l=jA(e),typeof l=="function")for(e=l.call(e),a=0;!(i=e.next()).done;)i=i.value,l=r+gv(i,a++),s+=Vp(i,t,n,l,o);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function op(e,t,n){if(e==null)return e;var r=[],o=0;return Vp(e,r,"","",function(i){return t.call(n,i,o++)}),r}function BA(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Nn={current:null},Up={transition:null},VA={ReactCurrentDispatcher:Nn,ReactCurrentBatchConfig:Up,ReactCurrentOwner:Gx};Ie.Children={map:op,forEach:function(e,t,n){op(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return op(e,function(){t++}),t},toArray:function(e){return op(e,function(t){return t})||[]},only:function(e){if(!Yx(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Ie.Component=Rc;Ie.Fragment=MA;Ie.Profiler=PA;Ie.PureComponent=Kx;Ie.StrictMode=RA;Ie.Suspense=AA;Ie.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=VA;Ie.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=D_({},e.props),o=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=Gx.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)L_.call(t,l)&&!j_.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var c=0;c<l;c++)a[c]=arguments[c+2];r.children=a}return{$$typeof:_f,type:e.type,key:o,ref:i,props:r,_owner:s}};Ie.createContext=function(e){return e={$$typeof:$A,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:NA,_context:e},e.Consumer=e};Ie.createElement=z_;Ie.createFactory=function(e){var t=z_.bind(null,e);return t.type=e,t};Ie.createRef=function(){return{current:null}};Ie.forwardRef=function(e){return{$$typeof:DA,render:e}};Ie.isValidElement=Yx;Ie.lazy=function(e){return{$$typeof:LA,_payload:{_status:-1,_result:e},_init:BA}};Ie.memo=function(e,t){return{$$typeof:IA,type:e,compare:t===void 0?null:t}};Ie.startTransition=function(e){var t=Up.transition;Up.transition={};try{e()}finally{Up.transition=t}};Ie.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};Ie.useCallback=function(e,t){return Nn.current.useCallback(e,t)};Ie.useContext=function(e){return Nn.current.useContext(e)};Ie.useDebugValue=function(){};Ie.useDeferredValue=function(e){return Nn.current.useDeferredValue(e)};Ie.useEffect=function(e,t){return Nn.current.useEffect(e,t)};Ie.useId=function(){return Nn.current.useId()};Ie.useImperativeHandle=function(e,t,n){return Nn.current.useImperativeHandle(e,t,n)};Ie.useInsertionEffect=function(e,t){return Nn.current.useInsertionEffect(e,t)};Ie.useLayoutEffect=function(e,t){return Nn.current.useLayoutEffect(e,t)};Ie.useMemo=function(e,t){return Nn.current.useMemo(e,t)};Ie.useReducer=function(e,t,n){return Nn.current.useReducer(e,t,n)};Ie.useRef=function(e){return Nn.current.useRef(e)};Ie.useState=function(e){return Nn.current.useState(e)};Ie.useSyncExternalStore=function(e,t,n){return Nn.current.useSyncExternalStore(e,t,n)};Ie.useTransition=function(){return Nn.current.useTransition()};Ie.version="18.2.0";N_.exports=Ie;var p=N_.exports;const H=Ri(p),UA=CA({__proto__:null,default:H},[p]);var Yu={},F_={exports:{}},fr={},B_={exports:{}},V_={};/**
10
- * @license React
11
- * scheduler.production.min.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */(function(e){function t(_,P){var N=_.length;_.push(P);e:for(;0<N;){var I=N-1>>>1,B=_[I];if(0<o(B,P))_[I]=P,_[N]=B,N=I;else break e}}function n(_){return _.length===0?null:_[0]}function r(_){if(_.length===0)return null;var P=_[0],N=_.pop();if(N!==P){_[0]=N;e:for(var I=0,B=_.length,de=B>>>1;I<de;){var ue=2*(I+1)-1,Ae=_[ue],me=ue+1,X=_[me];if(0>o(Ae,N))me<B&&0>o(X,Ae)?(_[I]=X,_[me]=N,I=me):(_[I]=Ae,_[ue]=N,I=ue);else if(me<B&&0>o(X,N))_[I]=X,_[me]=N,I=me;else break e}}return P}function o(_,P){var N=_.sortIndex-P.sortIndex;return N!==0?N:_.id-P.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var l=[],c=[],u=1,d=null,f=3,h=!1,m=!1,g=!1,b=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(_){for(var P=n(c);P!==null;){if(P.callback===null)r(c);else if(P.startTime<=_)r(c),P.sortIndex=P.expirationTime,t(l,P);else break;P=n(c)}}function S(_){if(g=!1,w(_),!m)if(n(l)!==null)m=!0,O(k);else{var P=n(c);P!==null&&M(S,P.startTime-_)}}function k(_,P){m=!1,g&&(g=!1,y(T),T=-1),h=!0;var N=f;try{for(w(P),d=n(l);d!==null&&(!(d.expirationTime>P)||_&&!j());){var I=d.callback;if(typeof I=="function"){d.callback=null,f=d.priorityLevel;var B=I(d.expirationTime<=P);P=e.unstable_now(),typeof B=="function"?d.callback=B:d===n(l)&&r(l),w(P)}else r(l);d=n(l)}if(d!==null)var de=!0;else{var ue=n(c);ue!==null&&M(S,ue.startTime-P),de=!1}return de}finally{d=null,f=N,h=!1}}var C=!1,E=null,T=-1,R=5,$=-1;function j(){return!(e.unstable_now()-$<R)}function z(){if(E!==null){var _=e.unstable_now();$=_;var P=!0;try{P=E(!0,_)}finally{P?ee():(C=!1,E=null)}}else C=!1}var ee;if(typeof v=="function")ee=function(){v(z)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,U=V.port2;V.port1.onmessage=z,ee=function(){U.postMessage(null)}}else ee=function(){b(z,0)};function O(_){E=_,C||(C=!0,ee())}function M(_,P){T=b(function(){_(e.unstable_now())},P)}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(_){_.callback=null},e.unstable_continueExecution=function(){m||h||(m=!0,O(k))},e.unstable_forceFrameRate=function(_){0>_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<_?Math.floor(1e3/_):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(_){switch(f){case 1:case 2:case 3:var P=3;break;default:P=f}var N=f;f=P;try{return _()}finally{f=N}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(_,P){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var N=f;f=_;try{return P()}finally{f=N}},e.unstable_scheduleCallback=function(_,P,N){var I=e.unstable_now();switch(typeof N=="object"&&N!==null?(N=N.delay,N=typeof N=="number"&&0<N?I+N:I):N=I,_){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=N+B,_={id:u++,callback:P,priorityLevel:_,startTime:N,expirationTime:B,sortIndex:-1},N>I?(_.sortIndex=N,t(c,_),n(l)===null&&_===n(c)&&(g?(y(T),T=-1):g=!0,M(S,N-I))):(_.sortIndex=B,t(l,_),m||h||(m=!0,O(k))),_},e.unstable_shouldYield=j,e.unstable_wrapCallback=function(_){var P=f;return function(){var N=f;f=P;try{return _.apply(this,arguments)}finally{f=N}}}})(V_);B_.exports=V_;var HA=B_.exports;/**
18
- * @license React
19
- * react-dom.production.min.js
20
- *
21
- * Copyright (c) Facebook, Inc. and its affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */var U_=p,cr=HA;function F(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var H_=new Set,vd={};function Za(e,t){ac(e,t),ac(e+"Capture",t)}function ac(e,t){for(vd[e]=t,e=0;e<t.length;e++)H_.add(t[e])}var xi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Dy=Object.prototype.hasOwnProperty,WA=/^[: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]*$/,Jw={},Qw={};function KA(e){return Dy.call(Qw,e)?!0:Dy.call(Jw,e)?!1:WA.test(e)?Qw[e]=!0:(Jw[e]=!0,!1)}function qA(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function GA(e,t,n,r){if(t===null||typeof t>"u"||qA(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function $n(e,t,n,r,o,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var rn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){rn[e]=new $n(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];rn[t]=new $n(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){rn[e]=new $n(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){rn[e]=new $n(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){rn[e]=new $n(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){rn[e]=new $n(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){rn[e]=new $n(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){rn[e]=new $n(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){rn[e]=new $n(e,5,!1,e.toLowerCase(),null,!1,!1)});var Xx=/[\-:]([a-z])/g;function Zx(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Xx,Zx);rn[t]=new $n(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Xx,Zx);rn[t]=new $n(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Xx,Zx);rn[t]=new $n(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){rn[e]=new $n(e,1,!1,e.toLowerCase(),null,!1,!1)});rn.xlinkHref=new $n("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){rn[e]=new $n(e,1,!1,e.toLowerCase(),null,!0,!0)});function Jx(e,t,n,r){var o=rn.hasOwnProperty(t)?rn[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(GA(t,n,o,r)&&(n=null),r||o===null?KA(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Pi=U_.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ip=Symbol.for("react.element"),$l=Symbol.for("react.portal"),Dl=Symbol.for("react.fragment"),Qx=Symbol.for("react.strict_mode"),Ay=Symbol.for("react.profiler"),W_=Symbol.for("react.provider"),K_=Symbol.for("react.context"),eb=Symbol.for("react.forward_ref"),Iy=Symbol.for("react.suspense"),Ly=Symbol.for("react.suspense_list"),tb=Symbol.for("react.memo"),rs=Symbol.for("react.lazy"),q_=Symbol.for("react.offscreen"),eS=Symbol.iterator;function nu(e){return e===null||typeof e!="object"?null:(e=eS&&e[eS]||e["@@iterator"],typeof e=="function"?e:null)}var xt=Object.assign,vv;function bu(e){if(vv===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);vv=t&&t[1]||""}return`
26
- `+vv+e}var yv=!1;function xv(e,t){if(!e||yv)return"";yv=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var o=c.stack.split(`
27
- `),i=r.stack.split(`
28
- `),s=o.length-1,a=i.length-1;1<=s&&0<=a&&o[s]!==i[a];)a--;for(;1<=s&&0<=a;s--,a--)if(o[s]!==i[a]){if(s!==1||a!==1)do if(s--,a--,0>a||o[s]!==i[a]){var l=`
29
- `+o[s].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{yv=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?bu(e):""}function YA(e){switch(e.tag){case 5:return bu(e.type);case 16:return bu("Lazy");case 13:return bu("Suspense");case 19:return bu("SuspenseList");case 0:case 2:case 15:return e=xv(e.type,!1),e;case 11:return e=xv(e.type.render,!1),e;case 1:return e=xv(e.type,!0),e;default:return""}}function jy(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Dl:return"Fragment";case $l:return"Portal";case Ay:return"Profiler";case Qx:return"StrictMode";case Iy:return"Suspense";case Ly:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case K_:return(e.displayName||"Context")+".Consumer";case W_:return(e._context.displayName||"Context")+".Provider";case eb:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case tb:return t=e.displayName||null,t!==null?t:jy(e.type)||"Memo";case rs:t=e._payload,e=e._init;try{return jy(e(t))}catch{}}return null}function XA(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return jy(t);case 8:return t===Qx?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function $s(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function G_(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ZA(e){var t=G_(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function sp(e){e._valueTracker||(e._valueTracker=ZA(e))}function Y_(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=G_(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function bh(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function zy(e,t){var n=t.checked;return xt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function tS(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=$s(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function X_(e,t){t=t.checked,t!=null&&Jx(e,"checked",t,!1)}function Fy(e,t){X_(e,t);var n=$s(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?By(e,t.type,n):t.hasOwnProperty("defaultValue")&&By(e,t.type,$s(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function nS(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function By(e,t,n){(t!=="number"||bh(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var wu=Array.isArray;function Kl(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+$s(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Vy(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(F(91));return xt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function rS(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(F(92));if(wu(n)){if(1<n.length)throw Error(F(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:$s(n)}}function Z_(e,t){var n=$s(t.value),r=$s(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function oS(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function J_(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Uy(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?J_(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var ap,Q_=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(ap=ap||document.createElement("div"),ap.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ap.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function yd(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Xu={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},JA=["Webkit","ms","Moz","O"];Object.keys(Xu).forEach(function(e){JA.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Xu[t]=Xu[e]})});function eO(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Xu.hasOwnProperty(e)&&Xu[e]?(""+t).trim():t+"px"}function tO(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=eO(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var QA=xt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Hy(e,t){if(t){if(QA[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(F(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(F(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(F(61))}if(t.style!=null&&typeof t.style!="object")throw Error(F(62))}}function Wy(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ky=null;function nb(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var qy=null,ql=null,Gl=null;function iS(e){if(e=Mf(e)){if(typeof qy!="function")throw Error(F(280));var t=e.stateNode;t&&(t=Jm(t),qy(e.stateNode,e.type,t))}}function nO(e){ql?Gl?Gl.push(e):Gl=[e]:ql=e}function rO(){if(ql){var e=ql,t=Gl;if(Gl=ql=null,iS(e),t)for(e=0;e<t.length;e++)iS(t[e])}}function oO(e,t){return e(t)}function iO(){}var bv=!1;function sO(e,t,n){if(bv)return e(t,n);bv=!0;try{return oO(e,t,n)}finally{bv=!1,(ql!==null||Gl!==null)&&(iO(),rO())}}function xd(e,t){var n=e.stateNode;if(n===null)return null;var r=Jm(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(F(231,t,typeof n));return n}var Gy=!1;if(xi)try{var ru={};Object.defineProperty(ru,"passive",{get:function(){Gy=!0}}),window.addEventListener("test",ru,ru),window.removeEventListener("test",ru,ru)}catch{Gy=!1}function eI(e,t,n,r,o,i,s,a,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(u){this.onError(u)}}var Zu=!1,wh=null,Sh=!1,Yy=null,tI={onError:function(e){Zu=!0,wh=e}};function nI(e,t,n,r,o,i,s,a,l){Zu=!1,wh=null,eI.apply(tI,arguments)}function rI(e,t,n,r,o,i,s,a,l){if(nI.apply(this,arguments),Zu){if(Zu){var c=wh;Zu=!1,wh=null}else throw Error(F(198));Sh||(Sh=!0,Yy=c)}}function Ja(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 aO(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 sS(e){if(Ja(e)!==e)throw Error(F(188))}function oI(e){var t=e.alternate;if(!t){if(t=Ja(e),t===null)throw Error(F(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var i=o.alternate;if(i===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return sS(o),e;if(i===r)return sS(o),t;i=i.sibling}throw Error(F(188))}if(n.return!==r.return)n=o,r=i;else{for(var s=!1,a=o.child;a;){if(a===n){s=!0,n=o,r=i;break}if(a===r){s=!0,r=o,n=i;break}a=a.sibling}if(!s){for(a=i.child;a;){if(a===n){s=!0,n=i,r=o;break}if(a===r){s=!0,r=i,n=o;break}a=a.sibling}if(!s)throw Error(F(189))}}if(n.alternate!==r)throw Error(F(190))}if(n.tag!==3)throw Error(F(188));return n.stateNode.current===n?e:t}function lO(e){return e=oI(e),e!==null?cO(e):null}function cO(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=cO(e);if(t!==null)return t;e=e.sibling}return null}var uO=cr.unstable_scheduleCallback,aS=cr.unstable_cancelCallback,iI=cr.unstable_shouldYield,sI=cr.unstable_requestPaint,Ct=cr.unstable_now,aI=cr.unstable_getCurrentPriorityLevel,rb=cr.unstable_ImmediatePriority,dO=cr.unstable_UserBlockingPriority,kh=cr.unstable_NormalPriority,lI=cr.unstable_LowPriority,fO=cr.unstable_IdlePriority,Gm=null,Do=null;function cI(e){if(Do&&typeof Do.onCommitFiberRoot=="function")try{Do.onCommitFiberRoot(Gm,e,void 0,(e.current.flags&128)===128)}catch{}}var ao=Math.clz32?Math.clz32:fI,uI=Math.log,dI=Math.LN2;function fI(e){return e>>>=0,e===0?32:31-(uI(e)/dI|0)|0}var lp=64,cp=4194304;function Su(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Eh(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~o;a!==0?r=Su(a):(i&=s,i!==0&&(r=Su(i)))}else s=n&~o,s!==0?r=Su(s):i!==0&&(r=Su(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-ao(t),o=1<<n,r|=e[n],t&=~o;return r}function pI(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function hI(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-ao(i),a=1<<s,l=o[s];l===-1?(!(a&n)||a&r)&&(o[s]=pI(a,t)):l<=t&&(e.expiredLanes|=a),i&=~a}}function Xy(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function pO(){var e=lp;return lp<<=1,!(lp&4194240)&&(lp=64),e}function wv(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Of(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ao(t),e[t]=n}function mI(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-ao(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function ob(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-ao(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var Ze=0;function hO(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var mO,ib,gO,vO,yO,Zy=!1,up=[],ys=null,xs=null,bs=null,bd=new Map,wd=new Map,cs=[],gI="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function lS(e,t){switch(e){case"focusin":case"focusout":ys=null;break;case"dragenter":case"dragleave":xs=null;break;case"mouseover":case"mouseout":bs=null;break;case"pointerover":case"pointerout":bd.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":wd.delete(t.pointerId)}}function ou(e,t,n,r,o,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},t!==null&&(t=Mf(t),t!==null&&ib(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function vI(e,t,n,r,o){switch(t){case"focusin":return ys=ou(ys,e,t,n,r,o),!0;case"dragenter":return xs=ou(xs,e,t,n,r,o),!0;case"mouseover":return bs=ou(bs,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return bd.set(i,ou(bd.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,wd.set(i,ou(wd.get(i)||null,e,t,n,r,o)),!0}return!1}function xO(e){var t=pa(e.target);if(t!==null){var n=Ja(t);if(n!==null){if(t=n.tag,t===13){if(t=aO(n),t!==null){e.blockedOn=t,yO(e.priority,function(){gO(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 Hp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Jy(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Ky=r,n.target.dispatchEvent(r),Ky=null}else return t=Mf(n),t!==null&&ib(t),e.blockedOn=n,!1;t.shift()}return!0}function cS(e,t,n){Hp(e)&&n.delete(t)}function yI(){Zy=!1,ys!==null&&Hp(ys)&&(ys=null),xs!==null&&Hp(xs)&&(xs=null),bs!==null&&Hp(bs)&&(bs=null),bd.forEach(cS),wd.forEach(cS)}function iu(e,t){e.blockedOn===t&&(e.blockedOn=null,Zy||(Zy=!0,cr.unstable_scheduleCallback(cr.unstable_NormalPriority,yI)))}function Sd(e){function t(o){return iu(o,e)}if(0<up.length){iu(up[0],e);for(var n=1;n<up.length;n++){var r=up[n];r.blockedOn===e&&(r.blockedOn=null)}}for(ys!==null&&iu(ys,e),xs!==null&&iu(xs,e),bs!==null&&iu(bs,e),bd.forEach(t),wd.forEach(t),n=0;n<cs.length;n++)r=cs[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<cs.length&&(n=cs[0],n.blockedOn===null);)xO(n),n.blockedOn===null&&cs.shift()}var Yl=Pi.ReactCurrentBatchConfig,Ch=!0;function xI(e,t,n,r){var o=Ze,i=Yl.transition;Yl.transition=null;try{Ze=1,sb(e,t,n,r)}finally{Ze=o,Yl.transition=i}}function bI(e,t,n,r){var o=Ze,i=Yl.transition;Yl.transition=null;try{Ze=4,sb(e,t,n,r)}finally{Ze=o,Yl.transition=i}}function sb(e,t,n,r){if(Ch){var o=Jy(e,t,n,r);if(o===null)Pv(e,t,r,_h,n),lS(e,r);else if(vI(o,e,t,n,r))r.stopPropagation();else if(lS(e,r),t&4&&-1<gI.indexOf(e)){for(;o!==null;){var i=Mf(o);if(i!==null&&mO(i),i=Jy(e,t,n,r),i===null&&Pv(e,t,r,_h,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else Pv(e,t,r,null,n)}}var _h=null;function Jy(e,t,n,r){if(_h=null,e=nb(r),e=pa(e),e!==null)if(t=Ja(e),t===null)e=null;else if(n=t.tag,n===13){if(e=aO(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 _h=e,null}function bO(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(aI()){case rb:return 1;case dO:return 4;case kh:case lI:return 16;case fO:return 536870912;default:return 16}default:return 16}}var ps=null,ab=null,Wp=null;function wO(){if(Wp)return Wp;var e,t=ab,n=t.length,r,o="value"in ps?ps.value:ps.textContent,i=o.length;for(e=0;e<n&&t[e]===o[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===o[i-r];r++);return Wp=o.slice(e,1<r?1-r:void 0)}function Kp(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 dp(){return!0}function uS(){return!1}function pr(e){function t(n,r,o,i,s){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=i,this.target=s,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?dp:uS,this.isPropagationStopped=uS,this}return xt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=dp)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=dp)},persist:function(){},isPersistent:dp}),t}var Pc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},lb=pr(Pc),Tf=xt({},Pc,{view:0,detail:0}),wI=pr(Tf),Sv,kv,su,Ym=xt({},Tf,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:cb,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!==su&&(su&&e.type==="mousemove"?(Sv=e.screenX-su.screenX,kv=e.screenY-su.screenY):kv=Sv=0,su=e),Sv)},movementY:function(e){return"movementY"in e?e.movementY:kv}}),dS=pr(Ym),SI=xt({},Ym,{dataTransfer:0}),kI=pr(SI),EI=xt({},Tf,{relatedTarget:0}),Ev=pr(EI),CI=xt({},Pc,{animationName:0,elapsedTime:0,pseudoElement:0}),_I=pr(CI),OI=xt({},Pc,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),TI=pr(OI),MI=xt({},Pc,{data:0}),fS=pr(MI),RI={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},PI={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"},NI={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $I(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=NI[e])?!!t[e]:!1}function cb(){return $I}var DI=xt({},Tf,{key:function(e){if(e.key){var t=RI[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Kp(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?PI[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:cb,charCode:function(e){return e.type==="keypress"?Kp(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Kp(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),AI=pr(DI),II=xt({},Ym,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),pS=pr(II),LI=xt({},Tf,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:cb}),jI=pr(LI),zI=xt({},Pc,{propertyName:0,elapsedTime:0,pseudoElement:0}),FI=pr(zI),BI=xt({},Ym,{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}),VI=pr(BI),UI=[9,13,27,32],ub=xi&&"CompositionEvent"in window,Ju=null;xi&&"documentMode"in document&&(Ju=document.documentMode);var HI=xi&&"TextEvent"in window&&!Ju,SO=xi&&(!ub||Ju&&8<Ju&&11>=Ju),hS=" ",mS=!1;function kO(e,t){switch(e){case"keyup":return UI.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function EO(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Al=!1;function WI(e,t){switch(e){case"compositionend":return EO(t);case"keypress":return t.which!==32?null:(mS=!0,hS);case"textInput":return e=t.data,e===hS&&mS?null:e;default:return null}}function KI(e,t){if(Al)return e==="compositionend"||!ub&&kO(e,t)?(e=wO(),Wp=ab=ps=null,Al=!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 SO&&t.locale!=="ko"?null:t.data;default:return null}}var qI={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 gS(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!qI[e.type]:t==="textarea"}function CO(e,t,n,r){nO(r),t=Oh(t,"onChange"),0<t.length&&(n=new lb("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Qu=null,kd=null;function GI(e){IO(e,0)}function Xm(e){var t=jl(e);if(Y_(t))return e}function YI(e,t){if(e==="change")return t}var _O=!1;if(xi){var Cv;if(xi){var _v="oninput"in document;if(!_v){var vS=document.createElement("div");vS.setAttribute("oninput","return;"),_v=typeof vS.oninput=="function"}Cv=_v}else Cv=!1;_O=Cv&&(!document.documentMode||9<document.documentMode)}function yS(){Qu&&(Qu.detachEvent("onpropertychange",OO),kd=Qu=null)}function OO(e){if(e.propertyName==="value"&&Xm(kd)){var t=[];CO(t,kd,e,nb(e)),sO(GI,t)}}function XI(e,t,n){e==="focusin"?(yS(),Qu=t,kd=n,Qu.attachEvent("onpropertychange",OO)):e==="focusout"&&yS()}function ZI(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Xm(kd)}function JI(e,t){if(e==="click")return Xm(t)}function QI(e,t){if(e==="input"||e==="change")return Xm(t)}function e3(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ho=typeof Object.is=="function"?Object.is:e3;function Ed(e,t){if(ho(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)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 o=n[r];if(!Dy.call(t,o)||!ho(e[o],t[o]))return!1}return!0}function xS(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function bS(e,t){var n=xS(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}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=xS(n)}}function TO(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?TO(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function MO(){for(var e=window,t=bh();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=bh(e.document)}return t}function db(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function t3(e){var t=MO(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&TO(n.ownerDocument.documentElement,n)){if(r!==null&&db(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=bS(n,i);var s=bS(n,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var n3=xi&&"documentMode"in document&&11>=document.documentMode,Il=null,Qy=null,ed=null,e0=!1;function wS(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;e0||Il==null||Il!==bh(r)||(r=Il,"selectionStart"in r&&db(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}),ed&&Ed(ed,r)||(ed=r,r=Oh(Qy,"onSelect"),0<r.length&&(t=new lb("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Il)))}function fp(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ll={animationend:fp("Animation","AnimationEnd"),animationiteration:fp("Animation","AnimationIteration"),animationstart:fp("Animation","AnimationStart"),transitionend:fp("Transition","TransitionEnd")},Ov={},RO={};xi&&(RO=document.createElement("div").style,"AnimationEvent"in window||(delete Ll.animationend.animation,delete Ll.animationiteration.animation,delete Ll.animationstart.animation),"TransitionEvent"in window||delete Ll.transitionend.transition);function Zm(e){if(Ov[e])return Ov[e];if(!Ll[e])return e;var t=Ll[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in RO)return Ov[e]=t[n];return e}var PO=Zm("animationend"),NO=Zm("animationiteration"),$O=Zm("animationstart"),DO=Zm("transitionend"),AO=new Map,SS="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function qs(e,t){AO.set(e,t),Za(t,[e])}for(var Tv=0;Tv<SS.length;Tv++){var Mv=SS[Tv],r3=Mv.toLowerCase(),o3=Mv[0].toUpperCase()+Mv.slice(1);qs(r3,"on"+o3)}qs(PO,"onAnimationEnd");qs(NO,"onAnimationIteration");qs($O,"onAnimationStart");qs("dblclick","onDoubleClick");qs("focusin","onFocus");qs("focusout","onBlur");qs(DO,"onTransitionEnd");ac("onMouseEnter",["mouseout","mouseover"]);ac("onMouseLeave",["mouseout","mouseover"]);ac("onPointerEnter",["pointerout","pointerover"]);ac("onPointerLeave",["pointerout","pointerover"]);Za("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Za("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Za("onBeforeInput",["compositionend","keypress","textInput","paste"]);Za("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Za("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Za("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ku="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(" "),i3=new Set("cancel close invalid load scroll toggle".split(" ").concat(ku));function kS(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,rI(r,t,void 0,e),e.currentTarget=null}function IO(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var s=r.length-1;0<=s;s--){var a=r[s],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==i&&o.isPropagationStopped())break e;kS(o,a,c),i=l}else for(s=0;s<r.length;s++){if(a=r[s],l=a.instance,c=a.currentTarget,a=a.listener,l!==i&&o.isPropagationStopped())break e;kS(o,a,c),i=l}}}if(Sh)throw e=Yy,Sh=!1,Yy=null,e}function lt(e,t){var n=t[i0];n===void 0&&(n=t[i0]=new Set);var r=e+"__bubble";n.has(r)||(LO(t,e,2,!1),n.add(r))}function Rv(e,t,n){var r=0;t&&(r|=4),LO(n,e,r,t)}var pp="_reactListening"+Math.random().toString(36).slice(2);function Cd(e){if(!e[pp]){e[pp]=!0,H_.forEach(function(n){n!=="selectionchange"&&(i3.has(n)||Rv(n,!1,e),Rv(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[pp]||(t[pp]=!0,Rv("selectionchange",!1,t))}}function LO(e,t,n,r){switch(bO(t)){case 1:var o=xI;break;case 4:o=bI;break;default:o=sb}n=o.bind(null,t,n,e),o=void 0,!Gy||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function Pv(e,t,n,r,o){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var a=r.stateNode.containerInfo;if(a===o||a.nodeType===8&&a.parentNode===o)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&(l=s.stateNode.containerInfo,l===o||l.nodeType===8&&l.parentNode===o))return;s=s.return}for(;a!==null;){if(s=pa(a),s===null)return;if(l=s.tag,l===5||l===6){r=i=s;continue e}a=a.parentNode}}r=r.return}sO(function(){var c=i,u=nb(n),d=[];e:{var f=AO.get(e);if(f!==void 0){var h=lb,m=e;switch(e){case"keypress":if(Kp(n)===0)break e;case"keydown":case"keyup":h=AI;break;case"focusin":m="focus",h=Ev;break;case"focusout":m="blur",h=Ev;break;case"beforeblur":case"afterblur":h=Ev;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=dS;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=kI;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=jI;break;case PO:case NO:case $O:h=_I;break;case DO:h=FI;break;case"scroll":h=wI;break;case"wheel":h=VI;break;case"copy":case"cut":case"paste":h=TI;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=pS}var g=(t&4)!==0,b=!g&&e==="scroll",y=g?f!==null?f+"Capture":null:f;g=[];for(var v=c,w;v!==null;){w=v;var S=w.stateNode;if(w.tag===5&&S!==null&&(w=S,y!==null&&(S=xd(v,y),S!=null&&g.push(_d(v,S,w)))),b)break;v=v.return}0<g.length&&(f=new h(f,m,null,n,u),d.push({event:f,listeners:g}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",f&&n!==Ky&&(m=n.relatedTarget||n.fromElement)&&(pa(m)||m[bi]))break e;if((h||f)&&(f=u.window===u?u:(f=u.ownerDocument)?f.defaultView||f.parentWindow:window,h?(m=n.relatedTarget||n.toElement,h=c,m=m?pa(m):null,m!==null&&(b=Ja(m),m!==b||m.tag!==5&&m.tag!==6)&&(m=null)):(h=null,m=c),h!==m)){if(g=dS,S="onMouseLeave",y="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(g=pS,S="onPointerLeave",y="onPointerEnter",v="pointer"),b=h==null?f:jl(h),w=m==null?f:jl(m),f=new g(S,v+"leave",h,n,u),f.target=b,f.relatedTarget=w,S=null,pa(u)===c&&(g=new g(y,v+"enter",m,n,u),g.target=w,g.relatedTarget=b,S=g),b=S,h&&m)t:{for(g=h,y=m,v=0,w=g;w;w=dl(w))v++;for(w=0,S=y;S;S=dl(S))w++;for(;0<v-w;)g=dl(g),v--;for(;0<w-v;)y=dl(y),w--;for(;v--;){if(g===y||y!==null&&g===y.alternate)break t;g=dl(g),y=dl(y)}g=null}else g=null;h!==null&&ES(d,f,h,g,!1),m!==null&&b!==null&&ES(d,b,m,g,!0)}}e:{if(f=c?jl(c):window,h=f.nodeName&&f.nodeName.toLowerCase(),h==="select"||h==="input"&&f.type==="file")var k=YI;else if(gS(f))if(_O)k=QI;else{k=ZI;var C=XI}else(h=f.nodeName)&&h.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(k=JI);if(k&&(k=k(e,c))){CO(d,k,n,u);break e}C&&C(e,f,c),e==="focusout"&&(C=f._wrapperState)&&C.controlled&&f.type==="number"&&By(f,"number",f.value)}switch(C=c?jl(c):window,e){case"focusin":(gS(C)||C.contentEditable==="true")&&(Il=C,Qy=c,ed=null);break;case"focusout":ed=Qy=Il=null;break;case"mousedown":e0=!0;break;case"contextmenu":case"mouseup":case"dragend":e0=!1,wS(d,n,u);break;case"selectionchange":if(n3)break;case"keydown":case"keyup":wS(d,n,u)}var E;if(ub)e:{switch(e){case"compositionstart":var T="onCompositionStart";break e;case"compositionend":T="onCompositionEnd";break e;case"compositionupdate":T="onCompositionUpdate";break e}T=void 0}else Al?kO(e,n)&&(T="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(T="onCompositionStart");T&&(SO&&n.locale!=="ko"&&(Al||T!=="onCompositionStart"?T==="onCompositionEnd"&&Al&&(E=wO()):(ps=u,ab="value"in ps?ps.value:ps.textContent,Al=!0)),C=Oh(c,T),0<C.length&&(T=new fS(T,e,null,n,u),d.push({event:T,listeners:C}),E?T.data=E:(E=EO(n),E!==null&&(T.data=E)))),(E=HI?WI(e,n):KI(e,n))&&(c=Oh(c,"onBeforeInput"),0<c.length&&(u=new fS("onBeforeInput","beforeinput",null,n,u),d.push({event:u,listeners:c}),u.data=E))}IO(d,t)})}function _d(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Oh(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=xd(e,n),i!=null&&r.unshift(_d(e,i,o)),i=xd(e,t),i!=null&&r.push(_d(e,i,o))),e=e.return}return r}function dl(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function ES(e,t,n,r,o){for(var i=t._reactName,s=[];n!==null&&n!==r;){var a=n,l=a.alternate,c=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&c!==null&&(a=c,o?(l=xd(n,i),l!=null&&s.unshift(_d(n,l,a))):o||(l=xd(n,i),l!=null&&s.push(_d(n,l,a)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var s3=/\r\n?/g,a3=/\u0000|\uFFFD/g;function CS(e){return(typeof e=="string"?e:""+e).replace(s3,`
30
- `).replace(a3,"")}function hp(e,t,n){if(t=CS(t),CS(e)!==t&&n)throw Error(F(425))}function Th(){}var t0=null,n0=null;function r0(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var o0=typeof setTimeout=="function"?setTimeout:void 0,l3=typeof clearTimeout=="function"?clearTimeout:void 0,_S=typeof Promise=="function"?Promise:void 0,c3=typeof queueMicrotask=="function"?queueMicrotask:typeof _S<"u"?function(e){return _S.resolve(null).then(e).catch(u3)}:o0;function u3(e){setTimeout(function(){throw e})}function Nv(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),Sd(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);Sd(t)}function ws(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function OS(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Nc=Math.random().toString(36).slice(2),Mo="__reactFiber$"+Nc,Od="__reactProps$"+Nc,bi="__reactContainer$"+Nc,i0="__reactEvents$"+Nc,d3="__reactListeners$"+Nc,f3="__reactHandles$"+Nc;function pa(e){var t=e[Mo];if(t)return t;for(var n=e.parentNode;n;){if(t=n[bi]||n[Mo]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=OS(e);e!==null;){if(n=e[Mo])return n;e=OS(e)}return t}e=n,n=e.parentNode}return null}function Mf(e){return e=e[Mo]||e[bi],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function jl(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(F(33))}function Jm(e){return e[Od]||null}var s0=[],zl=-1;function Gs(e){return{current:e}}function ct(e){0>zl||(e.current=s0[zl],s0[zl]=null,zl--)}function ot(e,t){zl++,s0[zl]=e.current,e.current=t}var Ds={},gn=Gs(Ds),Bn=Gs(!1),Pa=Ds;function lc(e,t){var n=e.type.contextTypes;if(!n)return Ds;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Vn(e){return e=e.childContextTypes,e!=null}function Mh(){ct(Bn),ct(gn)}function TS(e,t,n){if(gn.current!==Ds)throw Error(F(168));ot(gn,t),ot(Bn,n)}function jO(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(F(108,XA(e)||"Unknown",o));return xt({},n,r)}function Rh(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ds,Pa=gn.current,ot(gn,e),ot(Bn,Bn.current),!0}function MS(e,t,n){var r=e.stateNode;if(!r)throw Error(F(169));n?(e=jO(e,t,Pa),r.__reactInternalMemoizedMergedChildContext=e,ct(Bn),ct(gn),ot(gn,e)):ct(Bn),ot(Bn,n)}var li=null,Qm=!1,$v=!1;function zO(e){li===null?li=[e]:li.push(e)}function p3(e){Qm=!0,zO(e)}function Ys(){if(!$v&&li!==null){$v=!0;var e=0,t=Ze;try{var n=li;for(Ze=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}li=null,Qm=!1}catch(o){throw li!==null&&(li=li.slice(e+1)),uO(rb,Ys),o}finally{Ze=t,$v=!1}}return null}var Fl=[],Bl=0,Ph=null,Nh=0,Er=[],Cr=0,Na=null,ui=1,di="";function ta(e,t){Fl[Bl++]=Nh,Fl[Bl++]=Ph,Ph=e,Nh=t}function FO(e,t,n){Er[Cr++]=ui,Er[Cr++]=di,Er[Cr++]=Na,Na=e;var r=ui;e=di;var o=32-ao(r)-1;r&=~(1<<o),n+=1;var i=32-ao(t)+o;if(30<i){var s=o-o%5;i=(r&(1<<s)-1).toString(32),r>>=s,o-=s,ui=1<<32-ao(t)+o|n<<o|r,di=i+e}else ui=1<<i|n<<o|r,di=e}function fb(e){e.return!==null&&(ta(e,1),FO(e,1,0))}function pb(e){for(;e===Ph;)Ph=Fl[--Bl],Fl[Bl]=null,Nh=Fl[--Bl],Fl[Bl]=null;for(;e===Na;)Na=Er[--Cr],Er[Cr]=null,di=Er[--Cr],Er[Cr]=null,ui=Er[--Cr],Er[Cr]=null}var sr=null,ir=null,ut=!1,Jr=null;function BO(e,t){var n=Or(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function RS(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,sr=e,ir=ws(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,sr=e,ir=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Na!==null?{id:ui,overflow:di}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Or(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,sr=e,ir=null,!0):!1;default:return!1}}function a0(e){return(e.mode&1)!==0&&(e.flags&128)===0}function l0(e){if(ut){var t=ir;if(t){var n=t;if(!RS(e,t)){if(a0(e))throw Error(F(418));t=ws(n.nextSibling);var r=sr;t&&RS(e,t)?BO(r,n):(e.flags=e.flags&-4097|2,ut=!1,sr=e)}}else{if(a0(e))throw Error(F(418));e.flags=e.flags&-4097|2,ut=!1,sr=e}}}function PS(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;sr=e}function mp(e){if(e!==sr)return!1;if(!ut)return PS(e),ut=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!r0(e.type,e.memoizedProps)),t&&(t=ir)){if(a0(e))throw VO(),Error(F(418));for(;t;)BO(e,t),t=ws(t.nextSibling)}if(PS(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(F(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){ir=ws(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}ir=null}}else ir=sr?ws(e.stateNode.nextSibling):null;return!0}function VO(){for(var e=ir;e;)e=ws(e.nextSibling)}function cc(){ir=sr=null,ut=!1}function hb(e){Jr===null?Jr=[e]:Jr.push(e)}var h3=Pi.ReactCurrentBatchConfig;function Yr(e,t){if(e&&e.defaultProps){t=xt({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}var $h=Gs(null),Dh=null,Vl=null,mb=null;function gb(){mb=Vl=Dh=null}function vb(e){var t=$h.current;ct($h),e._currentValue=t}function c0(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Xl(e,t){Dh=e,mb=Vl=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(zn=!0),e.firstContext=null)}function Nr(e){var t=e._currentValue;if(mb!==e)if(e={context:e,memoizedValue:t,next:null},Vl===null){if(Dh===null)throw Error(F(308));Vl=e,Dh.dependencies={lanes:0,firstContext:e}}else Vl=Vl.next=e;return t}var ha=null;function yb(e){ha===null?ha=[e]:ha.push(e)}function UO(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,yb(t)):(n.next=o.next,o.next=n),t.interleaved=n,wi(e,r)}function wi(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var is=!1;function xb(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function HO(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function gi(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ss(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ve&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,wi(e,n)}return o=r.interleaved,o===null?(t.next=t,yb(r)):(t.next=o.next,o.next=t),r.interleaved=t,wi(e,n)}function qp(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ob(e,n)}}function NS(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Ah(e,t,n,r){var o=e.updateQueue;is=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,a=o.shared.pending;if(a!==null){o.shared.pending=null;var l=a,c=l.next;l.next=null,s===null?i=c:s.next=c,s=l;var u=e.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==s&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(i!==null){var d=o.baseState;s=0,u=c=l=null,a=i;do{var f=a.lane,h=a.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var m=e,g=a;switch(f=t,h=n,g.tag){case 1:if(m=g.payload,typeof m=="function"){d=m.call(h,d,f);break e}d=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m=="function"?m.call(h,d,f):m,f==null)break e;d=xt({},d,f);break e;case 2:is=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,f=o.effects,f===null?o.effects=[a]:f.push(a))}else h={eventTime:h,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=h,l=d):u=u.next=h,s|=f;if(a=a.next,a===null){if(a=o.shared.pending,a===null)break;f=a,a=f.next,f.next=null,o.lastBaseUpdate=f,o.shared.pending=null}}while(!0);if(u===null&&(l=d),o.baseState=l,o.firstBaseUpdate=c,o.lastBaseUpdate=u,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);Da|=s,e.lanes=s,e.memoizedState=d}}function $S(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(F(191,o));o.call(r)}}}var WO=new U_.Component().refs;function u0(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:xt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var eg={isMounted:function(e){return(e=e._reactInternals)?Ja(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Cn(),o=Es(e),i=gi(r,o);i.payload=t,n!=null&&(i.callback=n),t=Ss(e,i,o),t!==null&&(lo(t,e,o,r),qp(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Cn(),o=Es(e),i=gi(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ss(e,i,o),t!==null&&(lo(t,e,o,r),qp(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Cn(),r=Es(e),o=gi(n,r);o.tag=2,t!=null&&(o.callback=t),t=Ss(e,o,r),t!==null&&(lo(t,e,r,n),qp(t,e,r))}};function DS(e,t,n,r,o,i,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,s):t.prototype&&t.prototype.isPureReactComponent?!Ed(n,r)||!Ed(o,i):!0}function KO(e,t,n){var r=!1,o=Ds,i=t.contextType;return typeof i=="object"&&i!==null?i=Nr(i):(o=Vn(t)?Pa:gn.current,r=t.contextTypes,i=(r=r!=null)?lc(e,o):Ds),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=eg,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function AS(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&&eg.enqueueReplaceState(t,t.state,null)}function d0(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs=WO,xb(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=Nr(i):(i=Vn(t)?Pa:gn.current,o.context=lc(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(u0(e,t,i,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&eg.enqueueReplaceState(o,o.state,null),Ah(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function au(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(F(309));var r=n.stateNode}if(!r)throw Error(F(147,e));var o=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(s){var a=o.refs;a===WO&&(a=o.refs={}),s===null?delete a[i]:a[i]=s},t._stringRef=i,t)}if(typeof e!="string")throw Error(F(284));if(!n._owner)throw Error(F(290,e))}return e}function gp(e,t){throw e=Object.prototype.toString.call(t),Error(F(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function IS(e){var t=e._init;return t(e._payload)}function qO(e){function t(y,v){if(e){var w=y.deletions;w===null?(y.deletions=[v],y.flags|=16):w.push(v)}}function n(y,v){if(!e)return null;for(;v!==null;)t(y,v),v=v.sibling;return null}function r(y,v){for(y=new Map;v!==null;)v.key!==null?y.set(v.key,v):y.set(v.index,v),v=v.sibling;return y}function o(y,v){return y=Cs(y,v),y.index=0,y.sibling=null,y}function i(y,v,w){return y.index=w,e?(w=y.alternate,w!==null?(w=w.index,w<v?(y.flags|=2,v):w):(y.flags|=2,v)):(y.flags|=1048576,v)}function s(y){return e&&y.alternate===null&&(y.flags|=2),y}function a(y,v,w,S){return v===null||v.tag!==6?(v=Fv(w,y.mode,S),v.return=y,v):(v=o(v,w),v.return=y,v)}function l(y,v,w,S){var k=w.type;return k===Dl?u(y,v,w.props.children,S,w.key):v!==null&&(v.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===rs&&IS(k)===v.type)?(S=o(v,w.props),S.ref=au(y,v,w),S.return=y,S):(S=Qp(w.type,w.key,w.props,null,y.mode,S),S.ref=au(y,v,w),S.return=y,S)}function c(y,v,w,S){return v===null||v.tag!==4||v.stateNode.containerInfo!==w.containerInfo||v.stateNode.implementation!==w.implementation?(v=Bv(w,y.mode,S),v.return=y,v):(v=o(v,w.children||[]),v.return=y,v)}function u(y,v,w,S,k){return v===null||v.tag!==7?(v=ka(w,y.mode,S,k),v.return=y,v):(v=o(v,w),v.return=y,v)}function d(y,v,w){if(typeof v=="string"&&v!==""||typeof v=="number")return v=Fv(""+v,y.mode,w),v.return=y,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case ip:return w=Qp(v.type,v.key,v.props,null,y.mode,w),w.ref=au(y,null,v),w.return=y,w;case $l:return v=Bv(v,y.mode,w),v.return=y,v;case rs:var S=v._init;return d(y,S(v._payload),w)}if(wu(v)||nu(v))return v=ka(v,y.mode,w,null),v.return=y,v;gp(y,v)}return null}function f(y,v,w,S){var k=v!==null?v.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return k!==null?null:a(y,v,""+w,S);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case ip:return w.key===k?l(y,v,w,S):null;case $l:return w.key===k?c(y,v,w,S):null;case rs:return k=w._init,f(y,v,k(w._payload),S)}if(wu(w)||nu(w))return k!==null?null:u(y,v,w,S,null);gp(y,w)}return null}function h(y,v,w,S,k){if(typeof S=="string"&&S!==""||typeof S=="number")return y=y.get(w)||null,a(v,y,""+S,k);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case ip:return y=y.get(S.key===null?w:S.key)||null,l(v,y,S,k);case $l:return y=y.get(S.key===null?w:S.key)||null,c(v,y,S,k);case rs:var C=S._init;return h(y,v,w,C(S._payload),k)}if(wu(S)||nu(S))return y=y.get(w)||null,u(v,y,S,k,null);gp(v,S)}return null}function m(y,v,w,S){for(var k=null,C=null,E=v,T=v=0,R=null;E!==null&&T<w.length;T++){E.index>T?(R=E,E=null):R=E.sibling;var $=f(y,E,w[T],S);if($===null){E===null&&(E=R);break}e&&E&&$.alternate===null&&t(y,E),v=i($,v,T),C===null?k=$:C.sibling=$,C=$,E=R}if(T===w.length)return n(y,E),ut&&ta(y,T),k;if(E===null){for(;T<w.length;T++)E=d(y,w[T],S),E!==null&&(v=i(E,v,T),C===null?k=E:C.sibling=E,C=E);return ut&&ta(y,T),k}for(E=r(y,E);T<w.length;T++)R=h(E,y,T,w[T],S),R!==null&&(e&&R.alternate!==null&&E.delete(R.key===null?T:R.key),v=i(R,v,T),C===null?k=R:C.sibling=R,C=R);return e&&E.forEach(function(j){return t(y,j)}),ut&&ta(y,T),k}function g(y,v,w,S){var k=nu(w);if(typeof k!="function")throw Error(F(150));if(w=k.call(w),w==null)throw Error(F(151));for(var C=k=null,E=v,T=v=0,R=null,$=w.next();E!==null&&!$.done;T++,$=w.next()){E.index>T?(R=E,E=null):R=E.sibling;var j=f(y,E,$.value,S);if(j===null){E===null&&(E=R);break}e&&E&&j.alternate===null&&t(y,E),v=i(j,v,T),C===null?k=j:C.sibling=j,C=j,E=R}if($.done)return n(y,E),ut&&ta(y,T),k;if(E===null){for(;!$.done;T++,$=w.next())$=d(y,$.value,S),$!==null&&(v=i($,v,T),C===null?k=$:C.sibling=$,C=$);return ut&&ta(y,T),k}for(E=r(y,E);!$.done;T++,$=w.next())$=h(E,y,T,$.value,S),$!==null&&(e&&$.alternate!==null&&E.delete($.key===null?T:$.key),v=i($,v,T),C===null?k=$:C.sibling=$,C=$);return e&&E.forEach(function(z){return t(y,z)}),ut&&ta(y,T),k}function b(y,v,w,S){if(typeof w=="object"&&w!==null&&w.type===Dl&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case ip:e:{for(var k=w.key,C=v;C!==null;){if(C.key===k){if(k=w.type,k===Dl){if(C.tag===7){n(y,C.sibling),v=o(C,w.props.children),v.return=y,y=v;break e}}else if(C.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===rs&&IS(k)===C.type){n(y,C.sibling),v=o(C,w.props),v.ref=au(y,C,w),v.return=y,y=v;break e}n(y,C);break}else t(y,C);C=C.sibling}w.type===Dl?(v=ka(w.props.children,y.mode,S,w.key),v.return=y,y=v):(S=Qp(w.type,w.key,w.props,null,y.mode,S),S.ref=au(y,v,w),S.return=y,y=S)}return s(y);case $l:e:{for(C=w.key;v!==null;){if(v.key===C)if(v.tag===4&&v.stateNode.containerInfo===w.containerInfo&&v.stateNode.implementation===w.implementation){n(y,v.sibling),v=o(v,w.children||[]),v.return=y,y=v;break e}else{n(y,v);break}else t(y,v);v=v.sibling}v=Bv(w,y.mode,S),v.return=y,y=v}return s(y);case rs:return C=w._init,b(y,v,C(w._payload),S)}if(wu(w))return m(y,v,w,S);if(nu(w))return g(y,v,w,S);gp(y,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,v!==null&&v.tag===6?(n(y,v.sibling),v=o(v,w),v.return=y,y=v):(n(y,v),v=Fv(w,y.mode,S),v.return=y,y=v),s(y)):n(y,v)}return b}var uc=qO(!0),GO=qO(!1),Rf={},Ao=Gs(Rf),Td=Gs(Rf),Md=Gs(Rf);function ma(e){if(e===Rf)throw Error(F(174));return e}function bb(e,t){switch(ot(Md,t),ot(Td,e),ot(Ao,Rf),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Uy(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Uy(t,e)}ct(Ao),ot(Ao,t)}function dc(){ct(Ao),ct(Td),ct(Md)}function YO(e){ma(Md.current);var t=ma(Ao.current),n=Uy(t,e.type);t!==n&&(ot(Td,e),ot(Ao,n))}function wb(e){Td.current===e&&(ct(Ao),ct(Td))}var gt=Gs(0);function Ih(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Dv=[];function Sb(){for(var e=0;e<Dv.length;e++)Dv[e]._workInProgressVersionPrimary=null;Dv.length=0}var Gp=Pi.ReactCurrentDispatcher,Av=Pi.ReactCurrentBatchConfig,$a=0,yt=null,$t=null,Ht=null,Lh=!1,td=!1,Rd=0,m3=0;function cn(){throw Error(F(321))}function kb(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!ho(e[n],t[n]))return!1;return!0}function Eb(e,t,n,r,o,i){if($a=i,yt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Gp.current=e===null||e.memoizedState===null?x3:b3,e=n(r,o),td){i=0;do{if(td=!1,Rd=0,25<=i)throw Error(F(301));i+=1,Ht=$t=null,t.updateQueue=null,Gp.current=w3,e=n(r,o)}while(td)}if(Gp.current=jh,t=$t!==null&&$t.next!==null,$a=0,Ht=$t=yt=null,Lh=!1,t)throw Error(F(300));return e}function Cb(){var e=Rd!==0;return Rd=0,e}function Oo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ht===null?yt.memoizedState=Ht=e:Ht=Ht.next=e,Ht}function $r(){if($t===null){var e=yt.alternate;e=e!==null?e.memoizedState:null}else e=$t.next;var t=Ht===null?yt.memoizedState:Ht.next;if(t!==null)Ht=t,$t=e;else{if(e===null)throw Error(F(310));$t=e,e={memoizedState:$t.memoizedState,baseState:$t.baseState,baseQueue:$t.baseQueue,queue:$t.queue,next:null},Ht===null?yt.memoizedState=Ht=e:Ht=Ht.next=e}return Ht}function Pd(e,t){return typeof t=="function"?t(e):t}function Iv(e){var t=$r(),n=t.queue;if(n===null)throw Error(F(311));n.lastRenderedReducer=e;var r=$t,o=r.baseQueue,i=n.pending;if(i!==null){if(o!==null){var s=o.next;o.next=i.next,i.next=s}r.baseQueue=o=i,n.pending=null}if(o!==null){i=o.next,r=r.baseState;var a=s=null,l=null,c=i;do{var u=c.lane;if(($a&u)===u)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var d={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=d,s=r):l=l.next=d,yt.lanes|=u,Da|=u}c=c.next}while(c!==null&&c!==i);l===null?s=r:l.next=a,ho(r,t.memoizedState)||(zn=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do i=o.lane,yt.lanes|=i,Da|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Lv(e){var t=$r(),n=t.queue;if(n===null)throw Error(F(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(o!==null){n.pending=null;var s=o=o.next;do i=e(i,s.action),s=s.next;while(s!==o);ho(i,t.memoizedState)||(zn=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function XO(){}function ZO(e,t){var n=yt,r=$r(),o=t(),i=!ho(r.memoizedState,o);if(i&&(r.memoizedState=o,zn=!0),r=r.queue,_b(eT.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||Ht!==null&&Ht.memoizedState.tag&1){if(n.flags|=2048,Nd(9,QO.bind(null,n,r,o,t),void 0,null),Gt===null)throw Error(F(349));$a&30||JO(n,t,o)}return o}function JO(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=yt.updateQueue,t===null?(t={lastEffect:null,stores:null},yt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function QO(e,t,n,r){t.value=n,t.getSnapshot=r,tT(t)&&nT(e)}function eT(e,t,n){return n(function(){tT(t)&&nT(e)})}function tT(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!ho(e,n)}catch{return!0}}function nT(e){var t=wi(e,1);t!==null&&lo(t,e,1,-1)}function LS(e){var t=Oo();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Pd,lastRenderedState:e},t.queue=e,e=e.dispatch=y3.bind(null,yt,e),[t.memoizedState,e]}function Nd(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=yt.updateQueue,t===null?(t={lastEffect:null,stores:null},yt.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function rT(){return $r().memoizedState}function Yp(e,t,n,r){var o=Oo();yt.flags|=e,o.memoizedState=Nd(1|t,n,void 0,r===void 0?null:r)}function tg(e,t,n,r){var o=$r();r=r===void 0?null:r;var i=void 0;if($t!==null){var s=$t.memoizedState;if(i=s.destroy,r!==null&&kb(r,s.deps)){o.memoizedState=Nd(t,n,i,r);return}}yt.flags|=e,o.memoizedState=Nd(1|t,n,i,r)}function jS(e,t){return Yp(8390656,8,e,t)}function _b(e,t){return tg(2048,8,e,t)}function oT(e,t){return tg(4,2,e,t)}function iT(e,t){return tg(4,4,e,t)}function sT(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function aT(e,t,n){return n=n!=null?n.concat([e]):null,tg(4,4,sT.bind(null,t,e),n)}function Ob(){}function lT(e,t){var n=$r();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&kb(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function cT(e,t){var n=$r();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&kb(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function uT(e,t,n){return $a&21?(ho(n,t)||(n=pO(),yt.lanes|=n,Da|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,zn=!0),e.memoizedState=n)}function g3(e,t){var n=Ze;Ze=n!==0&&4>n?n:4,e(!0);var r=Av.transition;Av.transition={};try{e(!1),t()}finally{Ze=n,Av.transition=r}}function dT(){return $r().memoizedState}function v3(e,t,n){var r=Es(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},fT(e))pT(t,n);else if(n=UO(e,t,n,r),n!==null){var o=Cn();lo(n,e,r,o),hT(n,t,r)}}function y3(e,t,n){var r=Es(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(fT(e))pT(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,a=i(s,n);if(o.hasEagerState=!0,o.eagerState=a,ho(a,s)){var l=t.interleaved;l===null?(o.next=o,yb(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}n=UO(e,t,o,r),n!==null&&(o=Cn(),lo(n,e,r,o),hT(n,t,r))}}function fT(e){var t=e.alternate;return e===yt||t!==null&&t===yt}function pT(e,t){td=Lh=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function hT(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ob(e,n)}}var jh={readContext:Nr,useCallback:cn,useContext:cn,useEffect:cn,useImperativeHandle:cn,useInsertionEffect:cn,useLayoutEffect:cn,useMemo:cn,useReducer:cn,useRef:cn,useState:cn,useDebugValue:cn,useDeferredValue:cn,useTransition:cn,useMutableSource:cn,useSyncExternalStore:cn,useId:cn,unstable_isNewReconciler:!1},x3={readContext:Nr,useCallback:function(e,t){return Oo().memoizedState=[e,t===void 0?null:t],e},useContext:Nr,useEffect:jS,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Yp(4194308,4,sT.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Yp(4194308,4,e,t)},useInsertionEffect:function(e,t){return Yp(4,2,e,t)},useMemo:function(e,t){var n=Oo();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Oo();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=v3.bind(null,yt,e),[r.memoizedState,e]},useRef:function(e){var t=Oo();return e={current:e},t.memoizedState=e},useState:LS,useDebugValue:Ob,useDeferredValue:function(e){return Oo().memoizedState=e},useTransition:function(){var e=LS(!1),t=e[0];return e=g3.bind(null,e[1]),Oo().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=yt,o=Oo();if(ut){if(n===void 0)throw Error(F(407));n=n()}else{if(n=t(),Gt===null)throw Error(F(349));$a&30||JO(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,jS(eT.bind(null,r,i,e),[e]),r.flags|=2048,Nd(9,QO.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Oo(),t=Gt.identifierPrefix;if(ut){var n=di,r=ui;n=(r&~(1<<32-ao(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Rd++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=m3++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},b3={readContext:Nr,useCallback:lT,useContext:Nr,useEffect:_b,useImperativeHandle:aT,useInsertionEffect:oT,useLayoutEffect:iT,useMemo:cT,useReducer:Iv,useRef:rT,useState:function(){return Iv(Pd)},useDebugValue:Ob,useDeferredValue:function(e){var t=$r();return uT(t,$t.memoizedState,e)},useTransition:function(){var e=Iv(Pd)[0],t=$r().memoizedState;return[e,t]},useMutableSource:XO,useSyncExternalStore:ZO,useId:dT,unstable_isNewReconciler:!1},w3={readContext:Nr,useCallback:lT,useContext:Nr,useEffect:_b,useImperativeHandle:aT,useInsertionEffect:oT,useLayoutEffect:iT,useMemo:cT,useReducer:Lv,useRef:rT,useState:function(){return Lv(Pd)},useDebugValue:Ob,useDeferredValue:function(e){var t=$r();return $t===null?t.memoizedState=e:uT(t,$t.memoizedState,e)},useTransition:function(){var e=Lv(Pd)[0],t=$r().memoizedState;return[e,t]},useMutableSource:XO,useSyncExternalStore:ZO,useId:dT,unstable_isNewReconciler:!1};function fc(e,t){try{var n="",r=t;do n+=YA(r),r=r.return;while(r);var o=n}catch(i){o=`
31
- Error generating stack: `+i.message+`
32
- `+i.stack}return{value:e,source:t,stack:o,digest:null}}function jv(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function f0(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var S3=typeof WeakMap=="function"?WeakMap:Map;function mT(e,t,n){n=gi(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Fh||(Fh=!0,S0=r),f0(e,t)},n}function gT(e,t,n){n=gi(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){f0(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){f0(e,t),typeof r!="function"&&(ks===null?ks=new Set([this]):ks.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function zS(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new S3;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=I3.bind(null,e,t,n),t.then(e,e))}function FS(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function BS(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=gi(-1,1),t.tag=2,Ss(n,t,1))),n.lanes|=1),e)}var k3=Pi.ReactCurrentOwner,zn=!1;function Sn(e,t,n,r){t.child=e===null?GO(t,null,n,r):uc(t,e.child,n,r)}function VS(e,t,n,r,o){n=n.render;var i=t.ref;return Xl(t,o),r=Eb(e,t,n,r,i,o),n=Cb(),e!==null&&!zn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Si(e,t,o)):(ut&&n&&fb(t),t.flags|=1,Sn(e,t,r,o),t.child)}function US(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!Ab(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,vT(e,t,i,r,o)):(e=Qp(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&o)){var s=i.memoizedProps;if(n=n.compare,n=n!==null?n:Ed,n(s,r)&&e.ref===t.ref)return Si(e,t,o)}return t.flags|=1,e=Cs(i,r),e.ref=t.ref,e.return=t,t.child=e}function vT(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(Ed(i,r)&&e.ref===t.ref)if(zn=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(zn=!0);else return t.lanes=e.lanes,Si(e,t,o)}return p0(e,t,n,r,o)}function yT(e,t,n){var r=t.pendingProps,o=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ot(Hl,er),er|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ot(Hl,er),er|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,ot(Hl,er),er|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,ot(Hl,er),er|=r;return Sn(e,t,o,n),t.child}function xT(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function p0(e,t,n,r,o){var i=Vn(n)?Pa:gn.current;return i=lc(t,i),Xl(t,o),n=Eb(e,t,n,r,i,o),r=Cb(),e!==null&&!zn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Si(e,t,o)):(ut&&r&&fb(t),t.flags|=1,Sn(e,t,n,o),t.child)}function HS(e,t,n,r,o){if(Vn(n)){var i=!0;Rh(t)}else i=!1;if(Xl(t,o),t.stateNode===null)Xp(e,t),KO(t,n,r),d0(t,n,r,o),r=!0;else if(e===null){var s=t.stateNode,a=t.memoizedProps;s.props=a;var l=s.context,c=n.contextType;typeof c=="object"&&c!==null?c=Nr(c):(c=Vn(n)?Pa:gn.current,c=lc(t,c));var u=n.getDerivedStateFromProps,d=typeof u=="function"||typeof s.getSnapshotBeforeUpdate=="function";d||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==r||l!==c)&&AS(t,s,r,c),is=!1;var f=t.memoizedState;s.state=f,Ah(t,r,s,o),l=t.memoizedState,a!==r||f!==l||Bn.current||is?(typeof u=="function"&&(u0(t,n,u,r),l=t.memoizedState),(a=is||DS(t,n,a,r,f,l,c))?(d||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),s.props=r,s.state=l,s.context=c,r=a):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,HO(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:Yr(t.type,a),s.props=c,d=t.pendingProps,f=s.context,l=n.contextType,typeof l=="object"&&l!==null?l=Nr(l):(l=Vn(n)?Pa:gn.current,l=lc(t,l));var h=n.getDerivedStateFromProps;(u=typeof h=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==d||f!==l)&&AS(t,s,r,l),is=!1,f=t.memoizedState,s.state=f,Ah(t,r,s,o);var m=t.memoizedState;a!==d||f!==m||Bn.current||is?(typeof h=="function"&&(u0(t,n,h,r),m=t.memoizedState),(c=is||DS(t,n,c,r,f,m,l)||!1)?(u||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,m,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,m,l)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),s.props=r,s.state=m,s.context=l,r=c):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return h0(e,t,n,r,i,o)}function h0(e,t,n,r,o,i){xT(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&MS(t,n,!1),Si(e,t,i);r=t.stateNode,k3.current=t;var a=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=uc(t,e.child,null,i),t.child=uc(t,null,a,i)):Sn(e,t,a,i),t.memoizedState=r.state,o&&MS(t,n,!0),t.child}function bT(e){var t=e.stateNode;t.pendingContext?TS(e,t.pendingContext,t.pendingContext!==t.context):t.context&&TS(e,t.context,!1),bb(e,t.containerInfo)}function WS(e,t,n,r,o){return cc(),hb(o),t.flags|=256,Sn(e,t,n,r),t.child}var m0={dehydrated:null,treeContext:null,retryLane:0};function g0(e){return{baseLanes:e,cachePool:null,transitions:null}}function wT(e,t,n){var r=t.pendingProps,o=gt.current,i=!1,s=(t.flags&128)!==0,a;if((a=s)||(a=e!==null&&e.memoizedState===null?!1:(o&2)!==0),a?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),ot(gt,o&1),e===null)return l0(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=r.children,e=r.fallback,i?(r=t.mode,i=t.child,s={mode:"hidden",children:s},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=s):i=og(s,r,0,null),e=ka(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=g0(n),t.memoizedState=m0,e):Tb(t,s));if(o=e.memoizedState,o!==null&&(a=o.dehydrated,a!==null))return E3(e,t,s,r,a,o,n);if(i){i=r.fallback,s=t.mode,o=e.child,a=o.sibling;var l={mode:"hidden",children:r.children};return!(s&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=Cs(o,l),r.subtreeFlags=o.subtreeFlags&14680064),a!==null?i=Cs(a,i):(i=ka(i,s,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,s=e.child.memoizedState,s=s===null?g0(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=m0,r}return i=e.child,e=i.sibling,r=Cs(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Tb(e,t){return t=og({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function vp(e,t,n,r){return r!==null&&hb(r),uc(t,e.child,null,n),e=Tb(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function E3(e,t,n,r,o,i,s){if(n)return t.flags&256?(t.flags&=-257,r=jv(Error(F(422))),vp(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=og({mode:"visible",children:r.children},o,0,null),i=ka(i,o,s,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&uc(t,e.child,null,s),t.child.memoizedState=g0(s),t.memoizedState=m0,i);if(!(t.mode&1))return vp(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(F(419)),r=jv(i,r,void 0),vp(e,t,s,r)}if(a=(s&e.childLanes)!==0,zn||a){if(r=Gt,r!==null){switch(s&-s){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(r.suspendedLanes|s)?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,wi(e,o),lo(r,e,o,-1))}return Db(),r=jv(Error(F(421))),vp(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=L3.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,ir=ws(o.nextSibling),sr=t,ut=!0,Jr=null,e!==null&&(Er[Cr++]=ui,Er[Cr++]=di,Er[Cr++]=Na,ui=e.id,di=e.overflow,Na=t),t=Tb(t,r.children),t.flags|=4096,t)}function KS(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),c0(e.return,t,n)}function zv(e,t,n,r,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function ST(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(Sn(e,t,r.children,n),r=gt.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&KS(e,n,t);else if(e.tag===19)KS(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ot(gt,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&Ih(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),zv(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Ih(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}zv(t,!0,n,null,i);break;case"together":zv(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Xp(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Si(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Da|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(F(153));if(t.child!==null){for(e=t.child,n=Cs(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Cs(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function C3(e,t,n){switch(t.tag){case 3:bT(t),cc();break;case 5:YO(t);break;case 1:Vn(t.type)&&Rh(t);break;case 4:bb(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;ot($h,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ot(gt,gt.current&1),t.flags|=128,null):n&t.child.childLanes?wT(e,t,n):(ot(gt,gt.current&1),e=Si(e,t,n),e!==null?e.sibling:null);ot(gt,gt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return ST(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),ot(gt,gt.current),r)break;return null;case 22:case 23:return t.lanes=0,yT(e,t,n)}return Si(e,t,n)}var kT,v0,ET,CT;kT=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};v0=function(){};ET=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,ma(Ao.current);var i=null;switch(n){case"input":o=zy(e,o),r=zy(e,r),i=[];break;case"select":o=xt({},o,{value:void 0}),r=xt({},r,{value:void 0}),i=[];break;case"textarea":o=Vy(e,o),r=Vy(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Th)}Hy(n,r);var s;n=null;for(c in o)if(!r.hasOwnProperty(c)&&o.hasOwnProperty(c)&&o[c]!=null)if(c==="style"){var a=o[c];for(s in a)a.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(vd.hasOwnProperty(c)?i||(i=[]):(i=i||[]).push(c,null));for(c in r){var l=r[c];if(a=o!=null?o[c]:void 0,r.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(s in a)!a.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in l)l.hasOwnProperty(s)&&a[s]!==l[s]&&(n||(n={}),n[s]=l[s])}else n||(i||(i=[]),i.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(i=i||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(vd.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&lt("scroll",e),i||a===l||(i=[])):(i=i||[]).push(c,l))}n&&(i=i||[]).push("style",n);var c=i;(t.updateQueue=c)&&(t.flags|=4)}};CT=function(e,t,n,r){n!==r&&(t.flags|=4)};function lu(e,t){if(!ut)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 un(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function _3(e,t,n){var r=t.pendingProps;switch(pb(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return un(t),null;case 1:return Vn(t.type)&&Mh(),un(t),null;case 3:return r=t.stateNode,dc(),ct(Bn),ct(gn),Sb(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(mp(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Jr!==null&&(C0(Jr),Jr=null))),v0(e,t),un(t),null;case 5:wb(t);var o=ma(Md.current);if(n=t.type,e!==null&&t.stateNode!=null)ET(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(F(166));return un(t),null}if(e=ma(Ao.current),mp(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Mo]=t,r[Od]=i,e=(t.mode&1)!==0,n){case"dialog":lt("cancel",r),lt("close",r);break;case"iframe":case"object":case"embed":lt("load",r);break;case"video":case"audio":for(o=0;o<ku.length;o++)lt(ku[o],r);break;case"source":lt("error",r);break;case"img":case"image":case"link":lt("error",r),lt("load",r);break;case"details":lt("toggle",r);break;case"input":tS(r,i),lt("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},lt("invalid",r);break;case"textarea":rS(r,i),lt("invalid",r)}Hy(n,i),o=null;for(var s in i)if(i.hasOwnProperty(s)){var a=i[s];s==="children"?typeof a=="string"?r.textContent!==a&&(i.suppressHydrationWarning!==!0&&hp(r.textContent,a,e),o=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&hp(r.textContent,a,e),o=["children",""+a]):vd.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&lt("scroll",r)}switch(n){case"input":sp(r),nS(r,i,!0);break;case"textarea":sp(r),oS(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Th)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=J_(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Mo]=t,e[Od]=r,kT(e,t,!1,!1),t.stateNode=e;e:{switch(s=Wy(n,r),n){case"dialog":lt("cancel",e),lt("close",e),o=r;break;case"iframe":case"object":case"embed":lt("load",e),o=r;break;case"video":case"audio":for(o=0;o<ku.length;o++)lt(ku[o],e);o=r;break;case"source":lt("error",e),o=r;break;case"img":case"image":case"link":lt("error",e),lt("load",e),o=r;break;case"details":lt("toggle",e),o=r;break;case"input":tS(e,r),o=zy(e,r),lt("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=xt({},r,{value:void 0}),lt("invalid",e);break;case"textarea":rS(e,r),o=Vy(e,r),lt("invalid",e);break;default:o=r}Hy(n,o),a=o;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?tO(e,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Q_(e,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&yd(e,l):typeof l=="number"&&yd(e,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(vd.hasOwnProperty(i)?l!=null&&i==="onScroll"&&lt("scroll",e):l!=null&&Jx(e,i,l,s))}switch(n){case"input":sp(e),nS(e,r,!1);break;case"textarea":sp(e),oS(e);break;case"option":r.value!=null&&e.setAttribute("value",""+$s(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?Kl(e,!!r.multiple,i,!1):r.defaultValue!=null&&Kl(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Th)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return un(t),null;case 6:if(e&&t.stateNode!=null)CT(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(F(166));if(n=ma(Md.current),ma(Ao.current),mp(t)){if(r=t.stateNode,n=t.memoizedProps,r[Mo]=t,(i=r.nodeValue!==n)&&(e=sr,e!==null))switch(e.tag){case 3:hp(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&hp(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Mo]=t,t.stateNode=r}return un(t),null;case 13:if(ct(gt),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ut&&ir!==null&&t.mode&1&&!(t.flags&128))VO(),cc(),t.flags|=98560,i=!1;else if(i=mp(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(F(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(F(317));i[Mo]=t}else cc(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;un(t),i=!1}else Jr!==null&&(C0(Jr),Jr=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||gt.current&1?Lt===0&&(Lt=3):Db())),t.updateQueue!==null&&(t.flags|=4),un(t),null);case 4:return dc(),v0(e,t),e===null&&Cd(t.stateNode.containerInfo),un(t),null;case 10:return vb(t.type._context),un(t),null;case 17:return Vn(t.type)&&Mh(),un(t),null;case 19:if(ct(gt),i=t.memoizedState,i===null)return un(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)lu(i,!1);else{if(Lt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=Ih(e),s!==null){for(t.flags|=128,lu(i,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,s=i.alternate,s===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,e=s.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ot(gt,gt.current&1|2),t.child}e=e.sibling}i.tail!==null&&Ct()>pc&&(t.flags|=128,r=!0,lu(i,!1),t.lanes=4194304)}else{if(!r)if(e=Ih(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),lu(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!ut)return un(t),null}else 2*Ct()-i.renderingStartTime>pc&&n!==1073741824&&(t.flags|=128,r=!0,lu(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Ct(),t.sibling=null,n=gt.current,ot(gt,r?n&1|2:n&1),t):(un(t),null);case 22:case 23:return $b(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?er&1073741824&&(un(t),t.subtreeFlags&6&&(t.flags|=8192)):un(t),null;case 24:return null;case 25:return null}throw Error(F(156,t.tag))}function O3(e,t){switch(pb(t),t.tag){case 1:return Vn(t.type)&&Mh(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return dc(),ct(Bn),ct(gn),Sb(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return wb(t),null;case 13:if(ct(gt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(F(340));cc()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ct(gt),null;case 4:return dc(),null;case 10:return vb(t.type._context),null;case 22:case 23:return $b(),null;case 24:return null;default:return null}}var yp=!1,hn=!1,T3=typeof WeakSet=="function"?WeakSet:Set,ne=null;function Ul(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){bt(e,t,r)}else n.current=null}function y0(e,t,n){try{n()}catch(r){bt(e,t,r)}}var qS=!1;function M3(e,t){if(t0=Ch,e=MO(),db(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,c=0,u=0,d=e,f=null;t:for(;;){for(var h;d!==n||o!==0&&d.nodeType!==3||(a=s+o),d!==i||r!==0&&d.nodeType!==3||(l=s+r),d.nodeType===3&&(s+=d.nodeValue.length),(h=d.firstChild)!==null;)f=d,d=h;for(;;){if(d===e)break t;if(f===n&&++c===o&&(a=s),f===i&&++u===r&&(l=s),(h=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(n0={focusedElem:e,selectionRange:n},Ch=!1,ne=t;ne!==null;)if(t=ne,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ne=e;else for(;ne!==null;){t=ne;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var g=m.memoizedProps,b=m.memoizedState,y=t.stateNode,v=y.getSnapshotBeforeUpdate(t.elementType===t.type?g:Yr(t.type,g),b);y.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(F(163))}}catch(S){bt(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,ne=e;break}ne=t.return}return m=qS,qS=!1,m}function nd(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&y0(t,n,i)}o=o.next}while(o!==r)}}function ng(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function x0(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function _T(e){var t=e.alternate;t!==null&&(e.alternate=null,_T(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Mo],delete t[Od],delete t[i0],delete t[d3],delete t[f3])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function OT(e){return e.tag===5||e.tag===3||e.tag===4}function GS(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||OT(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function b0(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Th));else if(r!==4&&(e=e.child,e!==null))for(b0(e,t,n),e=e.sibling;e!==null;)b0(e,t,n),e=e.sibling}function w0(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&&(e=e.child,e!==null))for(w0(e,t,n),e=e.sibling;e!==null;)w0(e,t,n),e=e.sibling}var Qt=null,Zr=!1;function Fi(e,t,n){for(n=n.child;n!==null;)TT(e,t,n),n=n.sibling}function TT(e,t,n){if(Do&&typeof Do.onCommitFiberUnmount=="function")try{Do.onCommitFiberUnmount(Gm,n)}catch{}switch(n.tag){case 5:hn||Ul(n,t);case 6:var r=Qt,o=Zr;Qt=null,Fi(e,t,n),Qt=r,Zr=o,Qt!==null&&(Zr?(e=Qt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Qt.removeChild(n.stateNode));break;case 18:Qt!==null&&(Zr?(e=Qt,n=n.stateNode,e.nodeType===8?Nv(e.parentNode,n):e.nodeType===1&&Nv(e,n),Sd(e)):Nv(Qt,n.stateNode));break;case 4:r=Qt,o=Zr,Qt=n.stateNode.containerInfo,Zr=!0,Fi(e,t,n),Qt=r,Zr=o;break;case 0:case 11:case 14:case 15:if(!hn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&y0(n,t,s),o=o.next}while(o!==r)}Fi(e,t,n);break;case 1:if(!hn&&(Ul(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){bt(n,t,a)}Fi(e,t,n);break;case 21:Fi(e,t,n);break;case 22:n.mode&1?(hn=(r=hn)||n.memoizedState!==null,Fi(e,t,n),hn=r):Fi(e,t,n);break;default:Fi(e,t,n)}}function YS(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new T3),t.forEach(function(r){var o=j3.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function Ur(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var i=e,s=t,a=s;e:for(;a!==null;){switch(a.tag){case 5:Qt=a.stateNode,Zr=!1;break e;case 3:Qt=a.stateNode.containerInfo,Zr=!0;break e;case 4:Qt=a.stateNode.containerInfo,Zr=!0;break e}a=a.return}if(Qt===null)throw Error(F(160));TT(i,s,o),Qt=null,Zr=!1;var l=o.alternate;l!==null&&(l.return=null),o.return=null}catch(c){bt(o,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)MT(t,e),t=t.sibling}function MT(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Ur(t,e),Co(e),r&4){try{nd(3,e,e.return),ng(3,e)}catch(g){bt(e,e.return,g)}try{nd(5,e,e.return)}catch(g){bt(e,e.return,g)}}break;case 1:Ur(t,e),Co(e),r&512&&n!==null&&Ul(n,n.return);break;case 5:if(Ur(t,e),Co(e),r&512&&n!==null&&Ul(n,n.return),e.flags&32){var o=e.stateNode;try{yd(o,"")}catch(g){bt(e,e.return,g)}}if(r&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,s=n!==null?n.memoizedProps:i,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&X_(o,i),Wy(a,s);var c=Wy(a,i);for(s=0;s<l.length;s+=2){var u=l[s],d=l[s+1];u==="style"?tO(o,d):u==="dangerouslySetInnerHTML"?Q_(o,d):u==="children"?yd(o,d):Jx(o,u,d,c)}switch(a){case"input":Fy(o,i);break;case"textarea":Z_(o,i);break;case"select":var f=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var h=i.value;h!=null?Kl(o,!!i.multiple,h,!1):f!==!!i.multiple&&(i.defaultValue!=null?Kl(o,!!i.multiple,i.defaultValue,!0):Kl(o,!!i.multiple,i.multiple?[]:"",!1))}o[Od]=i}catch(g){bt(e,e.return,g)}}break;case 6:if(Ur(t,e),Co(e),r&4){if(e.stateNode===null)throw Error(F(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(g){bt(e,e.return,g)}}break;case 3:if(Ur(t,e),Co(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Sd(t.containerInfo)}catch(g){bt(e,e.return,g)}break;case 4:Ur(t,e),Co(e);break;case 13:Ur(t,e),Co(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(Pb=Ct())),r&4&&YS(e);break;case 22:if(u=n!==null&&n.memoizedState!==null,e.mode&1?(hn=(c=hn)||u,Ur(t,e),hn=c):Ur(t,e),Co(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!u&&e.mode&1)for(ne=e,u=e.child;u!==null;){for(d=ne=u;ne!==null;){switch(f=ne,h=f.child,f.tag){case 0:case 11:case 14:case 15:nd(4,f,f.return);break;case 1:Ul(f,f.return);var m=f.stateNode;if(typeof m.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(g){bt(r,n,g)}}break;case 5:Ul(f,f.return);break;case 22:if(f.memoizedState!==null){ZS(d);continue}}h!==null?(h.return=f,ne=h):ZS(d)}u=u.sibling}e:for(u=null,d=e;;){if(d.tag===5){if(u===null){u=d;try{o=d.stateNode,c?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=d.stateNode,l=d.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=eO("display",s))}catch(g){bt(e,e.return,g)}}}else if(d.tag===6){if(u===null)try{d.stateNode.nodeValue=c?"":d.memoizedProps}catch(g){bt(e,e.return,g)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;u===d&&(u=null),d=d.return}u===d&&(u=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:Ur(t,e),Co(e),r&4&&YS(e);break;case 21:break;default:Ur(t,e),Co(e)}}function Co(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(OT(n)){var r=n;break e}n=n.return}throw Error(F(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(yd(o,""),r.flags&=-33);var i=GS(e);w0(e,i,o);break;case 3:case 4:var s=r.stateNode.containerInfo,a=GS(e);b0(e,a,s);break;default:throw Error(F(161))}}catch(l){bt(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function R3(e,t,n){ne=e,RT(e)}function RT(e,t,n){for(var r=(e.mode&1)!==0;ne!==null;){var o=ne,i=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||yp;if(!s){var a=o.alternate,l=a!==null&&a.memoizedState!==null||hn;a=yp;var c=hn;if(yp=s,(hn=l)&&!c)for(ne=o;ne!==null;)s=ne,l=s.child,s.tag===22&&s.memoizedState!==null?JS(o):l!==null?(l.return=s,ne=l):JS(o);for(;i!==null;)ne=i,RT(i),i=i.sibling;ne=o,yp=a,hn=c}XS(e)}else o.subtreeFlags&8772&&i!==null?(i.return=o,ne=i):XS(e)}}function XS(e){for(;ne!==null;){var t=ne;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:hn||ng(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!hn)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:Yr(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&$S(t,i,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}$S(t,s,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var u=c.memoizedState;if(u!==null){var d=u.dehydrated;d!==null&&Sd(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(F(163))}hn||t.flags&512&&x0(t)}catch(f){bt(t,t.return,f)}}if(t===e){ne=null;break}if(n=t.sibling,n!==null){n.return=t.return,ne=n;break}ne=t.return}}function ZS(e){for(;ne!==null;){var t=ne;if(t===e){ne=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ne=n;break}ne=t.return}}function JS(e){for(;ne!==null;){var t=ne;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{ng(4,t)}catch(l){bt(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(l){bt(t,o,l)}}var i=t.return;try{x0(t)}catch(l){bt(t,i,l)}break;case 5:var s=t.return;try{x0(t)}catch(l){bt(t,s,l)}}}catch(l){bt(t,t.return,l)}if(t===e){ne=null;break}var a=t.sibling;if(a!==null){a.return=t.return,ne=a;break}ne=t.return}}var P3=Math.ceil,zh=Pi.ReactCurrentDispatcher,Mb=Pi.ReactCurrentOwner,Mr=Pi.ReactCurrentBatchConfig,Ve=0,Gt=null,Rt=null,nn=0,er=0,Hl=Gs(0),Lt=0,$d=null,Da=0,rg=0,Rb=0,rd=null,jn=null,Pb=0,pc=1/0,oi=null,Fh=!1,S0=null,ks=null,xp=!1,hs=null,Bh=0,od=0,k0=null,Zp=-1,Jp=0;function Cn(){return Ve&6?Ct():Zp!==-1?Zp:Zp=Ct()}function Es(e){return e.mode&1?Ve&2&&nn!==0?nn&-nn:h3.transition!==null?(Jp===0&&(Jp=pO()),Jp):(e=Ze,e!==0||(e=window.event,e=e===void 0?16:bO(e.type)),e):1}function lo(e,t,n,r){if(50<od)throw od=0,k0=null,Error(F(185));Of(e,n,r),(!(Ve&2)||e!==Gt)&&(e===Gt&&(!(Ve&2)&&(rg|=n),Lt===4&&us(e,nn)),Un(e,r),n===1&&Ve===0&&!(t.mode&1)&&(pc=Ct()+500,Qm&&Ys()))}function Un(e,t){var n=e.callbackNode;hI(e,t);var r=Eh(e,e===Gt?nn:0);if(r===0)n!==null&&aS(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&aS(n),t===1)e.tag===0?p3(QS.bind(null,e)):zO(QS.bind(null,e)),c3(function(){!(Ve&6)&&Ys()}),n=null;else{switch(hO(r)){case 1:n=rb;break;case 4:n=dO;break;case 16:n=kh;break;case 536870912:n=fO;break;default:n=kh}n=jT(n,PT.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function PT(e,t){if(Zp=-1,Jp=0,Ve&6)throw Error(F(327));var n=e.callbackNode;if(Zl()&&e.callbackNode!==n)return null;var r=Eh(e,e===Gt?nn:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Vh(e,r);else{t=r;var o=Ve;Ve|=2;var i=$T();(Gt!==e||nn!==t)&&(oi=null,pc=Ct()+500,Sa(e,t));do try{D3();break}catch(a){NT(e,a)}while(!0);gb(),zh.current=i,Ve=o,Rt!==null?t=0:(Gt=null,nn=0,t=Lt)}if(t!==0){if(t===2&&(o=Xy(e),o!==0&&(r=o,t=E0(e,o))),t===1)throw n=$d,Sa(e,0),us(e,r),Un(e,Ct()),n;if(t===6)us(e,r);else{if(o=e.current.alternate,!(r&30)&&!N3(o)&&(t=Vh(e,r),t===2&&(i=Xy(e),i!==0&&(r=i,t=E0(e,i))),t===1))throw n=$d,Sa(e,0),us(e,r),Un(e,Ct()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(F(345));case 2:na(e,jn,oi);break;case 3:if(us(e,r),(r&130023424)===r&&(t=Pb+500-Ct(),10<t)){if(Eh(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){Cn(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=o0(na.bind(null,e,jn,oi),t);break}na(e,jn,oi);break;case 4:if(us(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-ao(r);i=1<<s,s=t[s],s>o&&(o=s),r&=~i}if(r=o,r=Ct()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*P3(r/1960))-r,10<r){e.timeoutHandle=o0(na.bind(null,e,jn,oi),r);break}na(e,jn,oi);break;case 5:na(e,jn,oi);break;default:throw Error(F(329))}}}return Un(e,Ct()),e.callbackNode===n?PT.bind(null,e):null}function E0(e,t){var n=rd;return e.current.memoizedState.isDehydrated&&(Sa(e,t).flags|=256),e=Vh(e,t),e!==2&&(t=jn,jn=n,t!==null&&C0(t)),e}function C0(e){jn===null?jn=e:jn.push.apply(jn,e)}function N3(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!ho(i(),o))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 us(e,t){for(t&=~Rb,t&=~rg,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-ao(t),r=1<<n;e[n]=-1,t&=~r}}function QS(e){if(Ve&6)throw Error(F(327));Zl();var t=Eh(e,0);if(!(t&1))return Un(e,Ct()),null;var n=Vh(e,t);if(e.tag!==0&&n===2){var r=Xy(e);r!==0&&(t=r,n=E0(e,r))}if(n===1)throw n=$d,Sa(e,0),us(e,t),Un(e,Ct()),n;if(n===6)throw Error(F(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,na(e,jn,oi),Un(e,Ct()),null}function Nb(e,t){var n=Ve;Ve|=1;try{return e(t)}finally{Ve=n,Ve===0&&(pc=Ct()+500,Qm&&Ys())}}function Aa(e){hs!==null&&hs.tag===0&&!(Ve&6)&&Zl();var t=Ve;Ve|=1;var n=Mr.transition,r=Ze;try{if(Mr.transition=null,Ze=1,e)return e()}finally{Ze=r,Mr.transition=n,Ve=t,!(Ve&6)&&Ys()}}function $b(){er=Hl.current,ct(Hl)}function Sa(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,l3(n)),Rt!==null)for(n=Rt.return;n!==null;){var r=n;switch(pb(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Mh();break;case 3:dc(),ct(Bn),ct(gn),Sb();break;case 5:wb(r);break;case 4:dc();break;case 13:ct(gt);break;case 19:ct(gt);break;case 10:vb(r.type._context);break;case 22:case 23:$b()}n=n.return}if(Gt=e,Rt=e=Cs(e.current,null),nn=er=t,Lt=0,$d=null,Rb=rg=Da=0,jn=rd=null,ha!==null){for(t=0;t<ha.length;t++)if(n=ha[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,i=n.pending;if(i!==null){var s=i.next;i.next=o,r.next=s}n.pending=r}ha=null}return e}function NT(e,t){do{var n=Rt;try{if(gb(),Gp.current=jh,Lh){for(var r=yt.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}Lh=!1}if($a=0,Ht=$t=yt=null,td=!1,Rd=0,Mb.current=null,n===null||n.return===null){Lt=1,$d=t,Rt=null;break}e:{var i=e,s=n.return,a=n,l=t;if(t=nn,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,u=a,d=u.tag;if(!(u.mode&1)&&(d===0||d===11||d===15)){var f=u.alternate;f?(u.updateQueue=f.updateQueue,u.memoizedState=f.memoizedState,u.lanes=f.lanes):(u.updateQueue=null,u.memoizedState=null)}var h=FS(s);if(h!==null){h.flags&=-257,BS(h,s,a,i,t),h.mode&1&&zS(i,c,t),t=h,l=c;var m=t.updateQueue;if(m===null){var g=new Set;g.add(l),t.updateQueue=g}else m.add(l);break e}else{if(!(t&1)){zS(i,c,t),Db();break e}l=Error(F(426))}}else if(ut&&a.mode&1){var b=FS(s);if(b!==null){!(b.flags&65536)&&(b.flags|=256),BS(b,s,a,i,t),hb(fc(l,a));break e}}i=l=fc(l,a),Lt!==4&&(Lt=2),rd===null?rd=[i]:rd.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var y=mT(i,l,t);NS(i,y);break e;case 1:a=l;var v=i.type,w=i.stateNode;if(!(i.flags&128)&&(typeof v.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(ks===null||!ks.has(w)))){i.flags|=65536,t&=-t,i.lanes|=t;var S=gT(i,a,t);NS(i,S);break e}}i=i.return}while(i!==null)}AT(n)}catch(k){t=k,Rt===n&&n!==null&&(Rt=n=n.return);continue}break}while(!0)}function $T(){var e=zh.current;return zh.current=jh,e===null?jh:e}function Db(){(Lt===0||Lt===3||Lt===2)&&(Lt=4),Gt===null||!(Da&268435455)&&!(rg&268435455)||us(Gt,nn)}function Vh(e,t){var n=Ve;Ve|=2;var r=$T();(Gt!==e||nn!==t)&&(oi=null,Sa(e,t));do try{$3();break}catch(o){NT(e,o)}while(!0);if(gb(),Ve=n,zh.current=r,Rt!==null)throw Error(F(261));return Gt=null,nn=0,Lt}function $3(){for(;Rt!==null;)DT(Rt)}function D3(){for(;Rt!==null&&!iI();)DT(Rt)}function DT(e){var t=LT(e.alternate,e,er);e.memoizedProps=e.pendingProps,t===null?AT(e):Rt=t,Mb.current=null}function AT(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=O3(n,t),n!==null){n.flags&=32767,Rt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Lt=6,Rt=null;return}}else if(n=_3(n,t,er),n!==null){Rt=n;return}if(t=t.sibling,t!==null){Rt=t;return}Rt=t=e}while(t!==null);Lt===0&&(Lt=5)}function na(e,t,n){var r=Ze,o=Mr.transition;try{Mr.transition=null,Ze=1,A3(e,t,n,r)}finally{Mr.transition=o,Ze=r}return null}function A3(e,t,n,r){do Zl();while(hs!==null);if(Ve&6)throw Error(F(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(F(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(mI(e,i),e===Gt&&(Rt=Gt=null,nn=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||xp||(xp=!0,jT(kh,function(){return Zl(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=Mr.transition,Mr.transition=null;var s=Ze;Ze=1;var a=Ve;Ve|=4,Mb.current=null,M3(e,n),MT(n,e),t3(n0),Ch=!!t0,n0=t0=null,e.current=n,R3(n),sI(),Ve=a,Ze=s,Mr.transition=i}else e.current=n;if(xp&&(xp=!1,hs=e,Bh=o),i=e.pendingLanes,i===0&&(ks=null),cI(n.stateNode),Un(e,Ct()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(Fh)throw Fh=!1,e=S0,S0=null,e;return Bh&1&&e.tag!==0&&Zl(),i=e.pendingLanes,i&1?e===k0?od++:(od=0,k0=e):od=0,Ys(),null}function Zl(){if(hs!==null){var e=hO(Bh),t=Mr.transition,n=Ze;try{if(Mr.transition=null,Ze=16>e?16:e,hs===null)var r=!1;else{if(e=hs,hs=null,Bh=0,Ve&6)throw Error(F(331));var o=Ve;for(Ve|=4,ne=e.current;ne!==null;){var i=ne,s=i.child;if(ne.flags&16){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(ne=c;ne!==null;){var u=ne;switch(u.tag){case 0:case 11:case 15:nd(8,u,i)}var d=u.child;if(d!==null)d.return=u,ne=d;else for(;ne!==null;){u=ne;var f=u.sibling,h=u.return;if(_T(u),u===c){ne=null;break}if(f!==null){f.return=h,ne=f;break}ne=h}}}var m=i.alternate;if(m!==null){var g=m.child;if(g!==null){m.child=null;do{var b=g.sibling;g.sibling=null,g=b}while(g!==null)}}ne=i}}if(i.subtreeFlags&2064&&s!==null)s.return=i,ne=s;else e:for(;ne!==null;){if(i=ne,i.flags&2048)switch(i.tag){case 0:case 11:case 15:nd(9,i,i.return)}var y=i.sibling;if(y!==null){y.return=i.return,ne=y;break e}ne=i.return}}var v=e.current;for(ne=v;ne!==null;){s=ne;var w=s.child;if(s.subtreeFlags&2064&&w!==null)w.return=s,ne=w;else e:for(s=v;ne!==null;){if(a=ne,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:ng(9,a)}}catch(k){bt(a,a.return,k)}if(a===s){ne=null;break e}var S=a.sibling;if(S!==null){S.return=a.return,ne=S;break e}ne=a.return}}if(Ve=o,Ys(),Do&&typeof Do.onPostCommitFiberRoot=="function")try{Do.onPostCommitFiberRoot(Gm,e)}catch{}r=!0}return r}finally{Ze=n,Mr.transition=t}}return!1}function ek(e,t,n){t=fc(n,t),t=mT(e,t,1),e=Ss(e,t,1),t=Cn(),e!==null&&(Of(e,1,t),Un(e,t))}function bt(e,t,n){if(e.tag===3)ek(e,e,n);else for(;t!==null;){if(t.tag===3){ek(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(ks===null||!ks.has(r))){e=fc(n,e),e=gT(t,e,1),t=Ss(t,e,1),e=Cn(),t!==null&&(Of(t,1,e),Un(t,e));break}}t=t.return}}function I3(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Cn(),e.pingedLanes|=e.suspendedLanes&n,Gt===e&&(nn&n)===n&&(Lt===4||Lt===3&&(nn&130023424)===nn&&500>Ct()-Pb?Sa(e,0):Rb|=n),Un(e,t)}function IT(e,t){t===0&&(e.mode&1?(t=cp,cp<<=1,!(cp&130023424)&&(cp=4194304)):t=1);var n=Cn();e=wi(e,t),e!==null&&(Of(e,t,n),Un(e,n))}function L3(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),IT(e,n)}function j3(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(F(314))}r!==null&&r.delete(t),IT(e,n)}var LT;LT=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Bn.current)zn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return zn=!1,C3(e,t,n);zn=!!(e.flags&131072)}else zn=!1,ut&&t.flags&1048576&&FO(t,Nh,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Xp(e,t),e=t.pendingProps;var o=lc(t,gn.current);Xl(t,n),o=Eb(null,t,r,e,o,n);var i=Cb();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Vn(r)?(i=!0,Rh(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,xb(t),o.updater=eg,t.stateNode=o,o._reactInternals=t,d0(t,r,e,n),t=h0(null,t,r,!0,i,n)):(t.tag=0,ut&&i&&fb(t),Sn(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Xp(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=F3(r),e=Yr(r,e),o){case 0:t=p0(null,t,r,e,n);break e;case 1:t=HS(null,t,r,e,n);break e;case 11:t=VS(null,t,r,e,n);break e;case 14:t=US(null,t,r,Yr(r.type,e),n);break e}throw Error(F(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Yr(r,o),p0(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Yr(r,o),HS(e,t,r,o,n);case 3:e:{if(bT(t),e===null)throw Error(F(387));r=t.pendingProps,i=t.memoizedState,o=i.element,HO(e,t),Ah(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=fc(Error(F(423)),t),t=WS(e,t,r,n,o);break e}else if(r!==o){o=fc(Error(F(424)),t),t=WS(e,t,r,n,o);break e}else for(ir=ws(t.stateNode.containerInfo.firstChild),sr=t,ut=!0,Jr=null,n=GO(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(cc(),r===o){t=Si(e,t,n);break e}Sn(e,t,r,n)}t=t.child}return t;case 5:return YO(t),e===null&&l0(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,r0(r,o)?s=null:i!==null&&r0(r,i)&&(t.flags|=32),xT(e,t),Sn(e,t,s,n),t.child;case 6:return e===null&&l0(t),null;case 13:return wT(e,t,n);case 4:return bb(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=uc(t,null,r,n):Sn(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Yr(r,o),VS(e,t,r,o,n);case 7:return Sn(e,t,t.pendingProps,n),t.child;case 8:return Sn(e,t,t.pendingProps.children,n),t.child;case 12:return Sn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,ot($h,r._currentValue),r._currentValue=s,i!==null)if(ho(i.value,s)){if(i.children===o.children&&!Bn.current){t=Si(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){s=i.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=gi(-1,n&-n),l.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),c0(i.return,n,t),a.lanes|=n;break}l=l.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(F(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),c0(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}Sn(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Xl(t,n),o=Nr(o),r=r(o),t.flags|=1,Sn(e,t,r,n),t.child;case 14:return r=t.type,o=Yr(r,t.pendingProps),o=Yr(r.type,o),US(e,t,r,o,n);case 15:return vT(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Yr(r,o),Xp(e,t),t.tag=1,Vn(r)?(e=!0,Rh(t)):e=!1,Xl(t,n),KO(t,r,o),d0(t,r,o,n),h0(null,t,r,!0,e,n);case 19:return ST(e,t,n);case 22:return yT(e,t,n)}throw Error(F(156,t.tag))};function jT(e,t){return uO(e,t)}function z3(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.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 Or(e,t,n,r){return new z3(e,t,n,r)}function Ab(e){return e=e.prototype,!(!e||!e.isReactComponent)}function F3(e){if(typeof e=="function")return Ab(e)?1:0;if(e!=null){if(e=e.$$typeof,e===eb)return 11;if(e===tb)return 14}return 2}function Cs(e,t){var n=e.alternate;return n===null?(n=Or(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Qp(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")Ab(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Dl:return ka(n.children,o,i,t);case Qx:s=8,o|=8;break;case Ay:return e=Or(12,n,t,o|2),e.elementType=Ay,e.lanes=i,e;case Iy:return e=Or(13,n,t,o),e.elementType=Iy,e.lanes=i,e;case Ly:return e=Or(19,n,t,o),e.elementType=Ly,e.lanes=i,e;case q_:return og(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case W_:s=10;break e;case K_:s=9;break e;case eb:s=11;break e;case tb:s=14;break e;case rs:s=16,r=null;break e}throw Error(F(130,e==null?e:typeof e,""))}return t=Or(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function ka(e,t,n,r){return e=Or(7,e,r,t),e.lanes=n,e}function og(e,t,n,r){return e=Or(22,e,r,t),e.elementType=q_,e.lanes=n,e.stateNode={isHidden:!1},e}function Fv(e,t,n){return e=Or(6,e,null,t),e.lanes=n,e}function Bv(e,t,n){return t=Or(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function B3(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=wv(0),this.expirationTimes=wv(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=wv(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Ib(e,t,n,r,o,i,s,a,l){return e=new B3(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Or(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},xb(i),e}function V3(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:$l,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function zT(e){if(!e)return Ds;e=e._reactInternals;e:{if(Ja(e)!==e||e.tag!==1)throw Error(F(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Vn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(F(171))}if(e.tag===1){var n=e.type;if(Vn(n))return jO(e,n,t)}return t}function FT(e,t,n,r,o,i,s,a,l){return e=Ib(n,r,!0,e,o,i,s,a,l),e.context=zT(null),n=e.current,r=Cn(),o=Es(n),i=gi(r,o),i.callback=t??null,Ss(n,i,o),e.current.lanes=o,Of(e,o,r),Un(e,r),e}function ig(e,t,n,r){var o=t.current,i=Cn(),s=Es(o);return n=zT(n),t.context===null?t.context=n:t.pendingContext=n,t=gi(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Ss(o,t,s),e!==null&&(lo(e,o,s,i),qp(e,o,s)),s}function Uh(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function tk(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Lb(e,t){tk(e,t),(e=e.alternate)&&tk(e,t)}function U3(){return null}var BT=typeof reportError=="function"?reportError:function(e){console.error(e)};function jb(e){this._internalRoot=e}sg.prototype.render=jb.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(F(409));ig(e,t,null,null)};sg.prototype.unmount=jb.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Aa(function(){ig(null,e,null,null)}),t[bi]=null}};function sg(e){this._internalRoot=e}sg.prototype.unstable_scheduleHydration=function(e){if(e){var t=vO();e={blockedOn:null,target:e,priority:t};for(var n=0;n<cs.length&&t!==0&&t<cs[n].priority;n++);cs.splice(n,0,e),n===0&&xO(e)}};function zb(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ag(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function nk(){}function H3(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var c=Uh(s);i.call(c)}}var s=FT(t,r,e,0,null,!1,!1,"",nk);return e._reactRootContainer=s,e[bi]=s.current,Cd(e.nodeType===8?e.parentNode:e),Aa(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var a=r;r=function(){var c=Uh(l);a.call(c)}}var l=Ib(e,0,!1,null,null,!1,!1,"",nk);return e._reactRootContainer=l,e[bi]=l.current,Cd(e.nodeType===8?e.parentNode:e),Aa(function(){ig(t,l,n,r)}),l}function lg(e,t,n,r,o){var i=n._reactRootContainer;if(i){var s=i;if(typeof o=="function"){var a=o;o=function(){var l=Uh(s);a.call(l)}}ig(t,s,e,o)}else s=H3(n,t,e,o,r);return Uh(s)}mO=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Su(t.pendingLanes);n!==0&&(ob(t,n|1),Un(t,Ct()),!(Ve&6)&&(pc=Ct()+500,Ys()))}break;case 13:Aa(function(){var r=wi(e,1);if(r!==null){var o=Cn();lo(r,e,1,o)}}),Lb(e,1)}};ib=function(e){if(e.tag===13){var t=wi(e,134217728);if(t!==null){var n=Cn();lo(t,e,134217728,n)}Lb(e,134217728)}};gO=function(e){if(e.tag===13){var t=Es(e),n=wi(e,t);if(n!==null){var r=Cn();lo(n,e,t,r)}Lb(e,t)}};vO=function(){return Ze};yO=function(e,t){var n=Ze;try{return Ze=e,t()}finally{Ze=n}};qy=function(e,t,n){switch(t){case"input":if(Fy(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=Jm(r);if(!o)throw Error(F(90));Y_(r),Fy(r,o)}}}break;case"textarea":Z_(e,n);break;case"select":t=n.value,t!=null&&Kl(e,!!n.multiple,t,!1)}};oO=Nb;iO=Aa;var W3={usingClientEntryPoint:!1,Events:[Mf,jl,Jm,nO,rO,Nb]},cu={findFiberByHostInstance:pa,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},K3={bundleType:cu.bundleType,version:cu.version,rendererPackageName:cu.rendererPackageName,rendererConfig:cu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Pi.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=lO(e),e===null?null:e.stateNode},findFiberByHostInstance:cu.findFiberByHostInstance||U3,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var bp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!bp.isDisabled&&bp.supportsFiber)try{Gm=bp.inject(K3),Do=bp}catch{}}fr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=W3;fr.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!zb(t))throw Error(F(200));return V3(e,t,null,n)};fr.createRoot=function(e,t){if(!zb(e))throw Error(F(299));var n=!1,r="",o=BT;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Ib(e,1,!1,null,null,n,!1,r,o),e[bi]=t.current,Cd(e.nodeType===8?e.parentNode:e),new jb(t)};fr.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(F(188)):(e=Object.keys(e).join(","),Error(F(268,e)));return e=lO(t),e=e===null?null:e.stateNode,e};fr.flushSync=function(e){return Aa(e)};fr.hydrate=function(e,t,n){if(!ag(t))throw Error(F(200));return lg(null,e,t,!0,n)};fr.hydrateRoot=function(e,t,n){if(!zb(e))throw Error(F(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",s=BT;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=FT(t,null,e,1,n??null,o,!1,i,s),e[bi]=t.current,Cd(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new sg(t)};fr.render=function(e,t,n){if(!ag(t))throw Error(F(200));return lg(null,e,t,!1,n)};fr.unmountComponentAtNode=function(e){if(!ag(e))throw Error(F(40));return e._reactRootContainer?(Aa(function(){lg(null,null,e,!1,function(){e._reactRootContainer=null,e[bi]=null})}),!0):!1};fr.unstable_batchedUpdates=Nb;fr.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!ag(n))throw Error(F(200));if(e==null||e._reactInternals===void 0)throw Error(F(38));return lg(e,t,n,!1,r)};fr.version="18.2.0-next-9e3b772b8-20220608";function VT(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(VT)}catch(e){console.error(e)}}VT(),F_.exports=fr;var At=F_.exports;const q3=Ri(At);var rk=At;Yu.createRoot=rk.createRoot,Yu.hydrateRoot=rk.hydrateRoot;var UT={exports:{}},cg={};/**
33
- * @license React
34
- * react-jsx-runtime.production.min.js
35
- *
36
- * Copyright (c) Facebook, Inc. and its affiliates.
37
- *
38
- * This source code is licensed under the MIT license found in the
39
- * LICENSE file in the root directory of this source tree.
40
- */var G3=p,Y3=Symbol.for("react.element"),X3=Symbol.for("react.fragment"),Z3=Object.prototype.hasOwnProperty,J3=G3.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Q3={key:!0,ref:!0,__self:!0,__source:!0};function HT(e,t,n){var r,o={},i=null,s=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)Z3.call(t,r)&&!Q3.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:Y3,type:e,key:i,ref:s,props:o,_owner:J3.current}}cg.Fragment=X3;cg.jsx=HT;cg.jsxs=HT;UT.exports=cg;var x=UT.exports;function _0(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Fb(e,t){if(e){if(typeof e=="string")return _0(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _0(e,t)}}function ug(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Fb(e))||t&&e&&typeof e.length=="number"){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(l){throw l},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
41
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,s=!1,a;return{s:function(){n=n.call(e)},n:function(){var l=n.next();return i=l.done,l},e:function(l){s=!0,a=l},f:function(){try{!i&&n.return!=null&&n.return()}finally{if(s)throw a}}}}function WT(e){return e.length>0}var Pf=Object.freeze({kind:"ok",value:void 0});function Nf(e){return e===void 0?Pf:{kind:"ok",value:e}}function Lo(e){return{kind:"err",error:e}}function $c(e){return e===Pf||e.kind==="ok"}function Bb(e){return e!==Pf&&e.kind==="err"}function KT(e){var t=[],n=[],r=ug(e),o;try{for(r.s();!(o=r.n()).done;){var i=o.value;$c(i)?t.push(i.value):n.push(i.error)}}catch(s){r.e(s)}finally{r.f()}return WT(n)?Lo(n):Nf(t)}function e5(e){return KT(e)}function t5(e){var t=[],n=ug(e),r;try{for(n.s();!(r=n.n()).done;){var o=r.value;Bb(o)&&t.push(o.error)}}catch(i){n.e(i)}finally{n.f()}return WT(t)?Lo(t):Pf}function n5(e,t){return function(n){for(var r=Nf(t),o=0;o<n.length&&$c(r);++o)r=e(r.value,n[o],o);return r}}function r5(e){return function(t){return $c(t)?Nf(e(t.value)):t}}function o5(e){return function(t){return $c(t)?e(t.value):t}}function i5(e){return function(t){return Bb(t)?Lo(e(t.error)):t}}function s5(e,t){return function(n){return e(n)?Nf(n):Lo(t(n))}}var a5=function(t,n){return function(r){return $c(r)?t(r.value)?r:Lo(n(r.value)):r}},Ke=Object.freeze({__proto__:null,voidOk:Pf,ok:Nf,err:Lo,isOk:$c,isErr:Bb,allT:KT,all:e5,allV:t5,flatMapReduce:n5,map:r5,flatMap:o5,mapErr:i5,fromPredicate:s5,filterOrElse:a5});function Vb(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let Qa=Vb();function qT(e){Qa=e}const GT=/[&<>"']/,l5=new RegExp(GT.source,"g"),YT=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,c5=new RegExp(YT.source,"g"),u5={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ok=e=>u5[e];function tr(e,t){if(t){if(GT.test(e))return e.replace(l5,ok)}else if(YT.test(e))return e.replace(c5,ok);return e}const d5=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function f5(e){return e.replace(d5,(t,n)=>(n=n.toLowerCase(),n==="colon"?":":n.charAt(0)==="#"?n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)):""))}const p5=/(^|[^\[])\^/g;function Ge(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(r,o)=>(o=typeof o=="object"&&"source"in o?o.source:o,o=o.replace(p5,"$1"),e=e.replace(r,o),n),getRegex:()=>new RegExp(e,t)};return n}function ik(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch{return null}return e}const Hh={exec:()=>null};function sk(e,t){const n=e.replace(/\|/g,(i,s,a)=>{let l=!1,c=s;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),r=n.split(/ \|/);let o=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;o<r.length;o++)r[o]=r[o].trim().replace(/\\\|/g,"|");return r}function wp(e,t,n){const r=e.length;if(r===0)return"";let o=0;for(;o<r;){const i=e.charAt(r-o-1);if(i===t&&!n)o++;else if(i!==t&&n)o++;else break}return e.slice(0,r-o)}function h5(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return-1}function ak(e,t,n,r){const o=t.href,i=t.title?tr(t.title):null,s=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){r.state.inLink=!0;const a={type:"link",raw:n,href:o,title:i,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,a}return{type:"image",raw:n,href:o,title:i,text:tr(s)}}function m5(e,t){const n=e.match(/^(\s+)(?:```)/);if(n===null)return t;const r=n[1];return t.split(`
42
- `).map(o=>{const i=o.match(/^\s+/);if(i===null)return o;const[s]=i;return s.length>=r.length?o.slice(r.length):o}).join(`
43
- `)}class Wh{constructor(t){st(this,"options");st(this,"rules");st(this,"lexer");this.options=t||Qa}space(t){const n=this.rules.block.newline.exec(t);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(t){const n=this.rules.block.code.exec(t);if(n){const r=n[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?r:wp(r,`
44
- `)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const r=n[0],o=m5(r,n[3]||"");return{type:"code",raw:r,lang:n[2]?n[2].trim().replace(this.rules.inline._escapes,"$1"):n[2],text:o}}}heading(t){const n=this.rules.block.heading.exec(t);if(n){let r=n[2].trim();if(/#$/.test(r)){const o=wp(r,"#");(this.options.pedantic||!o||/ $/.test(o))&&(r=o.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){const n=this.rules.block.hr.exec(t);if(n)return{type:"hr",raw:n[0]}}blockquote(t){const n=this.rules.block.blockquote.exec(t);if(n){const r=wp(n[0].replace(/^ *>[ \t]?/gm,""),`
45
- `),o=this.lexer.state.top;this.lexer.state.top=!0;const i=this.lexer.blockTokens(r);return this.lexer.state.top=o,{type:"blockquote",raw:n[0],tokens:i,text:r}}}list(t){let n=this.rules.block.list.exec(t);if(n){let r=n[1].trim();const o=r.length>1,i={type:"list",raw:"",ordered:o,start:o?+r.slice(0,-1):"",loose:!1,items:[]};r=o?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=o?r:"[*+-]");const s=new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`);let a="",l="",c=!1;for(;t;){let u=!1;if(!(n=s.exec(t))||this.rules.block.hr.test(t))break;a=n[0],t=t.substring(a.length);let d=n[2].split(`
46
- `,1)[0].replace(/^\t+/,y=>" ".repeat(3*y.length)),f=t.split(`
47
- `,1)[0],h=0;this.options.pedantic?(h=2,l=d.trimStart()):(h=n[2].search(/[^ ]/),h=h>4?1:h,l=d.slice(h),h+=n[1].length);let m=!1;if(!d&&/^ *$/.test(f)&&(a+=f+`
48
- `,t=t.substring(f.length+1),u=!0),!u){const y=new RegExp(`^ {0,${Math.min(3,h-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),v=new RegExp(`^ {0,${Math.min(3,h-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),w=new RegExp(`^ {0,${Math.min(3,h-1)}}(?:\`\`\`|~~~)`),S=new RegExp(`^ {0,${Math.min(3,h-1)}}#`);for(;t;){const k=t.split(`
49
- `,1)[0];if(f=k,this.options.pedantic&&(f=f.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),w.test(f)||S.test(f)||y.test(f)||v.test(t))break;if(f.search(/[^ ]/)>=h||!f.trim())l+=`
50
- `+f.slice(h);else{if(m||d.search(/[^ ]/)>=4||w.test(d)||S.test(d)||v.test(d))break;l+=`
51
- `+f}!m&&!f.trim()&&(m=!0),a+=k+`
52
- `,t=t.substring(k.length+1),d=f.slice(h)}}i.loose||(c?i.loose=!0:/\n *\n *$/.test(a)&&(c=!0));let g=null,b;this.options.gfm&&(g=/^\[[ xX]\] /.exec(l),g&&(b=g[0]!=="[ ] ",l=l.replace(/^\[[ xX]\] +/,""))),i.items.push({type:"list_item",raw:a,task:!!g,checked:b,loose:!1,text:l,tokens:[]}),i.raw+=a}i.items[i.items.length-1].raw=a.trimEnd(),i.items[i.items.length-1].text=l.trimEnd(),i.raw=i.raw.trimEnd();for(let u=0;u<i.items.length;u++)if(this.lexer.state.top=!1,i.items[u].tokens=this.lexer.blockTokens(i.items[u].text,[]),!i.loose){const d=i.items[u].tokens.filter(h=>h.type==="space"),f=d.length>0&&d.some(h=>/\n.*\n/.test(h.raw));i.loose=f}if(i.loose)for(let u=0;u<i.items.length;u++)i.items[u].loose=!0;return i}}html(t){const n=this.rules.block.html.exec(t);if(n)return{type:"html",block:!0,raw:n[0],pre:n[1]==="pre"||n[1]==="script"||n[1]==="style",text:n[0]}}def(t){const n=this.rules.block.def.exec(t);if(n){const r=n[1].toLowerCase().replace(/\s+/g," "),o=n[2]?n[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",i=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline._escapes,"$1"):n[3];return{type:"def",tag:r,raw:n[0],href:o,title:i}}}table(t){const n=this.rules.block.table.exec(t);if(n){if(!/[:|]/.test(n[2]))return;const r={type:"table",raw:n[0],header:sk(n[1]).map(o=>({text:o,tokens:[]})),align:n[2].replace(/^\||\| *$/g,"").split("|"),rows:n[3]&&n[3].trim()?n[3].replace(/\n[ \t]*$/,"").split(`
53
- `):[]};if(r.header.length===r.align.length){let o=r.align.length,i,s,a,l;for(i=0;i<o;i++){const c=r.align[i];c&&(/^ *-+: *$/.test(c)?r.align[i]="right":/^ *:-+: *$/.test(c)?r.align[i]="center":/^ *:-+ *$/.test(c)?r.align[i]="left":r.align[i]=null)}for(o=r.rows.length,i=0;i<o;i++)r.rows[i]=sk(r.rows[i],r.header.length).map(c=>({text:c,tokens:[]}));for(o=r.header.length,s=0;s<o;s++)r.header[s].tokens=this.lexer.inline(r.header[s].text);for(o=r.rows.length,s=0;s<o;s++)for(l=r.rows[s],a=0;a<l.length;a++)l[a].tokens=this.lexer.inline(l[a].text);return r}}}lheading(t){const n=this.rules.block.lheading.exec(t);if(n)return{type:"heading",raw:n[0],depth:n[2].charAt(0)==="="?1:2,text:n[1],tokens:this.lexer.inline(n[1])}}paragraph(t){const n=this.rules.block.paragraph.exec(t);if(n){const r=n[1].charAt(n[1].length-1)===`
54
- `?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:r,tokens:this.lexer.inline(r)}}}text(t){const n=this.rules.block.text.exec(t);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(t){const n=this.rules.inline.escape.exec(t);if(n)return{type:"escape",raw:n[0],text:tr(n[1])}}tag(t){const n=this.rules.inline.tag.exec(t);if(n)return!this.lexer.state.inLink&&/^<a /i.test(n[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:n[0]}}link(t){const n=this.rules.inline.link.exec(t);if(n){const r=n[2].trim();if(!this.options.pedantic&&/^</.test(r)){if(!/>$/.test(r))return;const s=wp(r.slice(0,-1),"\\");if((r.length-s.length)%2===0)return}else{const s=h5(n[2],"()");if(s>-1){const l=(n[0].indexOf("!")===0?5:4)+n[1].length+s;n[2]=n[2].substring(0,s),n[0]=n[0].substring(0,l).trim(),n[3]=""}}let o=n[2],i="";if(this.options.pedantic){const s=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(o);s&&(o=s[1],i=s[3])}else i=n[3]?n[3].slice(1,-1):"";return o=o.trim(),/^</.test(o)&&(this.options.pedantic&&!/>$/.test(r)?o=o.slice(1):o=o.slice(1,-1)),ak(n,{href:o&&o.replace(this.rules.inline._escapes,"$1"),title:i&&i.replace(this.rules.inline._escapes,"$1")},n[0],this.lexer)}}reflink(t,n){let r;if((r=this.rules.inline.reflink.exec(t))||(r=this.rules.inline.nolink.exec(t))){let o=(r[2]||r[1]).replace(/\s+/g," ");if(o=n[o.toLowerCase()],!o){const i=r[0].charAt(0);return{type:"text",raw:i,text:i}}return ak(r,o,r[0],this.lexer)}}emStrong(t,n,r=""){let o=this.rules.inline.emStrong.lDelim.exec(t);if(!o||o[3]&&r.match(/[\p{L}\p{N}]/u))return;if(!(o[1]||o[2]||"")||!r||this.rules.inline.punctuation.exec(r)){const s=[...o[0]].length-1;let a,l,c=s,u=0;const d=o[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(d.lastIndex=0,n=n.slice(-1*t.length+s);(o=d.exec(n))!=null;){if(a=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!a)continue;if(l=[...a].length,o[3]||o[4]){c+=l;continue}else if((o[5]||o[6])&&s%3&&!((s+l)%3)){u+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c+u);const f=[...o[0]][0].length,h=t.slice(0,s+o.index+f+l);if(Math.min(s,l)%2){const g=h.slice(1,-1);return{type:"em",raw:h,text:g,tokens:this.lexer.inlineTokens(g)}}const m=h.slice(2,-2);return{type:"strong",raw:h,text:m,tokens:this.lexer.inlineTokens(m)}}}}codespan(t){const n=this.rules.inline.code.exec(t);if(n){let r=n[2].replace(/\n/g," ");const o=/[^ ]/.test(r),i=/^ /.test(r)&&/ $/.test(r);return o&&i&&(r=r.substring(1,r.length-1)),r=tr(r,!0),{type:"codespan",raw:n[0],text:r}}}br(t){const n=this.rules.inline.br.exec(t);if(n)return{type:"br",raw:n[0]}}del(t){const n=this.rules.inline.del.exec(t);if(n)return{type:"del",raw:n[0],text:n[2],tokens:this.lexer.inlineTokens(n[2])}}autolink(t){const n=this.rules.inline.autolink.exec(t);if(n){let r,o;return n[2]==="@"?(r=tr(n[1]),o="mailto:"+r):(r=tr(n[1]),o=r),{type:"link",raw:n[0],text:r,href:o,tokens:[{type:"text",raw:r,text:r}]}}}url(t){let n;if(n=this.rules.inline.url.exec(t)){let r,o;if(n[2]==="@")r=tr(n[0]),o="mailto:"+r;else{let i;do i=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0];while(i!==n[0]);r=tr(n[0]),n[1]==="www."?o="http://"+n[0]:o=n[0]}return{type:"link",raw:n[0],text:r,href:o,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(t){const n=this.rules.inline.text.exec(t);if(n){let r;return this.lexer.state.inRawBlock?r=n[0]:r=tr(n[0]),{type:"text",raw:n[0],text:r}}}}const fe={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:Hh,lheading:/^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};fe._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;fe._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;fe.def=Ge(fe.def).replace("label",fe._label).replace("title",fe._title).getRegex();fe.bullet=/(?:[*+-]|\d{1,9}[.)])/;fe.listItemStart=Ge(/^( *)(bull) */).replace("bull",fe.bullet).getRegex();fe.list=Ge(fe.list).replace(/bull/g,fe.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+fe.def.source+")").getRegex();fe._tag="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";fe._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/;fe.html=Ge(fe.html,"i").replace("comment",fe._comment).replace("tag",fe._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();fe.lheading=Ge(fe.lheading).replace(/bull/g,fe.bullet).getRegex();fe.paragraph=Ge(fe._paragraph).replace("hr",fe.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",fe._tag).getRegex();fe.blockquote=Ge(fe.blockquote).replace("paragraph",fe.paragraph).getRegex();fe.normal={...fe};fe.gfm={...fe.normal,table:"^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"};fe.gfm.table=Ge(fe.gfm.table).replace("hr",fe.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",fe._tag).getRegex();fe.gfm.paragraph=Ge(fe._paragraph).replace("hr",fe.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",fe.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",fe._tag).getRegex();fe.pedantic={...fe.normal,html:Ge(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",fe._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Hh,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ge(fe.normal._paragraph).replace("hr",fe.hr).replace("heading",` *#{1,6} *[^
55
- ]`).replace("lheading",fe.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const J={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Hh,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,rDelimAst:/^[^_*]*?__[^_*]*?\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\*)[punct](\*+)(?=[\s]|$)|[^punct\s](\*+)(?!\*)(?=[punct\s]|$)|(?!\*)[punct\s](\*+)(?=[^punct\s])|[\s](\*+)(?!\*)(?=[punct])|(?!\*)[punct](\*+)(?!\*)(?=[punct])|[^punct\s](\*+)(?=[^punct\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\s]|$)|[^punct\s](_+)(?!_)(?=[punct\s]|$)|(?!_)[punct\s](_+)(?=[^punct\s])|[\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Hh,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^((?![*_])[\spunctuation])/};J._punctuation="\\p{P}$+<=>`^|~";J.punctuation=Ge(J.punctuation,"u").replace(/punctuation/g,J._punctuation).getRegex();J.blockSkip=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g;J.anyPunctuation=/\\[punct]/g;J._escapes=/\\([punct])/g;J._comment=Ge(fe._comment).replace("(?:-->|$)","-->").getRegex();J.emStrong.lDelim=Ge(J.emStrong.lDelim,"u").replace(/punct/g,J._punctuation).getRegex();J.emStrong.rDelimAst=Ge(J.emStrong.rDelimAst,"gu").replace(/punct/g,J._punctuation).getRegex();J.emStrong.rDelimUnd=Ge(J.emStrong.rDelimUnd,"gu").replace(/punct/g,J._punctuation).getRegex();J.anyPunctuation=Ge(J.anyPunctuation,"gu").replace(/punct/g,J._punctuation).getRegex();J._escapes=Ge(J._escapes,"gu").replace(/punct/g,J._punctuation).getRegex();J._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;J._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;J.autolink=Ge(J.autolink).replace("scheme",J._scheme).replace("email",J._email).getRegex();J._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;J.tag=Ge(J.tag).replace("comment",J._comment).replace("attribute",J._attribute).getRegex();J._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;J._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;J._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;J.link=Ge(J.link).replace("label",J._label).replace("href",J._href).replace("title",J._title).getRegex();J.reflink=Ge(J.reflink).replace("label",J._label).replace("ref",fe._label).getRegex();J.nolink=Ge(J.nolink).replace("ref",fe._label).getRegex();J.reflinkSearch=Ge(J.reflinkSearch,"g").replace("reflink",J.reflink).replace("nolink",J.nolink).getRegex();J.normal={...J};J.pedantic={...J.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Ge(/^!?\[(label)\]\((.*?)\)/).replace("label",J._label).getRegex(),reflink:Ge(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",J._label).getRegex()};J.gfm={...J.normal,escape:Ge(J.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/};J.gfm.url=Ge(J.gfm.url,"i").replace("email",J.gfm._extended_email).getRegex();J.breaks={...J.gfm,br:Ge(J.br).replace("{2,}","*").getRegex(),text:Ge(J.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()};class No{constructor(t){st(this,"tokens");st(this,"options");st(this,"state");st(this,"tokenizer");st(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Qa,this.options.tokenizer=this.options.tokenizer||new Wh,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const n={block:fe.normal,inline:J.normal};this.options.pedantic?(n.block=fe.pedantic,n.inline=J.pedantic):this.options.gfm&&(n.block=fe.gfm,this.options.breaks?n.inline=J.breaks:n.inline=J.gfm),this.tokenizer.rules=n}static get rules(){return{block:fe,inline:J}}static lex(t,n){return new No(n).lex(t)}static lexInline(t,n){return new No(n).inlineTokens(t)}lex(t){t=t.replace(/\r\n|\r/g,`
56
- `),this.blockTokens(t,this.tokens);let n;for(;n=this.inlineQueue.shift();)this.inlineTokens(n.src,n.tokens);return this.tokens}blockTokens(t,n=[]){this.options.pedantic?t=t.replace(/\t/g," ").replace(/^ +$/gm,""):t=t.replace(/^( *)(\t+)/gm,(a,l,c)=>l+" ".repeat(c.length));let r,o,i,s;for(;t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(a=>(r=a.call({lexer:this},t,n))?(t=t.substring(r.raw.length),n.push(r),!0):!1))){if(r=this.tokenizer.space(t)){t=t.substring(r.raw.length),r.raw.length===1&&n.length>0?n[n.length-1].raw+=`
57
- `:n.push(r);continue}if(r=this.tokenizer.code(t)){t=t.substring(r.raw.length),o=n[n.length-1],o&&(o.type==="paragraph"||o.type==="text")?(o.raw+=`
58
- `+r.raw,o.text+=`
59
- `+r.text,this.inlineQueue[this.inlineQueue.length-1].src=o.text):n.push(r);continue}if(r=this.tokenizer.fences(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.heading(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.hr(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.blockquote(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.list(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.html(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.def(t)){t=t.substring(r.raw.length),o=n[n.length-1],o&&(o.type==="paragraph"||o.type==="text")?(o.raw+=`
60
- `+r.raw,o.text+=`
61
- `+r.raw,this.inlineQueue[this.inlineQueue.length-1].src=o.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.lheading(t)){t=t.substring(r.raw.length),n.push(r);continue}if(i=t,this.options.extensions&&this.options.extensions.startBlock){let a=1/0;const l=t.slice(1);let c;this.options.extensions.startBlock.forEach(u=>{c=u.call({lexer:this},l),typeof c=="number"&&c>=0&&(a=Math.min(a,c))}),a<1/0&&a>=0&&(i=t.substring(0,a+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){o=n[n.length-1],s&&o.type==="paragraph"?(o.raw+=`
62
- `+r.raw,o.text+=`
63
- `+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):n.push(r),s=i.length!==t.length,t=t.substring(r.raw.length);continue}if(r=this.tokenizer.text(t)){t=t.substring(r.raw.length),o=n[n.length-1],o&&o.type==="text"?(o.raw+=`
64
- `+r.raw,o.text+=`
65
- `+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):n.push(r);continue}if(t){const a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){let r,o,i,s=t,a,l,c;if(this.tokens.links){const u=Object.keys(this.tokens.links);if(u.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)u.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,a.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;t;)if(l||(c=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(u=>(r=u.call({lexer:this},t,n))?(t=t.substring(r.raw.length),n.push(r),!0):!1))){if(r=this.tokenizer.escape(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.tag(t)){t=t.substring(r.raw.length),o=n[n.length-1],o&&r.type==="text"&&o.type==="text"?(o.raw+=r.raw,o.text+=r.text):n.push(r);continue}if(r=this.tokenizer.link(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(r.raw.length),o=n[n.length-1],o&&r.type==="text"&&o.type==="text"?(o.raw+=r.raw,o.text+=r.text):n.push(r);continue}if(r=this.tokenizer.emStrong(t,s,c)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.codespan(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.br(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.del(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.autolink(t)){t=t.substring(r.raw.length),n.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(t))){t=t.substring(r.raw.length),n.push(r);continue}if(i=t,this.options.extensions&&this.options.extensions.startInline){let u=1/0;const d=t.slice(1);let f;this.options.extensions.startInline.forEach(h=>{f=h.call({lexer:this},d),typeof f=="number"&&f>=0&&(u=Math.min(u,f))}),u<1/0&&u>=0&&(i=t.substring(0,u+1))}if(r=this.tokenizer.inlineText(i)){t=t.substring(r.raw.length),r.raw.slice(-1)!=="_"&&(c=r.raw.slice(-1)),l=!0,o=n[n.length-1],o&&o.type==="text"?(o.raw+=r.raw,o.text+=r.text):n.push(r);continue}if(t){const u="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return n}}class Kh{constructor(t){st(this,"options");this.options=t||Qa}code(t,n,r){var i;const o=(i=(n||"").match(/^\S*/))==null?void 0:i[0];return t=t.replace(/\n$/,"")+`
66
- `,o?'<pre><code class="language-'+tr(o)+'">'+(r?t:tr(t,!0))+`</code></pre>
67
- `:"<pre><code>"+(r?t:tr(t,!0))+`</code></pre>
68
- `}blockquote(t){return`<blockquote>
69
- ${t}</blockquote>
70
- `}html(t,n){return t}heading(t,n,r){return`<h${n}>${t}</h${n}>
71
- `}hr(){return`<hr>
72
- `}list(t,n,r){const o=n?"ol":"ul",i=n&&r!==1?' start="'+r+'"':"";return"<"+o+i+`>
73
- `+t+"</"+o+`>
74
- `}listitem(t,n,r){return`<li>${t}</li>
75
- `}checkbox(t){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(t){return`<p>${t}</p>
76
- `}table(t,n){return n&&(n=`<tbody>${n}</tbody>`),`<table>
77
- <thead>
78
- `+t+`</thead>
79
- `+n+`</table>
80
- `}tablerow(t){return`<tr>
81
- ${t}</tr>
82
- `}tablecell(t,n){const r=n.header?"th":"td";return(n.align?`<${r} align="${n.align}">`:`<${r}>`)+t+`</${r}>
83
- `}strong(t){return`<strong>${t}</strong>`}em(t){return`<em>${t}</em>`}codespan(t){return`<code>${t}</code>`}br(){return"<br>"}del(t){return`<del>${t}</del>`}link(t,n,r){const o=ik(t);if(o===null)return r;t=o;let i='<a href="'+t+'"';return n&&(i+=' title="'+n+'"'),i+=">"+r+"</a>",i}image(t,n,r){const o=ik(t);if(o===null)return r;t=o;let i=`<img src="${t}" alt="${r}"`;return n&&(i+=` title="${n}"`),i+=">",i}text(t){return t}}class Ub{strong(t){return t}em(t){return t}codespan(t){return t}del(t){return t}html(t){return t}text(t){return t}link(t,n,r){return""+r}image(t,n,r){return""+r}br(){return""}}class $o{constructor(t){st(this,"options");st(this,"renderer");st(this,"textRenderer");this.options=t||Qa,this.options.renderer=this.options.renderer||new Kh,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ub}static parse(t,n){return new $o(n).parse(t)}static parseInline(t,n){return new $o(n).parseInline(t)}parse(t,n=!0){let r="";for(let o=0;o<t.length;o++){const i=t[o];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const s=i,a=this.options.extensions.renderers[s.type].call({parser:this},s);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(s.type)){r+=a||"";continue}}switch(i.type){case"space":continue;case"hr":{r+=this.renderer.hr();continue}case"heading":{const s=i;r+=this.renderer.heading(this.parseInline(s.tokens),s.depth,f5(this.parseInline(s.tokens,this.textRenderer)));continue}case"code":{const s=i;r+=this.renderer.code(s.text,s.lang,!!s.escaped);continue}case"table":{const s=i;let a="",l="";for(let u=0;u<s.header.length;u++)l+=this.renderer.tablecell(this.parseInline(s.header[u].tokens),{header:!0,align:s.align[u]});a+=this.renderer.tablerow(l);let c="";for(let u=0;u<s.rows.length;u++){const d=s.rows[u];l="";for(let f=0;f<d.length;f++)l+=this.renderer.tablecell(this.parseInline(d[f].tokens),{header:!1,align:s.align[f]});c+=this.renderer.tablerow(l)}r+=this.renderer.table(a,c);continue}case"blockquote":{const s=i,a=this.parse(s.tokens);r+=this.renderer.blockquote(a);continue}case"list":{const s=i,a=s.ordered,l=s.start,c=s.loose;let u="";for(let d=0;d<s.items.length;d++){const f=s.items[d],h=f.checked,m=f.task;let g="";if(f.task){const b=this.renderer.checkbox(!!h);c?f.tokens.length>0&&f.tokens[0].type==="paragraph"?(f.tokens[0].text=b+" "+f.tokens[0].text,f.tokens[0].tokens&&f.tokens[0].tokens.length>0&&f.tokens[0].tokens[0].type==="text"&&(f.tokens[0].tokens[0].text=b+" "+f.tokens[0].tokens[0].text)):f.tokens.unshift({type:"text",text:b+" "}):g+=b+" "}g+=this.parse(f.tokens,c),u+=this.renderer.listitem(g,m,!!h)}r+=this.renderer.list(u,a,l);continue}case"html":{const s=i;r+=this.renderer.html(s.text,s.block);continue}case"paragraph":{const s=i;r+=this.renderer.paragraph(this.parseInline(s.tokens));continue}case"text":{let s=i,a=s.tokens?this.parseInline(s.tokens):s.text;for(;o+1<t.length&&t[o+1].type==="text";)s=t[++o],a+=`
84
- `+(s.tokens?this.parseInline(s.tokens):s.text);r+=n?this.renderer.paragraph(a):a;continue}default:{const s='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return r}parseInline(t,n){n=n||this.renderer;let r="";for(let o=0;o<t.length;o++){const i=t[o];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const s=this.options.extensions.renderers[i.type].call({parser:this},i);if(s!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){r+=s||"";continue}}switch(i.type){case"escape":{const s=i;r+=n.text(s.text);break}case"html":{const s=i;r+=n.html(s.text);break}case"link":{const s=i;r+=n.link(s.href,s.title,this.parseInline(s.tokens,n));break}case"image":{const s=i;r+=n.image(s.href,s.title,s.text);break}case"strong":{const s=i;r+=n.strong(this.parseInline(s.tokens,n));break}case"em":{const s=i;r+=n.em(this.parseInline(s.tokens,n));break}case"codespan":{const s=i;r+=n.codespan(s.text);break}case"br":{r+=n.br();break}case"del":{const s=i;r+=n.del(this.parseInline(s.tokens,n));break}case"text":{const s=i;r+=n.text(s.text);break}default:{const s='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return r}}class id{constructor(t){st(this,"options");this.options=t||Qa}preprocess(t){return t}postprocess(t){return t}}st(id,"passThroughHooks",new Set(["preprocess","postprocess"]));var Cf,O0,qm,XT;class g5{constructor(...t){mv(this,Cf);mv(this,qm);st(this,"defaults",Vb());st(this,"options",this.setOptions);st(this,"parse",rp(this,Cf,O0).call(this,No.lex,$o.parse));st(this,"parseInline",rp(this,Cf,O0).call(this,No.lexInline,$o.parseInline));st(this,"Parser",$o);st(this,"Renderer",Kh);st(this,"TextRenderer",Ub);st(this,"Lexer",No);st(this,"Tokenizer",Wh);st(this,"Hooks",id);this.use(...t)}walkTokens(t,n){var o,i;let r=[];for(const s of t)switch(r=r.concat(n.call(this,s)),s.type){case"table":{const a=s;for(const l of a.header)r=r.concat(this.walkTokens(l.tokens,n));for(const l of a.rows)for(const c of l)r=r.concat(this.walkTokens(c.tokens,n));break}case"list":{const a=s;r=r.concat(this.walkTokens(a.items,n));break}default:{const a=s;(i=(o=this.defaults.extensions)==null?void 0:o.childTokens)!=null&&i[a.type]?this.defaults.extensions.childTokens[a.type].forEach(l=>{r=r.concat(this.walkTokens(a[l],n))}):a.tokens&&(r=r.concat(this.walkTokens(a.tokens,n)))}}return r}use(...t){const n=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{const o={...r};if(o.async=this.defaults.async||o.async||!1,r.extensions&&(r.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){const s=n.renderers[i.name];s?n.renderers[i.name]=function(...a){let l=i.renderer.apply(this,a);return l===!1&&(l=s.apply(this,a)),l}:n.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const s=n[i.level];s?s.unshift(i.tokenizer):n[i.level]=[i.tokenizer],i.start&&(i.level==="block"?n.startBlock?n.startBlock.push(i.start):n.startBlock=[i.start]:i.level==="inline"&&(n.startInline?n.startInline.push(i.start):n.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(n.childTokens[i.name]=i.childTokens)}),o.extensions=n),r.renderer){const i=this.defaults.renderer||new Kh(this.defaults);for(const s in r.renderer){const a=r.renderer[s],l=s,c=i[l];i[l]=(...u)=>{let d=a.apply(i,u);return d===!1&&(d=c.apply(i,u)),d||""}}o.renderer=i}if(r.tokenizer){const i=this.defaults.tokenizer||new Wh(this.defaults);for(const s in r.tokenizer){const a=r.tokenizer[s],l=s,c=i[l];i[l]=(...u)=>{let d=a.apply(i,u);return d===!1&&(d=c.apply(i,u)),d}}o.tokenizer=i}if(r.hooks){const i=this.defaults.hooks||new id;for(const s in r.hooks){const a=r.hooks[s],l=s,c=i[l];id.passThroughHooks.has(s)?i[l]=u=>{if(this.defaults.async)return Promise.resolve(a.call(i,u)).then(f=>c.call(i,f));const d=a.call(i,u);return c.call(i,d)}:i[l]=(...u)=>{let d=a.apply(i,u);return d===!1&&(d=c.apply(i,u)),d}}o.hooks=i}if(r.walkTokens){const i=this.defaults.walkTokens,s=r.walkTokens;o.walkTokens=function(a){let l=[];return l.push(s.call(this,a)),i&&(l=l.concat(i.call(this,a))),l}}this.defaults={...this.defaults,...o}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,n){return No.lex(t,n??this.defaults)}parser(t,n){return $o.parse(t,n??this.defaults)}}Cf=new WeakSet,O0=function(t,n){return(r,o)=>{const i={...o},s={...this.defaults,...i};this.defaults.async===!0&&i.async===!1&&(s.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),s.async=!0);const a=rp(this,qm,XT).call(this,!!s.silent,!!s.async);if(typeof r>"u"||r===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(s.hooks&&(s.hooks.options=s),s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(r):r).then(l=>t(l,s)).then(l=>s.walkTokens?Promise.all(this.walkTokens(l,s.walkTokens)).then(()=>l):l).then(l=>n(l,s)).then(l=>s.hooks?s.hooks.postprocess(l):l).catch(a);try{s.hooks&&(r=s.hooks.preprocess(r));const l=t(r,s);s.walkTokens&&this.walkTokens(l,s.walkTokens);let c=n(l,s);return s.hooks&&(c=s.hooks.postprocess(c)),c}catch(l){return a(l)}}},qm=new WeakSet,XT=function(t,n){return r=>{if(r.message+=`
85
- Please report this to https://github.com/markedjs/marked.`,t){const o="<p>An error occurred:</p><pre>"+tr(r.message+"",!0)+"</pre>";return n?Promise.resolve(o):o}if(n)return Promise.reject(r);throw r}};const Ia=new g5;function et(e,t){return Ia.parse(e,t)}et.options=et.setOptions=function(e){return Ia.setOptions(e),et.defaults=Ia.defaults,qT(et.defaults),et};et.getDefaults=Vb;et.defaults=Qa;et.use=function(...e){return Ia.use(...e),et.defaults=Ia.defaults,qT(et.defaults),et};et.walkTokens=function(e,t){return Ia.walkTokens(e,t)};et.parseInline=Ia.parseInline;et.Parser=$o;et.parser=$o.parse;et.Renderer=Kh;et.TextRenderer=Ub;et.Lexer=No;et.lexer=No.lex;et.Tokenizer=Wh;et.Hooks=id;et.parse=et;et.options;et.setOptions;et.use;et.walkTokens;et.parseInline;$o.parse;No.lex;function v5(e){if(Array.isArray(e))return _0(e)}function y5(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function x5(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
86
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ZT(e){return v5(e)||y5(e)||Fb(e)||x5()}function ye(e){"@babel/helpers - typeof";return ye=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ye(e)}function b5(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function JT(e){var t=b5(e,"string");return typeof t=="symbol"?t:String(t)}function le(e,t,n){return t=JT(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function _r(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lk(Object(n),!0).forEach(function(r){le(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function w5(e){if(Array.isArray(e))return e}function S5(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,o,i,s,a=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,o=u}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}function k5(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
87
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _s(e,t){return w5(e)||S5(e,t)||Fb(e,t)||k5()}function sn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ck(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,JT(r.key),r)}}function an(e,t,n){return t&&ck(e.prototype,t),n&&ck(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function qh(e){return qh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},qh(e)}function QT(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(QT=function(){return!!e})()}function e2(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function E5(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return e2(e)}function hr(e,t,n){return t=qh(t),E5(e,QT()?Reflect.construct(t,n||[],qh(e).constructor):t.apply(e,n))}function T0(e,t){return T0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},T0(e,t)}function mr(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&T0(e,t)}var gr=function(){function e(){sn(this,e)}return an(e,[{key:"appendValidationError",value:function(n,r,o,i){return n?(n[r]?n[r].push({message:o,value:i}):n[r]=[{message:o,value:i}],n):le({},r,[{message:o,value:i}])}}]),e}(),sd=Symbol("GetSchema"),En=Symbol("Path"),It=Symbol("GetSource");function C5(e){return e[sd]}var Hb=an(function e(t){sn(this,e),this.span=t}),_5=function(e){mr(t,e);function t(n,r){var o;return sn(this,t),o=hr(this,t,[r]),le(e2(o),"type","Sym"),o.value=n,o}return an(t,[{key:"transpile",value:function(){return this.value}}]),t}(Hb);new _5("()");var _n="_type",it="_ref",O5=function(e){mr(t,e);function t(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return sn(this,t),r=hr(this,t),r.options=n,r.opt=o,r}return an(t,[{key:"validate",value:function(r,o){return this.opt&&o==null?!1:o==null?le({},r,[{message:"Non-optional file was null or undefined.",value:o}]):typeof o[it]!="string"?le({},r,[{message:"File did not have a file reference string. Got: ".concat(ye(o[it])),value:o}]):o[_n]!=="file"?le({},r,[{message:"File did not have the valid file extension type. Got: ".concat(o[_n]),value:o}]):o.metadata?le({},r,[{message:"Found metadata, but it could not be validated. File metadata must be an object with the required props: width (positive number), height (positive number) and sha256 (string of length 64 of the base16 hash).",value:o,fixes:["file:check-metadata"]}]):le({},r,[{message:"Missing File metadata.",value:o,fixes:["file:add-metadata"]}])}},{key:"assert",value:function(r){return this.opt&&r==null?!0:(r==null?void 0:r[it])==="file"&&(r==null?void 0:r[_n])==="file"}},{key:"nullable",value:function(){return new t(this.options,!0)}},{key:"serialize",value:function(){return{type:"file",options:this.options,opt:this.opt}}}]),t}(gr),T5=function(t){return new O5(t)};function t2(e){var t,n,r;if(!e[it].startsWith("/public")){var o,i,s;return{url:e[it]+((o=e.metadata)!==null&&o!==void 0&&o.sha256?"?sha256=".concat((i=e.metadata)===null||i===void 0?void 0:i.sha256):"")+(e.patch_id?"".concat((s=e.metadata)!==null&&s!==void 0&&s.sha256?"&":"?","patch_id=").concat(e.patch_id):""),metadata:e.metadata}}return{url:e[it].slice(7)+((t=e.metadata)!==null&&t!==void 0&&t.sha256?"?sha256=".concat((n=e.metadata)===null||n===void 0?void 0:n.sha256):"")+(e.patch_id?"".concat((r=e.metadata)!==null&&r!==void 0&&r.sha256?"&":"?","patch_id=").concat(e.patch_id):""),metadata:e.metadata}}function n2(e){return ye(e)==="object"&&e!==null&&e!==void 0&&("val"in e||"valPath"in e)}function M5(e){return ye(e)==="object"&&e!==null&&e!==void 0&&En in e&&"val"in e}function r2(e){return e[En]}function R5(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function uk(e,t,n){return t?Vt(e(Vt(t,n))):Vt(t,n)}function Os(e){return ye(e)==="object"&&e!==null&&(It in e||En in e)}function Vt(e,t,n){if(ye(e)==="object"){if(Os(e))return e;if(n2(e))return Vt(e.val,e.valPath)}if(e&&e[it]&&e[_n]==="file"){var r=e[it];if(typeof r!="string")throw Error("Invalid file ref: "+r);return Vt(t2(e),t,n)}switch(ye(e)){case"function":case"symbol":throw Error("Invalid selector type: ".concat(ye(e),": ").concat(e));case"object":if(e!==null)return new Proxy(e,{has:function(i,s){return s===It||s===En||s==="andThen"||s===sd?!0:s in i},get:function(i,s){if(s===It)return e;if(s===En)return t;if(s===sd)return n;if(s==="andThen")return function(l){return uk(l,e,t)};if(Array.isArray(i)){if(s==="filter")return function(l){var c=i.map(function(u,d){return Vt(u,Tr(t,d),n==null?void 0:n.item)}).filter(function(u){return l&&l instanceof gr?l.assert(dk(u)):dk(l(u))});return Vt(c,t,n)};if(s==="map")return function(l){var c=i.map(function(u,d){var f=l(Vt(u,Tr(t,d),n==null?void 0:n.item),Vt(d));return Os(f)?f:Vt(f)});return Vt(c,t,n)}}if(Array.isArray(i)&&s==="length")return Vt(i.length);var a=Reflect.get(i,s);return R5(e,s)?Number.isNaN(Number(s))?Vt(a,Tr(t,s),n==null?void 0:n.items[s]):Vt(a,Tr(t,Number(s)),n==null?void 0:n.item):a}});default:return le(le(le({eq:function(i){var s=i;if(Os(i)&&(s=i[It],s instanceof Hb))throw Error("TODO: Cannot evaluate equality with an Expr");return Vt(e===s,void 0)},andThen:function(i){return uk(i,e===void 0?null:e,t)}},It,e===void 0?null:e),En,t),sd,n)}}function Tr(e,t){if(ye(t)==="symbol")throw Error("Cannot create val path of array item with symbol prop: ".concat(t.toString()));if(e)return e.includes(tt.ModuleFilePathSep)?"".concat(e,".").concat(JSON.stringify(t)):"".concat(e).concat(tt.ModuleFilePathSep).concat(JSON.stringify(t))}function dk(e){if(ye(e)==="object"&&(It in e||En in e)){var t=e[It];return t}return e}var Wb=function(e){mr(t,e);function t(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return sn(this,t),r=hr(this,t),r.items=n,r.opt=o,r}return an(t,[{key:"validate",value:function(r,o){var i=this,s=!1;return this.opt&&o==null?!1:ye(o)!=="object"?le({},r,[{message:"Expected 'object', got '".concat(ye(o),"'")}]):Array.isArray(o)?le({},r,[{message:"Expected 'object', got 'array'"}]):(Object.entries(this.items).forEach(function(a){var l=_s(a,2),c=l[0],u=l[1],d=Tr(r,c);if(!d)s=i.appendValidationError(s,r,"Internal error: could not create path at ".concat(!r&&typeof r=="string"?"<empty string>":r," at key ").concat(c),o);else{var f=u.validate(d,o[c]);f&&s?s=_r(_r({},f),s):f&&(s=f)}}),s)}},{key:"assert",value:function(r){if(this.opt&&r==null)return!0;if(!r)return!1;for(var o=0,i=Object.entries(this.items);o<i.length;o++){var s=_s(i[o],2),a=s[0],l=s[1];if(!l.assert(r[a]))return!1}return ye(r)==="object"&&!Array.isArray(r)}},{key:"nullable",value:function(){return new t(this.items,!0)}},{key:"serialize",value:function(){return{type:"object",items:Object.fromEntries(Object.entries(this.items).map(function(r){var o=_s(r,2),i=o[0],s=o[1];return[i,s.serialize()]})),opt:this.opt}}}]),t}(gr),P5=function(t){return new Wb(t)},o2=function(e){mr(t,e);function t(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return sn(this,t),r=hr(this,t),r.item=n,r.opt=o,r}return an(t,[{key:"validate",value:function(r,o){var i=this,s=!1;return this.opt&&o==null?!1:ye(o)!=="object"||!Array.isArray(o)?le({},r,[{message:"Expected 'array', got '".concat(ye(o),"'")}]):(o.forEach(function(a,l){var c=Tr(r,l);if(!c)s=i.appendValidationError(s,r,"Internal error: could not create path at ".concat(!r&&typeof r=="string"?"<empty string>":r," at index ").concat(l),o);else{var u=i.item.validate(c,a);u&&s?s=_r(_r({},u),s):u&&(s=u)}}),s)}},{key:"assert",value:function(r){if(this.opt&&r==null)return!0;if(!r)return!1;var o=ug(r),i;try{for(o.s();!(i=o.n()).done;){var s=i.value;if(!this.item.assert(s))return!1}}catch(a){o.e(a)}finally{o.f()}return ye(r)==="object"&&Array.isArray(r)}},{key:"nullable",value:function(){return new t(this.item,!0)}},{key:"serialize",value:function(){return{type:"array",item:this.item.serialize(),opt:this.opt}}}]),t}(gr),N5=function(t){return new o2(t)},M0=function(e){mr(t,e);function t(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return sn(this,t),r=hr(this,t),r.value=n,r.opt=o,r}return an(t,[{key:"validate",value:function(r,o){return this.opt&&o==null?!1:typeof o!="string"?le({},r,[{message:"Expected 'string', got '".concat(ye(o),"'"),value:o}]):o!==this.value?le({},r,[{message:"Expected literal '".concat(this.value,"', got '").concat(o,"'"),value:o}]):!1}},{key:"assert",value:function(r){return this.opt&&r==null?!0:typeof r=="string"}},{key:"nullable",value:function(){return new t(this.value,!0)}},{key:"serialize",value:function(){return{type:"literal",value:this.value,opt:this.opt}}}]),t}(gr),$5=function(t){return new M0(t)},i2=function(e){mr(t,e);function t(n,r){var o,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return sn(this,t),o=hr(this,t),o.key=n,o.items=r,o.opt=i,o}return an(t,[{key:"validate",value:function(r,o){var i=o,s=!1;if(this.opt&&i==null)return!1;if(!this.key)return le({},r,[{message:"Missing required first argument in union"}]);var a=this.key;if(!Array.isArray(this.items))return le({},r,[{message:"A union schema must take more than 1 schema arguments",fatal:!0}]);if(typeof a=="string"){if(this.items.some(function(T){return!(T instanceof Wb)}))return le({},r,[{message:"Key is a string, so all schema items must be objects",fatal:!0}]);var l=this.items,c=l.map(function(T){return T.serialize()}),u=c.filter(function(T){return T.type!=="object"||T.items[a].type!=="literal"});if(u.length>0)return le({},r,[{message:"All schema items must be objects with a key: ".concat(a," that is a literal schema. Found: ").concat(JSON.stringify(u,null,2)),fatal:!0}]);var d=c,f=d.filter(function(T){return T.items[a].opt});if(f.length>1)return le({},r,[{message:"Schema cannot have an optional keys: ".concat(a),fatal:!0}]);if(ye(i)!=="object")return le({},r,[{message:"Expected an object"}]);var h=i;if(h[a]===void 0)return le({},r,[{message:"Missing required key: ".concat(a)}]);var m=[],g=ug(d),b;try{for(g.s();!(b=g.n()).done;){var y=b.value,v=y.items[a];if(v.type==="literal")if(!m.includes(v.value))m.push(v.value);else return le({},r,[{message:"Found duplicate key in schema: ".concat(v.value),fatal:!0}])}}catch(T){g.e(T)}finally{g.f()}var w=l.find(function(T){return!T.items[a].validate(r,h[a])});if(!w){var S=Tr(r,a);if(!S)throw new Error("Internal error: could not create path at ".concat(!r&&typeof r=="string"?"<empty string>":r," at key ").concat(a));return le({},S,[{message:'Invalid key: "'.concat(a,'". Value was: "').concat(h[a],'". Valid values: ').concat(d.map(function(T){var R=T.items[a];if(R.type==="literal"&&R.value)return'"'.concat(R.value,'"');throw new Error("Expected literal schema, got ".concat(JSON.stringify(R,null,2)))}).join(", "))}])}var k=w.validate(r,h);if(k)return k}else if(a instanceof M0){if(this.items.some(function(T){return!(T instanceof M0)}))return le({},r,[{message:"Key is a literal schema, so all schema items must be literals",fatal:!0}]);var C=[a].concat(ZT(this.items));if(typeof i=="string"){var E=C.some(function(T){return!T.validate(r,i)});if(!E)return le({},r,[{message:"Union must match one of the following: ".concat(C.map(function(T){return'"'.concat(T.value,'"')}).join(", "))}])}}else return le({},r,[{message:"Expected a string or literal"}]);return s}},{key:"assert",value:function(r){return!0}},{key:"nullable",value:function(){return new t(this.key,this.items,!0)}},{key:"serialize",value:function(){return typeof this.key=="string"?{type:"union",key:this.key,items:this.items.map(function(r){return r.serialize()}),opt:this.opt}:{type:"union",key:this.key.serialize(),items:this.items.map(function(r){return r.serialize()}),opt:this.opt}}}]),t}(gr),D5=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return new i2(t,r)},s2=function(e){mr(t,e);function t(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return sn(this,t),r=hr(this,t),r.options=n,r.opt=o,r}return an(t,[{key:"validate",value:function(r,o){return o!=null&&o.markdownish?le({},r,[{message:"Replace markdown with structured format",value:o,fixes:["fix:deprecated-richtext"]}]):!1}},{key:"assert",value:function(r){return!0}},{key:"nullable",value:function(){return new t(this.options,!0)}},{key:"serialize",value:function(){return{type:"richtext",opt:this.opt,options:this.options}}}]),t}(gr),A5=function(t){return new s2(t??{})},a2=function(e){mr(t,e);function t(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return sn(this,t),r=hr(this,t),r.options=n,r.opt=o,r}return an(t,[{key:"validate",value:function(r,o){return this.opt&&o==null?!1:o==null?le({},r,[{message:"Non-optional image was null or undefined.",value:o}]):typeof o[it]!="string"?le({},r,[{message:"Image did not have a file reference string. Got: ".concat(ye(o[it])),value:o}]):o[_n]!=="file"?le({},r,[{message:"Image did not have the valid file extension type. Got: ".concat(o[_n]),value:o}]):o.metadata?le({},r,[{message:"Found metadata, but it could not be validated. Image metadata must be an object with the required props: width (positive number), height (positive number) and sha256 (string of length 64 of the base16 hash).",value:o,fixes:["image:replace-metadata"]}]):le({},r,[{message:"Could not validate Image metadata.",value:o,fixes:["image:add-metadata"]}])}},{key:"assert",value:function(r){return this.opt&&r==null?!0:(r==null?void 0:r[it])==="image"&&(r==null?void 0:r[_n])==="file"}},{key:"nullable",value:function(){return new t(this.options,!0)}},{key:"serialize",value:function(){return{type:"image",options:this.options,opt:this.opt}}}]),t}(gr),I5=function(t){return new a2(t)},l2=function(e){mr(t,e);function t(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return sn(this,t),r=hr(this,t),r.item=n,r.opt=o,r}return an(t,[{key:"validate",value:function(r,o){var i=this,s=!1;return this.opt&&o==null?!1:ye(o)!=="object"?le({},r,[{message:"Expected 'object', got '".concat(ye(o),"'")}]):Array.isArray(o)?le({},r,[{message:"Expected 'object', got 'array'"}]):(Object.entries(o).forEach(function(a){var l=_s(a,2),c=l[0],u=l[1],d=Tr(r,c);if(!d)s=i.appendValidationError(s,r,"Internal error: could not create path at ".concat(!r&&typeof r=="string"?"<empty string>":r," at key ").concat(u),o);else{var f=i.item.validate(d,u);f&&s?s=_r(_r({},f),s):f&&(s=f)}}),s)}},{key:"assert",value:function(r){if(this.opt&&r==null)return!0;if(!r)return!1;for(var o=0,i=Object.entries(r);o<i.length;o++){var s=_s(i[o],2),a=s[1];if(!this.item.assert(a))return!1}return ye(r)==="object"&&!Array.isArray(r)}},{key:"nullable",value:function(){return new t(this.item,!0)}},{key:"serialize",value:function(){return{type:"record",item:this.item.serialize(),opt:this.opt}}}]),t}(gr),L5=function(t){return new l2(t)};function j5(e){var t=e[It];if(t instanceof Hb)throw Error("Cannot get raw source of an Expr");var n=t;return n}function z5(e){var t=e.indexOf(R0);return t===-1?[e,""]:[e.slice(0,t),e.slice(t+R0.length)]}var R0="?p=";function F5(e){return e instanceof Wb||ye(e)==="object"&&"type"in e&&e.type==="object"}function B5(e){return e instanceof l2||ye(e)==="object"&&"type"in e&&e.type==="record"}function V5(e){return e instanceof o2||ye(e)==="object"&&"type"in e&&e.type==="array"}function U5(e){return e instanceof i2||ye(e)==="object"&&"type"in e&&e.type==="union"}function H5(e){return e instanceof s2||ye(e)==="object"&&"type"in e&&e.type==="richtext"}function W5(e){return e instanceof a2||ye(e)==="object"&&"type"in e&&e.type==="image"}function K5(e,t,n){for(var r=c2(e),o=ZT(r),i=n,s=t,a=function(){var u=r.shift();if(u===void 0)throw Error("Unexpected undefined part");if(V5(i)){if(Number.isNaN(Number(u)))throw Error("Invalid path: array schema ".concat(JSON.stringify(i)," must have a number as path, but got ").concat(u,". Path: ").concat(e));if(ye(s)!=="object"&&!Array.isArray(s))throw Error("Schema type error: expected source to be type of array, but got ".concat(ye(s)));if(s[u]===void 0){var d;throw Error("Invalid path: array source (length: ".concat((d=s)===null||d===void 0?void 0:d.length,") did not have index ").concat(u," from path: ").concat(e))}s=s[u],i=i.item}else if(B5(i)){if(typeof u!="string")throw Error("Invalid path: record schema ".concat(i," must have path: ").concat(u," as string"));if(ye(s)!=="object"&&!Array.isArray(s))throw Error("Schema type error: expected source to be type of record, but got ".concat(ye(s)));if(!s[u])throw Error("Invalid path: record source did not have key ".concat(u," from path: ").concat(e));s=s[u],i=i.item}else if(F5(i)){if(ye(s)!=="object")throw Error("Schema type error: expected source to be type of object, but got ".concat(ye(s)));if(!s[u])throw Error("Invalid path: object source did not have key ".concat(u," from path: ").concat(e));s=s[u],i=i.items[u]}else{if(W5(i))return{v:{path:o.slice(0,o.length-r.length-1).map(function(g){return JSON.stringify(g)}).join("."),schema:i,source:s}};if(U5(i)){var f=i.key;if(typeof f!="string")return{v:{path:o.map(function(g){return Number.isNaN(Number(g))?JSON.stringify(g):g}).join("."),schema:i,source:s}};var h=s[f];if(!h)throw Error("Invalid path: union source ".concat(i," did not have required key ").concat(f," in path: ").concat(e));var m=i.items.find(function(g){var b;return(g==null||(b=g.items)===null||b===void 0||(b=b[f])===null||b===void 0?void 0:b.value)===h});if(!m)throw Error("Invalid path: union schema ".concat(i," did not have a child object with ").concat(f," of value ").concat(h," in path: ").concat(e));i=m.items[u],s=s[u]}else{if(H5(i))return{v:{path:o.slice(0,o.length-r.length-1).map(function(g){return JSON.stringify(g)}).join("."),schema:i,source:s}};throw Error("Invalid path: ".concat(u," resolved to an unexpected schema ").concat(JSON.stringify(i)))}}},l;r.length>0;)if(l=a(),l)return l.v;if(r.length>0)throw Error("Invalid path: ".concat(r.join(".")," is not a valid path"));return{path:o.map(function(c){return Number.isNaN(Number(c))?JSON.stringify(c):c}).join("."),schema:i,source:s}}function c2(e){for(var t=[],n=0;n<e.length;){var r="";if(e[n]==='"'){for(n++;n<e.length&&e[n]!=='"';)e[n]==="\\"&&e[n+1]==='"'?(r+='"',n++):r+=e[n],n++;if(e[n]!=='"'){var o;throw new Error("Invalid input (".concat(JSON.stringify(e),"): Missing closing double quote: ").concat((o=e[n])!==null&&o!==void 0?o:"at end of string"," (char: ").concat(n,"; length: ").concat(e.length,")"))}}else for(;n<e.length&&e[n]!==".";)r+=e[n],n++;r!==""&&t.push(r),n++}return t}var u2=function(e){mr(t,e);function t(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return sn(this,t),r=hr(this,t),r.options=n,r.opt=o,r}return an(t,[{key:"validate",value:function(r,o){return this.opt&&o==null?!1:typeof o!="number"?le({},r,[{message:"Expected 'number', got '".concat(ye(o),"'"),value:o}]):!1}},{key:"assert",value:function(r){return this.opt&&r==null?!0:typeof r=="number"}},{key:"nullable",value:function(){return new t(this.options,!0)}},{key:"serialize",value:function(){return{type:"number",options:this.options,opt:this.opt}}}]),t}(gr),q5=function(t){return new u2(t)},d2=function(e){mr(t,e);function t(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return sn(this,t),r=hr(this,t),r.options=n,r.opt=o,r.isRaw=i,r}return an(t,[{key:"min",value:function(r){return new t(_r(_r({},this.options),{},{minLength:r}),this.opt,this.isRaw)}},{key:"max",value:function(r){return new t(_r(_r({},this.options),{},{maxLength:r}),this.opt,this.isRaw)}},{key:"regexp",value:function(r){return new t(_r(_r({},this.options),{},{regexp:r}),this.opt,this.isRaw)}},{key:"validate",value:function(r,o){var i,s,a;if(this.opt&&o==null)return!1;if(typeof o!="string")return le({},r,[{message:"Expected 'string', got '".concat(ye(o),"'"),value:o}]);var l=[];return(i=this.options)!==null&&i!==void 0&&i.maxLength&&o.length>this.options.maxLength&&l.push({message:"Expected string to be at most ".concat(this.options.maxLength," characters long, got ").concat(o.length),value:o}),(s=this.options)!==null&&s!==void 0&&s.minLength&&o.length<this.options.minLength&&l.push({message:"Expected string to be at least ".concat(this.options.minLength," characters long, got ").concat(o.length),value:o}),(a=this.options)!==null&&a!==void 0&&a.regexp&&!this.options.regexp.test(o)&&l.push({message:"Expected string to match reg exp: ".concat(this.options.regexp.toString(),", got '").concat(o,"'"),value:o}),l.length>0?le({},r,l):!1}},{key:"assert",value:function(r){return this.opt&&r==null?!0:typeof r=="string"}},{key:"nullable",value:function(){return new t(this.options,!0,this.isRaw)}},{key:"raw",value:function(){return new t(this.options,this.opt,!0)}},{key:"serialize",value:function(){var r,o,i;return{type:"string",options:{maxLength:(r=this.options)===null||r===void 0?void 0:r.maxLength,minLength:(o=this.options)===null||o===void 0?void 0:o.minLength,regexp:((i=this.options)===null||i===void 0?void 0:i.regexp)&&{source:this.options.regexp.source,flags:this.options.regexp.flags}},opt:this.opt,raw:this.isRaw}}}]),t}(gr),G5=function(t){return new d2(t)},Y5=function(e){mr(t,e);function t(){var n,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return sn(this,t),n=hr(this,t),n.opt=r,n}return an(t,[{key:"validate",value:function(r,o){return this.opt&&o==null?!1:typeof o!="boolean"?le({},r,[{message:"Expected 'boolean', got '".concat(ye(o),"'"),value:o}]):!1}},{key:"assert",value:function(r){return this.opt&&r==null?!0:typeof r=="boolean"}},{key:"nullable",value:function(){return new t(!0)}},{key:"serialize",value:function(){return{type:"boolean",opt:this.opt}}}]),t}(gr),X5=function(){return new Y5},Z5=function(e){mr(t,e);function t(n,r){var o,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return sn(this,t),o=hr(this,t),o.schema=n,o.sourcePath=r,o.opt=i,o}return an(t,[{key:"validate",value:function(r,o){if(this.opt&&o==null)return!1;if(!this.schema)return le({},r,[{message:"Schema not found for module. keyOf must be used with a Val Module"}]);var i=this.schema;if(!(i.type==="array"||i.type==="object"||i.type==="record"))return le({},r,[{message:"Schema in keyOf must be an 'array', 'object' or 'record'. Found '".concat(i.type,"'")}]);if(i.opt&&o==null)return!1;if(i.type==="array"&&typeof o!="number")return le({},r,[{message:"Type of value in keyof (array) must be 'number'"}]);if(i.type==="record"&&typeof o!="string")return le({},r,[{message:"Type of value in keyof (record) must be 'string'"}]);if(i.type==="object"){var s=Object.keys(i.items);if(!s.includes(o))return le({},r,[{message:"Value of keyOf (object) must be: ".concat(s.join(", "),". Found: ").concat(o)}])}return!1}},{key:"assert",value:function(r){if(this.opt&&r==null)return!0;var o=this.schema;if(!o)return!1;var i=o;if(!(i.type==="array"||i.type==="object"||i.type==="record"))return!1;if(i.opt&&r==null)return!0;if(i.type==="array"&&typeof r!="number"||i.type==="record"&&typeof r!="string")return!1;if(i.type==="object"){var s=Object.keys(i.items);if(!s.includes(r))return!1}return!0}},{key:"nullable",value:function(){return new t(this.schema,this.sourcePath,!0)}},{key:"serialize",value:function(){var r=this.sourcePath;if(!r)throw new Error("Cannot serialize keyOf schema with empty selector. TIP: keyOf must be used with a Val Module.");var o=this.schema;if(!o)throw new Error("Cannot serialize keyOf schema with empty selector.");var i;switch(o.type){case"array":i="number";break;case"record":i="string";break;case"object":i=Object.keys(o.items);break;default:throw new Error("Cannot serialize keyOf schema with selector of type '".concat(o.type,"'. keyOf must be used with a Val Module."))}return{type:"keyOf",path:r,schema:o,opt:this.opt,values:i}}}]),t}(gr),J5=function(t){var n;return new Z5(t==null||(n=t[sd])===null||n===void 0?void 0:n.serialize(),r2(t))};function Q5(){return{string:G5,boolean:X5,array:N5,object:P5,number:q5,union:D5,richtext:A5,image:I5,literal:$5,keyOf:J5,record:L5,file:T5}}function eL(e){return f2(rL(e))}function tL(e){return Os(e)?ye(e[It])==="object"&&e[It]!==null&&Array.isArray(e[It]):Array.isArray(e)}function nL(e){return Os(e)?ye(e[It])==="object"&&e[It]!==null&&!Array.isArray(e[It]):ye(e)==="object"}function rL(e){var t=Vt(e);function n(r){var o=tL(r),i=nL(r);if(o){var s=It in r?r[It]:r,a=En in r?r[En]:void 0;return{val:s.map(function(u,d){return n(Os(u)?u:Vt(u,Tr(a,d)))}),valPath:a}}else if(i){var l=It in r?r[It]:r,c=En in r?r[En]:void 0;return{val:l!==null&&Object.fromEntries(Object.entries(l).map(function(u){var d=_s(u,2),f=d[0],h=d[1];return[f,n(Os(h)?h:Vt(h,Tr(c,f)))]})),valPath:c}}else return Os(r)?{val:n(r[It]),valPath:r[En]}:r}return n(t)}function P0(e){var t=n2(e)?e.val:e;switch(ye(t)){case"function":case"symbol":throw Error("Invalid val type: ".concat(ye(t)));case"object":return t===null?null:Array.isArray(t)?t.map(P0):Object.fromEntries(Object.entries(t).map(function(n){var r=_s(n,2),o=r[0],i=r[1];return[o,i&&P0(i)]}));default:return t}}function f2(e){var t=e.val;switch(ye(t)){case"function":case"symbol":throw Error("Invalid val type: ".concat(ye(t)));case"object":if(t!==null)return new Proxy(t,{has:function(r,o){return o==="val"||o===En?!0:fk(r,o)},get:function(r,o){if(o===En)return e.valPath;if(o==="val")return P0(e);if(Array.isArray(r)&&o==="length")return r.length;if(fk(t,o)){var i,s;return f2({val:Reflect.get(r,o).val,valPath:(i=(s=Reflect.get(r,o))===null||s===void 0?void 0:s.valPath)!==null&&i!==void 0?i:Tr(e.valPath,Array.isArray(r)?Number(o):o)})}return Reflect.get(r,o)}});default:return le(le({},En,e.valPath),"val",e.val)}}function fk(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var oL=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998],Qe=function(e){return e[e.inputBytes=64]="inputBytes",e[e.inputWords=16]="inputWords",e[e.highIndex=14]="highIndex",e[e.lowIndex=15]="lowIndex",e[e.workWords=64]="workWords",e[e.allocBytes=80]="allocBytes",e[e.allocWords=20]="allocWords",e[e.allocTotal=8e3]="allocTotal",e}(Qe||{}),pk={sha256:1};function iL(e){if(e&&!pk[e]&&!pk[e.toLowerCase()])throw new Error("Digest method not supported");return new sL}var sL=function(){function e(){sn(this,e),le(this,"A",1779033703),le(this,"B",-1150833019),le(this,"C",1013904242),le(this,"D",-1521486534),le(this,"E",1359893119),le(this,"F",-1694144372),le(this,"G",528734635),le(this,"H",1541459225),le(this,"_size",0),le(this,"_sp",0),(!Sp||uu>=Qe.allocTotal)&&(Sp=new ArrayBuffer(Qe.allocTotal),uu=0),this._byte=new Uint8Array(Sp,uu,Qe.allocBytes),this._word=new Int32Array(Sp,uu,Qe.allocWords),uu+=Qe.allocBytes}return an(e,[{key:"update",value:function(n){if(typeof n=="string")return this._utf8(n);if(n==null)throw new TypeError("Invalid type: "+ye(n));var r=n.byteOffset,o=n.byteLength,i=o/Qe.inputBytes|0,s=0;if(i&&!(r&3)&&!(this._size%Qe.inputBytes)){for(var a=new Int32Array(n.buffer,r,i*Qe.inputWords);i--;)this._int32(a,s>>2),s+=Qe.inputBytes;this._size+=s}var l=n.BYTES_PER_ELEMENT;if(l!==1&&n.buffer){var c=new Uint8Array(n.buffer,r+s,o-s);return this._uint8(c)}return s===o?this:this._uint8(n,s)}},{key:"_uint8",value:function(n,r){var o=this._byte,i=this._word,s=n.length;for(r=r|0;r<s;){for(var a=this._size%Qe.inputBytes,l=a;r<s&&l<Qe.inputBytes;)o[l++]=n[r++];l>=Qe.inputBytes&&this._int32(i),this._size+=l-a}return this}},{key:"_utf8",value:function(n){for(var r=this._byte,o=this._word,i=n.length,s=this._sp,a=0;a<i;){for(var l=this._size%Qe.inputBytes,c=l;a<i&&c<Qe.inputBytes;){var u=n.charCodeAt(a++)|0;u<128?r[c++]=u:u<2048?(r[c++]=192|u>>>6,r[c++]=128|u&63):u<55296||u>57343?(r[c++]=224|u>>>12,r[c++]=128|u>>>6&63,r[c++]=128|u&63):s?(u=((s&1023)<<10)+(u&1023)+65536,r[c++]=240|u>>>18,r[c++]=128|u>>>12&63,r[c++]=128|u>>>6&63,r[c++]=128|u&63,s=0):s=u}c>=Qe.inputBytes&&(this._int32(o),o[0]=o[Qe.inputWords]),this._size+=c-l}return this._sp=s,this}},{key:"_int32",value:function(n,r){var o=this.A,i=this.B,s=this.C,a=this.D,l=this.E,c=this.F,u=this.G,d=this.H,f=0;for(r=r|0;f<Qe.inputWords;)Qs[f++]=Hr(n[r++]);for(f=Qe.inputWords;f<Qe.workWords;f++)Qs[f]=hL(Qs[f-2])+Qs[f-7]+pL(Qs[f-15])+Qs[f-16]|0;for(f=0;f<Qe.workWords;f++){var h=d+fL(l)+cL(l,c,u)+oL[f]+Qs[f]|0,m=dL(o)+uL(o,i,s)|0;d=u,u=c,c=l,l=a+h|0,a=s,s=i,i=o,o=h+m|0}this.A=o+this.A|0,this.B=i+this.B|0,this.C=s+this.C|0,this.D=a+this.D|0,this.E=l+this.E|0,this.F=c+this.F|0,this.G=u+this.G|0,this.H=d+this.H|0}},{key:"digest",value:function(n){var r=this._byte,o=this._word,i=this._size%Qe.inputBytes|0;for(r[i++]=128;i&3;)r[i++]=0;if(i>>=2,i>Qe.highIndex){for(;i<Qe.inputWords;)o[i++]=0;i=0,this._int32(o)}for(;i<Qe.inputWords;)o[i++]=0;var s=this._size*8,a=(s&4294967295)>>>0,l=(s-a)/4294967296;return l&&(o[Qe.highIndex]=Hr(l)),a&&(o[Qe.lowIndex]=Hr(a)),this._int32(o),n==="hex"?this._hex():this._bin()}},{key:"_hex",value:function(){var n=this.A,r=this.B,o=this.C,i=this.D,s=this.E,a=this.F,l=this.G,c=this.H;return Bi(n)+Bi(r)+Bi(o)+Bi(i)+Bi(s)+Bi(a)+Bi(l)+Bi(c)}},{key:"_bin",value:function(){var n=this.A,r=this.B,o=this.C,i=this.D,s=this.E,a=this.F,l=this.G,c=this.H,u=this._byte,d=this._word;return d[0]=Hr(n),d[1]=Hr(r),d[2]=Hr(o),d[3]=Hr(i),d[4]=Hr(s),d[5]=Hr(a),d[6]=Hr(l),d[7]=Hr(c),u.slice(0,32)}}]),e}(),Qs=new Int32Array(Qe.workWords),Sp,uu=0,Bi=function(t){return(t+4294967296).toString(16).substr(-8)},aL=function(t){return t<<24&4278190080|t<<8&16711680|t>>8&65280|t>>24&255},lL=function(t){return t},Hr=mL()?lL:aL,cL=function(t,n,r){return r^t&(n^r)},uL=function(t,n,r){return t&n|r&(t|n)},dL=function(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)},fL=function(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)},pL=function(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3},hL=function(t){return(t>>>17|t<<15)^(t>>>19|t<<13)^t>>>10};function mL(){var e=new Uint8Array(new Uint16Array([65279]).buffer);return e[0]===254}var p2=function(t){return iL().update(t).digest("hex")};function Xr(){Xr=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(O,M,_){O[M]=_.value},i=typeof Symbol=="function"?Symbol:{},s=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function c(O,M,_){return Object.defineProperty(O,M,{value:_,enumerable:!0,configurable:!0,writable:!0}),O[M]}try{c({},"")}catch{c=function(M,_,P){return M[_]=P}}function u(O,M,_,P){var N=M&&M.prototype instanceof y?M:y,I=Object.create(N.prototype),B=new V(P||[]);return o(I,"_invoke",{value:$(O,_,B)}),I}function d(O,M,_){try{return{type:"normal",arg:O.call(M,_)}}catch(P){return{type:"throw",arg:P}}}t.wrap=u;var f="suspendedStart",h="suspendedYield",m="executing",g="completed",b={};function y(){}function v(){}function w(){}var S={};c(S,s,function(){return this});var k=Object.getPrototypeOf,C=k&&k(k(U([])));C&&C!==n&&r.call(C,s)&&(S=C);var E=w.prototype=y.prototype=Object.create(S);function T(O){["next","throw","return"].forEach(function(M){c(O,M,function(_){return this._invoke(M,_)})})}function R(O,M){function _(N,I,B,de){var ue=d(O[N],O,I);if(ue.type!=="throw"){var Ae=ue.arg,me=Ae.value;return me&&typeof me=="object"&&r.call(me,"__await")?M.resolve(me.__await).then(function(X){_("next",X,B,de)},function(X){_("throw",X,B,de)}):M.resolve(me).then(function(X){Ae.value=X,B(Ae)},function(X){return _("throw",X,B,de)})}de(ue.arg)}var P;o(this,"_invoke",{value:function(N,I){function B(){return new M(function(de,ue){_(N,I,de,ue)})}return P=P?P.then(B,B):B()}})}function $(O,M,_){var P=f;return function(N,I){if(P===m)throw new Error("Generator is already running");if(P===g){if(N==="throw")throw I;return{value:e,done:!0}}for(_.method=N,_.arg=I;;){var B=_.delegate;if(B){var de=j(B,_);if(de){if(de===b)continue;return de}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(P===f)throw P=g,_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);P=m;var ue=d(O,M,_);if(ue.type==="normal"){if(P=_.done?g:h,ue.arg===b)continue;return{value:ue.arg,done:_.done}}ue.type==="throw"&&(P=g,_.method="throw",_.arg=ue.arg)}}}function j(O,M){var _=M.method,P=O.iterator[_];if(P===e)return M.delegate=null,_==="throw"&&O.iterator.return&&(M.method="return",M.arg=e,j(O,M),M.method==="throw")||_!=="return"&&(M.method="throw",M.arg=new TypeError("The iterator does not provide a '"+_+"' method")),b;var N=d(P,O.iterator,M.arg);if(N.type==="throw")return M.method="throw",M.arg=N.arg,M.delegate=null,b;var I=N.arg;return I?I.done?(M[O.resultName]=I.value,M.next=O.nextLoc,M.method!=="return"&&(M.method="next",M.arg=e),M.delegate=null,b):I:(M.method="throw",M.arg=new TypeError("iterator result is not an object"),M.delegate=null,b)}function z(O){var M={tryLoc:O[0]};1 in O&&(M.catchLoc=O[1]),2 in O&&(M.finallyLoc=O[2],M.afterLoc=O[3]),this.tryEntries.push(M)}function ee(O){var M=O.completion||{};M.type="normal",delete M.arg,O.completion=M}function V(O){this.tryEntries=[{tryLoc:"root"}],O.forEach(z,this),this.reset(!0)}function U(O){if(O||O===""){var M=O[s];if(M)return M.call(O);if(typeof O.next=="function")return O;if(!isNaN(O.length)){var _=-1,P=function N(){for(;++_<O.length;)if(r.call(O,_))return N.value=O[_],N.done=!1,N;return N.value=e,N.done=!0,N};return P.next=P}}throw new TypeError(typeof O+" is not iterable")}return v.prototype=w,o(E,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:v,configurable:!0}),v.displayName=c(w,l,"GeneratorFunction"),t.isGeneratorFunction=function(O){var M=typeof O=="function"&&O.constructor;return!!M&&(M===v||(M.displayName||M.name)==="GeneratorFunction")},t.mark=function(O){return Object.setPrototypeOf?Object.setPrototypeOf(O,w):(O.__proto__=w,c(O,l,"GeneratorFunction")),O.prototype=Object.create(E),O},t.awrap=function(O){return{__await:O}},T(R.prototype),c(R.prototype,a,function(){return this}),t.AsyncIterator=R,t.async=function(O,M,_,P,N){N===void 0&&(N=Promise);var I=new R(u(O,M,_,P),N);return t.isGeneratorFunction(M)?I:I.next().then(function(B){return B.done?B.value:I.next()})},T(E),c(E,l,"Generator"),c(E,s,function(){return this}),c(E,"toString",function(){return"[object Generator]"}),t.keys=function(O){var M=Object(O),_=[];for(var P in M)_.push(P);return _.reverse(),function N(){for(;_.length;){var I=_.pop();if(I in M)return N.value=I,N.done=!1,N}return N.done=!0,N}},t.values=U,V.prototype={constructor:V,reset:function(O){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(ee),!O)for(var M in this)M.charAt(0)==="t"&&r.call(this,M)&&!isNaN(+M.slice(1))&&(this[M]=e)},stop:function(){this.done=!0;var O=this.tryEntries[0].completion;if(O.type==="throw")throw O.arg;return this.rval},dispatchException:function(O){if(this.done)throw O;var M=this;function _(ue,Ae){return I.type="throw",I.arg=O,M.next=ue,Ae&&(M.method="next",M.arg=e),!!Ae}for(var P=this.tryEntries.length-1;P>=0;--P){var N=this.tryEntries[P],I=N.completion;if(N.tryLoc==="root")return _("end");if(N.tryLoc<=this.prev){var B=r.call(N,"catchLoc"),de=r.call(N,"finallyLoc");if(B&&de){if(this.prev<N.catchLoc)return _(N.catchLoc,!0);if(this.prev<N.finallyLoc)return _(N.finallyLoc)}else if(B){if(this.prev<N.catchLoc)return _(N.catchLoc,!0)}else{if(!de)throw new Error("try statement without catch or finally");if(this.prev<N.finallyLoc)return _(N.finallyLoc)}}}},abrupt:function(O,M){for(var _=this.tryEntries.length-1;_>=0;--_){var P=this.tryEntries[_];if(P.tryLoc<=this.prev&&r.call(P,"finallyLoc")&&this.prev<P.finallyLoc){var N=P;break}}N&&(O==="break"||O==="continue")&&N.tryLoc<=M&&M<=N.finallyLoc&&(N=null);var I=N?N.completion:{};return I.type=O,I.arg=M,N?(this.method="next",this.next=N.finallyLoc,b):this.complete(I)},complete:function(O,M){if(O.type==="throw")throw O.arg;return O.type==="break"||O.type==="continue"?this.next=O.arg:O.type==="return"?(this.rval=this.arg=O.arg,this.method="return",this.next="end"):O.type==="normal"&&M&&(this.next=M),b},finish:function(O){for(var M=this.tryEntries.length-1;M>=0;--M){var _=this.tryEntries[M];if(_.finallyLoc===O)return this.complete(_.completion,_.afterLoc),ee(_),b}},catch:function(O){for(var M=this.tryEntries.length-1;M>=0;--M){var _=this.tryEntries[M];if(_.tryLoc===O){var P=_.completion;if(P.type==="throw"){var N=P.arg;ee(_)}return N}}throw new Error("illegal catch attempt")},delegateYield:function(O,M,_){return this.delegate={iterator:U(O),resultName:M,nextLoc:_},this.method==="next"&&(this.arg=e),b}},t}function hk(e,t,n,r,o,i,s){try{var a=e[i](s),l=a.value}catch(c){n(c);return}a.done?t(l):Promise.resolve(l).then(r,o)}function Eu(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function s(l){hk(i,r,o,s,a,"next",l)}function a(l){hk(i,r,o,s,a,"throw",l)}s(void 0)})}}var Kb=function(){function e(t){sn(this,e),this.host=t}return an(e,[{key:"getDisableUrl",value:function(n){return"".concat(this.host,"/disable?redirect_to=").concat(encodeURIComponent(n))}},{key:"getLoginUrl",value:function(n){return"".concat(this.host,"/authorize?redirect_to=").concat(encodeURIComponent(n))}},{key:"getEnableUrl",value:function(n){return"".concat(this.host,"/enable?redirect_to=").concat(encodeURIComponent(n))}},{key:"getPatches",value:function(){var t=Eu(Xr().mark(function r(){return Xr().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",fetch("".concat(this.host,"/patches/~"),{headers:{"Content-Type":"application/json"}}).then(function(s){return Vi(s)}).catch(ea));case 1:case"end":return i.stop()}},r,this)}));function n(){return t.apply(this,arguments)}return n}()},{key:"deletePatches",value:function(){var t=Eu(Xr().mark(function r(o,i){var s;return Xr().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return s=new URLSearchParams,o.forEach(function(c){return s.append("id",c)}),l.abrupt("return",fetch("".concat(this.host,"/patches/~?").concat(s),{method:"DELETE",headers:i||{"Content-Type":"application/json"}}).then(function(c){return Vi(c)}).catch(ea));case 3:case"end":return l.stop()}},r,this)}));function n(r,o){return t.apply(this,arguments)}return n}()},{key:"getEditUrl",value:function(){return"/val"}},{key:"getSession",value:function(){return fetch("".concat(this.host,"/session")).then(function(n){return Vi(n).catch(ea)})}},{key:"getSchema",value:function(n){var r=n.headers;return fetch("".concat(this.host,"/schema"),{method:"GET",headers:r}).then(function(o){return Vi(o)}).catch(ea)}},{key:"putTree",value:function(n){var r=n.treePath,o=r===void 0?"/":r,i=n.patchIds,s=n.addPatch,a=n.validateAll,l=n.validateSource,c=n.validateBinaryFiles,u=n.headers,d=new URLSearchParams,f=new TextEncoder,h=p2(f.encode((i||[]).concat(JSON.stringify(s||{})).join(";")));return d.set("patches_sha",h),d.set("validate_all",(a||!1).toString()),d.set("validate_source",(l||!1).toString()),d.set("validate_binary_files",(c||!1).toString()),fetch("".concat(this.host,"/tree/~").concat(o,"?").concat(d.toString()),{method:"PUT",body:JSON.stringify({patchIds:i,addPatch:s}),headers:u}).then(function(m){return Vi(m)}).catch(ea)}},{key:"postSave",value:function(n){var r=n.patchIds;return fetch("".concat(this.host,"/save"),{method:"POST",body:JSON.stringify({patchIds:r}),headers:{"Content-Type":"application/json"}}).then(function(){var o=Eu(Xr().mark(function i(s){var a;return Xr().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(!s.ok){c.next=4;break}return c.abrupt("return",Vi(s));case 4:if(!(s.status===400&&s.headers.get("content-type")==="application/json")){c.next=9;break}return c.next=7,s.json();case 7:a=c.sent,alert(JSON.stringify(a));case 9:return c.abrupt("return",Vi(s));case 10:case"end":return c.stop()}},i)}));return function(i){return o.apply(this,arguments)}}()).catch(ea)}},{key:"postValidate",value:function(n){var r=n.patches,o=n.headers;return fetch("".concat(this.host,"/validate"),{method:"POST",body:JSON.stringify({patches:r}),headers:o||{"Content-Type":"application/json"}}).then(function(){var i=Eu(Xr().mark(function s(a){return Xr().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.abrupt("return",Vi(a));case 1:case"end":return c.stop()}},s)}));return function(s){return i.apply(this,arguments)}}()).catch(ea)}}]),e}();function ea(e){return Lo({statusCode:500,message:e instanceof Error||ye(e)==="object"&&e&&"message"in e&&typeof e.message=="string"?e.message:"Unknown error",details:ye(e)==="object"&&e&&"details"in e?e.details:void 0})}function gL(e,t,n){return Lo({statusCode:e,message:t.message||n,details:t.details||Object.fromEntries(Object.entries(t).filter(function(r){var o=_s(r,1),i=o[0];return i!=="message"}))})}function Vi(e){return N0.apply(this,arguments)}function N0(){return N0=Eu(Xr().mark(function e(t){var n;return Xr().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(o.prev=0,!t.ok){o.next=9;break}return o.t0=Ke,o.next=5,t.json();case 5:return o.t1=o.sent,o.abrupt("return",o.t0.ok.call(o.t0,o.t1));case 9:return o.prev=9,o.next=12,t.json();case 12:return n=o.sent,o.abrupt("return",gL(t.status,n,t.statusText));case 16:return o.prev=16,o.t2=o.catch(9),o.abrupt("return",Lo({statusCode:t.status,message:t.statusText}));case 19:o.next=24;break;case 21:return o.prev=21,o.t3=o.catch(0),o.abrupt("return",Lo({message:o.t3 instanceof Error?o.t3.message:"Unknown error"}));case 24:case"end":return o.stop()}},e,null,[[0,21],[9,16]])})),N0.apply(this,arguments)}var tt={VERSION:{core:function(){try{return require("../package.json").version}catch{return null}}()},convertFileSource:t2,getSchema:C5,getValPath:r2,getVal:eL,getSource:j5,resolvePath:K5,splitModuleFilePathAndModulePath:z5,isVal:M5,createValPathOfItem:Tr,getSHA256Hash:p2,initSchema:Q5,ModuleFilePathSep:R0,notFileOp:function(t){return t.op!=="file"},isFileOp:function(t){return t.op==="file"&&typeof t.filePath=="string"},createPatchJSONPath:function(t){return"/".concat(t.split(".").map(function(n){return n&&vL(n)}).join("/"))},createPatchPath:function(t){return c2(t)},patchPathToModulePath:function(t){return t.map(function(n){return Number.isInteger(Number(n))?n:JSON.stringify(n)}).join(".")},VAL_ENABLE_COOKIE_NAME:"val_enable",VAL_STATE_COOKIE:"val_state",VAL_SESSION_COOKIE:"val_session"};function vL(e){try{return JSON.parse(e)}catch{return e}}var h2={exports:{}};/*!
88
- Copyright (c) 2018 Jed Watson.
89
- Licensed under the MIT License (MIT), see
90
- http://jedwatson.github.io/classnames
91
- */(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var i="",s=0;s<arguments.length;s++){var a=arguments[s];a&&(i=o(i,r(a)))}return i}function r(i){if(typeof i=="string"||typeof i=="number")return i;if(typeof i!="object")return"";if(Array.isArray(i))return n.apply(null,i);if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]"))return i.toString();var s="";for(var a in i)t.call(i,a)&&i[a]&&(s=o(s,a));return s}function o(i,s){return s?i?i+" "+s:i+s:i}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(h2);var yL=h2.exports;const on=Ri(yL);function D(){return D=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},D.apply(this,arguments)}function xL(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function dg(...e){return t=>e.forEach(n=>xL(n,t))}function Le(...e){return p.useCallback(dg(...e),e)}const ki=p.forwardRef((e,t)=>{const{children:n,...r}=e,o=p.Children.toArray(n),i=o.find(wL);if(i){const s=i.props.children,a=o.map(l=>l===i?p.Children.count(s)>1?p.Children.only(null):p.isValidElement(s)?s.props.children:null:l);return p.createElement($0,D({},r,{ref:t}),p.isValidElement(s)?p.cloneElement(s,void 0,a):null)}return p.createElement($0,D({},r,{ref:t}),n)});ki.displayName="Slot";const $0=p.forwardRef((e,t)=>{const{children:n,...r}=e;return p.isValidElement(n)?p.cloneElement(n,{...SL(r,n.props),ref:t?dg(t,n.ref):n.ref}):p.Children.count(n)>1?p.Children.only(null):null});$0.displayName="SlotClone";const bL=({children:e})=>p.createElement(p.Fragment,null,e);function wL(e){return p.isValidElement(e)&&e.type===bL}function SL(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const kL=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],we=kL.reduce((e,t)=>{const n=p.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?ki:t;return p.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),p.createElement(a,D({},s,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function m2(e,t){e&&At.flushSync(()=>e.dispatchEvent(t))}const ur=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{};function EL(e,t){return p.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const yn=e=>{const{present:t,children:n}=e,r=CL(t),o=typeof n=="function"?n({present:r.isPresent}):p.Children.only(n),i=Le(r.ref,o.ref);return typeof n=="function"||r.isPresent?p.cloneElement(o,{ref:i}):null};yn.displayName="Presence";function CL(e){const[t,n]=p.useState(),r=p.useRef({}),o=p.useRef(e),i=p.useRef("none"),s=e?"mounted":"unmounted",[a,l]=EL(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const c=kp(r.current);i.current=a==="mounted"?c:"none"},[a]),ur(()=>{const c=r.current,u=o.current;if(u!==e){const f=i.current,h=kp(c);e?l("MOUNT"):h==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&f!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),ur(()=>{if(t){const c=d=>{const h=kp(r.current).includes(d.animationName);d.target===t&&h&&At.flushSync(()=>l("ANIMATION_END"))},u=d=>{d.target===t&&(i.current=kp(r.current))};return t.addEventListener("animationstart",u),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",u),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:p.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function kp(e){return(e==null?void 0:e.animationName)||"none"}function vr(e,t=[]){let n=[];function r(i,s){const a=p.createContext(s),l=n.length;n=[...n,s];function c(d){const{scope:f,children:h,...m}=d,g=(f==null?void 0:f[e][l])||a,b=p.useMemo(()=>m,Object.values(m));return p.createElement(g.Provider,{value:b},h)}function u(d,f){const h=(f==null?void 0:f[e][l])||a,m=p.useContext(h);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,u]}const o=()=>{const i=n.map(s=>p.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return p.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,_L(o,...t)]}function _L(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const d=l(i)[`__scope${c}`];return{...a,...d}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function qt(e){const t=p.useRef(e);return p.useEffect(()=>{t.current=e}),p.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}const OL=p.createContext(void 0);function $f(e){const t=p.useContext(OL);return e||t||"ltr"}function D0(e,[t,n]){return Math.min(n,Math.max(t,e))}function re(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function TL(e,t){return p.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const g2="ScrollArea",[v2,Kle]=vr(g2),[ML,Lr]=v2(g2),RL=p.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:i=600,...s}=e,[a,l]=p.useState(null),[c,u]=p.useState(null),[d,f]=p.useState(null),[h,m]=p.useState(null),[g,b]=p.useState(null),[y,v]=p.useState(0),[w,S]=p.useState(0),[k,C]=p.useState(!1),[E,T]=p.useState(!1),R=Le(t,j=>l(j)),$=$f(o);return p.createElement(ML,{scope:n,type:r,dir:$,scrollHideDelay:i,scrollArea:a,viewport:c,onViewportChange:u,content:d,onContentChange:f,scrollbarX:h,onScrollbarXChange:m,scrollbarXEnabled:k,onScrollbarXEnabledChange:C,scrollbarY:g,onScrollbarYChange:b,scrollbarYEnabled:E,onScrollbarYEnabledChange:T,onCornerWidthChange:v,onCornerHeightChange:S},p.createElement(we.div,D({dir:$},s,{ref:R,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":w+"px",...e.style}})))}),PL="ScrollAreaViewport",NL=p.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,...o}=e,i=Lr(PL,n),s=p.useRef(null),a=Le(t,s,i.onViewportChange);return p.createElement(p.Fragment,null,p.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"}}),p.createElement(we.div,D({"data-radix-scroll-area-viewport":""},o,{ref:a,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style}}),p.createElement("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"}},r)))}),Ni="ScrollAreaScrollbar",y2=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Lr(Ni,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:s}=o,a=e.orientation==="horizontal";return p.useEffect(()=>(a?i(!0):s(!0),()=>{a?i(!1):s(!1)}),[a,i,s]),o.type==="hover"?p.createElement($L,D({},r,{ref:t,forceMount:n})):o.type==="scroll"?p.createElement(DL,D({},r,{ref:t,forceMount:n})):o.type==="auto"?p.createElement(x2,D({},r,{ref:t,forceMount:n})):o.type==="always"?p.createElement(qb,D({},r,{ref:t})):null}),$L=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Lr(Ni,e.__scopeScrollArea),[i,s]=p.useState(!1);return p.useEffect(()=>{const a=o.scrollArea;let l=0;if(a){const c=()=>{window.clearTimeout(l),s(!0)},u=()=>{l=window.setTimeout(()=>s(!1),o.scrollHideDelay)};return a.addEventListener("pointerenter",c),a.addEventListener("pointerleave",u),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",c),a.removeEventListener("pointerleave",u)}}},[o.scrollArea,o.scrollHideDelay]),p.createElement(yn,{present:n||i},p.createElement(x2,D({"data-state":i?"visible":"hidden"},r,{ref:t})))}),DL=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Lr(Ni,e.__scopeScrollArea),i=e.orientation==="horizontal",s=pg(()=>l("SCROLL_END"),100),[a,l]=TL("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return p.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,o.scrollHideDelay,l]),p.useEffect(()=>{const c=o.viewport,u=i?"scrollLeft":"scrollTop";if(c){let d=c[u];const f=()=>{const h=c[u];d!==h&&(l("SCROLL"),s()),d=h};return c.addEventListener("scroll",f),()=>c.removeEventListener("scroll",f)}},[o.viewport,i,l,s]),p.createElement(yn,{present:n||a!=="hidden"},p.createElement(qb,D({"data-state":a==="hidden"?"hidden":"visible"},r,{ref:t,onPointerEnter:re(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:re(e.onPointerLeave,()=>l("POINTER_LEAVE"))})))}),x2=p.forwardRef((e,t)=>{const n=Lr(Ni,e.__scopeScrollArea),{forceMount:r,...o}=e,[i,s]=p.useState(!1),a=e.orientation==="horizontal",l=pg(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;s(a?c:u)}},10);return hc(n.viewport,l),hc(n.content,l),p.createElement(yn,{present:r||i},p.createElement(qb,D({"data-state":i?"visible":"hidden"},o,{ref:t})))}),qb=p.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=Lr(Ni,e.__scopeScrollArea),i=p.useRef(null),s=p.useRef(0),[a,l]=p.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=k2(a.viewport,a.content),u={...r,sizes:a,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:f=>i.current=f,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:f=>s.current=f};function d(f,h){return VL(f,s.current,a,h)}return n==="horizontal"?p.createElement(AL,D({},u,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const f=o.viewport.scrollLeft,h=mk(f,a,o.dir);i.current.style.transform=`translate3d(${h}px, 0, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollLeft=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollLeft=d(f,o.dir))}})):n==="vertical"?p.createElement(IL,D({},u,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const f=o.viewport.scrollTop,h=mk(f,a);i.current.style.transform=`translate3d(0, ${h}px, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollTop=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollTop=d(f))}})):null}),AL=p.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=Lr(Ni,e.__scopeScrollArea),[s,a]=p.useState(),l=p.useRef(null),c=Le(t,l,i.onScrollbarXChange);return p.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),p.createElement(w2,D({"data-orientation":"horizontal"},o,{ref:c,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":fg(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,d)=>{if(i.viewport){const f=i.viewport.scrollLeft+u.deltaX;e.onWheelScroll(f),C2(f,d)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Gh(s.paddingLeft),paddingEnd:Gh(s.paddingRight)}})}}))}),IL=p.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=Lr(Ni,e.__scopeScrollArea),[s,a]=p.useState(),l=p.useRef(null),c=Le(t,l,i.onScrollbarYChange);return p.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),p.createElement(w2,D({"data-orientation":"vertical"},o,{ref:c,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":fg(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,d)=>{if(i.viewport){const f=i.viewport.scrollTop+u.deltaY;e.onWheelScroll(f),C2(f,d)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Gh(s.paddingTop),paddingEnd:Gh(s.paddingBottom)}})}}))}),[LL,b2]=v2(Ni),w2=p.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:i,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:u,onResize:d,...f}=e,h=Lr(Ni,n),[m,g]=p.useState(null),b=Le(t,R=>g(R)),y=p.useRef(null),v=p.useRef(""),w=h.viewport,S=r.content-r.viewport,k=qt(u),C=qt(l),E=pg(d,10);function T(R){if(y.current){const $=R.clientX-y.current.left,j=R.clientY-y.current.top;c({x:$,y:j})}}return p.useEffect(()=>{const R=$=>{const j=$.target;(m==null?void 0:m.contains(j))&&k($,S)};return document.addEventListener("wheel",R,{passive:!1}),()=>document.removeEventListener("wheel",R,{passive:!1})},[w,m,S,k]),p.useEffect(C,[r,C]),hc(m,E),hc(h.content,E),p.createElement(LL,{scope:n,scrollbar:m,hasThumb:o,onThumbChange:qt(i),onThumbPointerUp:qt(s),onThumbPositionChange:C,onThumbPointerDown:qt(a)},p.createElement(we.div,D({},f,{ref:b,style:{position:"absolute",...f.style},onPointerDown:re(e.onPointerDown,R=>{R.button===0&&(R.target.setPointerCapture(R.pointerId),y.current=m.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",h.viewport&&(h.viewport.style.scrollBehavior="auto"),T(R))}),onPointerMove:re(e.onPointerMove,T),onPointerUp:re(e.onPointerUp,R=>{const $=R.target;$.hasPointerCapture(R.pointerId)&&$.releasePointerCapture(R.pointerId),document.body.style.webkitUserSelect=v.current,h.viewport&&(h.viewport.style.scrollBehavior=""),y.current=null})})))}),A0="ScrollAreaThumb",jL=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=b2(A0,e.__scopeScrollArea);return p.createElement(yn,{present:n||o.hasThumb},p.createElement(zL,D({ref:t},r)))}),zL=p.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,i=Lr(A0,n),s=b2(A0,n),{onThumbPositionChange:a}=s,l=Le(t,d=>s.onThumbChange(d)),c=p.useRef(),u=pg(()=>{c.current&&(c.current(),c.current=void 0)},100);return p.useEffect(()=>{const d=i.viewport;if(d){const f=()=>{if(u(),!c.current){const h=UL(d,a);c.current=h,a()}};return a(),d.addEventListener("scroll",f),()=>d.removeEventListener("scroll",f)}},[i.viewport,u,a]),p.createElement(we.div,D({"data-state":s.hasThumb?"visible":"hidden"},o,{ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:re(e.onPointerDownCapture,d=>{const h=d.target.getBoundingClientRect(),m=d.clientX-h.left,g=d.clientY-h.top;s.onThumbPointerDown({x:m,y:g})}),onPointerUp:re(e.onPointerUp,s.onThumbPointerUp)}))}),S2="ScrollAreaCorner",FL=p.forwardRef((e,t)=>{const n=Lr(S2,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?p.createElement(BL,D({},e,{ref:t})):null}),BL=p.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=Lr(S2,n),[i,s]=p.useState(0),[a,l]=p.useState(0),c=!!(i&&a);return hc(o.scrollbarX,()=>{var u;const d=((u=o.scrollbarX)===null||u===void 0?void 0:u.offsetHeight)||0;o.onCornerHeightChange(d),l(d)}),hc(o.scrollbarY,()=>{var u;const d=((u=o.scrollbarY)===null||u===void 0?void 0:u.offsetWidth)||0;o.onCornerWidthChange(d),s(d)}),c?p.createElement(we.div,D({},r,{ref:t,style:{width:i,height:a,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}})):null});function Gh(e){return e?parseInt(e,10):0}function k2(e,t){const n=e/t;return isNaN(n)?0:n}function fg(e){const t=k2(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function VL(e,t,n,r="ltr"){const o=fg(n),i=o/2,s=t||i,a=o-s,l=n.scrollbar.paddingStart+s,c=n.scrollbar.size-n.scrollbar.paddingEnd-a,u=n.content-n.viewport,d=r==="ltr"?[0,u]:[u*-1,0];return E2([l,c],d)(e)}function mk(e,t,n="ltr"){const r=fg(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,s=t.content-t.viewport,a=i-r,l=n==="ltr"?[0,s]:[s*-1,0],c=D0(e,l);return E2([0,s],[0,a])(c)}function E2(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function C2(e,t){return e>0&&e<t}const UL=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const i={left:e.scrollLeft,top:e.scrollTop},s=n.left!==i.left,a=n.top!==i.top;(s||a)&&t(),n=i,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function pg(e,t){const n=qt(e),r=p.useRef(0);return p.useEffect(()=>()=>window.clearTimeout(r.current),[]),p.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function hc(e,t){const n=qt(t);ur(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}const _2=RL,HL=NL,WL=FL;function O2(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=O2(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function KL(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=O2(e))&&(r&&(r+=" "),r+=t);return r}const Gb="-";function qL(e){const t=YL(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function o(s){const a=s.split(Gb);return a[0]===""&&a.length!==1&&a.shift(),T2(a,t)||GL(s)}function i(s,a){const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}return{getClassGroupId:o,getConflictingClassGroupIds:i}}function T2(e,t){var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?T2(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(Gb);return(s=t.validators.find(({validator:a})=>a(i)))==null?void 0:s.classGroupId}const gk=/^\[(.+)\]$/;function GL(e){if(gk.test(e)){const t=gk.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function YL(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return ZL(Object.entries(e.classGroups),n).forEach(([i,s])=>{I0(s,r,i,t)}),r}function I0(e,t,n,r){e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:vk(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(XL(o)){I0(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{I0(s,vk(t,i),n,r)})})}function vk(e,t){let n=e;return t.split(Gb).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function XL(e){return e.isThemeGetter}function ZL(e,t){return t?e.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,a])=>[t+s,a])):i);return[n,o]}):e}function JL(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;function o(i,s){n.set(i,s),t++,t>e&&(t=0,r=n,n=new Map)}return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=r.get(i))!==void 0)return o(i,s),s},set(i,s){n.has(i)?n.set(i,s):o(i,s)}}}const M2="!";function QL(e){const t=e.separator,n=t.length===1,r=t[0],o=t.length;return function(s){const a=[];let l=0,c=0,u;for(let g=0;g<s.length;g++){let b=s[g];if(l===0){if(b===r&&(n||s.slice(g,g+o)===t)){a.push(s.slice(c,g)),c=g+o;continue}if(b==="/"){u=g;continue}}b==="["?l++:b==="]"&&l--}const d=a.length===0?s:s.substring(c),f=d.startsWith(M2),h=f?d.substring(1):d,m=u&&u>c?u-c:void 0;return{modifiers:a,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:m}}}function e4(e){if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t}function t4(e){return{cache:JL(e.cacheSize),splitModifiers:QL(e),...qL(e)}}const n4=/\s+/;function r4(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=new Set;return e.trim().split(n4).map(s=>{const{modifiers:a,hasImportantModifier:l,baseClassName:c,maybePostfixModifierPosition:u}=n(s);let d=r(u?c.substring(0,u):c),f=!!u;if(!d){if(!u)return{isTailwindClass:!1,originalClassName:s};if(d=r(c),!d)return{isTailwindClass:!1,originalClassName:s};f=!1}const h=e4(a).join(":");return{isTailwindClass:!0,modifierId:l?h+M2:h,classGroupId:d,originalClassName:s,hasPostfixModifier:f}}).reverse().filter(s=>{if(!s.isTailwindClass)return!0;const{modifierId:a,classGroupId:l,hasPostfixModifier:c}=s,u=a+l;return i.has(u)?!1:(i.add(u),o(l,c).forEach(d=>i.add(a+d)),!0)}).reverse().map(s=>s.originalClassName).join(" ")}function o4(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=R2(t))&&(r&&(r+=" "),r+=n);return r}function R2(e){if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=R2(e[r]))&&(n&&(n+=" "),n+=t);return n}function i4(e,...t){let n,r,o,i=s;function s(l){const c=t.reduce((u,d)=>d(u),e());return n=t4(c),r=n.cache.get,o=n.cache.set,i=a,a(l)}function a(l){const c=r(l);if(c)return c;const u=r4(l,n);return o(l,u),u}return function(){return i(o4.apply(null,arguments))}}function at(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const P2=/^\[(?:([a-z-]+):)?(.+)\]$/i,s4=/^\d+\/\d+$/,a4=new Set(["px","full","screen"]),l4=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,c4=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,u4=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,d4=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function Xo(e){return ga(e)||a4.has(e)||s4.test(e)}function Ui(e){return Dc(e,"length",x4)}function ga(e){return!!e&&!Number.isNaN(Number(e))}function Ep(e){return Dc(e,"number",ga)}function du(e){return!!e&&Number.isInteger(Number(e))}function f4(e){return e.endsWith("%")&&ga(e.slice(0,-1))}function Ee(e){return P2.test(e)}function Hi(e){return l4.test(e)}const p4=new Set(["length","size","percentage"]);function h4(e){return Dc(e,p4,N2)}function m4(e){return Dc(e,"position",N2)}const g4=new Set(["image","url"]);function v4(e){return Dc(e,g4,w4)}function y4(e){return Dc(e,"",b4)}function fu(){return!0}function Dc(e,t,n){const r=P2.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function x4(e){return c4.test(e)}function N2(){return!1}function b4(e){return u4.test(e)}function w4(e){return d4.test(e)}function S4(){const e=at("colors"),t=at("spacing"),n=at("blur"),r=at("brightness"),o=at("borderColor"),i=at("borderRadius"),s=at("borderSpacing"),a=at("borderWidth"),l=at("contrast"),c=at("grayscale"),u=at("hueRotate"),d=at("invert"),f=at("gap"),h=at("gradientColorStops"),m=at("gradientColorStopPositions"),g=at("inset"),b=at("margin"),y=at("opacity"),v=at("padding"),w=at("saturate"),S=at("scale"),k=at("sepia"),C=at("skew"),E=at("space"),T=at("translate"),R=()=>["auto","contain","none"],$=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto",Ee,t],z=()=>[Ee,t],ee=()=>["",Xo,Ui],V=()=>["auto",ga,Ee],U=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],O=()=>["solid","dashed","dotted","double","none"],M=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],_=()=>["start","end","center","between","around","evenly","stretch"],P=()=>["","0",Ee],N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],I=()=>[ga,Ep],B=()=>[ga,Ee];return{cacheSize:500,separator:":",theme:{colors:[fu],spacing:[Xo,Ui],blur:["none","",Hi,Ee],brightness:I(),borderColor:[e],borderRadius:["none","","full",Hi,Ee],borderSpacing:z(),borderWidth:ee(),contrast:I(),grayscale:P(),hueRotate:B(),invert:P(),gap:z(),gradientColorStops:[e],gradientColorStopPositions:[f4,Ui],inset:j(),margin:j(),opacity:I(),padding:z(),saturate:I(),scale:I(),sepia:P(),skew:B(),space:z(),translate:z()},classGroups:{aspect:[{aspect:["auto","square","video",Ee]}],container:["container"],columns:[{columns:[Hi]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...U(),Ee]}],overflow:[{overflow:$()}],"overflow-x":[{"overflow-x":$()}],"overflow-y":[{"overflow-y":$()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",du,Ee]}],basis:[{basis:j()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ee]}],grow:[{grow:P()}],shrink:[{shrink:P()}],order:[{order:["first","last","none",du,Ee]}],"grid-cols":[{"grid-cols":[fu]}],"col-start-end":[{col:["auto",{span:["full",du,Ee]},Ee]}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":[fu]}],"row-start-end":[{row:["auto",{span:[du,Ee]},Ee]}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ee]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ee]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",..._()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",..._(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[..._(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[E]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[E]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ee,t]}],"min-w":[{"min-w":[Ee,t,"min","max","fit"]}],"max-w":[{"max-w":[Ee,t,"none","full","min","max","fit","prose",{screen:[Hi]},Hi]}],h:[{h:[Ee,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ee,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ee,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ee,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Hi,Ui]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ep]}],"font-family":[{font:[fu]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Ee]}],"line-clamp":[{"line-clamp":["none",ga,Ep]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Xo,Ee]}],"list-image":[{"list-image":["none",Ee]}],"list-style-type":[{list:["none","disc","decimal",Ee]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...O(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Xo,Ui]}],"underline-offset":[{"underline-offset":["auto",Xo,Ee]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ee]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ee]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...U(),m4]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",h4]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},v4]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...O(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:O()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...O()]}],"outline-offset":[{"outline-offset":[Xo,Ee]}],"outline-w":[{outline:[Xo,Ui]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:ee()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[Xo,Ui]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Hi,y4]}],"shadow-color":[{shadow:[fu]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":M()}],"bg-blend":[{"bg-blend":M()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Hi,Ee]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[w]}],sepia:[{sepia:[k]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[k]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Ee]}],duration:[{duration:B()}],ease:[{ease:["linear","in","out","in-out",Ee]}],delay:[{delay:B()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ee]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[du,Ee]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ee]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ee]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ee]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Xo,Ui,Ep]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const k4=i4(S4);function je(...e){return k4(KL(e))}const Jl=p.forwardRef(({className:e,children:t,innerRef:n,...r},o)=>x.jsxs(_2,{ref:o,className:je("relative overflow-hidden",e),...r,children:[x.jsx(HL,{className:"h-full w-full rounded-[inherit]",ref:n,children:t}),x.jsx($2,{}),x.jsx(WL,{})]}));Jl.displayName=_2.displayName;const $2=p.forwardRef(({className:e,orientation:t="vertical",...n},r)=>x.jsx(y2,{ref:r,orientation:t,className:je("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:x.jsx(jL,{className:je("relative rounded-full bg-border",t==="vertical"&&"flex-1")})}));$2.displayName=y2.displayName;/**
92
- * @license lucide-react v0.379.0 - ISC
93
- *
94
- * This source code is licensed under the ISC license.
95
- * See the LICENSE file in the root directory of this source tree.
96
- */const E4=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),D2=(...e)=>e.filter((t,n,r)=>!!t&&r.indexOf(t)===n).join(" ");/**
97
- * @license lucide-react v0.379.0 - ISC
98
- *
99
- * This source code is licensed under the ISC license.
100
- * See the LICENSE file in the root directory of this source tree.
101
- */var C4={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
102
- * @license lucide-react v0.379.0 - ISC
103
- *
104
- * This source code is licensed under the ISC license.
105
- * See the LICENSE file in the root directory of this source tree.
106
- */const _4=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:s,...a},l)=>p.createElement("svg",{ref:l,...C4,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:D2("lucide",o),...a},[...s.map(([c,u])=>p.createElement(c,u)),...Array.isArray(i)?i:[i]]));/**
107
- * @license lucide-react v0.379.0 - ISC
108
- *
109
- * This source code is licensed under the ISC license.
110
- * See the LICENSE file in the root directory of this source tree.
111
- */const Re=(e,t)=>{const n=p.forwardRef(({className:r,...o},i)=>p.createElement(_4,{ref:i,iconNode:t,className:D2(`lucide-${E4(e)}`,r),...o}));return n.displayName=`${e}`,n};/**
112
- * @license lucide-react v0.379.0 - ISC
113
- *
114
- * This source code is licensed under the ISC license.
115
- * See the LICENSE file in the root directory of this source tree.
116
- */const O4=Re("AlignJustify",[["line",{x1:"3",x2:"21",y1:"6",y2:"6",key:"4m8b97"}],["line",{x1:"3",x2:"21",y1:"12",y2:"12",key:"10d38w"}],["line",{x1:"3",x2:"21",y1:"18",y2:"18",key:"kwyyxn"}]]);/**
117
- * @license lucide-react v0.379.0 - ISC
118
- *
119
- * This source code is licensed under the ISC license.
120
- * See the LICENSE file in the root directory of this source tree.
121
- */const T4=Re("Bold",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]]);/**
122
- * @license lucide-react v0.379.0 - ISC
123
- *
124
- * This source code is licensed under the ISC license.
125
- * See the LICENSE file in the root directory of this source tree.
126
- */const Df=Re("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
127
- * @license lucide-react v0.379.0 - ISC
128
- *
129
- * This source code is licensed under the ISC license.
130
- * See the LICENSE file in the root directory of this source tree.
131
- */const A2=Re("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
132
- * @license lucide-react v0.379.0 - ISC
133
- *
134
- * This source code is licensed under the ISC license.
135
- * See the LICENSE file in the root directory of this source tree.
136
- */const M4=Re("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
137
- * @license lucide-react v0.379.0 - ISC
138
- *
139
- * This source code is licensed under the ISC license.
140
- * See the LICENSE file in the root directory of this source tree.
141
- */const R4=Re("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
142
- * @license lucide-react v0.379.0 - ISC
143
- *
144
- * This source code is licensed under the ISC license.
145
- * See the LICENSE file in the root directory of this source tree.
146
- */const P4=Re("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
147
- * @license lucide-react v0.379.0 - ISC
148
- *
149
- * This source code is licensed under the ISC license.
150
- * See the LICENSE file in the root directory of this source tree.
151
- */const N4=Re("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
152
- * @license lucide-react v0.379.0 - ISC
153
- *
154
- * This source code is licensed under the ISC license.
155
- * See the LICENSE file in the root directory of this source tree.
156
- */const $4=Re("EllipsisVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);/**
157
- * @license lucide-react v0.379.0 - ISC
158
- *
159
- * This source code is licensed under the ISC license.
160
- * See the LICENSE file in the root directory of this source tree.
161
- */const D4=Re("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
162
- * @license lucide-react v0.379.0 - ISC
163
- *
164
- * This source code is licensed under the ISC license.
165
- * See the LICENSE file in the root directory of this source tree.
166
- */const A4=Re("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
167
- * @license lucide-react v0.379.0 - ISC
168
- *
169
- * This source code is licensed under the ISC license.
170
- * See the LICENSE file in the root directory of this source tree.
171
- */const I4=Re("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);/**
172
- * @license lucide-react v0.379.0 - ISC
173
- *
174
- * This source code is licensed under the ISC license.
175
- * See the LICENSE file in the root directory of this source tree.
176
- */const L4=Re("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
177
- * @license lucide-react v0.379.0 - ISC
178
- *
179
- * This source code is licensed under the ISC license.
180
- * See the LICENSE file in the root directory of this source tree.
181
- */const yk=Re("Heading1",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]]);/**
182
- * @license lucide-react v0.379.0 - ISC
183
- *
184
- * This source code is licensed under the ISC license.
185
- * See the LICENSE file in the root directory of this source tree.
186
- */const xk=Re("Heading2",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]]);/**
187
- * @license lucide-react v0.379.0 - ISC
188
- *
189
- * This source code is licensed under the ISC license.
190
- * See the LICENSE file in the root directory of this source tree.
191
- */const bk=Re("Heading3",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2",key:"68ncm8"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2",key:"1ejuhz"}]]);/**
192
- * @license lucide-react v0.379.0 - ISC
193
- *
194
- * This source code is licensed under the ISC license.
195
- * See the LICENSE file in the root directory of this source tree.
196
- */const wk=Re("Heading4",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17 10v4h4",key:"13sv97"}],["path",{d:"M21 10v8",key:"1kdml4"}]]);/**
197
- * @license lucide-react v0.379.0 - ISC
198
- *
199
- * This source code is licensed under the ISC license.
200
- * See the LICENSE file in the root directory of this source tree.
201
- */const Sk=Re("Heading5",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17 13v-3h4",key:"1nvgqp"}],["path",{d:"M17 17.7c.4.2.8.3 1.3.3 1.5 0 2.7-1.1 2.7-2.5S19.8 13 18.3 13H17",key:"2nebdn"}]]);/**
202
- * @license lucide-react v0.379.0 - ISC
203
- *
204
- * This source code is licensed under the ISC license.
205
- * See the LICENSE file in the root directory of this source tree.
206
- */const kk=Re("Heading6",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["circle",{cx:"19",cy:"16",r:"2",key:"15mx69"}],["path",{d:"M20 10c-2 2-3 3.5-3 6",key:"f35dl0"}]]);/**
207
- * @license lucide-react v0.379.0 - ISC
208
- *
209
- * This source code is licensed under the ISC license.
210
- * See the LICENSE file in the root directory of this source tree.
211
- */const j4=Re("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
212
- * @license lucide-react v0.379.0 - ISC
213
- *
214
- * This source code is licensed under the ISC license.
215
- * See the LICENSE file in the root directory of this source tree.
216
- */const z4=Re("Italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]);/**
217
- * @license lucide-react v0.379.0 - ISC
218
- *
219
- * This source code is licensed under the ISC license.
220
- * See the LICENSE file in the root directory of this source tree.
221
- */const F4=Re("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/**
222
- * @license lucide-react v0.379.0 - ISC
223
- *
224
- * This source code is licensed under the ISC license.
225
- * See the LICENSE file in the root directory of this source tree.
226
- */const B4=Re("ListOrdered",[["line",{x1:"10",x2:"21",y1:"6",y2:"6",key:"76qw6h"}],["line",{x1:"10",x2:"21",y1:"12",y2:"12",key:"16nom4"}],["line",{x1:"10",x2:"21",y1:"18",y2:"18",key:"u3jurt"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/**
227
- * @license lucide-react v0.379.0 - ISC
228
- *
229
- * This source code is licensed under the ISC license.
230
- * See the LICENSE file in the root directory of this source tree.
231
- */const V4=Re("List",[["line",{x1:"8",x2:"21",y1:"6",y2:"6",key:"7ey8pc"}],["line",{x1:"8",x2:"21",y1:"12",y2:"12",key:"rjfblc"}],["line",{x1:"8",x2:"21",y1:"18",y2:"18",key:"c3b1m8"}],["line",{x1:"3",x2:"3.01",y1:"6",y2:"6",key:"1g7gq3"}],["line",{x1:"3",x2:"3.01",y1:"12",y2:"12",key:"1pjlvk"}],["line",{x1:"3",x2:"3.01",y1:"18",y2:"18",key:"28t2mc"}]]);/**
232
- * @license lucide-react v0.379.0 - ISC
233
- *
234
- * This source code is licensed under the ISC license.
235
- * See the LICENSE file in the root directory of this source tree.
236
- */const Ek=Re("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/**
237
- * @license lucide-react v0.379.0 - ISC
238
- *
239
- * This source code is licensed under the ISC license.
240
- * See the LICENSE file in the root directory of this source tree.
241
- */const U4=Re("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
242
- * @license lucide-react v0.379.0 - ISC
243
- *
244
- * This source code is licensed under the ISC license.
245
- * See the LICENSE file in the root directory of this source tree.
246
- */const H4=Re("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
247
- * @license lucide-react v0.379.0 - ISC
248
- *
249
- * This source code is licensed under the ISC license.
250
- * See the LICENSE file in the root directory of this source tree.
251
- */const W4=Re("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
252
- * @license lucide-react v0.379.0 - ISC
253
- *
254
- * This source code is licensed under the ISC license.
255
- * See the LICENSE file in the root directory of this source tree.
256
- */const K4=Re("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
257
- * @license lucide-react v0.379.0 - ISC
258
- *
259
- * This source code is licensed under the ISC license.
260
- * See the LICENSE file in the root directory of this source tree.
261
- */const q4=Re("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/**
262
- * @license lucide-react v0.379.0 - ISC
263
- *
264
- * This source code is licensed under the ISC license.
265
- * See the LICENSE file in the root directory of this source tree.
266
- */const G4=Re("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
267
- * @license lucide-react v0.379.0 - ISC
268
- *
269
- * This source code is licensed under the ISC license.
270
- * See the LICENSE file in the root directory of this source tree.
271
- */const L0=Re("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
272
- * @license lucide-react v0.379.0 - ISC
273
- *
274
- * This source code is licensed under the ISC license.
275
- * See the LICENSE file in the root directory of this source tree.
276
- */const Y4=Re("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
277
- * @license lucide-react v0.379.0 - ISC
278
- *
279
- * This source code is licensed under the ISC license.
280
- * See the LICENSE file in the root directory of this source tree.
281
- */const X4=Re("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/**
282
- * @license lucide-react v0.379.0 - ISC
283
- *
284
- * This source code is licensed under the ISC license.
285
- * See the LICENSE file in the root directory of this source tree.
286
- */const Z4=Re("Strikethrough",[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]]);/**
287
- * @license lucide-react v0.379.0 - ISC
288
- *
289
- * This source code is licensed under the ISC license.
290
- * See the LICENSE file in the root directory of this source tree.
291
- */const J4=Re("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
292
- * @license lucide-react v0.379.0 - ISC
293
- *
294
- * This source code is licensed under the ISC license.
295
- * See the LICENSE file in the root directory of this source tree.
296
- */const Q4=Re("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
297
- * @license lucide-react v0.379.0 - ISC
298
- *
299
- * This source code is licensed under the ISC license.
300
- * See the LICENSE file in the root directory of this source tree.
301
- */const ej=Re("Unlink",[["path",{d:"m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71",key:"yqzxt4"}],["path",{d:"m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71",key:"4qinb0"}],["line",{x1:"8",x2:"8",y1:"2",y2:"5",key:"1041cp"}],["line",{x1:"2",x2:"5",y1:"8",y2:"8",key:"14m1p5"}],["line",{x1:"16",x2:"16",y1:"19",y2:"22",key:"rzdirn"}],["line",{x1:"19",x2:"22",y1:"16",y2:"16",key:"ox905f"}]]);/**
302
- * @license lucide-react v0.379.0 - ISC
303
- *
304
- * This source code is licensed under the ISC license.
305
- * See the LICENSE file in the root directory of this source tree.
306
- */const Af=Re("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function ad({children:e}){const t=p.useRef(null),n=p.useRef(null),r=p.useRef(!1),o=p.useRef(0),i=p.useRef(null),s=p.useRef(0),[a,l]=p.useState(!0),c=()=>{r.current=!1,i.current=null,o.current=0,s.current=0},u=v=>{v.preventDefault();const w=i.current==="left"?t:n;if(w.current&&r.current){const S=i.current==="left"?v.screenX-o.current:o.current-v.screenX;w.current.style.width=`${Math.max(s.current+S,150)}px`}},d=v=>w=>{if(w.target){const k=v==="left"?t:v==="right"?n:null;r.current=!0,k&&k.current&&(o.current=w.screenX,i.current=v,k.current&&(s.current=k.current.offsetWidth))}},[f,h,m,g,b,y]=p.Children.toArray(e);return p.useEffect(()=>(document.addEventListener("mouseup",c),document.addEventListener("mousemove",u),()=>{document.removeEventListener("mouseup",c),document.removeEventListener("mousemove",u)}),[]),x.jsxs("div",{className:"relative flex h-screen",children:[x.jsxs("div",{ref:t,className:on("absolute top-0 left-0 border-r border-border md:relative z-[1] bg-gradient-to-br from-card from-50% to-background",{"w-[300px]":a,"w-0 md:w-[300px]":!a}),children:[x.jsxs(ad.Column,{children:[x.jsx(Ck,{showOnMobile:!a,onClick:()=>{l(!a)},children:f}),x.jsx(Jl,{style:{height:"calc(100vh - 50px)"},onClick:()=>{l(!1)},children:h})]}),x.jsx("div",{className:"absolute inset-y-0 right-0 cursor-col-resize w-[1px] hover:w-[3px] h-full hover:bg-border",onMouseDown:d("left")})]}),x.jsx("div",{className:on("w-[clamp(200px,70%,80vw)]",{"w-full":!b&&!y}),children:x.jsxs(ad.Column,{children:[x.jsxs("span",{className:"flex w-full",children:[x.jsx(Ck,{className:"md:hidden",showOnMobile:a,onClick:()=>{l(!a)},children:f}),m]}),x.jsx(Jl,{style:{height:"calc(100vh - 50px)"},children:g})]})}),(b||y)&&x.jsxs("div",{ref:n,className:"relative w-full h-screen",children:[x.jsxs(ad.Column,{children:[b,x.jsx(Jl,{style:{height:"calc(100vh - 50px)"},children:y})]}),x.jsx("div",{onMouseDown:d("right"),className:"absolute inset-y-0 left-0 cursor-col-resize w-[1px] bg-border hover:w-[3px] hover:bg-border"})]})]})}function Ck({className:e,showOnMobile:t,onClick:n,children:r}){return x.jsxs("div",{className:on("flex items-center px-4 md:px-4",e,{"hidden md:flex":t}),children:[x.jsx("button",{className:"md:hidden",onClick:n,children:x.jsx(H4,{})}),x.jsx("span",{className:"flex items-center justify-between w-full",children:r})]})}ad.Column=({children:e,className:t})=>{const[n,r]=p.Children.toArray(e);return x.jsxs("div",{className:on("flex flex-col",t),children:[x.jsx("div",{className:"flex items-center border-b border-border",children:n}),r]})};const tj=({className:e})=>x.jsxs("svg",{width:"58",height:"34",viewBox:"0 0 58 34",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:[x.jsx("g",{filter:"url(#filter0_d_21_1677)",children:x.jsx("path",{d:"M5 5.36426C5 5.16309 5.16309 5 5.36426 5H17.6581C17.8593 5 18.0223 5.16309 18.0223 5.36426V28.4949C18.0223 28.696 17.8593 28.8591 17.6581 28.8591H5.36426C5.16309 28.8591 5 28.696 5 28.4949V5.36426Z",fill:"hsl(var(--accent))"})}),x.jsx("g",{filter:"url(#filter1_i_21_1677)",children:x.jsx("circle",{cx:"11.4656",cy:"23.7595",r:"2.18557",fill:"currentColor"})}),x.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M52.8588 23.839H48.7257H48.537H48.1128C47.6715 23.839 47.4508 23.5942 47.4508 23.1044V13.7293C47.4508 13.5784 47.3285 13.4561 47.1777 13.4561H45.8118C45.6609 13.4561 45.5386 13.5784 45.5386 13.7293V15.1836C45.5386 15.2844 45.4569 15.3661 45.3561 15.3661C45.2876 15.3661 45.225 15.3275 45.1924 15.2672C44.805 14.5503 44.283 14.02 43.6264 13.6765C42.9563 13.301 42.2045 13.1132 41.3709 13.1132C40.6028 13.1132 39.8755 13.252 39.189 13.5295C38.5026 13.8071 37.8979 14.2152 37.3748 14.7539C36.8682 15.2764 36.4678 15.9212 36.1736 16.6885C35.8794 17.4558 35.7323 18.3374 35.7323 19.3332V19.725C35.7323 20.7372 35.8794 21.627 36.1736 22.3942C36.4678 23.1615 36.8682 23.8146 37.3748 24.3533C37.8979 24.8757 38.5026 25.2757 39.189 25.5532C39.8755 25.8144 40.6191 25.945 41.42 25.945C42.1881 25.945 42.9154 25.7491 43.6019 25.3573C44.2751 24.982 44.8058 24.4119 45.1941 23.6471C45.2255 23.5852 45.2886 23.5452 45.358 23.5452H45.3917C45.4728 23.5452 45.5386 23.611 45.5386 23.6921C45.5386 23.7904 45.544 23.8856 45.5547 23.9777V25.1392C45.5547 25.3904 45.7584 25.5941 46.0096 25.5941H47.2261C47.2914 25.5995 47.3581 25.6022 47.4263 25.6022H48.537H48.7257H57.7268C57.8777 25.6022 58 25.4799 58 25.329V24.1122C58 23.9614 57.8777 23.839 57.7268 23.839H55.3174C55.1665 23.839 55.0442 23.7167 55.0442 23.5659V8.73368C55.0442 8.58279 54.9219 8.46048 54.771 8.46048H50.5054C50.3545 8.46048 50.2322 8.58279 50.2322 8.73368V9.95043C50.2322 10.1013 50.3545 10.2236 50.5054 10.2236H52.8588C53.0097 10.2236 53.132 10.3459 53.132 10.4968V23.5659C53.132 23.7167 53.0097 23.839 52.8588 23.839ZM41.6161 24.1329C42.1881 24.1329 42.7111 24.0268 43.1851 23.8146C43.6754 23.6023 44.0922 23.3003 44.4354 22.9085C44.7786 22.5167 45.0483 22.0514 45.2444 21.5127C45.4406 20.9576 45.5386 20.3454 45.5386 19.6761V19.3822C45.5386 18.7292 45.4406 18.1333 45.2444 17.5946C45.0483 17.0395 44.7705 16.5661 44.4109 16.1743C44.0677 15.7824 43.6509 15.4804 43.1606 15.2682C42.6866 15.0396 42.1718 14.9254 41.6161 14.9254C41.044 14.9254 40.521 15.0315 40.0471 15.2437C39.5731 15.4559 39.1563 15.758 38.7968 16.1498C38.4535 16.5252 38.1839 16.9905 37.9877 17.5456C37.7916 18.0843 37.6936 18.6802 37.6936 19.3332V19.725C37.6936 21.1127 38.0531 22.1983 38.7722 22.982C39.5077 23.7493 40.4557 24.1329 41.6161 24.1329ZM31.1115 25.4191C31.0732 25.5287 30.9698 25.6022 30.8536 25.6022H27.4661C27.35 25.6022 27.2465 25.5287 27.2082 25.4191L23.1578 13.8193C23.0958 13.6417 23.2276 13.4561 23.4157 13.4561H25.089C25.2068 13.4561 25.3114 13.5316 25.3484 13.6435L28.9666 24.581C28.9942 24.6643 29.0721 24.7206 29.1599 24.7206C29.2477 24.7206 29.3256 24.6643 29.3532 24.581L32.9714 13.6435C33.0084 13.5316 33.1129 13.4561 33.2308 13.4561H34.9041C35.0922 13.4561 35.224 13.6417 35.162 13.8193L31.1115 25.4191Z",fill:"currentColor"}),x.jsxs("defs",{children:[x.jsxs("filter",{id:"filter0_d_21_1677",x:"0.124722",y:"0.124722",width:"22.7729",height:"33.6097",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[x.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),x.jsx("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),x.jsx("feOffset",{}),x.jsx("feGaussianBlur",{stdDeviation:"2.43764"}),x.jsx("feComposite",{in2:"hardAlpha",operator:"out"}),x.jsx("feColorMatrix",{type:"matrix",values:"0 0 0 0 0.219608 0 0 0 0 0.803922 0 0 0 0 0.501961 0 0 0 0.3 0"}),x.jsx("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_21_1677"}),x.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_21_1677",result:"shape"})]}),x.jsxs("filter",{id:"filter1_i_21_1677",x:"9.28003",y:"21.5739",width:"4.37112",height:"4.37112",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[x.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),x.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),x.jsx("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),x.jsx("feOffset",{}),x.jsx("feGaussianBlur",{stdDeviation:"0.546392"}),x.jsx("feComposite",{in2:"hardAlpha",operator:"arithmetic",k2:"-1",k3:"1"}),x.jsx("feColorMatrix",{type:"matrix",values:"0 0 0 0 0.219608 0 0 0 0 0.803922 0 0 0 0 0.501961 0 0 0 0.3 0"}),x.jsx("feBlend",{mode:"normal",in2:"shape",result:"effect1_innerShadow_21_1677"})]})]})]}),I2=tj,Yb=H.createContext({get session(){throw Error("ValUIContext not found. Ensure components are wrapped by ValUIProvider!")},get theme(){throw Error("ValUIContext not found. Ensure components are wrapped by ValUIProvider!")},get setTheme(){throw Error("ValUIContext not found. Ensure components are wrapped by ValUIProvider!")},get editMode(){throw Error("ValUIContext not found. Ensure components are wrapped by ValUIProvider!")},get setEditMode(){throw Error("ValUIContext not found. Ensure components are wrapped by ValUIProvider!")},get setWindowSize(){throw Error("ValOverlayContext not found. Ensure components are wrapped by ValOverlayProvider!")},get windowSize(){throw Error("ValOverlayContext not found. Ensure components are wrapped by ValOverlayProvider!")}});function L2(){return H.useContext(Yb)}function j2(e="dark"){const[t,n]=p.useState(e);return p.useEffect(()=>{localStorage.getItem("val-theme")==="light"?n("light"):localStorage.getItem("val-theme")==="dark"||window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?n("dark"):window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches&&n("light");const r=o=>{localStorage.getItem("val-theme")||n(o.matches?"dark":"light")};return window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",r),()=>{window.matchMedia("(prefers-color-scheme: dark)").removeEventListener("change",r)}},[]),[t,r=>{localStorage.setItem("val-theme",r),n(r)}]}var Ue;(function(e){e.assertEqual=o=>o;function t(o){}e.assertIs=t;function n(o){throw new Error}e.assertNever=n,e.arrayToEnum=o=>{const i={};for(const s of o)i[s]=s;return i},e.getValidEnumValues=o=>{const i=e.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),s={};for(const a of i)s[a]=o[a];return e.objectValues(s)},e.objectValues=o=>e.objectKeys(o).map(function(i){return o[i]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{const i=[];for(const s in o)Object.prototype.hasOwnProperty.call(o,s)&&i.push(s);return i},e.find=(o,i)=>{for(const s of o)if(i(s))return s},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&isFinite(o)&&Math.floor(o)===o;function r(o,i=" | "){return o.map(s=>typeof s=="string"?`'${s}'`:s).join(i)}e.joinValues=r,e.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(Ue||(Ue={}));var j0;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(j0||(j0={}));const Q=Ue.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ds=e=>{switch(typeof e){case"undefined":return Q.undefined;case"string":return Q.string;case"number":return isNaN(e)?Q.nan:Q.number;case"boolean":return Q.boolean;case"function":return Q.function;case"bigint":return Q.bigint;case"symbol":return Q.symbol;case"object":return Array.isArray(e)?Q.array:e===null?Q.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Q.promise:typeof Map<"u"&&e instanceof Map?Q.map:typeof Set<"u"&&e instanceof Set?Q.set:typeof Date<"u"&&e instanceof Date?Q.date:Q.object;default:return Q.unknown}},W=Ue.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),nj=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class co extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(i){return i.message},r={_errors:[]},o=i=>{for(const s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(o);else if(s.code==="invalid_return_type")o(s.returnTypeError);else if(s.code==="invalid_arguments")o(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let a=r,l=0;for(;l<s.path.length;){const c=s.path[l];l===s.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(n(s))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}};return o(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ue.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const o of this.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}co.create=e=>new co(e);const Dd=(e,t)=>{let n;switch(e.code){case W.invalid_type:e.received===Q.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case W.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Ue.jsonStringifyReplacer)}`;break;case W.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ue.joinValues(e.keys,", ")}`;break;case W.invalid_union:n="Invalid input";break;case W.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ue.joinValues(e.options)}`;break;case W.invalid_enum_value:n=`Invalid enum value. Expected ${Ue.joinValues(e.options)}, received '${e.received}'`;break;case W.invalid_arguments:n="Invalid function arguments";break;case W.invalid_return_type:n="Invalid function return type";break;case W.invalid_date:n="Invalid date";break;case W.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Ue.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case W.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case W.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case W.custom:n="Invalid input";break;case W.invalid_intersection_types:n="Intersection results could not be merged";break;case W.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case W.not_finite:n="Number must be finite";break;default:n=t.defaultError,Ue.assertNever(e)}return{message:n}};let z2=Dd;function rj(e){z2=e}function Yh(){return z2}const Xh=e=>{const{data:t,path:n,errorMaps:r,issueData:o}=e,i=[...n,...o.path||[]],s={...o,path:i};let a="";const l=r.filter(c=>!!c).slice().reverse();for(const c of l)a=c(s,{data:t,defaultError:a}).message;return{...o,path:i,message:o.message||a}},oj=[];function te(e,t){const n=Xh({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Yh(),Dd].filter(r=>!!r)});e.common.issues.push(n)}class vn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const o of n){if(o.status==="aborted")return be;o.status==="dirty"&&t.dirty(),r.push(o.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const o of n)r.push({key:await o.key,value:await o.value});return vn.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const o of n){const{key:i,value:s}=o;if(i.status==="aborted"||s.status==="aborted")return be;i.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof s.value<"u"||o.alwaysSet)&&(r[i.value]=s.value)}return{status:t.value,value:r}}}const be=Object.freeze({status:"aborted"}),F2=e=>({status:"dirty",value:e}),Tn=e=>({status:"valid",value:e}),z0=e=>e.status==="aborted",F0=e=>e.status==="dirty",Ad=e=>e.status==="valid",Zh=e=>typeof Promise<"u"&&e instanceof Promise;var pe;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(pe||(pe={}));class jo{constructor(t,n,r,o){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=o}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const _k=(e,t)=>{if(Ad(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new co(e.common.issues);return this._error=n,this._error}}};function ke(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:o}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(s,a)=>s.code!=="invalid_type"?{message:a.defaultError}:typeof a.data>"u"?{message:r??a.defaultError}:{message:n??a.defaultError},description:o}}class Oe{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return ds(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:ds(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new vn,ctx:{common:t.parent.common,data:t.data,parsedType:ds(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Zh(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const o={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ds(t)},i=this._parseSync({data:t,path:o.path,parent:o});return _k(o,i)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ds(t)},o=this._parse({data:t,path:r.path,parent:r}),i=await(Zh(o)?o:Promise.resolve(o));return _k(r,i)}refine(t,n){const r=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,i)=>{const s=t(o),a=()=>i.addIssue({code:W.custom,...r(o)});return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(t,n){return this._refinement((r,o)=>t(r)?!0:(o.addIssue(typeof n=="function"?n(r,o):n),!1))}_refinement(t){return new mo({schema:this,typeName:ve.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return vi.create(this,this._def)}nullable(){return za.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return uo.create(this,this._def)}promise(){return gc.create(this,this._def)}or(t){return zd.create([this,t],this._def)}and(t){return Fd.create(this,t,this._def)}transform(t){return new mo({...ke(this._def),schema:this,typeName:ve.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new Wd({...ke(this._def),innerType:this,defaultValue:n,typeName:ve.ZodDefault})}brand(){return new V2({typeName:ve.ZodBranded,type:this,...ke(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new tm({...ke(this._def),innerType:this,catchValue:n,typeName:ve.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return If.create(this,t)}readonly(){return rm.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const ij=/^c[^\s-]{8,}$/i,sj=/^[a-z][a-z0-9]*$/,aj=/^[0-9A-HJKMNP-TV-Z]{26}$/,lj=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,cj=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,uj="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Vv;const dj=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,fj=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,pj=e=>e.precision?e.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):e.precision===0?e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function hj(e,t){return!!((t==="v4"||!t)&&dj.test(e)||(t==="v6"||!t)&&fj.test(e))}class ro extends Oe{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Q.string){const i=this._getOrReturnCtx(t);return te(i,{code:W.invalid_type,expected:Q.string,received:i.parsedType}),be}const r=new vn;let o;for(const i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(o=this._getOrReturnCtx(t,o),te(o,{code:W.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")t.data.length>i.value&&(o=this._getOrReturnCtx(t,o),te(o,{code:W.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const s=t.data.length>i.value,a=t.data.length<i.value;(s||a)&&(o=this._getOrReturnCtx(t,o),s?te(o,{code:W.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&te(o,{code:W.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")cj.test(t.data)||(o=this._getOrReturnCtx(t,o),te(o,{validation:"email",code:W.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")Vv||(Vv=new RegExp(uj,"u")),Vv.test(t.data)||(o=this._getOrReturnCtx(t,o),te(o,{validation:"emoji",code:W.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")lj.test(t.data)||(o=this._getOrReturnCtx(t,o),te(o,{validation:"uuid",code:W.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")ij.test(t.data)||(o=this._getOrReturnCtx(t,o),te(o,{validation:"cuid",code:W.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")sj.test(t.data)||(o=this._getOrReturnCtx(t,o),te(o,{validation:"cuid2",code:W.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")aj.test(t.data)||(o=this._getOrReturnCtx(t,o),te(o,{validation:"ulid",code:W.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),te(o,{validation:"url",code:W.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),te(o,{validation:"regex",code:W.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(o=this._getOrReturnCtx(t,o),te(o,{code:W.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(o=this._getOrReturnCtx(t,o),te(o,{code:W.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(o=this._getOrReturnCtx(t,o),te(o,{code:W.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?pj(i).test(t.data)||(o=this._getOrReturnCtx(t,o),te(o,{code:W.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="ip"?hj(t.data,i.version)||(o=this._getOrReturnCtx(t,o),te(o,{validation:"ip",code:W.invalid_string,message:i.message}),r.dirty()):Ue.assertNever(i);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(o=>t.test(o),{validation:n,code:W.invalid_string,...pe.errToObj(r)})}_addCheck(t){return new ro({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...pe.errToObj(t)})}url(t){return this._addCheck({kind:"url",...pe.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...pe.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...pe.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...pe.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...pe.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...pe.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...pe.errToObj(t)})}datetime(t){var n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,...pe.errToObj(t==null?void 0:t.message)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...pe.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...pe.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...pe.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...pe.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...pe.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...pe.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...pe.errToObj(n)})}nonempty(t){return this.min(1,pe.errToObj(t))}trim(){return new ro({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ro({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ro({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}ro.create=e=>{var t;return new ro({checks:[],typeName:ve.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...ke(e)})};function mj(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,o=n>r?n:r,i=parseInt(e.toFixed(o).replace(".","")),s=parseInt(t.toFixed(o).replace(".",""));return i%s/Math.pow(10,o)}class As extends Oe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Q.number){const i=this._getOrReturnCtx(t);return te(i,{code:W.invalid_type,expected:Q.number,received:i.parsedType}),be}let r;const o=new vn;for(const i of this._def.checks)i.kind==="int"?Ue.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),te(r,{code:W.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),te(r,{code:W.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),te(r,{code:W.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?mj(t.data,i.value)!==0&&(r=this._getOrReturnCtx(t,r),te(r,{code:W.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),te(r,{code:W.not_finite,message:i.message}),o.dirty()):Ue.assertNever(i);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,pe.toString(n))}gt(t,n){return this.setLimit("min",t,!1,pe.toString(n))}lte(t,n){return this.setLimit("max",t,!0,pe.toString(n))}lt(t,n){return this.setLimit("max",t,!1,pe.toString(n))}setLimit(t,n,r,o){return new As({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:pe.toString(o)}]})}_addCheck(t){return new As({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:pe.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:pe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:pe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:pe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:pe.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:pe.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:pe.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:pe.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:pe.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Ue.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}As.create=e=>new As({checks:[],typeName:ve.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...ke(e)});class Is extends Oe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==Q.bigint){const i=this._getOrReturnCtx(t);return te(i,{code:W.invalid_type,expected:Q.bigint,received:i.parsedType}),be}let r;const o=new vn;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),te(r,{code:W.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),te(r,{code:W.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),te(r,{code:W.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):Ue.assertNever(i);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,pe.toString(n))}gt(t,n){return this.setLimit("min",t,!1,pe.toString(n))}lte(t,n){return this.setLimit("max",t,!0,pe.toString(n))}lt(t,n){return this.setLimit("max",t,!1,pe.toString(n))}setLimit(t,n,r,o){return new Is({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:pe.toString(o)}]})}_addCheck(t){return new Is({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:pe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:pe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:pe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:pe.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:pe.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Is.create=e=>{var t;return new Is({checks:[],typeName:ve.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...ke(e)})};class Id extends Oe{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Q.boolean){const r=this._getOrReturnCtx(t);return te(r,{code:W.invalid_type,expected:Q.boolean,received:r.parsedType}),be}return Tn(t.data)}}Id.create=e=>new Id({typeName:ve.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...ke(e)});class La extends Oe{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Q.date){const i=this._getOrReturnCtx(t);return te(i,{code:W.invalid_type,expected:Q.date,received:i.parsedType}),be}if(isNaN(t.data.getTime())){const i=this._getOrReturnCtx(t);return te(i,{code:W.invalid_date}),be}const r=new vn;let o;for(const i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(o=this._getOrReturnCtx(t,o),te(o,{code:W.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(o=this._getOrReturnCtx(t,o),te(o,{code:W.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):Ue.assertNever(i);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new La({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:pe.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:pe.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}La.create=e=>new La({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:ve.ZodDate,...ke(e)});class Jh extends Oe{_parse(t){if(this._getType(t)!==Q.symbol){const r=this._getOrReturnCtx(t);return te(r,{code:W.invalid_type,expected:Q.symbol,received:r.parsedType}),be}return Tn(t.data)}}Jh.create=e=>new Jh({typeName:ve.ZodSymbol,...ke(e)});class Ld extends Oe{_parse(t){if(this._getType(t)!==Q.undefined){const r=this._getOrReturnCtx(t);return te(r,{code:W.invalid_type,expected:Q.undefined,received:r.parsedType}),be}return Tn(t.data)}}Ld.create=e=>new Ld({typeName:ve.ZodUndefined,...ke(e)});class jd extends Oe{_parse(t){if(this._getType(t)!==Q.null){const r=this._getOrReturnCtx(t);return te(r,{code:W.invalid_type,expected:Q.null,received:r.parsedType}),be}return Tn(t.data)}}jd.create=e=>new jd({typeName:ve.ZodNull,...ke(e)});class mc extends Oe{constructor(){super(...arguments),this._any=!0}_parse(t){return Tn(t.data)}}mc.create=e=>new mc({typeName:ve.ZodAny,...ke(e)});class Ea extends Oe{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Tn(t.data)}}Ea.create=e=>new Ea({typeName:ve.ZodUnknown,...ke(e)});class Ei extends Oe{_parse(t){const n=this._getOrReturnCtx(t);return te(n,{code:W.invalid_type,expected:Q.never,received:n.parsedType}),be}}Ei.create=e=>new Ei({typeName:ve.ZodNever,...ke(e)});class Qh extends Oe{_parse(t){if(this._getType(t)!==Q.undefined){const r=this._getOrReturnCtx(t);return te(r,{code:W.invalid_type,expected:Q.void,received:r.parsedType}),be}return Tn(t.data)}}Qh.create=e=>new Qh({typeName:ve.ZodVoid,...ke(e)});class uo extends Oe{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),o=this._def;if(n.parsedType!==Q.array)return te(n,{code:W.invalid_type,expected:Q.array,received:n.parsedType}),be;if(o.exactLength!==null){const s=n.data.length>o.exactLength.value,a=n.data.length<o.exactLength.value;(s||a)&&(te(n,{code:s?W.too_big:W.too_small,minimum:a?o.exactLength.value:void 0,maximum:s?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),r.dirty())}if(o.minLength!==null&&n.data.length<o.minLength.value&&(te(n,{code:W.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),r.dirty()),o.maxLength!==null&&n.data.length>o.maxLength.value&&(te(n,{code:W.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((s,a)=>o.type._parseAsync(new jo(n,s,n.path,a)))).then(s=>vn.mergeArray(r,s));const i=[...n.data].map((s,a)=>o.type._parseSync(new jo(n,s,n.path,a)));return vn.mergeArray(r,i)}get element(){return this._def.type}min(t,n){return new uo({...this._def,minLength:{value:t,message:pe.toString(n)}})}max(t,n){return new uo({...this._def,maxLength:{value:t,message:pe.toString(n)}})}length(t,n){return new uo({...this._def,exactLength:{value:t,message:pe.toString(n)}})}nonempty(t){return this.min(1,t)}}uo.create=(e,t)=>new uo({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ve.ZodArray,...ke(t)});function Sl(e){if(e instanceof mt){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=vi.create(Sl(r))}return new mt({...e._def,shape:()=>t})}else return e instanceof uo?new uo({...e._def,type:Sl(e.element)}):e instanceof vi?vi.create(Sl(e.unwrap())):e instanceof za?za.create(Sl(e.unwrap())):e instanceof zo?zo.create(e.items.map(t=>Sl(t))):e}class mt extends Oe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Ue.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==Q.object){const c=this._getOrReturnCtx(t);return te(c,{code:W.invalid_type,expected:Q.object,received:c.parsedType}),be}const{status:r,ctx:o}=this._processInputParams(t),{shape:i,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof Ei&&this._def.unknownKeys==="strip"))for(const c in o.data)s.includes(c)||a.push(c);const l=[];for(const c of s){const u=i[c],d=o.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new jo(o,d,o.path,c)),alwaysSet:c in o.data})}if(this._def.catchall instanceof Ei){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of a)l.push({key:{status:"valid",value:u},value:{status:"valid",value:o.data[u]}});else if(c==="strict")a.length>0&&(te(o,{code:W.unrecognized_keys,keys:a}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of a){const d=o.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new jo(o,d,o.path,u)),alwaysSet:u in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const d=await u.key;c.push({key:d,value:await u.value,alwaysSet:u.alwaysSet})}return c}).then(c=>vn.mergeObjectSync(r,c)):vn.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return pe.errToObj,new mt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var o,i,s,a;const l=(s=(i=(o=this._def).errorMap)===null||i===void 0?void 0:i.call(o,n,r).message)!==null&&s!==void 0?s:r.defaultError;return n.code==="unrecognized_keys"?{message:(a=pe.errToObj(t).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new mt({...this._def,unknownKeys:"strip"})}passthrough(){return new mt({...this._def,unknownKeys:"passthrough"})}extend(t){return new mt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new mt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:ve.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new mt({...this._def,catchall:t})}pick(t){const n={};return Ue.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new mt({...this._def,shape:()=>n})}omit(t){const n={};return Ue.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new mt({...this._def,shape:()=>n})}deepPartial(){return Sl(this)}partial(t){const n={};return Ue.objectKeys(this.shape).forEach(r=>{const o=this.shape[r];t&&!t[r]?n[r]=o:n[r]=o.optional()}),new mt({...this._def,shape:()=>n})}required(t){const n={};return Ue.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof vi;)i=i._def.innerType;n[r]=i}}),new mt({...this._def,shape:()=>n})}keyof(){return B2(Ue.objectKeys(this.shape))}}mt.create=(e,t)=>new mt({shape:()=>e,unknownKeys:"strip",catchall:Ei.create(),typeName:ve.ZodObject,...ke(t)});mt.strictCreate=(e,t)=>new mt({shape:()=>e,unknownKeys:"strict",catchall:Ei.create(),typeName:ve.ZodObject,...ke(t)});mt.lazycreate=(e,t)=>new mt({shape:e,unknownKeys:"strip",catchall:Ei.create(),typeName:ve.ZodObject,...ke(t)});class zd extends Oe{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function o(i){for(const a of i)if(a.result.status==="valid")return a.result;for(const a of i)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const s=i.map(a=>new co(a.ctx.common.issues));return te(n,{code:W.invalid_union,unionErrors:s}),be}if(n.common.async)return Promise.all(r.map(async i=>{const s={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(o);{let i;const s=[];for(const l of r){const c={...n,common:{...n.common,issues:[]},parent:null},u=l._parseSync({data:n.data,path:n.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!i&&(i={result:u,ctx:c}),c.common.issues.length&&s.push(c.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const a=s.map(l=>new co(l));return te(n,{code:W.invalid_union,unionErrors:a}),be}}get options(){return this._def.options}}zd.create=(e,t)=>new zd({options:e,typeName:ve.ZodUnion,...ke(t)});const eh=e=>e instanceof Vd?eh(e.schema):e instanceof mo?eh(e.innerType()):e instanceof Ud?[e.value]:e instanceof Ls?e.options:e instanceof Hd?Object.keys(e.enum):e instanceof Wd?eh(e._def.innerType):e instanceof Ld?[void 0]:e instanceof jd?[null]:null;class hg extends Oe{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Q.object)return te(n,{code:W.invalid_type,expected:Q.object,received:n.parsedType}),be;const r=this.discriminator,o=n.data[r],i=this.optionsMap.get(o);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(te(n,{code:W.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),be)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const o=new Map;for(const i of n){const s=eh(i.shape[t]);if(!s)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of s){if(o.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);o.set(a,i)}}return new hg({typeName:ve.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:o,...ke(r)})}}function B0(e,t){const n=ds(e),r=ds(t);if(e===t)return{valid:!0,data:e};if(n===Q.object&&r===Q.object){const o=Ue.objectKeys(t),i=Ue.objectKeys(e).filter(a=>o.indexOf(a)!==-1),s={...e,...t};for(const a of i){const l=B0(e[a],t[a]);if(!l.valid)return{valid:!1};s[a]=l.data}return{valid:!0,data:s}}else if(n===Q.array&&r===Q.array){if(e.length!==t.length)return{valid:!1};const o=[];for(let i=0;i<e.length;i++){const s=e[i],a=t[i],l=B0(s,a);if(!l.valid)return{valid:!1};o.push(l.data)}return{valid:!0,data:o}}else return n===Q.date&&r===Q.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Fd extends Oe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),o=(i,s)=>{if(z0(i)||z0(s))return be;const a=B0(i.value,s.value);return a.valid?((F0(i)||F0(s))&&n.dirty(),{status:n.value,value:a.data}):(te(r,{code:W.invalid_intersection_types}),be)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,s])=>o(i,s)):o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Fd.create=(e,t,n)=>new Fd({left:e,right:t,typeName:ve.ZodIntersection,...ke(n)});class zo extends Oe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Q.array)return te(r,{code:W.invalid_type,expected:Q.array,received:r.parsedType}),be;if(r.data.length<this._def.items.length)return te(r,{code:W.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),be;!this._def.rest&&r.data.length>this._def.items.length&&(te(r,{code:W.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((s,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new jo(r,s,r.path,a)):null}).filter(s=>!!s);return r.common.async?Promise.all(i).then(s=>vn.mergeArray(n,s)):vn.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new zo({...this._def,rest:t})}}zo.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new zo({items:e,typeName:ve.ZodTuple,rest:null,...ke(t)})};class Bd extends Oe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Q.object)return te(r,{code:W.invalid_type,expected:Q.object,received:r.parsedType}),be;const o=[],i=this._def.keyType,s=this._def.valueType;for(const a in r.data)o.push({key:i._parse(new jo(r,a,r.path,a)),value:s._parse(new jo(r,r.data[a],r.path,a))});return r.common.async?vn.mergeObjectAsync(n,o):vn.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Oe?new Bd({keyType:t,valueType:n,typeName:ve.ZodRecord,...ke(r)}):new Bd({keyType:ro.create(),valueType:t,typeName:ve.ZodRecord,...ke(n)})}}class em extends Oe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Q.map)return te(r,{code:W.invalid_type,expected:Q.map,received:r.parsedType}),be;const o=this._def.keyType,i=this._def.valueType,s=[...r.data.entries()].map(([a,l],c)=>({key:o._parse(new jo(r,a,r.path,[c,"key"])),value:i._parse(new jo(r,l,r.path,[c,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of s){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return be;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const l of s){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return be;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}}}}em.create=(e,t,n)=>new em({valueType:t,keyType:e,typeName:ve.ZodMap,...ke(n)});class ja extends Oe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Q.set)return te(r,{code:W.invalid_type,expected:Q.set,received:r.parsedType}),be;const o=this._def;o.minSize!==null&&r.data.size<o.minSize.value&&(te(r,{code:W.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),n.dirty()),o.maxSize!==null&&r.data.size>o.maxSize.value&&(te(r,{code:W.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());const i=this._def.valueType;function s(l){const c=new Set;for(const u of l){if(u.status==="aborted")return be;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}const a=[...r.data.values()].map((l,c)=>i._parse(new jo(r,l,r.path,c)));return r.common.async?Promise.all(a).then(l=>s(l)):s(a)}min(t,n){return new ja({...this._def,minSize:{value:t,message:pe.toString(n)}})}max(t,n){return new ja({...this._def,maxSize:{value:t,message:pe.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}ja.create=(e,t)=>new ja({valueType:e,minSize:null,maxSize:null,typeName:ve.ZodSet,...ke(t)});class Ql extends Oe{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Q.function)return te(n,{code:W.invalid_type,expected:Q.function,received:n.parsedType}),be;function r(a,l){return Xh({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Yh(),Dd].filter(c=>!!c),issueData:{code:W.invalid_arguments,argumentsError:l}})}function o(a,l){return Xh({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Yh(),Dd].filter(c=>!!c),issueData:{code:W.invalid_return_type,returnTypeError:l}})}const i={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof gc){const a=this;return Tn(async function(...l){const c=new co([]),u=await a._def.args.parseAsync(l,i).catch(h=>{throw c.addIssue(r(l,h)),c}),d=await Reflect.apply(s,this,u);return await a._def.returns._def.type.parseAsync(d,i).catch(h=>{throw c.addIssue(o(d,h)),c})})}else{const a=this;return Tn(function(...l){const c=a._def.args.safeParse(l,i);if(!c.success)throw new co([r(l,c.error)]);const u=Reflect.apply(s,this,c.data),d=a._def.returns.safeParse(u,i);if(!d.success)throw new co([o(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Ql({...this._def,args:zo.create(t).rest(Ea.create())})}returns(t){return new Ql({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new Ql({args:t||zo.create([]).rest(Ea.create()),returns:n||Ea.create(),typeName:ve.ZodFunction,...ke(r)})}}class Vd extends Oe{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Vd.create=(e,t)=>new Vd({getter:e,typeName:ve.ZodLazy,...ke(t)});class Ud extends Oe{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return te(n,{received:n.data,code:W.invalid_literal,expected:this._def.value}),be}return{status:"valid",value:t.data}}get value(){return this._def.value}}Ud.create=(e,t)=>new Ud({value:e,typeName:ve.ZodLiteral,...ke(t)});function B2(e,t){return new Ls({values:e,typeName:ve.ZodEnum,...ke(t)})}class Ls extends Oe{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return te(n,{expected:Ue.joinValues(r),received:n.parsedType,code:W.invalid_type}),be}if(this._def.values.indexOf(t.data)===-1){const n=this._getOrReturnCtx(t),r=this._def.values;return te(n,{received:n.data,code:W.invalid_enum_value,options:r}),be}return Tn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t){return Ls.create(t)}exclude(t){return Ls.create(this.options.filter(n=>!t.includes(n)))}}Ls.create=B2;class Hd extends Oe{_parse(t){const n=Ue.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Q.string&&r.parsedType!==Q.number){const o=Ue.objectValues(n);return te(r,{expected:Ue.joinValues(o),received:r.parsedType,code:W.invalid_type}),be}if(n.indexOf(t.data)===-1){const o=Ue.objectValues(n);return te(r,{received:r.data,code:W.invalid_enum_value,options:o}),be}return Tn(t.data)}get enum(){return this._def.values}}Hd.create=(e,t)=>new Hd({values:e,typeName:ve.ZodNativeEnum,...ke(t)});class gc extends Oe{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Q.promise&&n.common.async===!1)return te(n,{code:W.invalid_type,expected:Q.promise,received:n.parsedType}),be;const r=n.parsedType===Q.promise?n.data:Promise.resolve(n.data);return Tn(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}}gc.create=(e,t)=>new gc({type:e,typeName:ve.ZodPromise,...ke(t)});class mo extends Oe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ve.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),o=this._def.effect||null,i={addIssue:s=>{te(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),o.type==="preprocess"){const s=o.transform(r.data,i);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(s).then(a=>this._def.schema._parseAsync({data:a,path:r.path,parent:r})):this._def.schema._parseSync({data:s,path:r.path,parent:r})}if(o.type==="refinement"){const s=a=>{const l=o.refinement(a,i);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?be:(a.status==="dirty"&&n.dirty(),s(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?be:(a.status==="dirty"&&n.dirty(),s(a.value).then(()=>({status:n.value,value:a.value}))))}if(o.type==="transform")if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Ad(s))return s;const a=o.transform(s.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>Ad(s)?Promise.resolve(o.transform(s.value,i)).then(a=>({status:n.value,value:a})):s);Ue.assertNever(o)}}mo.create=(e,t,n)=>new mo({schema:e,typeName:ve.ZodEffects,effect:t,...ke(n)});mo.createWithPreprocess=(e,t,n)=>new mo({schema:t,effect:{type:"preprocess",transform:e},typeName:ve.ZodEffects,...ke(n)});class vi extends Oe{_parse(t){return this._getType(t)===Q.undefined?Tn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}vi.create=(e,t)=>new vi({innerType:e,typeName:ve.ZodOptional,...ke(t)});class za extends Oe{_parse(t){return this._getType(t)===Q.null?Tn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}za.create=(e,t)=>new za({innerType:e,typeName:ve.ZodNullable,...ke(t)});class Wd extends Oe{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===Q.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Wd.create=(e,t)=>new Wd({innerType:e,typeName:ve.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...ke(t)});class tm extends Oe{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Zh(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new co(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new co(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}tm.create=(e,t)=>new tm({innerType:e,typeName:ve.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...ke(t)});class nm extends Oe{_parse(t){if(this._getType(t)!==Q.nan){const r=this._getOrReturnCtx(t);return te(r,{code:W.invalid_type,expected:Q.nan,received:r.parsedType}),be}return{status:"valid",value:t.data}}}nm.create=e=>new nm({typeName:ve.ZodNaN,...ke(e)});const gj=Symbol("zod_brand");class V2 extends Oe{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class If extends Oe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?be:i.status==="dirty"?(n.dirty(),F2(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?be:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(t,n){return new If({in:t,out:n,typeName:ve.ZodPipeline})}}class rm extends Oe{_parse(t){const n=this._def.innerType._parse(t);return Ad(n)&&(n.value=Object.freeze(n.value)),n}}rm.create=(e,t)=>new rm({innerType:e,typeName:ve.ZodReadonly,...ke(t)});const U2=(e,t={},n)=>e?mc.create().superRefine((r,o)=>{var i,s;if(!e(r)){const a=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,l=(s=(i=a.fatal)!==null&&i!==void 0?i:n)!==null&&s!==void 0?s:!0,c=typeof a=="string"?{message:a}:a;o.addIssue({code:"custom",...c,fatal:l})}}):mc.create(),vj={object:mt.lazycreate};var ve;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(ve||(ve={}));const yj=(e,t={message:`Input not instance of ${e.name}`})=>U2(n=>n instanceof e,t),H2=ro.create,W2=As.create,xj=nm.create,bj=Is.create,K2=Id.create,wj=La.create,Sj=Jh.create,kj=Ld.create,Ej=jd.create,Cj=mc.create,_j=Ea.create,Oj=Ei.create,Tj=Qh.create,Mj=uo.create,Rj=mt.create,Pj=mt.strictCreate,Nj=zd.create,$j=hg.create,Dj=Fd.create,Aj=zo.create,Ij=Bd.create,Lj=em.create,jj=ja.create,zj=Ql.create,Fj=Vd.create,Bj=Ud.create,Vj=Ls.create,Uj=Hd.create,Hj=gc.create,Ok=mo.create,Wj=vi.create,Kj=za.create,qj=mo.createWithPreprocess,Gj=If.create,Yj=()=>H2().optional(),Xj=()=>W2().optional(),Zj=()=>K2().optional(),Jj={string:e=>ro.create({...e,coerce:!0}),number:e=>As.create({...e,coerce:!0}),boolean:e=>Id.create({...e,coerce:!0}),bigint:e=>Is.create({...e,coerce:!0}),date:e=>La.create({...e,coerce:!0})},Qj=be;var A=Object.freeze({__proto__:null,defaultErrorMap:Dd,setErrorMap:rj,getErrorMap:Yh,makeIssue:Xh,EMPTY_PATH:oj,addIssueToContext:te,ParseStatus:vn,INVALID:be,DIRTY:F2,OK:Tn,isAborted:z0,isDirty:F0,isValid:Ad,isAsync:Zh,get util(){return Ue},get objectUtil(){return j0},ZodParsedType:Q,getParsedType:ds,ZodType:Oe,ZodString:ro,ZodNumber:As,ZodBigInt:Is,ZodBoolean:Id,ZodDate:La,ZodSymbol:Jh,ZodUndefined:Ld,ZodNull:jd,ZodAny:mc,ZodUnknown:Ea,ZodNever:Ei,ZodVoid:Qh,ZodArray:uo,ZodObject:mt,ZodUnion:zd,ZodDiscriminatedUnion:hg,ZodIntersection:Fd,ZodTuple:zo,ZodRecord:Bd,ZodMap:em,ZodSet:ja,ZodFunction:Ql,ZodLazy:Vd,ZodLiteral:Ud,ZodEnum:Ls,ZodNativeEnum:Hd,ZodPromise:gc,ZodEffects:mo,ZodTransformer:mo,ZodOptional:vi,ZodNullable:za,ZodDefault:Wd,ZodCatch:tm,ZodNaN:nm,BRAND:gj,ZodBranded:V2,ZodPipeline:If,ZodReadonly:rm,custom:U2,Schema:Oe,ZodSchema:Oe,late:vj,get ZodFirstPartyTypeKind(){return ve},coerce:Jj,any:Cj,array:Mj,bigint:bj,boolean:K2,date:wj,discriminatedUnion:$j,effect:Ok,enum:Vj,function:zj,instanceof:yj,intersection:Dj,lazy:Fj,literal:Bj,map:Lj,nan:xj,nativeEnum:Uj,never:Oj,null:Ej,nullable:Kj,number:W2,object:Rj,oboolean:Zj,onumber:Xj,optional:Wj,ostring:Yj,pipeline:Gj,preprocess:qj,promise:Hj,record:Ij,set:jj,strictObject:Pj,string:H2,symbol:Sj,transformer:Ok,tuple:Aj,undefined:kj,union:Nj,unknown:_j,void:Tj,NEVER:Qj,ZodIssueCode:W,quotelessJson:nj,ZodError:co});const e6=A.union([A.object({id:A.string(),mode:A.literal("proxy"),full_name:A.string().optional().nullable(),username:A.string().optional().nullable(),avatar_url:A.string().url().optional().nullable(),enabled:A.boolean().optional()}),A.object({mode:A.literal("local"),enabled:A.boolean().optional()}),A.object({mode:A.literal("unauthorized"),enabled:A.boolean().optional()})]);function q2(e){const[t,n]=p.useState({status:"not-asked"}),[r,o]=p.useState(0);return p.useEffect(()=>{n({status:"loading"}),e.getSession().then(async i=>{try{if(Ke.isOk(i)){const s=i.value;n({status:"success",data:e6.parse(s)})}else i.error.statusCode===401?(console.error("Unauthorized",i.error),n({status:"success",data:{mode:"unauthorized"}})):r<3?setTimeout(()=>{o(r+1)},200*r):n({status:"error",error:"Could not fetch session"})}catch(s){console.error("Could not authorize:",s),n({status:"error",error:"Got an error while trying to get session"})}})},[r]),t}function Xb({children:e}){const[t,n]=e.split(tt.ModuleFilePathSep);return t.split("/").filter(o=>o).map(o=>x.jsxs(p.Fragment,{children:[x.jsx("span",{children:o}),x.jsx("span",{className:"px-[2px] text-muted",children:"/"})]},`${e}/${o}`)).concat(...n?[x.jsx(t6,{children:n},n)]:[])}function t6({children:e}){try{if(e.includes(".")){const t=e.split(".");return t.map((n,r)=>r!==t.length-1?x.jsxs(p.Fragment,{children:[x.jsx("span",{children:JSON.parse(n)}),x.jsx("span",{className:"text-muted",children:"."})]},`${e}.${n}`):x.jsx("span",{children:JSON.parse(n)},e))}return x.jsx("span",{children:e})}catch(t){throw console.error("Parser failure",{children:e},t),new Error("Unexpected path formatting failure")}}function n6(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function G2(e){var t=n6(e,"string");return typeof t=="symbol"?t:String(t)}function Ln(e,t,n){return t=G2(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function va(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Tk(Object(n),!0).forEach(function(r){Ln(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function V0(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Zb(e,t){if(e){if(typeof e=="string")return V0(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return V0(e,t)}}function Jb(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Zb(e))||t&&e&&typeof e.length=="number"){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(l){throw l},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
307
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,s=!1,a;return{s:function(){n=n.call(e)},n:function(){var l=n.next();return i=l.done,l},e:function(l){s=!0,a=l},f:function(){try{!i&&n.return!=null&&n.return()}finally{if(s)throw a}}}}function r6(e){if(Array.isArray(e))return e}function o6(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,o,i,s,a=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,o=u}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}function i6(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
308
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function U0(e,t){return r6(e)||o6(e,t)||Zb(e,t)||i6()}var Y2={x3d:"application/vnd.hzn-3d-crossword","3gp":"video/3gpp","3g2":"video/3gpp2",mseq:"application/vnd.mseq",pwn:"application/vnd.3m.post-it-notes",plb:"application/vnd.3gpp.pic-bw-large",psb:"application/vnd.3gpp.pic-bw-small",pvb:"application/vnd.3gpp.pic-bw-var",tcap:"application/vnd.3gpp2.tcap","7z":"application/x-7z-compressed",abw:"application/x-abiword",ace:"application/x-ace-compressed",acc:"application/vnd.americandynamics.acc",acu:"application/vnd.acucobol",atc:"application/vnd.acucorp",adp:"audio/adpcm",aab:"application/x-authorware-bin",aam:"application/x-authorware-map",aas:"application/x-authorware-seg",air:"application/vnd.adobe.air-application-installer-package+zip",swf:"application/x-shockwave-flash",fxp:"application/vnd.adobe.fxp",pdf:"application/pdf",ppd:"application/vnd.cups-ppd",dir:"application/x-director",xdp:"application/vnd.adobe.xdp+xml",xfdf:"application/vnd.adobe.xfdf",aac:"audio/x-aac",ahead:"application/vnd.ahead.space",azf:"application/vnd.airzip.filesecure.azf",azs:"application/vnd.airzip.filesecure.azs",azw:"application/vnd.amazon.ebook",ami:"application/vnd.amiga.ami","N/A":"application/andrew-inset",apk:"application/vnd.android.package-archive",cii:"application/vnd.anser-web-certificate-issue-initiation",fti:"application/vnd.anser-web-funds-transfer-initiation",atx:"application/vnd.antix.game-component",dmg:"application/x-apple-diskimage",mpkg:"application/vnd.apple.installer+xml",aw:"application/applixware",mp3:"audio/mpeg",les:"application/vnd.hhe.lesson-player",swi:"application/vnd.aristanetworks.swi",s:"text/x-asm",atomcat:"application/atomcat+xml",atomsvc:"application/atomsvc+xml",atom:"application/atom+xml",ac:"application/pkix-attr-cert",aif:"audio/x-aiff",avi:"video/x-msvideo",aep:"application/vnd.audiograph",dxf:"image/vnd.dxf",dwf:"model/vnd.dwf",par:"text/plain-bas",bcpio:"application/x-bcpio",bin:"application/octet-stream",bmp:"image/bmp",torrent:"application/x-bittorrent",cod:"application/vnd.rim.cod",mpm:"application/vnd.blueice.multipass",bmi:"application/vnd.bmi",sh:"application/x-sh",btif:"image/prs.btif",rep:"application/vnd.businessobjects",bz:"application/x-bzip",bz2:"application/x-bzip2",csh:"application/x-csh",c:"text/x-c",cdxml:"application/vnd.chemdraw+xml",css:"text/css",cdx:"chemical/x-cdx",cml:"chemical/x-cml",csml:"chemical/x-csml",cdbcmsg:"application/vnd.contact.cmsg",cla:"application/vnd.claymore",c4g:"application/vnd.clonk.c4group",sub:"image/vnd.dvb.subtitle",cdmia:"application/cdmi-capability",cdmic:"application/cdmi-container",cdmid:"application/cdmi-domain",cdmio:"application/cdmi-object",cdmiq:"application/cdmi-queue",c11amc:"application/vnd.cluetrust.cartomobile-config",c11amz:"application/vnd.cluetrust.cartomobile-config-pkg",ras:"image/x-cmu-raster",dae:"model/vnd.collada+xml",csv:"text/csv",cpt:"application/mac-compactpro",wmlc:"application/vnd.wap.wmlc",cgm:"image/cgm",ice:"x-conference/x-cooltalk",cmx:"image/x-cmx",xar:"application/vnd.xara",cmc:"application/vnd.cosmocaller",cpio:"application/x-cpio",clkx:"application/vnd.crick.clicker",clkk:"application/vnd.crick.clicker.keyboard",clkp:"application/vnd.crick.clicker.palette",clkt:"application/vnd.crick.clicker.template",clkw:"application/vnd.crick.clicker.wordbank",wbs:"application/vnd.criticaltools.wbs+xml",cryptonote:"application/vnd.rig.cryptonote",cif:"chemical/x-cif",cmdf:"chemical/x-cmdf",cu:"application/cu-seeme",cww:"application/prs.cww",curl:"text/vnd.curl",dcurl:"text/vnd.curl.dcurl",mcurl:"text/vnd.curl.mcurl",scurl:"text/vnd.curl.scurl",car:"application/vnd.curl.car",pcurl:"application/vnd.curl.pcurl",cmp:"application/vnd.yellowriver-custom-menu",dssc:"application/dssc+der",xdssc:"application/dssc+xml",deb:"application/x-debian-package",uva:"audio/vnd.dece.audio",uvi:"image/vnd.dece.graphic",uvh:"video/vnd.dece.hd",uvm:"video/vnd.dece.mobile",uvu:"video/vnd.uvvu.mp4",uvp:"video/vnd.dece.pd",uvs:"video/vnd.dece.sd",uvv:"video/vnd.dece.video",dvi:"application/x-dvi",seed:"application/vnd.fdsn.seed",dtb:"application/x-dtbook+xml",res:"application/x-dtbresource+xml",ait:"application/vnd.dvb.ait",svc:"application/vnd.dvb.service",eol:"audio/vnd.digital-winds",djvu:"image/vnd.djvu",dtd:"application/xml-dtd",mlp:"application/vnd.dolby.mlp",wad:"application/x-doom",dpg:"application/vnd.dpgraph",dra:"audio/vnd.dra",dfac:"application/vnd.dreamfactory",dts:"audio/vnd.dts",dtshd:"audio/vnd.dts.hd",dwg:"image/vnd.dwg",geo:"application/vnd.dynageo",es:"application/ecmascript",mag:"application/vnd.ecowin.chart",mmr:"image/vnd.fujixerox.edmics-mmr",rlc:"image/vnd.fujixerox.edmics-rlc",exi:"application/exi",mgz:"application/vnd.proteus.magazine",epub:"application/epub+zip",eml:"message/rfc822",nml:"application/vnd.enliven",xpr:"application/vnd.is-xpr",xif:"image/vnd.xiff",xfdl:"application/vnd.xfdl",emma:"application/emma+xml",ez2:"application/vnd.ezpix-album",ez3:"application/vnd.ezpix-package",fst:"image/vnd.fst",fvt:"video/vnd.fvt",fbs:"image/vnd.fastbidsheet",fe_launch:"application/vnd.denovo.fcselayout-link",f4v:"video/x-f4v",flv:"video/x-flv",fpx:"image/vnd.fpx",npx:"image/vnd.net-fpx",flx:"text/vnd.fmi.flexstor",fli:"video/x-fli",ftc:"application/vnd.fluxtime.clip",fdf:"application/vnd.fdf",f:"text/x-fortran",mif:"application/vnd.mif",fm:"application/vnd.framemaker",fh:"image/x-freehand",fsc:"application/vnd.fsc.weblaunch",fnc:"application/vnd.frogans.fnc",ltf:"application/vnd.frogans.ltf",ddd:"application/vnd.fujixerox.ddd",xdw:"application/vnd.fujixerox.docuworks",xbd:"application/vnd.fujixerox.docuworks.binder",oas:"application/vnd.fujitsu.oasys",oa2:"application/vnd.fujitsu.oasys2",oa3:"application/vnd.fujitsu.oasys3",fg5:"application/vnd.fujitsu.oasysgp",bh2:"application/vnd.fujitsu.oasysprs",spl:"application/x-futuresplash",fzs:"application/vnd.fuzzysheet",g3:"image/g3fax",gmx:"application/vnd.gmx",gtw:"model/vnd.gtw",txd:"application/vnd.genomatix.tuxedo",ggb:"application/vnd.geogebra.file",ggt:"application/vnd.geogebra.tool",gdl:"model/vnd.gdl",gex:"application/vnd.geometry-explorer",gxt:"application/vnd.geonext",g2w:"application/vnd.geoplan",g3w:"application/vnd.geospace",gsf:"application/x-font-ghostscript",bdf:"application/x-font-bdf",gtar:"application/x-gtar",texinfo:"application/x-texinfo",gnumeric:"application/x-gnumeric",kml:"application/vnd.google-earth.kml+xml",kmz:"application/vnd.google-earth.kmz",gqf:"application/vnd.grafeq",gif:"image/gif",gv:"text/vnd.graphviz",gac:"application/vnd.groove-account",ghf:"application/vnd.groove-help",gim:"application/vnd.groove-identity-message",grv:"application/vnd.groove-injector",gtm:"application/vnd.groove-tool-message",tpl:"application/vnd.groove-tool-template",vcg:"application/vnd.groove-vcard",h261:"video/h261",h263:"video/h263",h264:"video/h264",hpid:"application/vnd.hp-hpid",hps:"application/vnd.hp-hps",hdf:"application/x-hdf",rip:"audio/vnd.rip",hbci:"application/vnd.hbci",jlt:"application/vnd.hp-jlyt",pcl:"application/vnd.hp-pcl",hpgl:"application/vnd.hp-hpgl",hvs:"application/vnd.yamaha.hv-script",hvd:"application/vnd.yamaha.hv-dic",hvp:"application/vnd.yamaha.hv-voice","sfd-hdstx":"application/vnd.hydrostatix.sof-data",stk:"application/hyperstudio",hal:"application/vnd.hal+xml",html:"text/html",irm:"application/vnd.ibm.rights-management",sc:"application/vnd.ibm.secure-container",ics:"text/calendar",icc:"application/vnd.iccprofile",ico:"image/x-icon",igl:"application/vnd.igloader",ief:"image/ief",ivp:"application/vnd.immervision-ivp",ivu:"application/vnd.immervision-ivu",rif:"application/reginfo+xml","3dml":"text/vnd.in3d.3dml",spot:"text/vnd.in3d.spot",igs:"model/iges",i2g:"application/vnd.intergeo",cdy:"application/vnd.cinderella",xpw:"application/vnd.intercon.formnet",fcs:"application/vnd.isac.fcs",ipfix:"application/ipfix",cer:"application/pkix-cert",pki:"application/pkixcmp",crl:"application/pkix-crl",pkipath:"application/pkix-pkipath",igm:"application/vnd.insors.igm",rcprofile:"application/vnd.ipunplugged.rcprofile",irp:"application/vnd.irepository.package+xml",jad:"text/vnd.sun.j2me.app-descriptor",jar:"application/java-archive",class:"application/java-vm",jnlp:"application/x-java-jnlp-file",ser:"application/java-serialized-object",java:"text/x-java-source,java",js:"application/javascript",json:"application/json",joda:"application/vnd.joost.joda-archive",jpm:"video/jpm",jpeg:"image/jpeg",jpg:"image/jpeg",pjpeg:"image/pjpeg",jpgv:"video/jpeg",ktz:"application/vnd.kahootz",mmd:"application/vnd.chipnuts.karaoke-mmd",karbon:"application/vnd.kde.karbon",chrt:"application/vnd.kde.kchart",kfo:"application/vnd.kde.kformula",flw:"application/vnd.kde.kivio",kon:"application/vnd.kde.kontour",kpr:"application/vnd.kde.kpresenter",ksp:"application/vnd.kde.kspread",kwd:"application/vnd.kde.kword",htke:"application/vnd.kenameaapp",kia:"application/vnd.kidspiration",kne:"application/vnd.kinar",sse:"application/vnd.kodak-descriptor",lasxml:"application/vnd.las.las+xml",latex:"application/x-latex",lbd:"application/vnd.llamagraphics.life-balance.desktop",lbe:"application/vnd.llamagraphics.life-balance.exchange+xml",jam:"application/vnd.jam",123:"application/vnd.lotus-1-2-3",apr:"application/vnd.lotus-approach",pre:"application/vnd.lotus-freelance",nsf:"application/vnd.lotus-notes",org:"application/vnd.lotus-organizer",scm:"application/vnd.lotus-screencam",lwp:"application/vnd.lotus-wordpro",lvp:"audio/vnd.lucent.voice",m3u:"audio/x-mpegurl",m4v:"video/x-m4v",hqx:"application/mac-binhex40",portpkg:"application/vnd.macports.portpkg",mgp:"application/vnd.osgeo.mapguide.package",mrc:"application/marc",mrcx:"application/marcxml+xml",mxf:"application/mxf",nbp:"application/vnd.wolfram.player",ma:"application/mathematica",mathml:"application/mathml+xml",mbox:"application/mbox",mc1:"application/vnd.medcalcdata",mscml:"application/mediaservercontrol+xml",cdkey:"application/vnd.mediastation.cdkey",mwf:"application/vnd.mfer",mfm:"application/vnd.mfmp",msh:"model/mesh",mads:"application/mads+xml",mets:"application/mets+xml",mods:"application/mods+xml",meta4:"application/metalink4+xml",mcd:"application/vnd.mcd",flo:"application/vnd.micrografx.flo",igx:"application/vnd.micrografx.igx",es3:"application/vnd.eszigno3+xml",mdb:"application/x-msaccess",asf:"video/x-ms-asf",exe:"application/x-msdownload",cil:"application/vnd.ms-artgalry",cab:"application/vnd.ms-cab-compressed",ims:"application/vnd.ms-ims",application:"application/x-ms-application",clp:"application/x-msclip",mdi:"image/vnd.ms-modi",eot:"application/vnd.ms-fontobject",xls:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xltm:"application/vnd.ms-excel.template.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",chm:"application/vnd.ms-htmlhelp",crd:"application/x-mscardfile",lrm:"application/vnd.ms-lrm",mvb:"application/x-msmediaview",mny:"application/x-msmoney",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",sldx:"application/vnd.openxmlformats-officedocument.presentationml.slide",ppsx:"application/vnd.openxmlformats-officedocument.presentationml.slideshow",potx:"application/vnd.openxmlformats-officedocument.presentationml.template",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",obd:"application/x-msbinder",thmx:"application/vnd.ms-officetheme",onetoc:"application/onenote",pya:"audio/vnd.ms-playready.media.pya",pyv:"video/vnd.ms-playready.media.pyv",ppt:"application/vnd.ms-powerpoint",ppam:"application/vnd.ms-powerpoint.addin.macroenabled.12",sldm:"application/vnd.ms-powerpoint.slide.macroenabled.12",pptm:"application/vnd.ms-powerpoint.presentation.macroenabled.12",ppsm:"application/vnd.ms-powerpoint.slideshow.macroenabled.12",potm:"application/vnd.ms-powerpoint.template.macroenabled.12",mpp:"application/vnd.ms-project",pub:"application/x-mspublisher",scd:"application/x-msschedule",xap:"application/x-silverlight-app",stl:"application/vnd.ms-pki.stl",cat:"application/vnd.ms-pki.seccat",vsd:"application/vnd.visio",vsdx:"application/vnd.visio2013",wm:"video/x-ms-wm",wma:"audio/x-ms-wma",wax:"audio/x-ms-wax",wmx:"video/x-ms-wmx",wmd:"application/x-ms-wmd",wpl:"application/vnd.ms-wpl",wmz:"application/x-ms-wmz",wmv:"video/x-ms-wmv",wvx:"video/x-ms-wvx",wmf:"application/x-msmetafile",trm:"application/x-msterminal",doc:"application/msword",docm:"application/vnd.ms-word.document.macroenabled.12",dotm:"application/vnd.ms-word.template.macroenabled.12",wri:"application/x-mswrite",wps:"application/vnd.ms-works",xbap:"application/x-ms-xbap",xps:"application/vnd.ms-xpsdocument",mid:"audio/midi",mpy:"application/vnd.ibm.minipay",afp:"application/vnd.ibm.modcap",rms:"application/vnd.jcp.javame.midlet-rms",tmo:"application/vnd.tmobile-livetv",prc:"application/x-mobipocket-ebook",mbk:"application/vnd.mobius.mbk",dis:"application/vnd.mobius.dis",plc:"application/vnd.mobius.plc",mqy:"application/vnd.mobius.mqy",msl:"application/vnd.mobius.msl",txf:"application/vnd.mobius.txf",daf:"application/vnd.mobius.daf",fly:"text/vnd.fly",mpc:"application/vnd.mophun.certificate",mpn:"application/vnd.mophun.application",mj2:"video/mj2",mpga:"audio/mpeg",mxu:"video/vnd.mpegurl",mpeg:"video/mpeg",m21:"application/mp21",mp4a:"audio/mp4",mp4:"video/mp4",m3u8:"application/vnd.apple.mpegurl",mus:"application/vnd.musician",msty:"application/vnd.muvee.style",mxml:"application/xv+xml",ngdat:"application/vnd.nokia.n-gage.data","n-gage":"application/vnd.nokia.n-gage.symbian.install",ncx:"application/x-dtbncx+xml",nc:"application/x-netcdf",nlu:"application/vnd.neurolanguage.nlu",dna:"application/vnd.dna",nnd:"application/vnd.noblenet-directory",nns:"application/vnd.noblenet-sealer",nnw:"application/vnd.noblenet-web",rpst:"application/vnd.nokia.radio-preset",rpss:"application/vnd.nokia.radio-presets",n3:"text/n3",edm:"application/vnd.novadigm.edm",edx:"application/vnd.novadigm.edx",ext:"application/vnd.novadigm.ext",gph:"application/vnd.flographit",ecelp4800:"audio/vnd.nuera.ecelp4800",ecelp7470:"audio/vnd.nuera.ecelp7470",ecelp9600:"audio/vnd.nuera.ecelp9600",oda:"application/oda",ogx:"application/ogg",oga:"audio/ogg",ogv:"video/ogg",dd2:"application/vnd.oma.dd2+xml",oth:"application/vnd.oasis.opendocument.text-web",opf:"application/oebps-package+xml",qbo:"application/vnd.intu.qbo",oxt:"application/vnd.openofficeorg.extension",osf:"application/vnd.yamaha.openscoreformat",weba:"audio/webm",webm:"video/webm",odc:"application/vnd.oasis.opendocument.chart",otc:"application/vnd.oasis.opendocument.chart-template",odb:"application/vnd.oasis.opendocument.database",odf:"application/vnd.oasis.opendocument.formula",odft:"application/vnd.oasis.opendocument.formula-template",odg:"application/vnd.oasis.opendocument.graphics",otg:"application/vnd.oasis.opendocument.graphics-template",odi:"application/vnd.oasis.opendocument.image",oti:"application/vnd.oasis.opendocument.image-template",odp:"application/vnd.oasis.opendocument.presentation",otp:"application/vnd.oasis.opendocument.presentation-template",ods:"application/vnd.oasis.opendocument.spreadsheet",ots:"application/vnd.oasis.opendocument.spreadsheet-template",odt:"application/vnd.oasis.opendocument.text",odm:"application/vnd.oasis.opendocument.text-master",ott:"application/vnd.oasis.opendocument.text-template",ktx:"image/ktx",sxc:"application/vnd.sun.xml.calc",stc:"application/vnd.sun.xml.calc.template",sxd:"application/vnd.sun.xml.draw",std:"application/vnd.sun.xml.draw.template",sxi:"application/vnd.sun.xml.impress",sti:"application/vnd.sun.xml.impress.template",sxm:"application/vnd.sun.xml.math",sxw:"application/vnd.sun.xml.writer",sxg:"application/vnd.sun.xml.writer.global",stw:"application/vnd.sun.xml.writer.template",otf:"application/x-font-otf",osfpvg:"application/vnd.yamaha.openscoreformat.osfpvg+xml",dp:"application/vnd.osgi.dp",pdb:"application/vnd.palm",p:"text/x-pascal",paw:"application/vnd.pawaafile",pclxl:"application/vnd.hp-pclxl",efif:"application/vnd.picsel",pcx:"image/x-pcx",psd:"image/vnd.adobe.photoshop",prf:"application/pics-rules",pic:"image/x-pict",chat:"application/x-chat",p10:"application/pkcs10",p12:"application/x-pkcs12",p7m:"application/pkcs7-mime",p7s:"application/pkcs7-signature",p7r:"application/x-pkcs7-certreqresp",p7b:"application/x-pkcs7-certificates",p8:"application/pkcs8",plf:"application/vnd.pocketlearn",pnm:"image/x-portable-anymap",pbm:"image/x-portable-bitmap",pcf:"application/x-font-pcf",pfr:"application/font-tdpfr",pgn:"application/x-chess-pgn",pgm:"image/x-portable-graymap",png:"image/png",ppm:"image/x-portable-pixmap",pskcxml:"application/pskc+xml",pml:"application/vnd.ctc-posml",ai:"application/postscript",pfa:"application/x-font-type1",pbd:"application/vnd.powerbuilder6",pgp:"application/pgp-signature",box:"application/vnd.previewsystems.box",ptid:"application/vnd.pvi.ptid1",pls:"application/pls+xml",str:"application/vnd.pg.format",ei6:"application/vnd.pg.osasli",dsc:"text/prs.lines.tag",psf:"application/x-font-linux-psf",qps:"application/vnd.publishare-delta-tree",wg:"application/vnd.pmi.widget",qxd:"application/vnd.quark.quarkxpress",esf:"application/vnd.epson.esf",msf:"application/vnd.epson.msf",ssf:"application/vnd.epson.ssf",qam:"application/vnd.epson.quickanime",qfx:"application/vnd.intu.qfx",qt:"video/quicktime",rar:"application/x-rar-compressed",ram:"audio/x-pn-realaudio",rmp:"audio/x-pn-realaudio-plugin",rsd:"application/rsd+xml",rm:"application/vnd.rn-realmedia",bed:"application/vnd.realvnc.bed",mxl:"application/vnd.recordare.musicxml",musicxml:"application/vnd.recordare.musicxml+xml",rnc:"application/relax-ng-compact-syntax",rdz:"application/vnd.data-vision.rdz",rdf:"application/rdf+xml",rp9:"application/vnd.cloanto.rp9",jisp:"application/vnd.jisp",rtf:"application/rtf",rtx:"text/richtext",link66:"application/vnd.route66.link66+xml",rss:"application/rss+xml",shf:"application/shf+xml",st:"application/vnd.sailingtracker.track",svg:"image/svg+xml",sus:"application/vnd.sus-calendar",sru:"application/sru+xml",setpay:"application/set-payment-initiation",setreg:"application/set-registration-initiation",sema:"application/vnd.sema",semd:"application/vnd.semd",semf:"application/vnd.semf",see:"application/vnd.seemail",snf:"application/x-font-snf",spq:"application/scvp-vp-request",spp:"application/scvp-vp-response",scq:"application/scvp-cv-request",scs:"application/scvp-cv-response",sdp:"application/sdp",etx:"text/x-setext",movie:"video/x-sgi-movie",ifm:"application/vnd.shana.informed.formdata",itp:"application/vnd.shana.informed.formtemplate",iif:"application/vnd.shana.informed.interchange",ipk:"application/vnd.shana.informed.package",tfi:"application/thraud+xml",shar:"application/x-shar",rgb:"image/x-rgb",slt:"application/vnd.epson.salt",aso:"application/vnd.accpac.simply.aso",imp:"application/vnd.accpac.simply.imp",twd:"application/vnd.simtech-mindmapper",csp:"application/vnd.commonspace",saf:"application/vnd.yamaha.smaf-audio",mmf:"application/vnd.smaf",spf:"application/vnd.yamaha.smaf-phrase",teacher:"application/vnd.smart.teacher",svd:"application/vnd.svd",rq:"application/sparql-query",srx:"application/sparql-results+xml",gram:"application/srgs",grxml:"application/srgs+xml",ssml:"application/ssml+xml",skp:"application/vnd.koan",sgml:"text/sgml",sdc:"application/vnd.stardivision.calc",sda:"application/vnd.stardivision.draw",sdd:"application/vnd.stardivision.impress",smf:"application/vnd.stardivision.math",sdw:"application/vnd.stardivision.writer",sgl:"application/vnd.stardivision.writer-global",sm:"application/vnd.stepmania.stepchart",sit:"application/x-stuffit",sitx:"application/x-stuffitx",sdkm:"application/vnd.solent.sdkm+xml",xo:"application/vnd.olpc-sugar",au:"audio/basic",wqd:"application/vnd.wqd",sis:"application/vnd.symbian.install",smi:"application/smil+xml",xsm:"application/vnd.syncml+xml",bdm:"application/vnd.syncml.dm+wbxml",xdm:"application/vnd.syncml.dm+xml",sv4cpio:"application/x-sv4cpio",sv4crc:"application/x-sv4crc",sbml:"application/sbml+xml",tsv:"text/tab-separated-values",tiff:"image/tiff",tao:"application/vnd.tao.intent-module-archive",tar:"application/x-tar",tcl:"application/x-tcl",tex:"application/x-tex",tfm:"application/x-tex-tfm",tei:"application/tei+xml",txt:"text/plain",dxp:"application/vnd.spotfire.dxp",sfs:"application/vnd.spotfire.sfs",tsd:"application/timestamped-data",tpt:"application/vnd.trid.tpt",mxs:"application/vnd.triscape.mxs",t:"text/troff",tra:"application/vnd.trueapp",ttf:"application/x-font-ttf",ttl:"text/turtle",umj:"application/vnd.umajin",uoml:"application/vnd.uoml+xml",unityweb:"application/vnd.unity",ufd:"application/vnd.ufdl",uri:"text/uri-list",utz:"application/vnd.uiq.theme",ustar:"application/x-ustar",uu:"text/x-uuencode",vcs:"text/x-vcalendar",vcf:"text/x-vcard",vcd:"application/x-cdlink",vsf:"application/vnd.vsf",wrl:"model/vrml",vcx:"application/vnd.vcx",mts:"model/vnd.mts",vtu:"model/vnd.vtu",vis:"application/vnd.visionary",viv:"video/vnd.vivo",ccxml:"application/ccxml+xml,",vxml:"application/voicexml+xml",src:"application/x-wais-source",wbxml:"application/vnd.wap.wbxml",wbmp:"image/vnd.wap.wbmp",wav:"audio/x-wav",davmount:"application/davmount+xml",woff:"application/x-font-woff",wspolicy:"application/wspolicy+xml",webp:"image/webp",wtb:"application/vnd.webturbo",wgt:"application/widget",hlp:"application/winhlp",wml:"text/vnd.wap.wml",wmls:"text/vnd.wap.wmlscript",wmlsc:"application/vnd.wap.wmlscriptc",wpd:"application/vnd.wordperfect",stf:"application/vnd.wt.stf",wsdl:"application/wsdl+xml",xbm:"image/x-xbitmap",xpm:"image/x-xpixmap",xwd:"image/x-xwindowdump",der:"application/x-x509-ca-cert",fig:"application/x-xfig",xhtml:"application/xhtml+xml",xml:"application/xml",xdf:"application/xcap-diff+xml",xenc:"application/xenc+xml",xer:"application/patch-ops-error+xml",rl:"application/resource-lists+xml",rs:"application/rls-services+xml",rld:"application/resource-lists-diff+xml",xslt:"application/xslt+xml",xop:"application/xop+xml",xpi:"application/x-xpinstall",xspf:"application/xspf+xml",xul:"application/vnd.mozilla.xul+xml",xyz:"chemical/x-xyz",yaml:"text/yaml",yang:"application/yang",yin:"application/yin+xml",zir:"application/vnd.zul",zip:"application/zip",zmm:"application/vnd.handheld-entertainment+xml",zaz:"application/vnd.zzazz.deck+xml"},s6=Object.fromEntries(Object.entries(Y2).map(function(e){var t=U0(e,2),n=t[0],r=t[1];return[r,n]})),a6=/^data:(.*?);base64,/;function mg(e){var t=a6.exec(e);if(t&&t[1])return t[1]}function gg(e){var t=s6[e];return t||e.split("/")[1]}function l6(e){var t=e.split(".").pop(),n=t&&Y2[t];if(n)return n}function c6(e){var t={},n=[],r=0,o=Jb(e.content),i;try{for(o.s();!(i=o.n()).done;){var s=i.value,a=u6([(r++).toString()],s,t);n.push(a)}}catch(l){o.e(l)}finally{o.f()}return{blocks:n,files:t}}function u6(e,t,n){if(t.type==="heading"){var r,o,i=((r=t.attrs)===null||r===void 0?void 0:r.level)||1;if(Number.isNaN(i))throw new Error("Invalid header depth");return{tag:"h".concat(i),children:((o=t.content)===null||o===void 0?void 0:o.map(function(a,l){return d6(e.concat("children",l.toString()),a,n)}))||[]}}else{if(t.type==="paragraph")return X2(e,t,n);if(t.type==="bulletList")return Q2(e,t,n);if(t.type==="orderedList")return eM(e,t,n);var s=t;throw new Error("Unhandled node type: ".concat("type"in s?"exhaustiveCheck.type":"unknown"))}}function d6(e,t,n){if(t.type==="text")return Z2(t);if(t.type==="hardBreak")return{tag:"br"};if(t.type==="image")return tM(e,t,n);var r=t;throw new Error("Unexpected heading child type: ".concat(JSON.stringify(r,null,2)))}function X2(e,t,n){var r;return{tag:"p",children:((r=t.content)===null||r===void 0?void 0:r.map(function(o,i){if(o.type==="text")return Z2(o);if(o.type==="hardBreak")return{tag:"br"};if(o.type==="image")return tM(e.concat("children",i.toString()),o,n);var s=o;throw new Error("Unexpected paragraph child type: ".concat(JSON.stringify(s,null,2)))}))||[]}}function Z2(e){if(e.type==="text"){var t,n,r=((t=e.marks)===null||t===void 0?void 0:t.flatMap(function(a){return a.type!=="link"?a.type==="strike"?["line-through"]:[a.type]:[]}))||[];if((n=e.marks)!==null&&n!==void 0&&n.some(function(a){return a.type==="link"})){var o;if(r.length>0){var i;return{tag:"a",href:((i=e.marks.find(function(a){return a.type==="link"}))===null||i===void 0?void 0:i.attrs.href)||"",children:[{tag:"span",styles:r,children:[e.text]}]}}return{tag:"a",href:((o=e.marks.find(function(a){return a.type==="link"}))===null||o===void 0?void 0:o.attrs.href)||"",children:[e.text]}}return r.length>0?{tag:"span",styles:r,children:[e.text]}:e.text}else{var s=e.type;throw new Error("Unexpected node type: ".concat(s))}}function J2(e,t,n){var r;return{tag:"li",children:((r=t.content)===null||r===void 0?void 0:r.map(function(o,i){if(o.type==="paragraph")return X2(e.concat("children",i.toString()),o,n);if(o.type==="bulletList")return Q2(e.concat("children",i.toString()),o,n);if(o.type==="orderedList")return eM(e.concat("children",i.toString()),o,n);var s=o;throw new Error("Unexpected list child type: ".concat(s))}))||[]}}function Q2(e,t,n){var r;return{tag:"ul",children:((r=t.content)===null||r===void 0?void 0:r.map(function(o,i){if(o.type==="listItem")return J2(e.concat("children",i.toString()),o,n);var s=o.type;throw new Error("Unexpected bullet list child type: ".concat(s))}))||[]}}function eM(e,t,n){var r;return{tag:"ol",children:((r=t.content)===null||r===void 0?void 0:r.map(function(o,i){if(o.type==="listItem")return J2(e.concat("children",i.toString()),o,n);var s=o.type;throw new Error("Unexpected ordered list child type: ".concat(s))}))||[]}}var f6=new TextEncoder;function tM(e,t,n){if(t.attrs&&t.attrs.src.startsWith("data:")){var r=tt.getSHA256Hash(f6.encode(t.attrs.src)),o=mg(t.attrs.src);if(o===void 0)throw new Error("Could not detect Mime Type for image: ".concat(t.attrs.src));var i=gg(o),s=t.attrs.fileName||"".concat(r,".").concat(i),a="/public/".concat(s),l=n[a],c=e.concat("src");return l?l.patchPaths.push(c):n[a]={value:t.attrs.src,patchPaths:[c]},{tag:"img",src:Ln(Ln(Ln({},_n,"file"),it,a),"metadata",{width:typeof t.attrs.width=="number"?t.attrs.width:0,height:typeof t.attrs.height=="number"?t.attrs.height:0,sha256:r||"",mimeType:o})}}else if(t.attrs){var u=Mk("sha256",t.attrs.src),d=Mk("patch_id",t.attrs.src),f=t.attrs.src.split("?")[0],h={tag:"img",src:va(Ln(Ln(Ln({},_n,"file"),it,"/public".concat(t.attrs.src.split("?")[0])),"metadata",{width:typeof t.attrs.width=="number"?t.attrs.width:0,height:typeof t.attrs.height=="number"?t.attrs.height:0,sha256:u||"",mimeType:f&&l6(f)||""}),d?{patch_id:d}:{})};return h}else throw new Error("Invalid image node (no attrs): "+JSON.stringify(t))}function Mk(e,t){var n=t.split("?");if(!(n.length<2)){var r=n[1],o=new URLSearchParams(r);if(o.has(e))return o.get(e)}}var nM=A.object({type:A.union([A.literal("bold"),A.literal("strike"),A.literal("italic")])}),p6=A.object({type:A.literal("link"),attrs:A.object({href:A.string(),target:A.union([A.literal("_blank"),A.null()]),auto:A.boolean()})}),rM=A.intersection(A.object({type:A.literal("text"),text:A.string()}),A.object({marks:A.array(A.union([nM,p6]))}).partial()),oM=A.intersection(A.object({type:A.literal("hardBreak")}),A.object({marks:A.array(nM)}).partial()),iM=A.intersection(A.object({type:A.literal("image")}),A.object({attrs:A.intersection(A.object({src:A.string()}),A.object({align:A.union([A.literal("center"),A.literal("end"),A.literal("justify"),A.literal("left"),A.literal("match-parent"),A.literal("right"),A.literal("start"),A.null()]),alt:A.union([A.string(),A.null()]),height:A.union([A.string(),A.number(),A.null()]),width:A.union([A.string(),A.number(),A.null()]),rotate:A.union([A.string(),A.null()]),title:A.union([A.string(),A.null()]),fileName:A.union([A.string(),A.null()])}).partial())}).partial()),h6=A.intersection(A.object({type:A.literal("heading")}),A.object({attrs:A.object({level:A.number()}),content:A.array(A.union([rM,iM,oM]))}).partial()),sM=A.lazy(function(){return A.intersection(A.object({type:A.literal("bulletList")}),A.object({content:A.array(lM)}).partial())}),aM=A.lazy(function(){return A.intersection(A.object({type:A.literal("orderedList")}),A.object({content:A.array(lM)}).partial())}),lM=A.lazy(function(){return A.intersection(A.object({type:A.literal("listItem")}),A.object({attrs:A.object({closed:A.boolean(),nested:A.boolean()}).partial().optional(),content:A.array(A.union([cM,sM,aM]))}).partial())}),cM=A.lazy(function(){return A.intersection(A.object({type:A.literal("paragraph")}),A.object({content:A.array(A.union([rM,iM,oM]))}).partial())}),m6=A.object({type:A.literal("doc"),content:A.array(A.union([cM,h6,sM,aM]))});function g6(e){if(Array.isArray(e))return V0(e)}function v6(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function y6(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
309
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function x6(e){return g6(e)||v6(e)||Zb(e)||y6()}function b6(e){return{type:"doc",content:e.map(function(t){return w6(t)})}}function w6(e){switch(e.tag){case"h1":return fl(1,e.children);case"h2":return fl(2,e.children);case"h3":return fl(3,e.children);case"h4":return fl(4,e.children);case"h5":return fl(5,e.children);case"h6":return fl(6,e.children);case"p":return fM(e.children);case"ul":return gM(e);case"ol":return vM(e);default:{var t=e;throw Error("Unexpected child node: "+JSON.stringify(t))}}}function fl(e,t){return{type:"heading",attrs:{level:e},content:t.flatMap(uM)}}function vg(e){return{type:"text",text:e}}function uM(e){return typeof e=="string"?[vg(e)]:e.tag==="img"?[mM(e)]:e.tag==="br"?[pM()]:e.tag==="a"?hM(e):dM(e)}function dM(e){if(e.styles.length===0&&e.children.length===1){if(typeof e.children[0]=="string")return[vg(e.children[0])];throw Error("Unexpected amount of children in span node: "+JSON.stringify(e,null,2))}var t=Array.from(new Set(e.styles));return e.children.map(function(n){return{type:"text",text:n,marks:t.map(function(r){switch(r){case"bold":return{type:"bold"};case"italic":return{type:"italic"};case"line-through":return{type:"strike"};default:{var o=r;throw Error("Unexpected span class: "+o)}}})}})}function fM(e){return{type:"paragraph",content:e.flatMap(function(t){if(typeof t=="string")return[vg(t)];switch(t.tag){case"span":return dM(t);case"a":return hM(t);case"img":return[mM(t)];case"br":return[pM()];default:{var n=t;throw Error("Unexpected paragraph child: "+JSON.stringify(n))}}})}}function pM(){return{type:"hardBreak",marks:[]}}function hM(e){return e.children.flatMap(uM).map(function(t){return t.type!=="text"?t:va(va({},t),{},{marks:(t.marks||[]).concat({type:"link",attrs:{href:e.href,auto:!1,target:null}})})})}function mM(e){var t,n,r=e.src;if(!(_n in r)||r[_n]!=="file")throw Error("Expected file source in image node");var o=tt.convertFileSource(r);return{type:"image",attrs:{height:(t=r.metadata)===null||t===void 0?void 0:t.height,width:(n=r.metadata)===null||n===void 0?void 0:n.width,src:o.url}}}function gM(e){return{type:"bulletList",content:e.children.map(yM)}}function vM(e){return{type:"orderedList",content:e.children.map(yM)}}function yM(e){return{type:"listItem",content:S6(e.children)}}function S6(e){var t=[],n=Jb(e),r;try{for(n.s();!(r=n.n()).done;){var o=r.value,i=t[t.length-1];i||(i={type:"paragraph",content:[]},t.push(i));var s=i.content;if(typeof o=="string")s.push(vg(o));else switch(o.tag){case"ol":{t.push(vM(o));break}case"ul":{t.push(gM(o));break}case"p":{var a=fM(o.children);i.type==="paragraph"&&a.type==="paragraph"?a.content&&s.push.apply(s,x6(a.content)):t.push(a);break}default:{var l=o;throw Error("Unexpected list item child: "+JSON.stringify(l))}}}}catch(c){n.e(c)}finally{n.f()}return t}function ei(){ei=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(O,M,_){O[M]=_.value},i=typeof Symbol=="function"?Symbol:{},s=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function c(O,M,_){return Object.defineProperty(O,M,{value:_,enumerable:!0,configurable:!0,writable:!0}),O[M]}try{c({},"")}catch{c=function(M,_,P){return M[_]=P}}function u(O,M,_,P){var N=M&&M.prototype instanceof y?M:y,I=Object.create(N.prototype),B=new V(P||[]);return o(I,"_invoke",{value:$(O,_,B)}),I}function d(O,M,_){try{return{type:"normal",arg:O.call(M,_)}}catch(P){return{type:"throw",arg:P}}}t.wrap=u;var f="suspendedStart",h="suspendedYield",m="executing",g="completed",b={};function y(){}function v(){}function w(){}var S={};c(S,s,function(){return this});var k=Object.getPrototypeOf,C=k&&k(k(U([])));C&&C!==n&&r.call(C,s)&&(S=C);var E=w.prototype=y.prototype=Object.create(S);function T(O){["next","throw","return"].forEach(function(M){c(O,M,function(_){return this._invoke(M,_)})})}function R(O,M){function _(N,I,B,de){var ue=d(O[N],O,I);if(ue.type!=="throw"){var Ae=ue.arg,me=Ae.value;return me&&typeof me=="object"&&r.call(me,"__await")?M.resolve(me.__await).then(function(X){_("next",X,B,de)},function(X){_("throw",X,B,de)}):M.resolve(me).then(function(X){Ae.value=X,B(Ae)},function(X){return _("throw",X,B,de)})}de(ue.arg)}var P;o(this,"_invoke",{value:function(N,I){function B(){return new M(function(de,ue){_(N,I,de,ue)})}return P=P?P.then(B,B):B()}})}function $(O,M,_){var P=f;return function(N,I){if(P===m)throw new Error("Generator is already running");if(P===g){if(N==="throw")throw I;return{value:e,done:!0}}for(_.method=N,_.arg=I;;){var B=_.delegate;if(B){var de=j(B,_);if(de){if(de===b)continue;return de}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(P===f)throw P=g,_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);P=m;var ue=d(O,M,_);if(ue.type==="normal"){if(P=_.done?g:h,ue.arg===b)continue;return{value:ue.arg,done:_.done}}ue.type==="throw"&&(P=g,_.method="throw",_.arg=ue.arg)}}}function j(O,M){var _=M.method,P=O.iterator[_];if(P===e)return M.delegate=null,_==="throw"&&O.iterator.return&&(M.method="return",M.arg=e,j(O,M),M.method==="throw")||_!=="return"&&(M.method="throw",M.arg=new TypeError("The iterator does not provide a '"+_+"' method")),b;var N=d(P,O.iterator,M.arg);if(N.type==="throw")return M.method="throw",M.arg=N.arg,M.delegate=null,b;var I=N.arg;return I?I.done?(M[O.resultName]=I.value,M.next=O.nextLoc,M.method!=="return"&&(M.method="next",M.arg=e),M.delegate=null,b):I:(M.method="throw",M.arg=new TypeError("iterator result is not an object"),M.delegate=null,b)}function z(O){var M={tryLoc:O[0]};1 in O&&(M.catchLoc=O[1]),2 in O&&(M.finallyLoc=O[2],M.afterLoc=O[3]),this.tryEntries.push(M)}function ee(O){var M=O.completion||{};M.type="normal",delete M.arg,O.completion=M}function V(O){this.tryEntries=[{tryLoc:"root"}],O.forEach(z,this),this.reset(!0)}function U(O){if(O||O===""){var M=O[s];if(M)return M.call(O);if(typeof O.next=="function")return O;if(!isNaN(O.length)){var _=-1,P=function N(){for(;++_<O.length;)if(r.call(O,_))return N.value=O[_],N.done=!1,N;return N.value=e,N.done=!0,N};return P.next=P}}throw new TypeError(typeof O+" is not iterable")}return v.prototype=w,o(E,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:v,configurable:!0}),v.displayName=c(w,l,"GeneratorFunction"),t.isGeneratorFunction=function(O){var M=typeof O=="function"&&O.constructor;return!!M&&(M===v||(M.displayName||M.name)==="GeneratorFunction")},t.mark=function(O){return Object.setPrototypeOf?Object.setPrototypeOf(O,w):(O.__proto__=w,c(O,l,"GeneratorFunction")),O.prototype=Object.create(E),O},t.awrap=function(O){return{__await:O}},T(R.prototype),c(R.prototype,a,function(){return this}),t.AsyncIterator=R,t.async=function(O,M,_,P,N){N===void 0&&(N=Promise);var I=new R(u(O,M,_,P),N);return t.isGeneratorFunction(M)?I:I.next().then(function(B){return B.done?B.value:I.next()})},T(E),c(E,l,"Generator"),c(E,s,function(){return this}),c(E,"toString",function(){return"[object Generator]"}),t.keys=function(O){var M=Object(O),_=[];for(var P in M)_.push(P);return _.reverse(),function N(){for(;_.length;){var I=_.pop();if(I in M)return N.value=I,N.done=!1,N}return N.done=!0,N}},t.values=U,V.prototype={constructor:V,reset:function(O){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(ee),!O)for(var M in this)M.charAt(0)==="t"&&r.call(this,M)&&!isNaN(+M.slice(1))&&(this[M]=e)},stop:function(){this.done=!0;var O=this.tryEntries[0].completion;if(O.type==="throw")throw O.arg;return this.rval},dispatchException:function(O){if(this.done)throw O;var M=this;function _(ue,Ae){return I.type="throw",I.arg=O,M.next=ue,Ae&&(M.method="next",M.arg=e),!!Ae}for(var P=this.tryEntries.length-1;P>=0;--P){var N=this.tryEntries[P],I=N.completion;if(N.tryLoc==="root")return _("end");if(N.tryLoc<=this.prev){var B=r.call(N,"catchLoc"),de=r.call(N,"finallyLoc");if(B&&de){if(this.prev<N.catchLoc)return _(N.catchLoc,!0);if(this.prev<N.finallyLoc)return _(N.finallyLoc)}else if(B){if(this.prev<N.catchLoc)return _(N.catchLoc,!0)}else{if(!de)throw new Error("try statement without catch or finally");if(this.prev<N.finallyLoc)return _(N.finallyLoc)}}}},abrupt:function(O,M){for(var _=this.tryEntries.length-1;_>=0;--_){var P=this.tryEntries[_];if(P.tryLoc<=this.prev&&r.call(P,"finallyLoc")&&this.prev<P.finallyLoc){var N=P;break}}N&&(O==="break"||O==="continue")&&N.tryLoc<=M&&M<=N.finallyLoc&&(N=null);var I=N?N.completion:{};return I.type=O,I.arg=M,N?(this.method="next",this.next=N.finallyLoc,b):this.complete(I)},complete:function(O,M){if(O.type==="throw")throw O.arg;return O.type==="break"||O.type==="continue"?this.next=O.arg:O.type==="return"?(this.rval=this.arg=O.arg,this.method="return",this.next="end"):O.type==="normal"&&M&&(this.next=M),b},finish:function(O){for(var M=this.tryEntries.length-1;M>=0;--M){var _=this.tryEntries[M];if(_.finallyLoc===O)return this.complete(_.completion,_.afterLoc),ee(_),b}},catch:function(O){for(var M=this.tryEntries.length-1;M>=0;--M){var _=this.tryEntries[M];if(_.tryLoc===O){var P=_.completion;if(P.type==="throw"){var N=P.arg;ee(_)}return N}}throw new Error("illegal catch attempt")},delegateYield:function(O,M,_){return this.delegate={iterator:U(O),resultName:M,nextLoc:_},this.method==="next"&&(this.arg=e),b}},t}function Rk(e,t,n,r,o,i,s){try{var a=e[i](s),l=a.value}catch(c){n(c);return}a.done?t(l):Promise.resolve(l).then(r,o)}function Cp(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function s(l){Rk(i,r,o,s,a,"next",l)}function a(l){Rk(i,r,o,s,a,"throw",l)}s(void 0)})}}function k6(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Pk(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,G2(r.key),r)}}function E6(e,t,n){return t&&Pk(e.prototype,t),n&&Pk(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}var Qb=function(){function e(t){var n=this;k6(this,e),Ln(this,"subscribe",function(r){return function(o){var i=Nk(r);return n.listeners[i]||(n.listeners[i]=[],n.subscribers.set(i,{})),n.listeners[i].push(o),function(){n.listeners[i].splice(n.listeners[i].indexOf(o),1)}}}),Ln(this,"getSnapshot",function(r){return function(){return n.get(r)}}),Ln(this,"getServerSnapshot",function(r){return function(){return n.get(r)}}),Ln(this,"get",function(r){var o=Nk(r);return n.subscribers.get(o)}),this.api=t,this.subscribers=new Map,this.listeners={},this.drafts={},this.schema={}}return E6(e,[{key:"reset",value:function(){var t=Cp(ei().mark(function r(){var o,i,s,a,l,c,u,d,f,h,m,g;return ei().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,this.api.getPatches();case 2:if(o=y.sent,!Ke.isErr(o)){y.next=6;break}return console.error("Val: failed to get patches",o.error),y.abrupt("return");case 6:return i=Object.values(o.value).flatMap(function(v){return v.map(function(w){return w.patch_id})}),y.next=9,this.api.putTree({patchIds:i});case 9:return s=y.sent,y.next=12,this.initialize();case 12:if(Ke.isOk(s))for(a=0,l=Object.keys(s.value.modules);a<l.length;a++)for(c=l[a],u=c,this.drafts[u]=s.value.modules[u].source,this.emitEvent(u,this.drafts[u]),d=0,f=Array.from(this.subscribers.entries());d<f.length;d++)h=U0(f[d],2),m=h[0],g=h[1],g[u]&&(this.subscribers.set(m,va(va({},g),{},Ln({},u,this.drafts[u]))),this.emitChange(m));else console.error("Val: failed to reset",s.error);case 13:case"end":return y.stop()}},r,this)}));function n(){return t.apply(this,arguments)}return n}()},{key:"getModule",value:function(){var t=Cp(ei().mark(function r(o){var i,s,a,l,c=arguments;return ei().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(i=c.length>1&&c[1]!==void 0?c[1]:!1,!(!i&&this.drafts[o]&&this.schema[o])){d.next=3;break}return d.abrupt("return",Ke.ok({source:this.drafts[o],schema:this.schema[o]}));case 3:return d.next=5,this.api.putTree({treePath:o});case 5:if(s=d.sent,!Ke.isOk(s)){d.next=26;break}if(s.value.modules[o]){d.next=10;break}return console.error("Val: could not find the module",{moduleIds:Object.keys(s.value.modules),moduleId:o,data:s}),d.abrupt("return",Ke.err({message:`Could not fetch data.
310
- Could not find the module:
311
- `+o+`
312
-
313
- Verify that the val.modules file includes this module.`}));case 10:if(a=s.value.modules[o].source,l=this.schema[o],this.schema[o]){d.next=17;break}return d.next=15,this.initialize();case 15:if(this.schema[o]){d.next=17;break}return d.abrupt("return",Ke.err({message:"Path not found in schema. Verify that the module exists."}));case 17:if(a===void 0){d.next=22;break}return this.drafts[o]=a,d.abrupt("return",Ke.ok({source:a,schema:l}));case 22:return console.error("Val: could not find the module source"),d.abrupt("return",Ke.err({message:"Could not fetch data. Verify that the module exists."}));case 24:d.next=33;break;case 26:if(s.error.statusCode!==504){d.next=31;break}return console.error("Val: timeout",s.error),d.abrupt("return",Ke.err({message:"Timed out while fetching data. Try again later."}));case 31:return console.error("Val: failed to get module",s.error),d.abrupt("return",Ke.err({message:"Could not fetch data. Verify that Val is correctly configured."}));case 33:case"end":return d.stop()}},r,this)}));function n(r){return t.apply(this,arguments)}return n}()},{key:"applyPatch",value:function(){var t=Cp(ei().mark(function r(o,i,s){var a,l,c,u,d,f,h,m;return ei().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return b.next=2,this.api.putTree({treePath:o,patchIds:i,addPatch:{path:o,patch:s}});case 2:if(a=b.sent,!Ke.isOk(a)){b.next=16;break}if(l=a.value.modules[o].source,l===void 0){b.next=12;break}for(this.drafts[o]=l,this.emitEvent(o,l),u=0,d=Array.from(this.subscribers.entries());u<d.length;u++)f=U0(d[u],2),h=f[0],m=f[1],m[o]&&(this.subscribers.set(h,va(va({},m),{},Ln({},o,this.drafts[o]))),this.emitChange(h));return b.abrupt("return",Ke.ok(Ln({},o,{patchIds:((c=a.value.modules[o].patches)===null||c===void 0?void 0:c.applied)||[]})));case 12:return console.error("Val: could not patch"),b.abrupt("return",Ke.err({message:"Val: could not fetch data. Verify that the module exists."}));case 14:b.next=18;break;case 16:return console.error("Val: failed to get module",a.error),b.abrupt("return",Ke.err({message:"Val: could not fetch data. Verify that Val is correctly configured."}));case 18:case"end":return b.stop()}},r,this)}));function n(r,o,i){return t.apply(this,arguments)}return n}()},{key:"emitEvent",value:function(n,r){var o=new CustomEvent("val-event",{detail:{type:"module-update",path:n,source:r}});window.dispatchEvent(o)}},{key:"initialize",value:function(){var t=Cp(ei().mark(function r(){var o,i,s,a,l,c,u;return ei().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,this.api.getSchema({});case 2:if(o=f.sent,!Ke.isOk(o)){f.next=9;break}for(i=[],s=0,a=Object.keys(o.value.schemas);s<a.length;s++)l=a[s],c=o.value.schemas[l],c&&(i.push(l),this.schema[l]=c);return f.abrupt("return",Ke.ok(i));case 9:return u="Failed to fetch content. ",o.error.statusCode===401?u+="Authorization failed - check that you are logged in.":u+="Get a developer to verify that Val is correctly setup.",f.abrupt("return",Ke.err({message:u,details:{fetchError:o.error}}));case 12:case"end":return f.stop()}},r,this)}));function n(){return t.apply(this,arguments)}return n}()},{key:"emitChange",value:function(n){var r=Jb(this.listeners[n]),o;try{for(r.s();!(o=r.n()).done;){var i=o.value;i()}}catch(s){r.e(s)}finally{r.f()}}}]),e}();function Nk(e){return e.slice().sort().join("&")}const C6=new TextEncoder;function xM(e){return new Promise((t,n)=>{var i;const r=(i=e.currentTarget.files)==null?void 0:i[0],o=new FileReader;o.addEventListener("load",()=>{const s=o.result;if(typeof s=="string"){const a=new Image;a.addEventListener("load",()=>{const l=tt.getSHA256Hash(C6.encode(s));if(a.naturalWidth&&a.naturalHeight){const c=mg(s);t({src:s,width:a.naturalWidth,height:a.naturalHeight,filename:r==null?void 0:r.name,sha256:l,mimeType:c,fileExt:c&&gg(c)})}else t({src:s,filename:r==null?void 0:r.name,sha256:l})}),a.src=s}else n(s?{message:"Unexpected image result type",result:s}:{message:"Empty result"})}),r&&o.readAsDataURL(r)})}function bM(e,t,n){if(!n||!e)return t;const r=n.sha256.slice(0,5),o=mg(e)??"unknown",i=gg(o)??"unknown";if(t){let s=t.split(".").slice(0,-1).join(".")||t;const a=s.lastIndexOf("_");return s.slice(a+1,s.length)===r&&(s=s.slice(0,a)),`${encodeURIComponent(s).replace(/%[0-9A-Fa-f]{2}/g,"").toLowerCase()}_${r}.${i}`}return`${n.sha256}.${i}`}function wM(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=wM(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function _6(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=wM(e))&&(r&&(r+=" "),r+=t);return r}const $k=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,Dk=_6,O6=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Dk(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(c=>{const u=n==null?void 0:n[c],d=i==null?void 0:i[c];if(u===null)return null;const f=$k(u)||$k(d);return o[c][f]}),a=n&&Object.entries(n).reduce((c,u)=>{let[d,f]=u;return f===void 0||(c[d]=f),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:d,className:f,...h}=u;return Object.entries(h).every(m=>{let[g,b]=m;return Array.isArray(b)?b.includes({...i,...a}[g]):{...i,...a}[g]===b})?[...c,d,f]:c},[]);return Dk(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},T6=O6("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Kd=p.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},i)=>{const s=r?ki:"button";return x.jsx(s,{className:je(T6({variant:t,size:n,className:e})),ref:i,...o})});Kd.displayName="Button";const yg=p.forwardRef(({className:e,type:t,...n},r)=>x.jsx("input",{type:t,className:je("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));yg.displayName="Input";let xg=()=>({events:{},emit(e,...t){(this.events[e]||[]).forEach(n=>n(...t))},on(e,t){return(this.events[e]=this.events[e]||[]).push(t),()=>this.events[e]=(this.events[e]||[]).filter(n=>n!==t)}});var H0={exports:{}};(function(e,t){var n=typeof Reflect<"u"?Reflect.construct:void 0,r=Object.defineProperty,o=Error.captureStackTrace;o===void 0&&(o=function(c){var u=new Error;r(c,"stack",{configurable:!0,get:function(){var f=u.stack;return r(this,"stack",{configurable:!0,value:f,writable:!0}),f},set:function(f){r(c,"stack",{configurable:!0,value:f,writable:!0})}})});function i(l){l!==void 0&&r(this,"message",{configurable:!0,value:l,writable:!0});var c=this.constructor.name;c!==void 0&&c!==this.name&&r(this,"name",{configurable:!0,value:c,writable:!0}),o(this,this.constructor)}i.prototype=Object.create(Error.prototype,{constructor:{configurable:!0,value:i,writable:!0}});var s=function(){function l(u,d){return r(u,"name",{configurable:!0,value:d})}try{var c=function(){};if(l(c,"foo"),c.name==="foo")return l}catch{}}();function a(l,c){if(c==null||c===Error)c=i;else if(typeof c!="function")throw new TypeError("super_ should be a function");var u;if(typeof l=="string")u=l,l=n!==void 0?function(){return n(c,arguments,this.constructor)}:function(){c.apply(this,arguments)},s!==void 0&&(s(l,u),u=void 0);else if(typeof l!="function")throw new TypeError("constructor should be either a string or a function");l.super_=l.super=c;var d={constructor:{configurable:!0,value:l,writable:!0}};return u!==void 0&&(d.name={configurable:!0,value:u,writable:!0}),l.prototype=Object.create(c.prototype,d),l}t=e.exports=a,t.BaseError=i})(H0,H0.exports);var SM=H0.exports,Ak="ProseMirror-selectednode",kM="",ms="\0",Ik="__state_override__",M6={LastNodeCompatible:"lastNodeCompatible",FormattingMark:"formattingMark",FormattingNode:"formattingNode",NodeCursor:"nodeCursor",FontStyle:"fontStyle",Link:"link",Color:"color",Alignment:"alignment",Indentation:"indentation",Behavior:"behavior",Code:"code",InlineNode:"inline",ListContainerNode:"listContainer",ListItemNode:"listItemNode",Block:"block",BlockNode:"block",TextBlock:"textBlock",ExcludeInputRules:"excludeFromInputRules",PreventExits:"preventsExits",Media:"media"},Me=M6,Ci=Symbol.for("__remirror__"),Yt=(e=>(e.PlainExtension="RemirrorPlainExtension",e.NodeExtension="RemirrorNodeExtension",e.MarkExtension="RemirrorMarkExtension",e.PlainExtensionConstructor="RemirrorPlainExtensionConstructor",e.NodeExtensionConstructor="RemirrorNodeExtensionConstructor",e.MarkExtensionConstructor="RemirrorMarkExtensionConstructor",e.Manager="RemirrorManager",e.Preset="RemirrorPreset",e.PresetConstructor="RemirrorPresetConstructor",e))(Yt||{}),Je=(e=>(e[e.Critical=1e6]="Critical",e[e.Highest=1e5]="Highest",e[e.High=1e4]="High",e[e.Medium=1e3]="Medium",e[e.Default=100]="Default",e[e.Low=10]="Low",e[e.Lowest=0]="Lowest",e))(Je||{}),In=(e=>(e[e.None=0]="None",e[e.Create=1]="Create",e[e.EditorView=2]="EditorView",e[e.Runtime=3]="Runtime",e[e.Destroy=4]="Destroy",e))(In||{}),q=(e=>(e.Undo="_|undo|_",e.Redo="_|redo|_",e.Bold="_|bold|_",e.Italic="_|italic|_",e.Underline="_|underline|_",e.Strike="_|strike|_",e.Code="_|code|_",e.Paragraph="_|paragraph|_",e.H1="_|h1|_",e.H2="_|h2|_",e.H3="_|h3|_",e.H4="_|h4|_",e.H5="_|h5|_",e.H6="_|h6|_",e.TaskList="_|task|_",e.BulletList="_|bullet|_",e.OrderedList="_|number|_",e.Quote="_|quote|_",e.Divider="_|divider|_",e.Codeblock="_|codeblock|_",e.ClearFormatting="_|clear|_",e.Superscript="_|sup|_",e.Subscript="_|sub|_",e.LeftAlignment="_|left-align|_",e.CenterAlignment="_|center-align|_",e.RightAlignment="_|right-align|_",e.JustifyAlignment="_|justify-align|_",e.InsertLink="_|link|_",e.Find="_|find|_",e.FindBackwards="_|find-backwards|_",e.FindReplace="_|find-replace|_",e.AddFootnote="_|footnote|_",e.AddComment="_|comment|_",e.ContextMenu="_|context-menu|_",e.IncreaseFontSize="_|inc-font-size|_",e.DecreaseFontSize="_|dec-font-size|_",e.IncreaseIndent="_|indent|_",e.DecreaseIndent="_|dedent|_",e.Shortcuts="_|shortcuts|_",e.Copy="_|copy|_",e.Cut="_|cut|_",e.Paste="_|paste|_",e.PastePlain="_|paste-plain|_",e.SelectAll="_|select-all|_",e.Format="_|format|_",e))(q||{}),K=(e=>(e.PROD="RMR0000",e.UNKNOWN="RMR0001",e.INVALID_COMMAND_ARGUMENTS="RMR0002",e.CUSTOM="RMR0003",e.CORE_HELPERS="RMR0004",e.MUTATION="RMR0005",e.INTERNAL="RMR0006",e.MISSING_REQUIRED_EXTENSION="RMR0007",e.MANAGER_PHASE_ERROR="RMR0008",e.INVALID_GET_EXTENSION="RMR0010",e.INVALID_MANAGER_ARGUMENTS="RMR0011",e.SCHEMA="RMR0012",e.HELPERS_CALLED_IN_OUTER_SCOPE="RMR0013",e.INVALID_MANAGER_EXTENSION="RMR0014",e.DUPLICATE_COMMAND_NAMES="RMR0016",e.DUPLICATE_HELPER_NAMES="RMR0017",e.NON_CHAINABLE_COMMAND="RMR0018",e.INVALID_EXTENSION="RMR0019",e.INVALID_CONTENT="RMR0021",e.INVALID_NAME="RMR0050",e.EXTENSION="RMR0100",e.EXTENSION_SPEC="RMR0101",e.EXTENSION_EXTRA_ATTRIBUTES="RMR0102",e.INVALID_SET_EXTENSION_OPTIONS="RMR0103",e.REACT_PROVIDER_CONTEXT="RMR0200",e.REACT_GET_ROOT_PROPS="RMR0201",e.REACT_EDITOR_VIEW="RMR0202",e.REACT_CONTROLLED="RMR0203",e.REACT_NODE_VIEW="RMR0204",e.REACT_GET_CONTEXT="RMR0205",e.REACT_COMPONENTS="RMR0206",e.REACT_HOOKS="RMR0207",e.I18N_CONTEXT="RMR0300",e))(K||{}),R6=function(t){return P6(t)&&!N6(t)};function P6(e){return!!e&&typeof e=="object"}function N6(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||A6(e)}var $6=typeof Symbol=="function"&&Symbol.for,D6=$6?Symbol.for("react.element"):60103;function A6(e){return e.$$typeof===D6}function I6(e){return Array.isArray(e)?[]:{}}function qd(e,t){return t.clone!==!1&&t.isMergeableObject(e)?vc(I6(e),e,t):e}function L6(e,t,n){return e.concat(t).map(function(r){return qd(r,n)})}function j6(e,t){if(!t.customMerge)return vc;var n=t.customMerge(e);return typeof n=="function"?n:vc}function z6(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function Lk(e){return Object.keys(e).concat(z6(e))}function EM(e,t){try{return t in e}catch{return!1}}function F6(e,t){return EM(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function B6(e,t,n){var r={};return n.isMergeableObject(e)&&Lk(e).forEach(function(o){r[o]=qd(e[o],n)}),Lk(t).forEach(function(o){F6(e,o)||(EM(e,o)&&n.isMergeableObject(t[o])?r[o]=j6(o,n)(e[o],t[o],n):r[o]=qd(t[o],n))}),r}function vc(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||L6,n.isMergeableObject=n.isMergeableObject||R6,n.cloneUnlessOtherwiseSpecified=qd;var r=Array.isArray(t),o=Array.isArray(e),i=r===o;return i?r?n.arrayMerge(e,t,n):B6(e,t,n):qd(t,n)}vc.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,o){return vc(r,o,n)},{})};var V6=vc,U6=V6;const H6=Ri(U6);/*!
314
- * isobject <https://github.com/jonschlinkert/isobject>
315
- *
316
- * Copyright (c) 2014-2017, Jon Schlinkert.
317
- * Released under the MIT License.
318
- */var CM=function(t){return t!=null&&typeof t=="object"&&Array.isArray(t)===!1};/*!
319
- * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
320
- *
321
- * Copyright (c) 2014-2017, Jon Schlinkert.
322
- * Released under the MIT License.
323
- */var W6=CM;function jk(e){return W6(e)===!0&&Object.prototype.toString.call(e)==="[object Object]"}var K6=function(t){var n,r;return!(jk(t)===!1||(n=t.constructor,typeof n!="function")||(r=n.prototype,jk(r)===!1)||r.hasOwnProperty("isPrototypeOf")===!1)};/*!
324
- * is-extendable <https://github.com/jonschlinkert/is-extendable>
325
- *
326
- * Copyright (c) 2015-2017, Jon Schlinkert.
327
- * Released under the MIT License.
328
- */var q6=K6,G6=function(t){return q6(t)||typeof t=="function"||Array.isArray(t)};/*!
329
- * object.omit <https://github.com/jonschlinkert/object.omit>
330
- *
331
- * Copyright (c) 2014-2017, Jon Schlinkert.
332
- * Released under the MIT License.
333
- */var Y6=G6,X6=function(t,n,r){if(!Y6(t))return{};typeof n=="function"&&(r=n,n=[]),typeof n=="string"&&(n=[n]);for(var o=typeof r=="function",i=Object.keys(t),s={},a=0;a<i.length;a++){var l=i[a],c=t[l];(!n||n.indexOf(l)===-1&&(!o||r(c,l,t)))&&(s[l]=c)}return s};const e1=Ri(X6);/*!
334
- * object.pick <https://github.com/jonschlinkert/object.pick>
335
- *
336
- * Copyright (c) 2014-2015 Jon Schlinkert, contributors.
337
- * Licensed under the MIT License
338
- */var Z6=CM,J6=function(t,n){if(!Z6(t)&&typeof t!="function")return{};var r={};if(typeof n=="string")return n in t&&(r[n]=t[n]),r;for(var o=n.length,i=-1;++i<o;){var s=n[i];s in t&&(r[s]=t[s])}return r};const W0=Ri(J6),_M=/^[a-zà-öø-ÿ]+|[A-ZÀ-ÖØ-ß][a-zà-öø-ÿ]+|[a-zà-öø-ÿ]+|[0-9]+|[A-ZÀ-ÖØ-ß]+(?![a-zà-öø-ÿ])/g,Q6=/\S+/g;function e7(e,t){const n={parts:[],prefixes:[]},r=e.matchAll(t);let o=0;for(const s of r){if(typeof s.index!="number")continue;const a=s[0];n.parts.push(a);const l=e.slice(o,s.index).trim();n.prefixes.push(l),o=s.index+a.length}const i=e.slice(o).trim();return i&&(n.parts.push(""),n.prefixes.push(i)),n}function OM(e,t){const{keepSpecialCharacters:n=!1,keep:r,prefix:o=""}=t||{},i=e.trim().normalize("NFC"),s=i.includes(" "),l=e7(i,s?Q6:_M);return l.parts.map((c,u)=>{let d=l.prefixes[u]||"",f=c;return n===!1&&(r&&(f=f.normalize("NFD").replace(new RegExp(`[^a-zA-ZØßø0-9${r.join("")}]`,"g"),"")),r||(f=f.normalize("NFD").replace(/[^a-zA-ZØßø0-9]/g,""),d="")),r&&(d=d.replace(new RegExp(`[^${r.join("")}]`,"g"),"")),u===0?d+f:!d&&!f?"":s&&!d&&o.match(/\s/)?" "+f:(d||o)+f}).filter(Boolean)}function t7(e){const t=e.matchAll(_M).next().value,n=t?t.index:0;return e.slice(0,n+1).toUpperCase()+e.slice(n+1).toLowerCase()}function TM(e,t){return OM(e,t).reduce((n,r)=>n+t7(r),"")}function zk(e,t){return OM(e,{...t,prefix:"-"}).join("").toLowerCase()}function K0(e,t,n,r){var o,i=!1,s=0;function a(){o&&clearTimeout(o)}function l(){a(),i=!0}typeof t!="boolean"&&(r=n,n=t,t=void 0);function c(){for(var u=arguments.length,d=new Array(u),f=0;f<u;f++)d[f]=arguments[f];var h=this,m=Date.now()-s;if(i)return;function g(){s=Date.now(),n.apply(h,d)}function b(){o=void 0}r&&!o&&g(),a(),r===void 0&&m>e?g():t!==!0&&(o=setTimeout(r?b:g,r===void 0?e-m:e))}return c.cancel=l,c}function n7(e,t,n){return n===void 0?K0(e,t,!1):K0(e,n,t!==!1)}function vt(e,t,n){const r=e[t];return MM(!wg(r),n),r}function MM(e,t){if(!e)throw new r7(t)}var r7=class extends SM.BaseError{constructor(){super(...arguments),this.name="AssertionError"}};function jt(e){return Object.entries(e)}function Gd(e){return Object.keys(e)}function bg(e){return Object.values(e)}function go(e,t,n){return e.includes(t,n)}function ce(e){return Object.assign(Object.create(null),e)}function RM(e){return Object.prototype.toString.call(e)}function PM(e){return RM(e).slice(8,-1)}function Lf(e,t){return n=>typeof n!==e?!1:t?t(n):!0}function t1(e){return t=>PM(t)===e}var wg=Lf("undefined"),xe=Lf("string"),dr=Lf("number",e=>!Number.isNaN(e)),nt=Lf("function");function o7(e){return e===null}function i7(e){return e===!0||e===!1}function el(e){if(PM(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.getPrototypeOf({})}function s7(e){return e==null||/^[bns]/.test(typeof e)}function js(e){return o7(e)||wg(e)}function xn(e){return!js(e)&&(nt(e)||Lf("object")(e))}var a7=t1("RegExp");function l7(e){return t1("Map")(e)}function c7(e){return t1("Set")(e)}function om(e){return xn(e)&&!l7(e)&&!c7(e)&&Object.keys(e).length===0}var zt=Array.isArray;function zs(e){return zt(e)&&e.length===0}function Fk(e){return zt(e)&&e.length>0}function Sg(e,t,n=r=>!!r){t.lastIndex=0;const r=[],o=t.flags;let i;o.includes("g")||(t=new RegExp(t.source,`g${o}`));do i=t.exec(e),i&&r.push(i);while(n(i));return t.lastIndex=0,r}function im(){const e=Date.now(),t=im.last||e;return im.last=e>t?e:t+1}im.last=0;function sm(e=""){return`${e}${im().toString(36)}`}function u7(e){return e1(e,t=>!wg(t))}function d7(e){if(!el(e))throw new Error("An invalid value was passed into this clone utility. Expected a plain object");return{...e}}function Yd(e,t=!1){const n=t?[...e].reverse():e,r=new Set(n);return t?[...r].reverse():[...r]}function NM(){}function f7(...e){return H6.all(e,{isMergeableObject:el})}function p7({min:e,max:t,value:n}){return n<e?e:n>t?t:n}function h7(e){return e[e.length-1]}function Fa(e,t){return[...e].map((n,r)=>({value:n,index:r})).sort((n,r)=>t(n.value,r.value)||n.index-r.index).map(({value:n})=>n)}function m7(e,t,n){try{if(xe(t)&&t in e)return e[t];zt(t)&&(t=`['${t.join("']['")}']`);let r=e;return t.replace(/\[\s*(["'])(.*?)\1\s*]|^\s*(\w+)\s*(?=\.|\[|$)|\.\s*(\w*)\s*(?=\.|\[|$)|\[\s*(-?\d+)\s*]/g,(o,i,s,a,l,c)=>(r=r[s||a||l||c],"")),r===void 0?n:r}catch{return n}}function g7(e,t){const n=d7(t);let r=n;for(const[o,i]of e.entries()){const s=o>=e.length-1;let a=r[i];if(s){if(zt(r)){const l=Number.parseInt(i.toString(),10);dr(l)&&r.splice(l,1)}else Reflect.deleteProperty(r,i);return n}if(s7(a))return n;a=zt(a)?[...a]:{...a},r[i]=a,r=a}return n}function v7(e){return t=>m7(t,e)}function $M(e,t,n=!1){const r=[],o=new Set,i=nt(t)?t:v7(t),s=n?[...e].reverse():e;for(const a of s){const l=i(a);o.has(l)||(o.add(l),r.push(a))}return n?r.reverse():r}function DM(e,t){const n=zt(e)?e[0]:e;return dr(t)?n<=t?Array.from({length:t+1-n},(r,o)=>o+n):Array.from({length:n+1-t},(r,o)=>-1*o+n):Array.from({length:Math.abs(n)},(r,o)=>(n<0?-1:1)*o)}function Bk(e,...t){const n=t.filter(dr);return e>=Math.min(...n)&&e<=Math.max(...n)}function AM(e){return nt(e)?e():e}var IM="https://remirror.io/docs/errors",y7={[K.UNKNOWN]:"An error occurred but we're not quite sure why. 🧐",[K.INVALID_COMMAND_ARGUMENTS]:"The arguments passed to the command method were invalid.",[K.CUSTOM]:"This is a custom error, possibly thrown by an external library.",[K.CORE_HELPERS]:"An error occurred in a function called from the `@remirror/core-helpers` library.",[K.MUTATION]:"Mutation of immutable value detected.",[K.INTERNAL]:"This is an error which should not occur and is internal to the remirror codebase.",[K.MISSING_REQUIRED_EXTENSION]:"Your editor is missing a required extension.",[K.MANAGER_PHASE_ERROR]:"This occurs when accessing a method or property before it is available.",[K.INVALID_GET_EXTENSION]:"The user requested an invalid extension from the getExtensions method. Please check the `createExtensions` return method is returning an extension with the defined constructor.",[K.INVALID_MANAGER_ARGUMENTS]:"Invalid value(s) passed into `Manager` constructor. Only `Presets` and `Extensions` are supported.",[K.SCHEMA]:"There is a problem with the schema or you are trying to access a node / mark that doesn't exists.",[K.HELPERS_CALLED_IN_OUTER_SCOPE]:"The `helpers` method which is passed into the ``create*` method should only be called within returned method since it relies on an active view (not present in the outer scope).",[K.INVALID_MANAGER_EXTENSION]:"You requested an invalid extension from the manager.",[K.DUPLICATE_COMMAND_NAMES]:"Command method names must be unique within the editor.",[K.DUPLICATE_HELPER_NAMES]:"Helper method names must be unique within the editor.",[K.NON_CHAINABLE_COMMAND]:"Attempted to chain a non chainable command.",[K.INVALID_EXTENSION]:"The provided extension is invalid.",[K.INVALID_CONTENT]:"The content provided to the editor is not supported.",[K.INVALID_NAME]:"An invalid name was used for the extension.",[K.EXTENSION]:"An error occurred within an extension. More details should be made available.",[K.EXTENSION_SPEC]:"The spec was defined without calling the `defaults`, `parse` or `dom` methods.",[K.EXTENSION_EXTRA_ATTRIBUTES]:"Extra attributes must either be a string or an object.",[K.INVALID_SET_EXTENSION_OPTIONS]:"A call to `extension.setOptions` was made with invalid keys.",[K.REACT_PROVIDER_CONTEXT]:"`useRemirrorContext` was called outside of the `remirror` context. It can only be used within an active remirror context created by the `<Remirror />`.",[K.REACT_GET_ROOT_PROPS]:"`getRootProps` has been attached to the DOM more than once. It should only be attached to the dom once per editor.",[K.REACT_EDITOR_VIEW]:"A problem occurred adding the editor view to the dom.",[K.REACT_CONTROLLED]:"There is a problem with your controlled editor setup.",[K.REACT_NODE_VIEW]:"Something went wrong with your custom ReactNodeView Component.",[K.REACT_GET_CONTEXT]:"You attempted to call `getContext` provided by the `useRemirror` prop during the first render of the editor. This is not possible and should only be after the editor first mounts.",[K.REACT_COMPONENTS]:"An error occurred within a remirror component.",[K.REACT_HOOKS]:"An error occurred within a remirror hook.",[K.I18N_CONTEXT]:"You called `useI18n()` outside of an `I18nProvider` context."};function x7(e){return xe(e)&&go(bg(K),e)}function b7(e,t){const n=y7[e],r=n?`${n}
339
-
340
- `:"",o=t?`${t}
341
-
342
- `:"";return`${r}${o}For more information visit ${IM}#${e.toLowerCase()}`}var LM=class extends SM.BaseError{constructor({code:e,message:t,disableLogging:n=!1}={}){const r=x7(e)?e:K.CUSTOM;super(b7(r,t)),this.errorCode=r,this.url=`${IM}#${r.toLowerCase()}`,n||console.error(this.message)}static create(e={}){return new LM(e)}};function he(e,t){if(!e)throw LM.create(t)}function ya(e,t={}){return e}function en(e){this.content=e}en.prototype={constructor:en,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,o=r.find(e),i=r.content.slice();return o==-1?i.push(n||e,t):(i[o+1]=t,n&&(i[o]=n)),new en(i)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new en(n)},addToStart:function(e,t){return new en([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new en(n)},addBefore:function(e,t,n){var r=this.remove(t),o=r.content.slice(),i=r.find(e);return o.splice(i==-1?o.length:i,0,t,n),new en(o)},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=en.from(e),e.size?new en(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=en.from(e),e.size?new en(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=en.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}};en.from=function(e){if(e instanceof en)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new en(t)};function jM(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let o=e.child(r),i=t.child(r);if(o==i){n+=o.nodeSize;continue}if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(let s=0;o.text[s]==i.text[s];s++)n++;return n}if(o.content.size||i.content.size){let s=jM(o.content,i.content,n+1);if(s!=null)return s}n+=o.nodeSize}}function zM(e,t,n,r){for(let o=e.childCount,i=t.childCount;;){if(o==0||i==0)return o==i?null:{a:n,b:r};let s=e.child(--o),a=t.child(--i),l=s.nodeSize;if(s==a){n-=l,r-=l;continue}if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let c=0,u=Math.min(s.text.length,a.text.length);for(;c<u&&s.text[s.text.length-c-1]==a.text[a.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){let c=zM(s.content,a.content,n-1,r-1);if(c)return c}n-=l,r-=l}}class L{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let r=0;r<t.length;r++)this.size+=t[r].nodeSize}nodesBetween(t,n,r,o=0,i){for(let s=0,a=0;a<n;s++){let l=this.content[s],c=a+l.nodeSize;if(c>t&&r(l,o+a,i||null,s)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,t-u),Math.min(l.content.size,n-u),r,o+u)}a=c}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,r,o){let i="",s=!0;return this.nodesBetween(t,n,(a,l)=>{let c=a.isText?a.text.slice(Math.max(t,l)-l,n-l):a.isLeaf?o?typeof o=="function"?o(a):o:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&r&&(s?s=!1:i+=r),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,o=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(o[o.length-1]=n.withText(n.text+r.text),i=1);i<t.content.length;i++)o.push(t.content[i]);return new L(o,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],o=0;if(n>t)for(let i=0,s=0;s<n;i++){let a=this.content[i],l=s+a.nodeSize;l>t&&((s<t||l>n)&&(a.isText?a=a.cut(Math.max(0,t-s),Math.min(a.text.length,n-s)):a=a.cut(Math.max(0,t-s-1),Math.min(a.content.size,n-s-1))),r.push(a),o+=a.nodeSize),s=l}return new L(r,o)}cutByIndex(t,n){return t==n?L.empty:t==0&&n==this.content.length?this:new L(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let o=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return o[t]=n,new L(o,i)}addToStart(t){return new L([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new L(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(t.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let n=this.content[t];if(!n)throw new RangeError("Index "+t+" out of range for "+this);return n}maybeChild(t){return this.content[t]||null}forEach(t){for(let n=0,r=0;n<this.content.length;n++){let o=this.content[n];t(o,r,n),r+=o.nodeSize}}findDiffStart(t,n=0){return jM(this,t,n)}findDiffEnd(t,n=this.size,r=t.size){return zM(this,t,n,r)}findIndex(t,n=-1){if(t==0)return _p(0,t);if(t==this.size)return _p(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let r=0,o=0;;r++){let i=this.child(r),s=o+i.nodeSize;if(s>=t)return s==t||n>0?_p(r+1,s):_p(r,o);o=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return L.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new L(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return L.empty;let n,r=0;for(let o=0;o<t.length;o++){let i=t[o];r+=i.nodeSize,o&&i.isText&&t[o-1].sameMarkup(i)?(n||(n=t.slice(0,o)),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new L(n||t,r)}static from(t){if(!t)return L.empty;if(t instanceof L)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new L([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}L.empty=new L([],0);const Uv={index:0,offset:0};function _p(e,t){return Uv.index=e,Uv.offset=t,Uv}function am(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 r=0;r<e.length;r++)if(!am(e[r],t[r]))return!1}else{for(let r in e)if(!(r in t)||!am(e[r],t[r]))return!1;for(let r in t)if(!(r in e))return!1}return!0}class Be{constructor(t,n){this.type=t,this.attrs=n}addToSet(t){let n,r=!1;for(let o=0;o<t.length;o++){let i=t[o];if(this.eq(i))return t;if(this.type.excludes(i.type))n||(n=t.slice(0,o));else{if(i.type.excludes(this.type))return t;!r&&i.type.rank>this.type.rank&&(n||(n=t.slice(0,o)),n.push(this),r=!0),n&&n.push(i)}}return n||(n=t.slice()),r||n.push(this),n}removeFromSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return t.slice(0,n).concat(t.slice(n+1));return t}isInSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return!0;return!1}eq(t){return this==t||this.type==t.type&&am(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=t.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);return r.create(n.attrs)}static sameSet(t,n){if(t==n)return!0;if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].eq(n[r]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return Be.none;if(t instanceof Be)return[t];let n=t.slice();return n.sort((r,o)=>r.type.rank-o.type.rank),n}}Be.none=[];class lm extends Error{}class Y{constructor(t,n,r){this.content=t,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=BM(this.content,t+this.openStart,n);return r&&new Y(r,this.openStart,this.openEnd)}removeBetween(t,n){return new Y(FM(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return Y.empty;let r=n.openStart||0,o=n.openEnd||0;if(typeof r!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Y(L.fromJSON(t,n.content),r,o)}static maxOpen(t,n=!0){let r=0,o=0;for(let i=t.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=t.lastChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.lastChild)o++;return new Y(t,r,o)}}Y.empty=new Y(L.empty,0,0);function FM(e,t,n){let{index:r,offset:o}=e.findIndex(t),i=e.maybeChild(r),{index:s,offset:a}=e.findIndex(n);if(o==t||i.isText){if(a!=n&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(r,i.copy(FM(i.content,t-o-1,n-o-1)))}function BM(e,t,n,r){let{index:o,offset:i}=e.findIndex(t),s=e.maybeChild(o);if(i==t||s.isText)return r&&!r.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let a=BM(s.content,t-i-1,n);return a&&e.replaceChild(o,s.copy(a))}function w7(e,t,n){if(n.openStart>e.depth)throw new lm("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new lm("Inconsistent open depths");return VM(e,t,n,0)}function VM(e,t,n,r){let o=e.index(r),i=e.node(r);if(o==t.index(r)&&r<e.depth-n.openStart){let s=VM(e,t,n,r+1);return i.copy(i.content.replaceChild(o,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let s=e.parent,a=s.content;return _a(s,a.cut(0,e.parentOffset).append(n.content).append(a.cut(t.parentOffset)))}else{let{start:s,end:a}=S7(n,e);return _a(i,HM(e,s,a,t,r))}else return _a(i,cm(e,t,r))}function UM(e,t){if(!t.type.compatibleContent(e.type))throw new lm("Cannot join "+t.type.name+" onto "+e.type.name)}function q0(e,t,n){let r=e.node(n);return UM(r,t.node(n)),r}function Ca(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 ld(e,t,n,r){let o=(t||e).node(n),i=0,s=t?t.index(n):o.childCount;e&&(i=e.index(n),e.depth>n?i++:e.textOffset&&(Ca(e.nodeAfter,r),i++));for(let a=i;a<s;a++)Ca(o.child(a),r);t&&t.depth==n&&t.textOffset&&Ca(t.nodeBefore,r)}function _a(e,t){return e.type.checkContent(t),e.copy(t)}function HM(e,t,n,r,o){let i=e.depth>o&&q0(e,t,o+1),s=r.depth>o&&q0(n,r,o+1),a=[];return ld(null,e,o,a),i&&s&&t.index(o)==n.index(o)?(UM(i,s),Ca(_a(i,HM(e,t,n,r,o+1)),a)):(i&&Ca(_a(i,cm(e,t,o+1)),a),ld(t,n,o,a),s&&Ca(_a(s,cm(n,r,o+1)),a)),ld(r,null,o,a),new L(a)}function cm(e,t,n){let r=[];if(ld(null,e,n,r),e.depth>n){let o=q0(e,t,n+1);Ca(_a(o,cm(e,t,n+1)),r)}return ld(t,null,n,r),new L(r)}function S7(e,t){let n=t.depth-e.openStart,o=t.node(n).copy(e.content);for(let i=n-1;i>=0;i--)o=t.node(i).copy(L.from(o));return{start:o.resolveNoCache(e.openStart+n),end:o.resolveNoCache(o.content.size-e.openEnd-n)}}class yc{constructor(t,n,r){this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let r=this.pos-this.path[this.path.length-1],o=t.child(n);return r?t.child(n).cut(r):o}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let r=this.path[n*3],o=n==0?0:this.path[n*3-1]+1;for(let i=0;i<t;i++)o+=r.child(i).nodeSize;return o}marks(){let t=this.parent,n=this.index();if(t.content.size==0)return Be.none;if(this.textOffset)return t.child(n).marks;let r=t.maybeChild(n-1),o=t.maybeChild(n);if(!r){let a=r;r=o,o=a}let i=r.marks;for(var s=0;s<i.length;s++)i[s].type.spec.inclusive===!1&&(!o||!i[s].isInSet(o.marks))&&(i=i[s--].removeFromSet(i));return i}marksAcross(t){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,o=t.parent.maybeChild(t.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!o||!r[i].isInSet(o.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(t){for(let n=this.depth;n>0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos<this.pos)return t.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);r>=0;r--)if(t.pos<=this.end(r)&&(!n||n(this.node(r))))return new Ba(this,t,r);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let n=1;n<=this.depth;n++)t+=(t?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return t+":"+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let r=[],o=0,i=n;for(let s=t;;){let{index:a,offset:l}=s.content.findIndex(i),c=i-l;if(r.push(s,a,o+l),!c||(s=s.child(a),s.isText))break;i=c-1,o+=l+1}return new yc(n,r,i)}static resolveCached(t,n){for(let o=0;o<Hv.length;o++){let i=Hv[o];if(i.pos==n&&i.doc==t)return i}let r=Hv[Wv]=yc.resolve(t,n);return Wv=(Wv+1)%k7,r}}let Hv=[],Wv=0,k7=12;class Ba{constructor(t,n,r){this.$from=t,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const E7=Object.create(null);let Ts=class G0{constructor(t,n,r,o=Be.none){this.type=t,this.attrs=n,this.marks=o,this.content=r||L.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,n,r,o=0){this.content.nodesBetween(t,n,r,o,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,n,r,o){return this.content.textBetween(t,n,r,o)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,n,r){return this.type==t&&am(this.attrs,n||t.defaultAttrs||E7)&&Be.sameSet(this.marks,r||Be.none)}copy(t=null){return t==this.content?this:new G0(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new G0(this.type,this.attrs,this.content,t)}cut(t,n=this.content.size){return t==0&&n==this.content.size?this:this.copy(this.content.cut(t,n))}slice(t,n=this.content.size,r=!1){if(t==n)return Y.empty;let o=this.resolve(t),i=this.resolve(n),s=r?0:o.sharedDepth(n),a=o.start(s),c=o.node(s).content.cut(o.pos-a,i.pos-a);return new Y(c,o.depth-s,i.depth-s)}replace(t,n,r){return w7(this.resolve(t),this.resolve(n),r)}nodeAt(t){for(let n=this;;){let{index:r,offset:o}=n.content.findIndex(t);if(n=n.maybeChild(r),!n)return null;if(o==t||n.isText)return n;t-=o+1}}childAfter(t){let{index:n,offset:r}=this.content.findIndex(t);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(t){if(t==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(t);if(r<t)return{node:this.content.child(n),index:n,offset:r};let o=this.content.child(n-1);return{node:o,index:n-1,offset:r-o.nodeSize}}resolve(t){return yc.resolveCached(this,t)}resolveNoCache(t){return yc.resolve(this,t)}rangeHasMark(t,n,r){let o=!1;return n>t&&this.nodesBetween(t,n,i=>(r.isInSet(i.marks)&&(o=!0),!o)),o}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),WM(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,r=L.empty,o=0,i=r.childCount){let s=this.contentMatchAt(t).matchFragment(r,o,i),a=s&&s.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=o;l<i;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(t,n,r,o){if(o&&!this.type.allowsMarks(o))return!1;let i=this.contentMatchAt(t).matchType(r),s=i&&i.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content);let t=Be.none;for(let n=0;n<this.marks.length;n++)t=this.marks[n].addToSet(t);if(!Be.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,r)}let o=L.fromJSON(t,n.content);return t.nodeType(n.type).create(n.attrs,o,r)}};Ts.prototype.text=void 0;class um extends Ts{constructor(t,n,r,o){if(super(t,n,null,o),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):WM(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new um(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new um(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function WM(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class Va{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new C7(t,n);if(r.next==null)return Va.empty;let o=KM(r);r.next&&r.err("Unexpected trailing text");let i=N7(P7(o));return $7(i,r),i}matchType(t){for(let n=0;n<this.next.length;n++)if(this.next[n].type==t)return this.next[n].next;return null}matchFragment(t,n=0,r=t.childCount){let o=this;for(let i=n;o&&i<r;i++)o=o.matchType(t.child(i).type);return o}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:n}=this.next[t];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(t){for(let n=0;n<this.next.length;n++)for(let r=0;r<t.next.length;r++)if(this.next[n].type==t.next[r].type)return!0;return!1}fillBefore(t,n=!1,r=0){let o=[this];function i(s,a){let l=s.matchFragment(t,r);if(l&&(!n||l.validEnd))return L.from(a.map(c=>c.createAndFill()));for(let c=0;c<s.next.length;c++){let{type:u,next:d}=s.next[c];if(!(u.isText||u.hasRequiredAttrs())&&o.indexOf(d)==-1){o.push(d);let f=i(d,a.concat(u));if(f)return f}}return null}return i(this,[])}findWrapping(t){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==t)return this.wrapCache[r+1];let n=this.computeWrapping(t);return this.wrapCache.push(t,n),n}computeWrapping(t){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let o=r.shift(),i=o.match;if(i.matchType(t)){let s=[];for(let a=o;a.type;a=a.via)s.push(a.type);return s.reverse()}for(let s=0;s<i.next.length;s++){let{type:a,next:l}=i.next[s];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!o.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:o}),n[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(r){t.push(r);for(let o=0;o<r.next.length;o++)t.indexOf(r.next[o].next)==-1&&n(r.next[o].next)}return n(this),t.map((r,o)=>{let i=o+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)i+=(s?", ":"")+r.next[s].type.name+"->"+t.indexOf(r.next[s].next);return i}).join(`
343
- `)}}Va.empty=new Va(!0);class C7{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.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(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function KM(e){let t=[];do t.push(_7(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function _7(e){let t=[];do t.push(O7(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function O7(e){let t=R7(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=T7(e,t);else break;return t}function Vk(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function T7(e,t){let n=Vk(e),r=n;return e.eat(",")&&(e.next!="}"?r=Vk(e):r=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function M7(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let o=[];for(let i in n){let s=n[i];s.groups.indexOf(t)>-1&&o.push(s)}return o.length==0&&e.err("No node type or group '"+t+"' found"),o}function R7(e){if(e.eat("(")){let t=KM(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=M7(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function P7(e){let t=[[]];return o(i(e,0),n()),t;function n(){return t.push([])-1}function r(s,a,l){let c={term:l,to:a};return t[s].push(c),c}function o(s,a){s.forEach(l=>l.to=a)}function i(s,a){if(s.type=="choice")return s.exprs.reduce((l,c)=>l.concat(i(c,a)),[]);if(s.type=="seq")for(let l=0;;l++){let c=i(s.exprs[l],a);if(l==s.exprs.length-1)return c;o(c,a=n())}else if(s.type=="star"){let l=n();return r(a,l),o(i(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=n();return o(i(s.expr,a),l),o(i(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(a)].concat(i(s.expr,a));if(s.type=="range"){let l=a;for(let c=0;c<s.min;c++){let u=n();o(i(s.expr,l),u),l=u}if(s.max==-1)o(i(s.expr,l),l);else for(let c=s.min;c<s.max;c++){let u=n();r(l,u),o(i(s.expr,l),u),l=u}return[r(l)]}else{if(s.type=="name")return[r(a,void 0,s.value)];throw new Error("Unknown expr type")}}}}function qM(e,t){return t-e}function Uk(e,t){let n=[];return r(t),n.sort(qM);function r(o){let i=e[o];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(o);for(let s=0;s<i.length;s++){let{term:a,to:l}=i[s];!a&&n.indexOf(l)==-1&&r(l)}}}function N7(e){let t=Object.create(null);return n(Uk(e,0));function n(r){let o=[];r.forEach(s=>{e[s].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let u=0;u<o.length;u++)o[u][0]==a&&(c=o[u][1]);Uk(e,l).forEach(u=>{c||o.push([a,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let i=t[r.join(",")]=new Va(r.indexOf(e.length-1)>-1);for(let s=0;s<o.length;s++){let a=o[s][1].sort(qM);i.next.push({type:o[s][0],next:t[a.join(",")]||n(a)})}return i}}function $7(e,t){for(let n=0,r=[e];n<r.length;n++){let o=r[n],i=!o.validEnd,s=[];for(let a=0;a<o.next.length;a++){let{type:l,next:c}=o.next[a];s.push(l.name),i&&!(l.isText||l.hasRequiredAttrs())&&(i=!1),r.indexOf(c)==-1&&r.push(c)}i&&t.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function GM(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 YM(e,t){let n=Object.create(null);for(let r in e){let o=t&&t[r];if(o===void 0){let i=e[r];if(i.hasDefault)o=i.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=o}return n}function XM(e){let t=Object.create(null);if(e)for(let n in e)t[n]=new D7(e[n]);return t}let Y0=class ZM{constructor(t,n,r){this.name=t,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=XM(r.attrs),this.defaultAttrs=GM(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||t=="text"),this.isText=t=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Va.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:YM(this.attrs,t)}create(t=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Ts(this,this.computeAttrs(t),L.from(n),Be.setFrom(r))}createChecked(t=null,n,r){return n=L.from(n),this.checkContent(n),new Ts(this,this.computeAttrs(t),n,Be.setFrom(r))}createAndFill(t=null,n,r){if(t=this.computeAttrs(t),n=L.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let o=this.contentMatch.matchFragment(n),i=o&&o.fillBefore(L.empty,!0);return i?new Ts(this,t,n.append(i),Be.setFrom(r)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let r=0;r<t.childCount;r++)if(!this.allowsMarks(t.child(r).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw new RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}allowsMarkType(t){return this.markSet==null||this.markSet.indexOf(t)>-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;n<t.length;n++)if(!this.allowsMarkType(t[n].type))return!1;return!0}allowedMarks(t){if(this.markSet==null)return t;let n;for(let r=0;r<t.length;r++)this.allowsMarkType(t[r].type)?n&&n.push(t[r]):n||(n=t.slice(0,r));return n?n.length?n:Be.none:t}static compile(t,n){let r=Object.create(null);t.forEach((i,s)=>r[i]=new ZM(i,n,s));let o=n.spec.topNode||"doc";if(!r[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class D7{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class jf{constructor(t,n,r,o){this.name=t,this.rank=n,this.schema=r,this.spec=o,this.attrs=XM(o.attrs),this.excluded=null;let i=GM(this.attrs);this.instance=i?new Be(this,i):null}create(t=null){return!t&&this.instance?this.instance:new Be(this,YM(this.attrs,t))}static compile(t,n){let r=Object.create(null),o=0;return t.forEach((i,s)=>r[i]=new jf(i,o++,n,s)),r}removeFromSet(t){for(var n=0;n<t.length;n++)t[n].type==this&&(t=t.slice(0,n).concat(t.slice(n+1)),n--);return t}isInSet(t){for(let n=0;n<t.length;n++)if(t[n].type==this)return t[n]}excludes(t){return this.excluded.indexOf(t)>-1}}class A7{constructor(t){this.cached=Object.create(null);let n=this.spec={};for(let o in t)n[o]=t[o];n.nodes=en.from(t.nodes),n.marks=en.from(t.marks||{}),this.nodes=Y0.compile(this.spec.nodes,this),this.marks=jf.compile(this.spec.marks,this);let r=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let i=this.nodes[o],s=i.spec.content||"",a=i.spec.marks;i.contentMatch=r[s]||(r[s]=Va.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.markSet=a=="_"?null:a?Hk(this,a.split(" ")):a==""||!i.inlineContent?[]:null}for(let o in this.marks){let i=this.marks[o],s=i.spec.excludes;i.excluded=s==null?[i]:s==""?[]:Hk(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,r,o){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof Y0){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,r,o)}text(t,n){let r=this.nodes.text;return new um(r,r.defaultAttrs,t,Be.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeFromJSON(t){return Ts.fromJSON(this,t)}markFromJSON(t){return Be.fromJSON(this,t)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}}function Hk(e,t){let n=[];for(let r=0;r<t.length;r++){let o=t[r],i=e.marks[o],s=i;if(i)n.push(i);else for(let a in e.marks){let l=e.marks[a];(o=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(o)>-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class xc{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[],n.forEach(r=>{r.tag?this.tags.push(r):r.style&&this.styles.push(r)}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let o=t.nodes[r.node];return o.contentMatch.matchType(o)})}parse(t,n={}){let r=new Kk(this,n,!1);return r.addAll(t,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new Kk(this,n,!0);return r.addAll(t,n.from,n.to),Y.maxOpen(r.finish())}matchTag(t,n,r){for(let o=r?this.tags.indexOf(r)+1:0;o<this.tags.length;o++){let i=this.tags[o];if(j7(t,i.tag)&&(i.namespace===void 0||t.namespaceURI==i.namespace)&&(!i.context||n.matchesContext(i.context))){if(i.getAttrs){let s=i.getAttrs(t);if(s===!1)continue;i.attrs=s||void 0}return i}}}matchStyle(t,n,r,o){for(let i=o?this.styles.indexOf(o)+1:0;i<this.styles.length;i++){let s=this.styles[i],a=s.style;if(!(a.indexOf(t)!=0||s.context&&!r.matchesContext(s.context)||a.length>t.length&&(a.charCodeAt(t.length)!=61||a.slice(t.length+1)!=n))){if(s.getAttrs){let l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(t){let n=[];function r(o){let i=o.priority==null?50:o.priority,s=0;for(;s<n.length;s++){let a=n[s];if((a.priority==null?50:a.priority)<i)break}n.splice(s,0,o)}for(let o in t.marks){let i=t.marks[o].spec.parseDOM;i&&i.forEach(s=>{r(s=qk(s)),s.mark||s.ignore||s.clearMark||(s.mark=o)})}for(let o in t.nodes){let i=t.nodes[o].spec.parseDOM;i&&i.forEach(s=>{r(s=qk(s)),s.node||s.ignore||s.mark||(s.node=o)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new xc(t,xc.schemaRules(t)))}}const JM={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},I7={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},QM={ol:!0,ul:!0},dm=1,fm=2,cd=4;function Wk(e,t,n){return t!=null?(t?dm:0)|(t==="full"?fm:0):e&&e.whitespace=="pre"?dm|fm:n&~cd}class Op{constructor(t,n,r,o,i,s,a){this.type=t,this.attrs=n,this.marks=r,this.pendingMarks=o,this.solid=i,this.options=a,this.content=[],this.activeMarks=Be.none,this.stashMarks=[],this.match=s||(a&cd?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(L.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,o;return(o=r.findWrapping(t.type))?(this.match=r,o):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&dm)){let r=this.content[this.content.length-1],o;if(r&&r.isText&&(o=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-o[0].length))}}let n=L.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(L.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}popFromStashMark(t){for(let n=this.stashMarks.length-1;n>=0;n--)if(t.eq(this.stashMarks[n]))return this.stashMarks.splice(n,1)[0]}applyPending(t){for(let n=0,r=this.pendingMarks;n<r.length;n++){let o=r[n];(this.type?this.type.allowsMarkType(o.type):F7(o.type,t))&&!o.isInSet(this.activeMarks)&&(this.activeMarks=o.addToSet(this.activeMarks),this.pendingMarks=o.removeFromSet(this.pendingMarks))}}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!JM.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class Kk{constructor(t,n,r){this.parser=t,this.options=n,this.isOpen=r,this.open=0;let o=n.topNode,i,s=Wk(null,n.preserveWhitespace,0)|(r?cd:0);o?i=new Op(o.type,o.attrs,Be.none,Be.none,!0,n.topMatch||o.type.contentMatch,s):r?i=new Op(null,null,Be.none,Be.none,!0,null,s):i=new Op(t.schema.topNodeType,null,Be.none,Be.none,!0,null,s),this.nodes=[i],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t){t.nodeType==3?this.addTextNode(t):t.nodeType==1&&this.addElement(t)}withStyleRules(t,n){let r=t.getAttribute("style");if(!r)return n();let o=this.readStyles(z7(r));if(!o)return;let[i,s]=o,a=this.top;for(let l=0;l<s.length;l++)this.removePendingMark(s[l],a);for(let l=0;l<i.length;l++)this.addPendingMark(i[l]);n();for(let l=0;l<i.length;l++)this.removePendingMark(i[l],a);for(let l=0;l<s.length;l++)this.addPendingMark(s[l])}addTextNode(t){let n=t.nodeValue,r=this.top;if(r.options&fm||r.inlineContext(t)||/[^ \t\r\n\u000c]/.test(n)){if(r.options&dm)r.options&fm?n=n.replace(/\r\n?/g,`
344
- `):n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let o=r.content[r.content.length-1],i=t.previousSibling;(!o||i&&i.nodeName=="BR"||o.isText&&/[ \t\r\n\u000c]$/.test(o.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n)),this.findInText(t)}else this.findInside(t)}addElement(t,n){let r=t.nodeName.toLowerCase(),o;QM.hasOwnProperty(r)&&this.parser.normalizeLists&&L7(t);let i=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(o=this.parser.matchTag(t,this,n));if(i?i.ignore:I7.hasOwnProperty(r))this.findInside(t),this.ignoreFallback(t);else if(!i||i.skip||i.closeParent){i&&i.closeParent?this.open=Math.max(0,this.open-1):i&&i.skip.nodeType&&(t=i.skip);let s,a=this.top,l=this.needsBlock;if(JM.hasOwnProperty(r))a.content.length&&a.content[0].isInline&&this.open&&(this.open--,a=this.top),s=!0,a.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t);return}i&&i.skip?this.addAll(t):this.withStyleRules(t,()=>this.addAll(t)),s&&this.sync(a),this.needsBlock=l}else this.withStyleRules(t,()=>{this.addElementByRule(t,i,i.consuming===!1?o:void 0)})}leafFallback(t){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(`
345
- `))}ignoreFallback(t){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(t){let n=Be.none,r=Be.none;for(let o=0;o<t.length;o+=2)for(let i=void 0;;){let s=this.parser.matchStyle(t[o],t[o+1],this,i);if(!s)break;if(s.ignore)return null;if(s.clearMark?this.top.pendingMarks.concat(this.top.activeMarks).forEach(a=>{s.clearMark(a)&&(r=a.addToSet(r))}):n=this.parser.schema.marks[s.mark].create(s.attrs).addToSet(n),s.consuming===!1)i=s;else break}return[n,r]}addElementByRule(t,n,r){let o,i,s;n.node?(i=this.parser.schema.nodes[n.node],i.isLeaf?this.insertNode(i.create(n.attrs))||this.leafFallback(t):o=this.enter(i,n.attrs||null,n.preserveWhitespace)):(s=this.parser.schema.marks[n.mark].create(n.attrs),this.addPendingMark(s));let a=this.top;if(i&&i.isLeaf)this.findInside(t);else if(r)this.addElement(t,r);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(l=>this.insertNode(l));else{let l=t;typeof n.contentElement=="string"?l=t.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(t):n.contentElement&&(l=n.contentElement),this.findAround(t,l,!0),this.addAll(l)}o&&this.sync(a)&&this.open--,s&&this.removePendingMark(s,a)}addAll(t,n,r){let o=n||0;for(let i=n?t.childNodes[n]:t.firstChild,s=r==null?null:t.childNodes[r];i!=s;i=i.nextSibling,++o)this.findAtPoint(t,o),this.addDOM(i);this.findAtPoint(t,o)}findPlace(t){let n,r;for(let o=this.open;o>=0;o--){let i=this.nodes[o],s=i.findWrapping(t);if(s&&(!n||n.length>s.length)&&(n=s,r=i,!s.length)||i.solid)break}if(!n)return!1;this.sync(r);for(let o=0;o<n.length;o++)this.enterInner(n[o],null,!1);return!0}insertNode(t){if(t.isInline&&this.needsBlock&&!this.top.type){let n=this.textblockFromContext();n&&this.enterInner(n)}if(this.findPlace(t)){this.closeExtra();let n=this.top;n.applyPending(t.type),n.match&&(n.match=n.match.matchType(t.type));let r=n.activeMarks;for(let o=0;o<t.marks.length;o++)(!n.type||n.type.allowsMarkType(t.marks[o].type))&&(r=t.marks[o].addToSet(r));return n.content.push(t.mark(r)),!0}return!1}enter(t,n,r){let o=this.findPlace(t.create(n));return o&&this.enterInner(t,n,!0,r),o}enterInner(t,n=null,r=!1,o){this.closeExtra();let i=this.top;i.applyPending(t),i.match=i.match&&i.match.matchType(t);let s=Wk(t,o,i.options);i.options&cd&&i.content.length==0&&(s|=cd),this.nodes.push(new Op(t,n,i.activeMarks,i.pendingMarks,r,null,s)),this.open++}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));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(t){for(let n=this.open;n>=0;n--)if(this.nodes[n]==t)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let o=r.length-1;o>=0;o--)t+=r[o].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==t&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&t.nodeType==1&&t.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(t,n,r){if(t!=n&&this.find)for(let o=0;o<this.find.length;o++)this.find[o].pos==null&&t.nodeType==1&&t.contains(this.find[o].node)&&n.compareDocumentPosition(this.find[o].node)&(r?2:4)&&(this.find[o].pos=this.currentPos)}findInText(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&(this.find[n].pos=this.currentPos-(t.nodeValue.length-this.find[n].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),r=this.options.context,o=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1),s=(a,l)=>{for(;a>=0;a--){let c=n[a];if(c==""){if(a==n.length-1||a==0)continue;for(;l>=i;l--)if(s(a-1,l))return!0;return!1}else{let u=l>0||l==0&&o?this.nodes[l].type:r&&l>=i?r.node(l-i).type:null;if(!u||u.name!=c&&u.groups.indexOf(c)==-1)return!1;l--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(t){let n=B7(t,this.top.pendingMarks);n&&this.top.stashMarks.push(n),this.top.pendingMarks=t.addToSet(this.top.pendingMarks)}removePendingMark(t,n){for(let r=this.open;r>=0;r--){let o=this.nodes[r];if(o.pendingMarks.lastIndexOf(t)>-1)o.pendingMarks=t.removeFromSet(o.pendingMarks);else{o.activeMarks=t.removeFromSet(o.activeMarks);let s=o.popFromStashMark(t);s&&o.type&&o.type.allowsMarkType(s.type)&&(o.activeMarks=s.addToSet(o.activeMarks))}if(o==n)break}}}function L7(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&QM.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):r=="li"?n=t:r&&(n=null)}}function j7(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function z7(e){let t=/\s*([\w-]+)\s*:\s*([^;]+)/g,n,r=[];for(;n=t.exec(e);)r.push(n[1],n[2].trim());return r}function qk(e){let t={};for(let n in e)t[n]=e[n];return t}function F7(e,t){let n=t.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(e))continue;let i=[],s=a=>{i.push(a);for(let l=0;l<a.edgeCount;l++){let{type:c,next:u}=a.edge(l);if(c==t||i.indexOf(u)<0&&s(u))return!0}};if(s(o.contentMatch))return!0}}function B7(e,t){for(let n=0;n<t.length;n++)if(e.eq(t[n]))return t[n]}class oo{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},r){r||(r=Kv(n).createDocumentFragment());let o=r,i=[];return t.forEach(s=>{if(i.length||s.marks.length){let a=0,l=0;for(;a<i.length&&l<s.marks.length;){let c=s.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(i[a][0])||c.type.spec.spanning===!1)break;a++,l++}for(;a<i.length;)o=i.pop()[1];for(;l<s.marks.length;){let c=s.marks[l++],u=this.serializeMark(c,s.isInline,n);u&&(i.push([c,o]),o.appendChild(u.dom),o=u.contentDOM||u.dom)}}o.appendChild(this.serializeNodeInner(s,n))}),r}serializeNodeInner(t,n){let{dom:r,contentDOM:o}=oo.renderSpec(Kv(n),this.nodes[t.type.name](t));if(o){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,n,o)}return r}serializeNode(t,n={}){let r=this.serializeNodeInner(t,n);for(let o=t.marks.length-1;o>=0;o--){let i=this.serializeMark(t.marks[o],t.isInline,n);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(t,n,r={}){let o=this.marks[t.type.name];return o&&oo.renderSpec(Kv(r),o(t,n))}static renderSpec(t,n,r=null){if(typeof n=="string")return{dom:t.createTextNode(n)};if(n.nodeType!=null)return{dom:n};if(n.dom&&n.dom.nodeType!=null)return n;let o=n[0],i=o.indexOf(" ");i>0&&(r=o.slice(0,i),o=o.slice(i+1));let s,a=r?t.createElementNS(r,o):t.createElement(o),l=n[1],c=1;if(l&&typeof l=="object"&&l.nodeType==null&&!Array.isArray(l)){c=2;for(let u in l)if(l[u]!=null){let d=u.indexOf(" ");d>0?a.setAttributeNS(u.slice(0,d),u.slice(d+1),l[u]):a.setAttribute(u,l[u])}}for(let u=c;u<n.length;u++){let d=n[u];if(d===0){if(u<n.length-1||u>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:f,contentDOM:h}=oo.renderSpec(t,d,r);if(a.appendChild(f),h){if(s)throw new RangeError("Multiple content holes");s=h}}}return{dom:a,contentDOM:s}}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new oo(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=Gk(t.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(t){return Gk(t.marks)}}function Gk(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function Kv(e){return e.document||window.document}const eR=65535,tR=Math.pow(2,16);function V7(e,t){return e+t*tR}function Yk(e){return e&eR}function U7(e){return(e-(e&eR))/tR}const nR=1,rR=2,th=4,oR=8;class X0{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&oR)>0}get deletedBefore(){return(this.delInfo&(nR|th))>0}get deletedAfter(){return(this.delInfo&(rR|th))>0}get deletedAcross(){return(this.delInfo&th)>0}}class or{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&or.empty)return or.empty}recover(t){let n=0,r=Yk(t);if(!this.inverted)for(let o=0;o<r;o++)n+=this.ranges[o*3+2]-this.ranges[o*3+1];return this.ranges[r*3]+n+U7(t)}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,r){let o=0,i=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?o:0);if(l>t)break;let c=this.ranges[a+i],u=this.ranges[a+s],d=l+c;if(t<=d){let f=c?t==l?-1:t==d?1:n:n,h=l+o+(f<0?0:u);if(r)return h;let m=t==(n<0?l:d)?null:V7(a/3,t-l),g=t==l?rR:t==d?nR:th;return(n<0?t!=l:t!=d)&&(g|=oR),new X0(h,g,m)}o+=u-c}return r?t+o:new X0(t+o,0,null)}touches(t,n){let r=0,o=Yk(n),i=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>t)break;let c=this.ranges[a+i],u=l+c;if(t<=u&&a==o*3)return!0;r+=this.ranges[a+s]-c}return!1}forEach(t){let n=this.inverted?2:1,r=this.inverted?1:2;for(let o=0,i=0;o<this.ranges.length;o+=3){let s=this.ranges[o],a=s-(this.inverted?i:0),l=s+(this.inverted?0:i),c=this.ranges[o+n],u=this.ranges[o+r];t(a,a+c,l,l+u),i+=u-c}}invert(){return new or(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?or.empty:new or(t<0?[0,-t,0]:[0,0,t])}}or.empty=new or([]);class ec{constructor(t=[],n,r=0,o=t.length){this.maps=t,this.mirror=n,this.from=r,this.to=o}slice(t=0,n=this.maps.length){return new ec(this.maps,this.mirror,t,n)}copy(){return new ec(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(t,n){this.to=this.maps.push(t),n!=null&&this.setMirror(this.maps.length-1,n)}appendMapping(t){for(let n=0,r=this.maps.length;n<t.maps.length;n++){let o=t.getMirror(n);this.appendMap(t.maps[n],o!=null&&o<n?r+o:void 0)}}getMirror(t){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==t)return this.mirror[n+(n%2?-1:1)]}}setMirror(t,n){this.mirror||(this.mirror=[]),this.mirror.push(t,n)}appendMappingInverted(t){for(let n=t.maps.length-1,r=this.maps.length+t.maps.length;n>=0;n--){let o=t.getMirror(n);this.appendMap(t.maps[n].invert(),o!=null&&o>n?r-o-1:void 0)}}invert(){let t=new ec;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let r=this.from;r<this.to;r++)t=this.maps[r].map(t,n);return t}mapResult(t,n=1){return this._map(t,n,!1)}_map(t,n,r){let o=0;for(let i=this.from;i<this.to;i++){let s=this.maps[i],a=s.mapResult(t,n);if(a.recover!=null){let l=this.getMirror(i);if(l!=null&&l>i&&l<this.to){i=l,t=this.maps[l].recover(a.recover);continue}}o|=a.delInfo,t=a.pos}return r?t:new X0(t,o,null)}}const qv=Object.create(null);class Ft{getMap(){return or.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=qv[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in qv)throw new RangeError("Duplicate use of step JSON ID "+t);return qv[t]=n,n.prototype.jsonID=t,n}}class _t{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new _t(t,null)}static fail(t){return new _t(null,t)}static fromReplace(t,n,r,o){try{return _t.ok(t.replace(n,r,o))}catch(i){if(i instanceof lm)return _t.fail(i.message);throw i}}}function n1(e,t,n){let r=[];for(let o=0;o<e.childCount;o++){let i=e.child(o);i.content.size&&(i=i.copy(n1(i.content,t,i))),i.isInline&&(i=t(i,n,o)),r.push(i)}return L.fromArray(r)}class fi extends Ft{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=t.resolve(this.from),o=r.node(r.sharedDepth(this.to)),i=new Y(n1(n.content,(s,a)=>!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),o),n.openStart,n.openEnd);return _t.fromReplace(t,this.from,this.to,i)}invert(){return new io(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 fi(n.pos,r.pos,this.mark)}merge(t){return t instanceof fi&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new fi(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 new RangeError("Invalid input for AddMarkStep.fromJSON");return new fi(n.from,n.to,t.markFromJSON(n.mark))}}Ft.jsonID("addMark",fi);class io extends Ft{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=new Y(n1(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),t),n.openStart,n.openEnd);return _t.fromReplace(t,this.from,this.to,r)}invert(){return new fi(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 io(n.pos,r.pos,this.mark)}merge(t){return t instanceof io&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new io(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 new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new io(n.from,n.to,t.markFromJSON(n.mark))}}Ft.jsonID("removeMark",io);class gs extends Ft{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return _t.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return _t.fromReplace(t,this.pos,this.pos+1,new Y(L.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let o=0;o<n.marks.length;o++)if(!n.marks[o].isInSet(r))return new gs(this.pos,n.marks[o]);return new gs(this.pos,this.mark)}}return new bc(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new gs(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 new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new gs(n.pos,t.markFromJSON(n.mark))}}Ft.jsonID("addNodeMark",gs);class bc extends Ft{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return _t.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return _t.fromReplace(t,this.pos,this.pos+1,new Y(L.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new gs(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new bc(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 new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new bc(n.pos,t.markFromJSON(n.mark))}}Ft.jsonID("removeNodeMark",bc);class Kt extends Ft{constructor(t,n,r,o=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=o}apply(t){return this.structure&&Z0(t,this.from,this.to)?_t.fail("Structure replace would overwrite content"):_t.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new or([this.from,this.to-this.from,this.slice.size])}invert(t){return new Kt(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new Kt(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof Kt)||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?Y.empty:new Y(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new Kt(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?Y.empty:new Y(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new Kt(t.from,this.to,n,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Kt(n.from,n.to,Y.fromJSON(t,n.slice),!!n.structure)}}Ft.jsonID("replace",Kt);class Ot extends Ft{constructor(t,n,r,o,i,s,a=!1){super(),this.from=t,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=i,this.insert=s,this.structure=a}apply(t){if(this.structure&&(Z0(t,this.from,this.gapFrom)||Z0(t,this.gapTo,this.to)))return _t.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return _t.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?_t.fromReplace(t,this.from,this.to,r):_t.fail("Content does not fit in gap")}getMap(){return new or([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 Ot(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),o=t.map(this.gapFrom,-1),i=t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||o<n.pos||i>r.pos?null:new Ot(n.pos,r.pos,o,i,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}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 new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ot(n.from,n.to,n.gapFrom,n.gapTo,Y.fromJSON(t,n.slice),n.insert,!!n.structure)}}Ft.jsonID("replaceAround",Ot);function Z0(e,t,n){let r=e.resolve(t),o=n-t,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let s=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}}return!1}function H7(e,t,n,r){let o=[],i=[],s,a;e.doc.nodesBetween(t,n,(l,c,u)=>{if(!l.isInline)return;let d=l.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,t),h=Math.min(c+l.nodeSize,n),m=r.addToSet(d);for(let g=0;g<d.length;g++)d[g].isInSet(m)||(s&&s.to==f&&s.mark.eq(d[g])?s.to=h:o.push(s=new io(f,h,d[g])));a&&a.to==f?a.to=h:i.push(a=new fi(f,h,r))}}),o.forEach(l=>e.step(l)),i.forEach(l=>e.step(l))}function W7(e,t,n,r){let o=[],i=0;e.doc.nodesBetween(t,n,(s,a)=>{if(!s.isInline)return;i++;let l=null;if(r instanceof jf){let c=s.marks,u;for(;u=r.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let c=Math.min(a+s.nodeSize,n);for(let u=0;u<l.length;u++){let d=l[u],f;for(let h=0;h<o.length;h++){let m=o[h];m.step==i-1&&d.eq(o[h].style)&&(f=m)}f?(f.to=c,f.step=i):o.push({style:d,from:Math.max(a,t),to:c,step:i})}}}),o.forEach(s=>e.step(new io(s.from,s.to,s.style)))}function K7(e,t,n,r=n.contentMatch){let o=e.doc.nodeAt(t),i=[],s=t+1;for(let a=0;a<o.childCount;a++){let l=o.child(a),c=s+l.nodeSize,u=r.matchType(l.type);if(!u)i.push(new Kt(s,c,Y.empty));else{r=u;for(let d=0;d<l.marks.length;d++)n.allowsMarkType(l.marks[d].type)||e.step(new io(s,c,l.marks[d]));if(l.isText&&!n.spec.code){let d,f=/\r?\n|\r/g,h;for(;d=f.exec(l.text);)h||(h=new Y(L.from(n.schema.text(" ",n.allowedMarks(l.marks))),0,0)),i.push(new Kt(s+d.index,s+d.index+d[0].length,h))}}s=c}if(!r.validEnd){let a=r.fillBefore(L.empty,!0);e.replace(s,s,new Y(a,0,0))}for(let a=i.length-1;a>=0;a--)e.step(i[a])}function q7(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Ac(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let r=e.depth;;--r){let o=e.$from.node(r),i=e.$from.index(r),s=e.$to.indexAfter(r);if(r<e.depth&&o.canReplace(i,s,n))return r;if(r==0||o.type.spec.isolating||!q7(o,i,s))break}return null}function G7(e,t,n){let{$from:r,$to:o,depth:i}=t,s=r.before(i+1),a=o.after(i+1),l=s,c=a,u=L.empty,d=0;for(let m=i,g=!1;m>n;m--)g||r.index(m)>0?(g=!0,u=L.from(r.node(m).copy(u)),d++):l--;let f=L.empty,h=0;for(let m=i,g=!1;m>n;m--)g||o.after(m+1)<o.end(m)?(g=!0,f=L.from(o.node(m).copy(f)),h++):c++;e.step(new Ot(l,c,s,a,new Y(u.append(f),d,h),u.size-d,!0))}function r1(e,t,n=null,r=e){let o=Y7(e,t),i=o&&X7(r,t);return i?o.map(Xk).concat({type:t,attrs:n}).concat(i.map(Xk)):null}function Xk(e){return{type:e,attrs:null}}function Y7(e,t){let{parent:n,startIndex:r,endIndex:o}=e,i=n.contentMatchAt(r).findWrapping(t);if(!i)return null;let s=i.length?i[0]:t;return n.canReplaceWith(r,o,s)?i:null}function X7(e,t){let{parent:n,startIndex:r,endIndex:o}=e,i=n.child(r),s=t.contentMatch.findWrapping(i.type);if(!s)return null;let l=(s.length?s[s.length-1]:t).contentMatch;for(let c=r;l&&c<o;c++)l=l.matchType(n.child(c).type);return!l||!l.validEnd?null:s}function Z7(e,t,n){let r=L.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let a=n[s].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=L.from(n[s].type.create(n[s].attrs,r))}let o=t.start,i=t.end;e.step(new Ot(o,i,o,i,new Y(r,0,0),n.length,!0))}function J7(e,t,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=e.steps.length;e.doc.nodesBetween(t,n,(s,a)=>{if(s.isTextblock&&!s.hasMarkup(r,o)&&Q7(e.doc,e.mapping.slice(i).map(a),r)){e.clearIncompatible(e.mapping.slice(i).map(a,1),r);let l=e.mapping.slice(i),c=l.map(a,1),u=l.map(a+s.nodeSize,1);return e.step(new Ot(c,u,c+1,u-1,new Y(L.from(r.create(o,null,s.marks)),0,0),1,!0)),!1}})}function Q7(e,t,n){let r=e.resolve(t),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}function e8(e,t,n,r,o){let i=e.doc.nodeAt(t);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,o||i.marks);if(i.isLeaf)return e.replaceWith(t,t+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new Ot(t,t+i.nodeSize,t+1,t+i.nodeSize-1,new Y(L.from(s),0,0),1,!0))}function tc(e,t,n=1,r){let o=e.resolve(t),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let c=o.depth-1,u=n-2;c>i;c--,u--){let d=o.node(c),f=o.index(c);if(d.type.spec.isolating)return!1;let h=d.content.cutByIndex(f,d.childCount),m=r&&r[u+1];m&&(h=h.replaceChild(0,m.type.create(m.attrs)));let g=r&&r[u]||d;if(!d.canReplace(f+1,d.childCount)||!g.type.validContent(h))return!1}let a=o.indexAfter(i),l=r&&r[0];return o.node(i).canReplaceWith(a,a,l?l.type:o.node(i+1).type)}function t8(e,t,n=1,r){let o=e.doc.resolve(t),i=L.empty,s=L.empty;for(let a=o.depth,l=o.depth-n,c=n-1;a>l;a--,c--){i=L.from(o.node(a).copy(i));let u=r&&r[c];s=L.from(u?u.type.create(u.attrs,s):o.node(a).copy(s))}e.step(new Kt(t,t,new Y(i.append(s),n,n),!0))}function zf(e,t){let n=e.resolve(t),r=n.index();return n8(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function n8(e,t){return!!(e&&t&&!e.isLeaf&&e.canAppend(t))}function r8(e,t,n){let r=new Kt(t-n,t+n,Y.empty,!0);e.step(r)}function iR(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 o=r.depth-1;o>=0;o--){let i=r.index(o);if(r.node(o).canReplaceWith(i,i,n))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let i=r.indexAfter(o);if(r.node(o).canReplaceWith(i,i,n))return r.after(o+1);if(i<r.node(o).childCount)return null}return null}function sR(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let o=n.content;for(let i=0;i<n.openStart;i++)o=o.firstChild.content;for(let i=1;i<=(n.openStart==0&&n.size?2:1);i++)for(let s=r.depth;s>=0;s--){let a=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,l=r.index(s)+(a>0?1:0),c=r.node(s),u=!1;if(i==1)u=c.canReplace(l,l,o);else{let d=c.contentMatchAt(l).findWrapping(o.firstChild.type);u=d&&c.canReplaceWith(l,l,d[0])}if(u)return a==0?r.pos:a<0?r.before(s+1):r.after(s+1)}return null}function o1(e,t,n=t,r=Y.empty){if(t==n&&!r.size)return null;let o=e.resolve(t),i=e.resolve(n);return aR(o,i,r)?new Kt(t,n,r):new o8(o,i,r).fit()}function aR(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class o8{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=L.empty;for(let o=0;o<=t.depth;o++){let i=t.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(t.indexAfter(o))})}for(let o=t.depth;o>0;o--)this.placed=L.from(t.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(t<0?this.$to:r.doc.resolve(t));if(!o)return null;let i=this.placed,s=r.depth,a=o.depth;for(;s&&a&&i.childCount==1;)i=i.firstChild.content,s--,a--;let l=new Y(i,s,a);return t>-1?new Ot(r.pos,t,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new Kt(r.pos,o.pos,l):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,o=this.unplaced.openEnd;r<t;r++){let i=n.firstChild;if(n.childCount>1&&(o=0),i.type.spec.isolating&&o<=r){t=r;break}n=i.content}for(let n=1;n<=2;n++)for(let r=n==1?t:this.unplaced.openStart;r>=0;r--){let o,i=null;r?(i=Gv(this.unplaced.content,r-1).firstChild,o=i.content):o=this.unplaced.content;let s=o.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],u,d=null;if(n==1&&(s?c.matchType(s.type)||(d=c.fillBefore(L.from(s),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:a,parent:i,inject:d};if(n==2&&s&&(u=c.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:i,wrap:u};if(i&&c.matchType(i.type))break}}}openMore(){let{content:t,openStart:n,openEnd:r}=this.unplaced,o=Gv(t,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new Y(t,n+1,Math.max(r,o.size+n>=t.size-r?n+1:0)),!0)}dropNode(){let{content:t,openStart:n,openEnd:r}=this.unplaced,o=Gv(t,n);if(o.childCount<=1&&n>0){let i=t.size-n<=n+o.size;this.unplaced=new Y(Cu(t,n-1,1),n-1,i?n-1:r)}else this.unplaced=new Y(Cu(t,n,1),n,r)}placeNodes({sliceDepth:t,frontierDepth:n,parent:r,inject:o,wrap:i}){for(;this.depth>n;)this.closeFrontierNode();if(i)for(let g=0;g<i.length;g++)this.openFrontierNode(i[g]);let s=this.unplaced,a=r?r.content:s.content,l=s.openStart-t,c=0,u=[],{match:d,type:f}=this.frontier[n];if(o){for(let g=0;g<o.childCount;g++)u.push(o.child(g));d=d.matchFragment(o)}let h=a.size+t-(s.content.size-s.openEnd);for(;c<a.childCount;){let g=a.child(c),b=d.matchType(g.type);if(!b)break;c++,(c>1||l==0||g.content.size)&&(d=b,u.push(lR(g.mark(f.allowedMarks(g.marks)),c==1?l:0,c==a.childCount?h:-1)))}let m=c==a.childCount;m||(h=-1),this.placed=_u(this.placed,n,L.from(u)),this.frontier[n].match=d,m&&h<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,b=a;g<h;g++){let y=b.lastChild;this.frontier.push({type:y.type,match:y.contentMatchAt(y.childCount)}),b=y.content}this.unplaced=m?t==0?Y.empty:new Y(Cu(s.content,t-1,1),t-1,h<0?s.openEnd:t-1):new Y(Cu(s.content,t,c),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t=this.frontier[this.depth],n;if(!t.type.isTextblock||!Yv(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,o=this.$to.after(r);for(;r>1&&o==this.$to.end(--r);)++o;return o}findCloseLevel(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:r,type:o}=this.frontier[n],i=n<t.depth&&t.end(n+1)==t.pos+(t.depth-(n+1)),s=Yv(t,n,o,r,i);if(s){for(let a=n-1;a>=0;a--){let{match:l,type:c}=this.frontier[a],u=Yv(t,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:n,fit:s,move:i?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=_u(this.placed,n.depth,n.fit)),t=n.move;for(let r=n.depth+1;r<=t.depth;r++){let o=t.node(r),i=o.type.contentMatch.fillBefore(o.content,!0,t.index(r));this.openFrontierNode(o.type,o.attrs,i)}return t}openFrontierNode(t,n=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(t),this.placed=_u(this.placed,this.depth,L.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(L.empty,!0);n.childCount&&(this.placed=_u(this.placed,this.frontier.length,n))}}function Cu(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Cu(e.firstChild.content,t-1,n)))}function _u(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(_u(e.lastChild.content,t-1,n)))}function Gv(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function lR(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,lR(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(L.empty,!0)))),e.copy(r)}function Yv(e,t,n,r,o){let i=e.node(t),s=o?e.indexAfter(t):e.index(t);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,s);return a&&!i8(n,i.content,s)?a:null}function i8(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function s8(e){return e.spec.defining||e.spec.definingForContent}function a8(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let o=e.doc.resolve(t),i=e.doc.resolve(n);if(aR(o,i,r))return e.step(new Kt(t,n,r));let s=uR(o,e.doc.resolve(n));s[s.length-1]==0&&s.pop();let a=-(o.depth+1);s.unshift(a);for(let f=o.depth,h=o.pos-1;f>0;f--,h--){let m=o.node(f).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;s.indexOf(f)>-1?a=f:o.before(f)==h&&s.splice(1,0,-f)}let l=s.indexOf(a),c=[],u=r.openStart;for(let f=r.content,h=0;;h++){let m=f.firstChild;if(c.push(m),h==r.openStart)break;f=m.content}for(let f=u-1;f>=0;f--){let h=c[f],m=s8(h.type);if(m&&!h.sameMarkup(o.node(Math.abs(a)-1)))u=f;else if(m||!h.type.isTextblock)break}for(let f=r.openStart;f>=0;f--){let h=(f+u+1)%(r.openStart+1),m=c[h];if(m)for(let g=0;g<s.length;g++){let b=s[(g+l)%s.length],y=!0;b<0&&(y=!1,b=-b);let v=o.node(b-1),w=o.index(b-1);if(v.canReplaceWith(w,w,m.type,m.marks))return e.replace(o.before(b),y?i.after(b):n,new Y(cR(r.content,0,r.openStart,h),h,r.openEnd))}}let d=e.steps.length;for(let f=s.length-1;f>=0&&(e.replace(t,n,r),!(e.steps.length>d));f--){let h=s[f];h<0||(t=o.before(h),n=i.after(h))}}function cR(e,t,n,r,o){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(cR(i.content,t+1,n,r,i)))}if(t>r){let i=o.contentMatchAt(0),s=i.fillBefore(e).append(e);e=s.append(i.matchFragment(s).fillBefore(L.empty,!0))}return e}function l8(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let o=iR(e.doc,t,r.type);o!=null&&(t=n=o)}e.replaceRange(t,n,new Y(L.from(r),0,0))}function c8(e,t,n){let r=e.doc.resolve(t),o=e.doc.resolve(n),i=uR(r,o);for(let s=0;s<i.length;s++){let a=i[s],l=s==i.length-1;if(l&&a==0||r.node(a).type.contentMatch.validEnd)return e.delete(r.start(a),o.end(a));if(a>0&&(l||r.node(a-1).canReplace(r.index(a-1),o.indexAfter(a-1))))return e.delete(r.before(a),o.after(a))}for(let s=1;s<=r.depth&&s<=o.depth;s++)if(t-r.start(s)==r.depth-s&&n>r.end(s)&&o.end(s)-n!=o.depth-s)return e.delete(r.before(s),n);e.delete(t,n)}function uR(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let o=r;o>=0;o--){let i=e.start(o);if(i<e.pos-(e.depth-o)||t.end(o)>t.pos+(t.depth-o)||e.node(o).type.spec.isolating||t.node(o).type.spec.isolating)break;(i==t.start(o)||o==e.depth&&o==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&o&&t.start(o-1)==i-1)&&n.push(o)}return n}class nc extends Ft{constructor(t,n,r){super(),this.pos=t,this.attr=n,this.value=r}apply(t){let n=t.nodeAt(this.pos);if(!n)return _t.fail("No node at attribute step's position");let r=Object.create(null);for(let i in n.attrs)r[i]=n.attrs[i];r[this.attr]=this.value;let o=n.type.create(r,null,n.marks);return _t.fromReplace(t,this.pos,this.pos+1,new Y(L.from(o),0,n.isLeaf?0:1))}getMap(){return or.empty}invert(t){return new nc(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 nc(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 new RangeError("Invalid input for AttrStep.fromJSON");return new nc(n.pos,n.attr,n.value)}}Ft.jsonID("attr",nc);class Xd extends Ft{constructor(t,n){super(),this.attr=t,this.value=n}apply(t){let n=Object.create(null);for(let o in t.attrs)n[o]=t.attrs[o];n[this.attr]=this.value;let r=t.type.create(n,t.content,t.marks);return _t.ok(r)}getMap(){return or.empty}invert(t){return new Xd(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Xd(n.attr,n.value)}}Ft.jsonID("docAttr",Xd);let wc=class extends Error{};wc=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};wc.prototype=Object.create(Error.prototype);wc.prototype.constructor=wc;wc.prototype.name="TransformError";class u8{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new ec}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new wc(n.failed);return this}maybeStep(t){let n=t.apply(this.doc);return n.failed||this.addStep(t,n.doc),n}get docChanged(){return this.steps.length>0}addStep(t,n){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=n}replace(t,n=t,r=Y.empty){let o=o1(this.doc,t,n,r);return o&&this.step(o),this}replaceWith(t,n,r){return this.replace(t,n,new Y(L.from(r),0,0))}delete(t,n){return this.replace(t,n,Y.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,r){return a8(this,t,n,r),this}replaceRangeWith(t,n,r){return l8(this,t,n,r),this}deleteRange(t,n){return c8(this,t,n),this}lift(t,n){return G7(this,t,n),this}join(t,n=1){return r8(this,t,n),this}wrap(t,n){return Z7(this,t,n),this}setBlockType(t,n=t,r,o=null){return J7(this,t,n,r,o),this}setNodeMarkup(t,n,r=null,o){return e8(this,t,n,r,o),this}setNodeAttribute(t,n,r){return this.step(new nc(t,n,r)),this}setDocAttribute(t,n){return this.step(new Xd(t,n)),this}addNodeMark(t,n){return this.step(new gs(t,n)),this}removeNodeMark(t,n){if(!(n instanceof Be)){let r=this.doc.nodeAt(t);if(!r)throw new RangeError("No node at position "+t);if(n=n.isInSet(r.marks),!n)return this}return this.step(new bc(t,n)),this}split(t,n=1,r){return t8(this,t,n,r),this}addMark(t,n,r){return H7(this,t,n,r),this}removeMark(t,n,r){return W7(this,t,n,r),this}clearIncompatible(t,n,r){return K7(this,t,n,r),this}}const Xv=Object.create(null);class $e{constructor(t,n,r){this.$anchor=t,this.$head=n,this.ranges=r||[new d8(t.min(n),t.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let n=0;n<t.length;n++)if(t[n].$from.pos!=t[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,n=Y.empty){let r=n.content.lastChild,o=null;for(let a=0;a<n.openEnd;a++)o=r,r=r.lastChild;let i=t.steps.length,s=this.ranges;for(let a=0;a<s.length;a++){let{$from:l,$to:c}=s[a],u=t.mapping.slice(i);t.replaceRange(u.map(l.pos),u.map(c.pos),a?Y.empty:n),a==0&&Qk(t,i,(r?r.isInline:o&&o.isTextblock)?-1:1)}}replaceWith(t,n){let r=t.steps.length,o=this.ranges;for(let i=0;i<o.length;i++){let{$from:s,$to:a}=o[i],l=t.mapping.slice(r),c=l.map(s.pos),u=l.map(a.pos);i?t.deleteRange(c,u):(t.replaceRangeWith(c,u,n),Qk(t,r,n.isInline?-1:1))}}static findFrom(t,n,r=!1){let o=t.parent.inlineContent?new Se(t):kl(t.node(0),t.parent,t.pos,t.index(),n,r);if(o)return o;for(let i=t.depth-1;i>=0;i--){let s=n<0?kl(t.node(0),t.node(i),t.before(i+1),t.index(i),n,r):kl(t.node(0),t.node(i),t.after(i+1),t.index(i)+1,n,r);if(s)return s}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new On(t.node(0))}static atStart(t){return kl(t,t,0,0,1)||new On(t)}static atEnd(t){return kl(t,t,t.content.size,t.childCount,-1)||new On(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Xv[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in Xv)throw new RangeError("Duplicate use of selection JSON ID "+t);return Xv[t]=n,n.prototype.jsonID=t,n}getBookmark(){return Se.between(this.$anchor,this.$head).getBookmark()}}$e.prototype.visible=!0;class d8{constructor(t,n){this.$from=t,this.$to=n}}let Zk=!1;function Jk(e){!Zk&&!e.parent.inlineContent&&(Zk=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class Se extends $e{constructor(t,n=t){Jk(t),Jk(n),super(t,n)}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 $e.near(r);let o=t.resolve(n.map(this.anchor));return new Se(o.parent.inlineContent?o:r,r)}replace(t,n=Y.empty){if(super.replace(t,n),n==Y.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof Se&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new kg(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 new RangeError("Invalid input for TextSelection.fromJSON");return new Se(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){let o=t.resolve(n);return new this(o,r==n?o:t.resolve(r))}static between(t,n,r){let o=t.pos-n.pos;if((!r||o)&&(r=o>=0?1:-1),!n.parent.inlineContent){let i=$e.findFrom(n,r,!0)||$e.findFrom(n,-r,!0);if(i)n=i.$head;else return $e.near(n,r)}return t.parent.inlineContent||(o==0?t=n:(t=($e.findFrom(t,-r,!0)||$e.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=o<0&&(t=n))),new Se(t,n)}}$e.jsonID("text",Se);class kg{constructor(t,n){this.anchor=t,this.head=n}map(t){return new kg(t.map(this.anchor),t.map(this.head))}resolve(t){return Se.between(t.resolve(this.anchor),t.resolve(this.head))}}class ge extends $e{constructor(t){let n=t.nodeAfter,r=t.node(0).resolve(t.pos+n.nodeSize);super(t,r),this.node=n}map(t,n){let{deleted:r,pos:o}=n.mapResult(this.anchor),i=t.resolve(o);return r?$e.near(i):new ge(i)}content(){return new Y(L.from(this.node),0,0)}eq(t){return t instanceof ge&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new i1(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new ge(t.resolve(n.anchor))}static create(t,n){return new ge(t.resolve(n))}static isSelectable(t){return!t.isText&&t.type.spec.selectable!==!1}}ge.prototype.visible=!1;$e.jsonID("node",ge);class i1{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new kg(r,r):new i1(r)}resolve(t){let n=t.resolve(this.anchor),r=n.nodeAfter;return r&&ge.isSelectable(r)?new ge(n):$e.near(n)}}class On extends $e{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=Y.empty){if(n==Y.empty){t.delete(0,t.doc.content.size);let r=$e.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new On(t)}map(t){return new On(t)}eq(t){return t instanceof On}getBookmark(){return f8}}$e.jsonID("all",On);const f8={map(){return this},resolve(e){return new On(e)}};function kl(e,t,n,r,o,i=!1){if(t.inlineContent)return Se.create(e,n);for(let s=r-(o>0?0:1);o>0?s<t.childCount:s>=0;s+=o){let a=t.child(s);if(a.isAtom){if(!i&&ge.isSelectable(a))return ge.create(e,n-(o<0?a.nodeSize:0))}else{let l=kl(e,a,n+o,o<0?a.childCount:0,o,i);if(l)return l}n+=a.nodeSize*o}return null}function Qk(e,t,n){let r=e.steps.length-1;if(r<t)return;let o=e.steps[r];if(!(o instanceof Kt||o instanceof Ot))return;let i=e.mapping.maps[r],s;i.forEach((a,l,c,u)=>{s==null&&(s=u)}),e.setSelection($e.near(e.doc.resolve(s),n))}const eE=1,Tp=2,tE=4;class p8 extends u8{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.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(t){if(t.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=(this.updated|eE)&~Tp,this.storedMarks=null,this}get selectionSet(){return(this.updated&eE)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=Tp,this}ensureMarks(t){return Be.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Tp)>0}addStep(t,n){super.addStep(t,n),this.updated=this.updated&~Tp,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,n=!0){let r=this.selection;return n&&(t=t.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||Be.none))),r.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,n,r){let o=this.doc.type.schema;if(n==null)return t?this.replaceSelectionWith(o.text(t),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!t)return this.deleteRange(n,r);let i=this.storedMarks;if(!i){let s=this.doc.resolve(n);i=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,o.text(t,i)),this.selection.empty||this.setSelection($e.near(this.selection.$to)),this}}setMeta(t,n){return this.meta[typeof t=="string"?t:t.key]=n,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=tE,this}get scrolledIntoView(){return(this.updated&tE)>0}}function nE(e,t){return!t||!e?e:e.bind(t)}class Ou{constructor(t,n,r){this.name=t,this.init=nE(n.init,r),this.apply=nE(n.apply,r)}}const h8=[new Ou("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Ou("selection",{init(e,t){return e.selection||$e.atStart(t.doc)},apply(e){return e.selection}}),new Ou("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new Ou("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class Zv{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=h8.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Ou(r.key,r.spec.state,r))})}}class xa{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let o=this.config.plugins[r];if(o.spec.filterTransaction&&!o.spec.filterTransaction.call(o,t,this))return!1}return!0}applyTransaction(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};let n=[t],r=this.applyInner(t),o=null;for(;;){let i=!1;for(let s=0;s<this.config.plugins.length;s++){let a=this.config.plugins[s];if(a.spec.appendTransaction){let l=o?o[s].n:0,c=o?o[s].state:this,u=l<n.length&&a.spec.appendTransaction.call(a,l?n.slice(l):n,c,r);if(u&&r.filterTransaction(u,s)){if(u.setMeta("appendedTransaction",t),!o){o=[];for(let d=0;d<this.config.plugins.length;d++)o.push(d<s?{state:r,n:n.length}:{state:this,n:0})}n.push(u),r=r.applyInner(u),i=!0}o&&(o[s]={state:r,n:n.length})}}if(!i)return{state:r,transactions:n}}}applyInner(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new xa(this.config),r=this.config.fields;for(let o=0;o<r.length;o++){let i=r[o];n[i.name]=i.apply(t,this[i.name],this,n)}return n}get tr(){return new p8(this)}static create(t){let n=new Zv(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new xa(n);for(let o=0;o<n.fields.length;o++)r[n.fields[o].name]=n.fields[o].init(t,r);return r}reconfigure(t){let n=new Zv(this.schema,t.plugins),r=n.fields,o=new xa(n);for(let i=0;i<r.length;i++){let s=r[i].name;o[s]=this.hasOwnProperty(s)?this[s]:r[i].init(t,o)}return o}toJSON(t){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),t&&typeof t=="object")for(let r in t){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=t[r],i=o.spec.state;i&&i.toJSON&&(n[r]=i.toJSON.call(o,this[o.key]))}return n}static fromJSON(t,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let o=new Zv(t.schema,t.plugins),i=new xa(o);return o.fields.forEach(s=>{if(s.name=="doc")i.doc=Ts.fromJSON(t.schema,n.doc);else if(s.name=="selection")i.selection=$e.fromJSON(i.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(i.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],c=l.spec.state;if(l.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){i[s.name]=c.fromJSON.call(l,t,n[a],i);return}}i[s.name]=s.init(t,i)}}),i}}function dR(e,t,n){for(let r in e){let o=e[r];o instanceof Function?o=o.bind(t):r=="handleDOMEvents"&&(o=dR(o,t,{})),n[r]=o}return n}class $i{constructor(t){this.spec=t,this.props={},t.props&&dR(t.props,this,this.props),this.key=t.key?t.key.key:fR("plugin")}getState(t){return t[this.key]}}const Jv=Object.create(null);function fR(e){return e in Jv?e+"$"+ ++Jv[e]:(Jv[e]=0,e+"$")}class Ic{constructor(t="key"){this.key=fR(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}function pR(){return typeof document<"u"?document:null}function hR(e,t){if(typeof e!="string")return[e];var n=[e];typeof t=="string"||Array.isArray(t)?t={brackets:t}:t||(t={});var r=t.brackets?Array.isArray(t.brackets)?t.brackets:[t.brackets]:["{}","[]","()"],o=t.escape||"___",i=!!t.flat;r.forEach(function(l){var c=new RegExp(["\\",l[0],"[^\\",l[0],"\\",l[1],"]*\\",l[1]].join("")),u=[];function d(f,h,m){var g=n.push(f.slice(l[0].length,-l[1].length))-1;return u.push(g),o+g+o}n.forEach(function(f,h){for(var m,g=0;f!=m;)if(m=f,f=f.replace(c,d),g++>1e4)throw Error("References have circular dependency. Please, check them.");n[h]=f}),u=u.reverse(),n=n.map(function(f){return u.forEach(function(h){f=f.replace(new RegExp("(\\"+o+h+"\\"+o+")","g"),l[0]+"$1"+l[1])}),f})});var s=new RegExp("\\"+o+"([0-9]+)\\"+o);function a(l,c,u){for(var d=[],f,h=0;f=s.exec(l);){if(h++>1e4)throw Error("Circular references in parenthesis");d.push(l.slice(0,f.index)),d.push(a(c[f[1]],c)),l=l.slice(f.index+f[0].length)}return d.push(l),d}return i?n:a(n[0],n)}function mR(e,t){if(t&&t.flat){var n=t&&t.escape||"___",r=e[0],o;if(!r)return"";for(var i=new RegExp("\\"+n+"([0-9]+)\\"+n),s=0;r!=o;){if(s++>1e4)throw Error("Circular references in "+e);o=r,r=r.replace(i,a)}return r}return e.reduce(function l(c,u){return Array.isArray(u)&&(u=u.reduce(l,"")),c+u},"");function a(l,c){if(e[c]==null)throw Error("Reference "+c+"is undefined");return e[c]}}function gR(e,t){return Array.isArray(e)?mR(e,t):hR(e,t)}gR.parse=hR;gR.stringify=mR;const m8={id:"extension.command.copy.label",message:"Copy",comment:"Label for copy command."},g8={id:"extension.command.copy.description",message:"Copy the selected text",comment:"Description for copy command."},v8={id:"extension.command.cut.label",message:"Cut",comment:"Label for cut command."},y8={id:"extension.command.cut.description",message:"Cut the selected text",comment:"Description for cut command."},x8={id:"extension.command.paste.label",message:"Paste",comment:"Label for paste command."},b8={id:"extension.command.paste.description",message:"Paste content into the editor",comment:"Description for paste command."},w8={id:"extension.command.select-all.label",message:"Select all",comment:"Label for select all command."},S8={id:"extension.command.select-all.description",message:"Select all content within the editor",comment:"Description for select all command."};var Fs=Object.freeze({__proto__:null,COPY_DESCRIPTION:g8,COPY_LABEL:m8,CUT_DESCRIPTION:y8,CUT_LABEL:v8,PASTE_DESCRIPTION:b8,PASTE_LABEL:x8,SELECT_ALL_DESCRIPTION:S8,SELECT_ALL_LABEL:w8});const k8={id:"extension.command.toggle-bold.label",message:"Bold",comment:"Label for bold formatting command."},E8={id:"extension.command.toggle-bold.description",message:"Add bold formatting to the selected text",comment:"Description for bold formatting command."};var rE=Object.freeze({__proto__:null,DESCRIPTION:E8,LABEL:k8});const C8={id:"extension.command.toggle-heading.label",message:`{level, select, 1 {Heading 1}
346
- 2 {Heading 2}
347
- 3 {Heading 3}
348
- 4 {Heading 4}
349
- 5 {Heading 5}
350
- 6 {Heading 6}
351
- other {Heading}}`,comment:"Label for heading command with support for levels."};var _8=Object.freeze({__proto__:null,LABEL:C8});const O8={id:"extension.command.undo.label",message:"Undo",comment:"Label for undo."},T8={id:"extension.command.undo.description",message:"Undo the most recent action",comment:"Description for undo."},M8={id:"extension.command.redo.label",message:"Redo",comment:"Label for redo."},R8={id:"extension.command.redo.description",message:"Redo the most recent action",comment:"Description for redo."};var pm=Object.freeze({__proto__:null,REDO_DESCRIPTION:R8,REDO_LABEL:M8,UNDO_DESCRIPTION:T8,UNDO_LABEL:O8});const P8={id:"extension.command.toggle-italic.label",message:"Italic",comment:"Label for italic formatting command."},N8={id:"extension.command.toggle-italic.description",message:"Italicize the selected text",comment:"Description for italic formatting command."};var oE=Object.freeze({__proto__:null,DESCRIPTION:N8,LABEL:P8});const $8={id:"extension.command.toggle-ordered-list.label",message:"Ordered list",comment:"Label for inserting an ordered list into the editor."},D8={id:"extension.command.toggle-bullet-list.description",message:"Bulleted list",comment:"Description for inserting a bullet list into the editor."},A8={id:"extension.command.toggle-task-list.description",message:"Tasked list",comment:"Description for inserting a task list into the editor."};var s1=Object.freeze({__proto__:null,BULLET_LIST_LABEL:D8,ORDERED_LIST_LABEL:$8,TASK_LIST_LABEL:A8});const I8={id:"extension.command.insert-paragraph.label",message:"Insert Paragraph",comment:"Label for inserting a paragraph."},L8={id:"extension.command.insert-paragraph.description",message:"Insert a new paragraph",comment:"Description for inserting a paragraph."},j8={id:"extension.command.convert-paragraph.label",message:"Convert Paragraph",comment:"Label for converting the current node into a paragraph."},z8={id:"extension.command.convert-paragraph.description",message:"Convert current block into a paragraph block.",comment:"Description for converting a paragraph."};var hm=Object.freeze({__proto__:null,CONVERT_DESCRIPTION:z8,CONVERT_LABEL:j8,INSERT_DESCRIPTION:L8,INSERT_LABEL:I8});const F8={id:"extension.command.toggle-strike.label",message:"Strikethrough",comment:"Label for strike formatting command."},B8={id:"extension.command.toggle-strike.description",message:"Strikethrough the selected text",comment:"Description for strike formatting command."};var iE=Object.freeze({__proto__:null,DESCRIPTION:B8,LABEL:F8});class jr{constructor(t,n,r={}){this.match=t,this.match=t,this.handler=typeof n=="string"?V8(n):n,this.undoable=r.undoable!==!1}}function V8(e){return function(t,n,r,o){let i=e;if(n[1]){let s=n[0].lastIndexOf(n[1]);i+=n[0].slice(s+n[1].length),r+=s;let a=r-o;a>0&&(i=n[0].slice(s-a,s)+i,r=o)}return t.tr.insertText(i,r,o)}}const U8=500;function H8({rules:e}){let t=new $i({state:{init(){return null},apply(n,r){let o=n.getMeta(this);return o||(n.selectionSet||n.docChanged?null:r)}},props:{handleTextInput(n,r,o,i){return sE(n,r,o,i,e,t)},handleDOMEvents:{compositionend:n=>{setTimeout(()=>{let{$cursor:r}=n.state.selection;r&&sE(n,r.pos,r.pos,"",e,t)})}}},isInputRules:!0});return t}function sE(e,t,n,r,o,i){if(e.composing)return!1;let s=e.state,a=s.doc.resolve(t);if(a.parent.type.spec.code)return!1;let l=a.parent.textBetween(Math.max(0,a.parentOffset-U8),a.parentOffset,null,"")+r;for(let c=0;c<o.length;c++){let u=o[c],d=u.match.exec(l),f=d&&u.handler(s,d,t-(d[0].length-r.length),n);if(f)return u.undoable&&f.setMeta(i,{transform:f,from:t,to:n,text:r}),e.dispatch(f),!0}return!1}const W8=(e,t)=>{let n=e.plugins;for(let r=0;r<n.length;r++){let o=n[r],i;if(o.spec.isInputRules&&(i=o.getState(e))){if(t){let s=e.tr,a=i.transform;for(let l=a.steps.length-1;l>=0;l--)s.step(a.steps[l].invert(a.docs[l]));if(i.text){let l=s.doc.resolve(i.from).marks();s.replaceWith(i.from,i.to,e.schema.text(i.text,l))}else s.delete(i.from,i.to);t(s)}return!0}}return!1};new jr(/--$/,"—");new jr(/\.\.\.$/,"…");new jr(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“");new jr(/"$/,"”");new jr(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘");new jr(/'$/,"’");function a1(e,t,n=null,r){return new jr(e,(o,i,s,a)=>{let l=n instanceof Function?n(i):n,c=o.tr.delete(s,a),u=c.doc.resolve(s),d=u.blockRange(),f=d&&r1(d,t,l);if(!f)return null;c.wrap(d,f);let h=c.doc.resolve(s-1).nodeBefore;return h&&h.type==t&&zf(c.doc,s-1)&&(!r||r(i,h))&&c.join(s-1),c})}function K8(e,t,n=null){return new jr(e,(r,o,i,s)=>{let a=r.doc.resolve(i),l=n instanceof Function?n(o):n;return a.node(-1).canReplaceWith(a.index(-1),a.indexAfter(-1),t)?r.tr.delete(i,s).setBlockType(i,i,t,l):null})}const kn=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},Zd=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t};let aE=null;const ii=function(e,t,n){let r=aE||(aE=document.createRange());return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},Ua=function(e,t,n,r){return n&&(lE(e,t,n,r,-1)||lE(e,t,n,r,1))},q8=/^(img|br|input|textarea|hr)$/i;function lE(e,t,n,r,o){for(;;){if(e==n&&t==r)return!0;if(t==(o<0?0:Ro(e))){let i=e.parentNode;if(!i||i.nodeType!=1||l1(e)||q8.test(e.nodeName)||e.contentEditable=="false")return!1;t=kn(e)+(o<0?0:1),e=i}else if(e.nodeType==1){if(e=e.childNodes[t+(o<0?-1:0)],e.contentEditable=="false")return!1;t=o<0?Ro(e):0}else return!1}}function Ro(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function G8(e,t,n){for(let r=t==0,o=t==Ro(e);r||o;){if(e==n)return!0;let i=kn(e);if(e=e.parentNode,!e)return!1;r=r&&i==0,o=o&&i==Ro(e)}}function l1(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)}const Eg=function(e){return e.focusNode&&Ua(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function fa(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function Y8(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function X8(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:r.offset}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:r.startOffset}}}const Fo=typeof navigator<"u"?navigator:null,cE=typeof document<"u"?document:null,Xs=Fo&&Fo.userAgent||"",J0=/Edge\/(\d+)/.exec(Xs),vR=/MSIE \d/.exec(Xs),Q0=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Xs),Hn=!!(vR||Q0||J0),Ms=vR?document.documentMode:Q0?+Q0[1]:J0?+J0[1]:0,vo=!Hn&&/gecko\/(\d+)/i.test(Xs);vo&&+(/Firefox\/(\d+)/.exec(Xs)||[0,0])[1];const ex=!Hn&&/Chrome\/(\d+)/.exec(Xs),mn=!!ex,Z8=ex?+ex[1]:0,Mn=!Hn&&!!Fo&&/Apple Computer/.test(Fo.vendor),Sc=Mn&&(/Mobile\/\w+/.test(Xs)||!!Fo&&Fo.maxTouchPoints>2),Sr=Sc||(Fo?/Mac/.test(Fo.platform):!1),J8=Fo?/Win/.test(Fo.platform):!1,Qr=/Android \d/.test(Xs),Ff=!!cE&&"webkitFontSmoothing"in cE.documentElement.style,Q8=Ff?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function e9(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Zo(e,t){return typeof e=="number"?e:e[t]}function t9(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 uE(e,t,n){let r=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument;for(let s=n||e.dom;s;s=Zd(s)){if(s.nodeType!=1)continue;let a=s,l=a==i.body,c=l?e9(i):t9(a),u=0,d=0;if(t.top<c.top+Zo(r,"top")?d=-(c.top-t.top+Zo(o,"top")):t.bottom>c.bottom-Zo(r,"bottom")&&(d=t.bottom-t.top>c.bottom-c.top?t.top+Zo(o,"top")-c.top:t.bottom-c.bottom+Zo(o,"bottom")),t.left<c.left+Zo(r,"left")?u=-(c.left-t.left+Zo(o,"left")):t.right>c.right-Zo(r,"right")&&(u=t.right-c.right+Zo(o,"right")),u||d)if(l)i.defaultView.scrollBy(u,d);else{let f=a.scrollLeft,h=a.scrollTop;d&&(a.scrollTop+=d),u&&(a.scrollLeft+=u);let m=a.scrollLeft-f,g=a.scrollTop-h;t={left:t.left-m,top:t.top-g,right:t.right-m,bottom:t.bottom-g}}if(l||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function n9(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,o;for(let i=(t.left+t.right)/2,s=n+1;s<Math.min(innerHeight,t.bottom);s+=5){let a=e.root.elementFromPoint(i,s);if(!a||a==e.dom||!e.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=n-20){r=a,o=l.top;break}}return{refDOM:r,refTop:o,stack:yR(e.dom)}}function yR(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=Zd(r));return t}function r9({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;xR(n,r==0?0:r-t)}function xR(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:o,left:i}=e[n];r.scrollTop!=o+t&&(r.scrollTop=o+t),r.scrollLeft!=i&&(r.scrollLeft=i)}}let pl=null;function o9(e){if(e.setActive)return e.setActive();if(pl)return e.focus(pl);let t=yR(e);e.focus(pl==null?{get preventScroll(){return pl={preventScroll:!0},!0}}:void 0),pl||(pl=!1,xR(t,0))}function bR(e,t){let n,r=2e8,o,i=0,s=t.top,a=t.top,l,c;for(let u=e.firstChild,d=0;u;u=u.nextSibling,d++){let f;if(u.nodeType==1)f=u.getClientRects();else if(u.nodeType==3)f=ii(u).getClientRects();else continue;for(let h=0;h<f.length;h++){let m=f[h];if(m.top<=s&&m.bottom>=a){s=Math.max(m.bottom,s),a=Math.min(m.top,a);let g=m.left>t.left?m.left-t.left:m.right<t.left?t.left-m.right:0;if(g<r){n=u,r=g,o=g&&n.nodeType==3?{left:m.right<t.left?m.right:m.left,top:t.top}:t,u.nodeType==1&&g&&(i=d+(t.left>=(m.left+m.right)/2?1:0));continue}}else m.top>t.top&&!l&&m.left<=t.left&&m.right>=t.left&&(l=u,c={left:Math.max(m.left,Math.min(m.right,t.left)),top:m.top});!n&&(t.left>=m.right&&t.top>=m.top||t.left>=m.left&&t.top>=m.bottom)&&(i=d+1)}}return!n&&l&&(n=l,o=c,r=0),n&&n.nodeType==3?i9(n,o):!n||r&&n.nodeType==1?{node:e,offset:i}:bR(n,o)}function i9(e,t){let n=e.nodeValue.length,r=document.createRange();for(let o=0;o<n;o++){r.setEnd(e,o+1),r.setStart(e,o);let i=Xi(r,1);if(i.top!=i.bottom&&c1(t,i))return{node:e,offset:o+(t.left>=(i.left+i.right)/2?1:0)}}return{node:e,offset:0}}function c1(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function s9(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function a9(e,t,n){let{node:r,offset:o}=bR(t,n),i=-1;if(r.nodeType==1&&!r.firstChild){let s=r.getBoundingClientRect();i=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return e.docView.posFromDOM(r,o,i)}function l9(e,t,n,r){let o=-1;for(let i=t,s=!1;i!=e.dom;){let a=e.docView.nearestDesc(i,!0);if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent&&!s||!a.contentDOM)){let l=a.dom.getBoundingClientRect();if(a.node.isBlock&&a.parent&&!s&&(s=!0,l.left>r.left||l.top>r.top?o=a.posBefore:(l.right<r.left||l.bottom<r.top)&&(o=a.posAfter)),!a.contentDOM&&o<0&&!a.node.isText)return(a.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?a.posBefore:a.posAfter}i=a.dom.parentNode}return o>-1?o:e.docView.posFromDOM(t,n,-1)}function wR(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let o=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),i=o;;){let s=e.childNodes[i];if(s.nodeType==1){let a=s.getClientRects();for(let l=0;l<a.length;l++){let c=a[l];if(c1(t,c))return wR(s,t,c)}}if((i=(i+1)%r)==o)break}return e}function c9(e,t){let n=e.dom.ownerDocument,r,o=0,i=X8(n,t.left,t.top);i&&({node:r,offset:o}=i);let s=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),a;if(!s||!e.dom.contains(s.nodeType!=1?s.parentNode:s)){let c=e.dom.getBoundingClientRect();if(!c1(t,c)||(s=wR(e.dom,t,c),!s))return null}if(Mn)for(let c=s;r&&c;c=Zd(c))c.draggable&&(r=void 0);if(s=s9(s,t),r){if(vo&&r.nodeType==1&&(o=Math.min(o,r.childNodes.length),o<r.childNodes.length)){let u=r.childNodes[o],d;u.nodeName=="IMG"&&(d=u.getBoundingClientRect()).right<=t.left&&d.bottom>t.top&&o++}let c;Ff&&o&&r.nodeType==1&&(c=r.childNodes[o-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=t.top&&o--,r==e.dom&&o==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?a=e.state.doc.content.size:(o==0||r.nodeType!=1||r.childNodes[o-1].nodeName!="BR")&&(a=l9(e,r,o,t))}a==null&&(a=a9(e,s,t));let l=e.docView.nearestDesc(s,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function dE(e){return e.top<e.bottom||e.left<e.right}function Xi(e,t){let n=e.getClientRects();if(n.length){let r=n[t<0?0:n.length-1];if(dE(r))return r}return Array.prototype.find.call(n,dE)||e.getBoundingClientRect()}const u9=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function SR(e,t,n){let{node:r,offset:o,atom:i}=e.docView.domFromPos(t,n<0?-1:1),s=Ff||vo;if(r.nodeType==3)if(s&&(u9.test(r.nodeValue)||(n<0?!o:o==r.nodeValue.length))){let l=Xi(ii(r,o,o),n);if(vo&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let c=Xi(ii(r,o-1,o-1),-1);if(c.top==l.top){let u=Xi(ii(r,o,o+1),-1);if(u.top!=l.top)return pu(u,u.left<c.left)}}return l}else{let l=o,c=o,u=n<0?1:-1;return n<0&&!o?(c++,u=-1):n>=0&&o==r.nodeValue.length?(l--,u=1):n<0?l--:c++,pu(Xi(ii(r,l,c),u),u<0)}if(!e.state.doc.resolve(t-(i||0)).parent.inlineContent){if(i==null&&o&&(n<0||o==Ro(r))){let l=r.childNodes[o-1];if(l.nodeType==1)return Qv(l.getBoundingClientRect(),!1)}if(i==null&&o<Ro(r)){let l=r.childNodes[o];if(l.nodeType==1)return Qv(l.getBoundingClientRect(),!0)}return Qv(r.getBoundingClientRect(),n>=0)}if(i==null&&o&&(n<0||o==Ro(r))){let l=r.childNodes[o-1],c=l.nodeType==3?ii(l,Ro(l)-(s?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return pu(Xi(c,1),!1)}if(i==null&&o<Ro(r)){let l=r.childNodes[o];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let c=l?l.nodeType==3?ii(l,0,s?0:1):l.nodeType==1?l:null:null;if(c)return pu(Xi(c,-1),!0)}return pu(Xi(r.nodeType==3?ii(r):r,-n),n>=0)}function pu(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 Qv(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 kR(e,t,n){let r=e.state,o=e.root.activeElement;r!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),o!=e.dom&&o&&o.focus()}}function d9(e,t,n){let r=t.selection,o=n=="up"?r.$from:r.$to;return kR(e,t,()=>{let{node:i}=e.docView.domFromPos(o.pos,n=="up"?-1:1);for(;;){let a=e.docView.nearestDesc(i,!0);if(!a)break;if(a.node.isBlock){i=a.contentDOM||a.dom;break}i=a.dom.parentNode}let s=SR(e,o.pos,1);for(let a=i.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=ii(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;c<l.length;c++){let u=l[c];if(u.bottom>u.top+1&&(n=="up"?s.top-u.top>(u.bottom-s.top)*2:u.bottom-s.bottom>(s.bottom-u.top)*2))return!1}}return!0})}const f9=/[\u0590-\u08ac]/;function p9(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,s=o==r.parent.content.size,a=e.domSelection();return!f9.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?i:s:kR(e,t,()=>{let{focusNode:l,focusOffset:c,anchorNode:u,anchorOffset:d}=e.domSelectionRange(),f=a.caretBidiLevel;a.modify("move",n,"character");let h=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:m,focusOffset:g}=e.domSelectionRange(),b=m&&!h.contains(m.nodeType==1?m:m.parentNode)||l==m&&c==g;try{a.collapse(u,d),l&&(l!=u||c!=d)&&a.extend&&a.extend(l,c)}catch{}return f!=null&&(a.caretBidiLevel=f),b})}let fE=null,pE=null,hE=!1;function h9(e,t,n){return fE==t&&pE==n?hE:(fE=t,pE=n,hE=n=="up"||n=="down"?d9(e,t,n):p9(e,t,n))}const Rr=0,mE=1,ba=2,Bo=3;class Bf{constructor(t,n,r,o){this.parent=t,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=Rr,r.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,n,r){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let n=0;n<this.children.length;n++)t+=this.children[n].size;return t}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let t=0;t<this.children.length;t++)this.children[t].destroy()}posBeforeChild(t){for(let n=0,r=this.posAtStart;;n++){let o=this.children[n];if(o==t)return r;r+=o.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(t,n,r){if(this.contentDOM&&this.contentDOM.contains(t.nodeType==1?t:t.parentNode))if(r<0){let i,s;if(t==this.contentDOM)i=t.childNodes[n-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;i=t.previousSibling}for(;i&&!((s=i.pmViewDesc)&&s.parent==this);)i=i.previousSibling;return i?this.posBeforeChild(s)+s.size:this.posAtStart}else{let i,s;if(t==this.contentDOM)i=t.childNodes[n];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;i=t.nextSibling}for(;i&&!((s=i.pmViewDesc)&&s.parent==this);)i=i.nextSibling;return i?this.posBeforeChild(s):this.posAtEnd}let o;if(t==this.dom&&this.contentDOM)o=n>kn(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=t.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let i=t;;i=i.parentNode){if(i==this.dom){o=!1;break}if(i.previousSibling)break}if(o==null&&n==t.childNodes.length)for(let i=t;;i=i.parentNode){if(i==this.dom){o=!0;break}if(i.nextSibling)break}}return o??r>0?this.posAtEnd:this.posAtStart}nearestDesc(t,n=!1){for(let r=!0,o=t;o;o=o.parentNode){let i=this.getDesc(o),s;if(i&&(!n||i.node))if(r&&(s=i.nodeDOM)&&!(s.nodeType==1?s.contains(t.nodeType==1?t:t.parentNode):s==t))r=!1;else return i}}getDesc(t){let n=t.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(t,n,r){for(let o=t;o;o=o.parentNode){let i=this.getDesc(o);if(i)return i.localPosFromDOM(t,n,r)}return-1}descAt(t){for(let n=0,r=0;n<this.children.length;n++){let o=this.children[n],i=r+o.size;if(r==t&&i!=r){for(;!o.border&&o.children.length;)o=o.children[0];return o}if(t<i)return o.descAt(t-r-o.border);r=i}}domFromPos(t,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:t+1};let r=0,o=0;for(let i=0;r<this.children.length;r++){let s=this.children[r],a=i+s.size;if(a>t||s instanceof CR){o=t-i;break}i=a}if(o)return this.children[r].domFromPos(o-this.children[r].border,n);for(let i;r&&!(i=this.children[r-1]).size&&i instanceof ER&&i.side>=0;r--);if(n<=0){let i,s=!0;for(;i=r?this.children[r-1]:null,!(!i||i.dom.parentNode==this.contentDOM);r--,s=!1);return i&&n&&s&&!i.border&&!i.domAtom?i.domFromPos(i.size,n):{node:this.contentDOM,offset:i?kn(i.dom)+1:0}}else{let i,s=!0;for(;i=r<this.children.length?this.children[r]:null,!(!i||i.dom.parentNode==this.contentDOM);r++,s=!1);return i&&s&&!i.border&&!i.domAtom?i.domFromPos(0,n):{node:this.contentDOM,offset:i?kn(i.dom):this.contentDOM.childNodes.length}}}parseRange(t,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:t,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let o=-1,i=-1;for(let s=r,a=0;;a++){let l=this.children[a],c=s+l.size;if(o==-1&&t<=c){let u=s+l.border;if(t>=u&&n<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(t,n,u);t=s;for(let d=a;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){o=kn(f.dom)+1;break}t-=f.size}o==-1&&(o=0)}if(o>-1&&(c>n||a==this.children.length-1)){n=c;for(let u=a+1;u<this.children.length;u++){let d=this.children[u];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){i=kn(d.dom);break}n+=d.size}i==-1&&(i=this.contentDOM.childNodes.length);break}s=c}return{node:this.contentDOM,from:t,to:n,fromOffset:o,toOffset:i}}emptyChildAt(t){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[t<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(t)}domAfterPos(t){let{node:n,offset:r}=this.domFromPos(t,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+t);return n.childNodes[r]}setSelection(t,n,r,o=!1){let i=Math.min(t,n),s=Math.max(t,n);for(let f=0,h=0;f<this.children.length;f++){let m=this.children[f],g=h+m.size;if(i>h&&s<g)return m.setSelection(t-h-m.border,n-h-m.border,r,o);h=g}let a=this.domFromPos(t,t?-1:1),l=n==t?a:this.domFromPos(n,n?-1:1),c=r.getSelection(),u=!1;if((vo||Mn)&&t==n){let{node:f,offset:h}=a;if(f.nodeType==3){if(u=!!(h&&f.nodeValue[h-1]==`
352
- `),u&&h==f.nodeValue.length)for(let m=f,g;m;m=m.parentNode){if(g=m.nextSibling){g.nodeName=="BR"&&(a=l={node:g.parentNode,offset:kn(g)+1});break}let b=m.pmViewDesc;if(b&&b.node&&b.node.isBlock)break}}else{let m=f.childNodes[h-1];u=m&&(m.nodeName=="BR"||m.contentEditable=="false")}}if(vo&&c.focusNode&&c.focusNode!=l.node&&c.focusNode.nodeType==1){let f=c.focusNode.childNodes[c.focusOffset];f&&f.contentEditable=="false"&&(o=!0)}if(!(o||u&&Mn)&&Ua(a.node,a.offset,c.anchorNode,c.anchorOffset)&&Ua(l.node,l.offset,c.focusNode,c.focusOffset))return;let d=!1;if((c.extend||t==n)&&!u){c.collapse(a.node,a.offset);try{t!=n&&c.extend(l.node,l.offset),d=!0}catch{}}if(!d){if(t>n){let h=a;a=l,l=h}let f=document.createRange();f.setEnd(l.node,l.offset),f.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(f)}}ignoreMutation(t){return!this.contentDOM&&t.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,n){for(let r=0,o=0;o<this.children.length;o++){let i=this.children[o],s=r+i.size;if(r==s?t<=s&&n>=r:t<s&&n>r){let a=r+i.border,l=s-i.border;if(t>=a&&n<=l){this.dirty=t==r||n==s?ba:mE,t==a&&n==l&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=Bo:i.markDirty(t-a,n-a);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?ba:Bo}r=s}this.dirty=ba}markParentsDirty(){let t=1;for(let n=this.parent;n;n=n.parent,t++){let r=t==1?ba:mE;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class ER extends Bf{constructor(t,n,r,o){let i,s=n.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{if(!i)return o;if(i.parent)return i.parent.posBeforeChild(i)})),!n.type.spec.raw){if(s.nodeType!=1){let a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(t,[],s,null),this.widget=n,this.widget=n,i=this}matchesWidget(t){return this.dirty==Rr&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let n=this.widget.spec.stopEvent;return n?n(t):!1}ignoreMutation(t){return t.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class m9 extends Bf{constructor(t,n,r,o){super(t,[],n,null),this.textDOM=r,this.text=o}get size(){return this.text.length}localPosFromDOM(t,n){return t!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return t.type==="characterData"&&t.target.nodeValue==t.oldValue}}class Ha extends Bf{constructor(t,n,r,o){super(t,[],r,o),this.mark=n}static create(t,n,r,o){let i=o.nodeViews[n.type.name],s=i&&i(n,o,r);return(!s||!s.dom)&&(s=oo.renderSpec(document,n.type.spec.toDOM(n,r))),new Ha(t,n,s.dom,s.contentDOM||s.dom)}parseRule(){return this.dirty&Bo||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return this.dirty!=Bo&&this.mark.eq(t)}markDirty(t,n){if(super.markDirty(t,n),this.dirty!=Rr){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Rr}}slice(t,n,r){let o=Ha.create(this.parent,this.mark,!0,r),i=this.children,s=this.size;n<s&&(i=rx(i,n,s,r)),t>0&&(i=rx(i,0,t,r));for(let a=0;a<i.length;a++)i[a].parent=o;return o.children=i,o}}class Rs extends Bf{constructor(t,n,r,o,i,s,a,l,c){super(t,[],i,s),this.node=n,this.outerDeco=r,this.innerDeco=o,this.nodeDOM=a}static create(t,n,r,o,i,s){let a=i.nodeViews[n.type.name],l,c=a&&a(n,i,()=>{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},r,o),u=c&&c.dom,d=c&&c.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:d}=oo.renderSpec(document,n.type.spec.toDOM(n)));!d&&!n.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let f=u;return u=TR(u,r,n),c?l=new g9(t,n,r,o,u,d||null,f,c,i,s+1):n.isText?new Cg(t,n,r,o,u,f,i):new Rs(t,n,r,o,u,d||null,f,i,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(t.preserveWhitespace="full"),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){t.contentElement=r.dom.parentNode;break}}t.contentElement||(t.getContent=()=>L.empty)}return t}matchesNode(t,n,r){return this.dirty==Rr&&t.eq(this.node)&&nx(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,n){let r=this.node.inlineContent,o=n,i=t.composing?this.localCompositionInfo(t,n):null,s=i&&i.pos>-1?i:null,a=i&&i.pos<0,l=new y9(this,s&&s.node,t);w9(this.node,this.innerDeco,(c,u,d)=>{c.spec.marks?l.syncToMarks(c.spec.marks,r,t):c.type.side>=0&&!d&&l.syncToMarks(u==this.node.childCount?Be.none:this.node.child(u).marks,r,t),l.placeWidget(c,t,o)},(c,u,d,f)=>{l.syncToMarks(c.marks,r,t);let h;l.findNodeMatch(c,u,d,f)||a&&t.state.selection.from>o&&t.state.selection.to<o+c.nodeSize&&(h=l.findIndexWithChild(i.node))>-1&&l.updateNodeAt(c,u,d,h,t)||l.updateNextNode(c,u,d,t,f,o)||l.addNode(c,u,d,t,o),o+=c.nodeSize}),l.syncToMarks([],r,t),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==ba)&&(s&&this.protectLocalComposition(t,s),_R(this.contentDOM,this.children,t),Sc&&S9(this.dom))}localCompositionInfo(t,n){let{from:r,to:o}=t.state.selection;if(!(t.state.selection instanceof Se)||r<n||o>n+this.node.content.size)return null;let i=t.domSelectionRange(),s=k9(i.focusNode,i.focusOffset);if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let a=s.nodeValue,l=E9(this.node.content,a,r-n,o-n);return l<0?null:{node:s,pos:l,text:a}}else return{node:s,pos:-1,text:""}}protectLocalComposition(t,{node:n,pos:r,text:o}){if(this.getDesc(n))return;let i=n;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&&(i.pmViewDesc=void 0)}let s=new m9(this,i,n,o);t.input.compositionNodes.push(s),this.children=rx(this.children,r,r+o.length,t,s)}update(t,n,r,o){return this.dirty==Bo||!t.sameMarkup(this.node)?!1:(this.updateInner(t,n,r,o),!0)}updateInner(t,n,r,o){this.updateOuterDeco(n),this.node=t,this.innerDeco=r,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=Rr}updateOuterDeco(t){if(nx(t,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=OR(this.dom,this.nodeDOM,tx(this.outerDeco,this.node,n),tx(t,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function gE(e,t,n,r,o){TR(r,t,e);let i=new Rs(void 0,e,t,n,r,r,r,o,0);return i.contentDOM&&i.updateChildren(o,0),i}class Cg extends Rs{constructor(t,n,r,o,i,s,a){super(t,n,r,o,i,null,s,a,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,n,r,o){return this.dirty==Bo||this.dirty!=Rr&&!this.inParent()||!t.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Rr||t.text!=this.node.text)&&t.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=t.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=t,this.dirty=Rr,!0)}inParent(){let t=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,n,r){return t==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(t,n,r)}ignoreMutation(t){return t.type!="characterData"&&t.type!="selection"}slice(t,n,r){let o=this.node.cut(t,n),i=document.createTextNode(o.text);return new Cg(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)}markDirty(t,n){super.markDirty(t,n),this.dom!=this.nodeDOM&&(t==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=Bo)}get domAtom(){return!1}}class CR extends Bf{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==Rr&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class g9 extends Rs{constructor(t,n,r,o,i,s,a,l,c,u){super(t,n,r,o,i,s,a,c,u),this.spec=l}update(t,n,r,o){if(this.dirty==Bo)return!1;if(this.spec.update){let i=this.spec.update(t,n,r);return i&&this.updateInner(t,n,r,o),i}else return!this.contentDOM&&!t.isLeaf?!1:super.update(t,n,r,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,n,r,o){this.spec.setSelection?this.spec.setSelection(t,n,r):super.setSelection(t,n,r,o)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return this.spec.stopEvent?this.spec.stopEvent(t):!1}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function _R(e,t,n){let r=e.firstChild,o=!1;for(let i=0;i<t.length;i++){let s=t[i],a=s.dom;if(a.parentNode==e){for(;a!=r;)r=vE(r),o=!0;r=r.nextSibling}else o=!0,e.insertBefore(a,r);if(s instanceof Ha){let l=r?r.previousSibling:e.lastChild;_R(s.contentDOM,s.children,n),r=l?l.nextSibling:e.firstChild}}for(;r;)r=vE(r),o=!0;o&&n.trackWrites==e&&(n.trackWrites=null)}const ud=function(e){e&&(this.nodeName=e)};ud.prototype=Object.create(null);const wa=[new ud];function tx(e,t,n){if(e.length==0)return wa;let r=n?wa[0]:new ud,o=[r];for(let i=0;i<e.length;i++){let s=e[i].type.attrs;if(s){s.nodeName&&o.push(r=new ud(s.nodeName));for(let a in s){let l=s[a];l!=null&&(n&&o.length==1&&o.push(r=new ud(t.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+l:a=="style"?r.style=(r.style?r.style+";":"")+l:a!="nodeName"&&(r[a]=l))}}}return o}function OR(e,t,n,r){if(n==wa&&r==wa)return t;let o=t;for(let i=0;i<r.length;i++){let s=r[i],a=n[i];if(i){let l;a&&a.nodeName==s.nodeName&&o!=e&&(l=o.parentNode)&&l.nodeName.toLowerCase()==s.nodeName||(l=document.createElement(s.nodeName),l.pmIsDeco=!0,l.appendChild(o),a=wa[0]),o=l}v9(o,a||wa[0],s)}return o}function v9(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):[],o=n.class?n.class.split(" ").filter(Boolean):[];for(let i=0;i<r.length;i++)o.indexOf(r[i])==-1&&e.classList.remove(r[i]);for(let i=0;i<o.length;i++)r.indexOf(o[i])==-1&&e.classList.add(o[i]);e.classList.length==0&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,o;for(;o=r.exec(t.style);)e.style.removeProperty(o[1])}n.style&&(e.style.cssText+=n.style)}}function TR(e,t,n){return OR(e,e,wa,tx(t,n,e.nodeType!=1))}function nx(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 vE(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class y9{constructor(t,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=x9(t.node.content,t)}destroyBetween(t,n){if(t!=n){for(let r=t;r<n;r++)this.top.children[r].destroy();this.top.children.splice(t,n-t),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(t,n,r){let o=0,i=this.stack.length>>1,s=Math.min(i,t.length);for(;o<s&&(o==i-1?this.top:this.stack[o+1<<1]).matchesMark(t[o])&&t[o].type.spec.spanning!==!1;)o++;for(;o<i;)this.destroyRest(),this.top.dirty=Rr,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<t.length;){this.stack.push(this.top,this.index+1);let a=-1;for(let l=this.index;l<Math.min(this.index+3,this.top.children.length);l++){let c=this.top.children[l];if(c.matchesMark(t[i])&&!this.isLocked(c.dom)){a=l;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=Ha.create(this.top,t[i],n,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,i++}}findNodeMatch(t,n,r,o){let i=-1,s;if(o>=this.preMatch.index&&(s=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&s.matchesNode(t,n,r))i=this.top.children.indexOf(s,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let c=this.top.children[a];if(c.matchesNode(t,n,r)&&!this.preMatch.matched.has(c)){i=a;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(t,n,r,o,i){let s=this.top.children[o];return s.dirty==Bo&&s.dom==s.contentDOM&&(s.dirty=ba),s.update(t,n,r,i)?(this.destroyBetween(this.index,o),this.index++,!0):!1}findIndexWithChild(t){for(;;){let n=t.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=t.pmViewDesc;if(r){for(let o=this.index;o<this.top.children.length;o++)if(this.top.children[o]==r)return o}return-1}t=n}}updateNextNode(t,n,r,o,i,s){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof Rs){let c=this.preMatch.matched.get(l);if(c!=null&&c!=i)return!1;let u=l.dom,d,f=this.isLocked(u)&&!(t.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==t.text&&l.dirty!=Bo&&nx(n,l.outerDeco));if(!f&&l.update(t,n,r,o))return this.destroyBetween(this.index,a),l.dom!=u&&(this.changed=!0),this.index++,!0;if(!f&&(d=this.recreateWrapper(l,t,n,r,o,s)))return this.top.children[this.index]=d,d.contentDOM&&(d.dirty=ba,d.updateChildren(o,s+1),d.dirty=Rr),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(t,n,r,o,i,s){if(t.dirty||n.isAtom||!t.children.length||!t.node.content.eq(n.content))return null;let a=Rs.create(this.top,n,r,o,i,s);if(a.contentDOM){a.children=t.children,t.children=[];for(let l of a.children)l.parent=a}return t.destroy(),a}addNode(t,n,r,o,i){let s=Rs.create(this.top,t,n,r,o,i);s.contentDOM&&s.updateChildren(o,i+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(t,n,r){let o=this.index<this.top.children.length?this.top.children[this.index]:null;if(o&&o.matchesWidget(t)&&(t==o.widget||!o.widget.type.toDOM.parentNode))this.index++;else{let i=new ER(this.top,t,n,r);this.top.children.splice(this.index++,0,i),this.changed=!0}}addTextblockHacks(){let t=this.top.children[this.index-1],n=this.top;for(;t instanceof Ha;)n=t,t=n.children[n.children.length-1];(!t||!(t instanceof Cg)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((Mn||mn)&&t&&t.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(t,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(t))this.index++;else{let r=document.createElement(t);t=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),t=="BR"&&(r.className="ProseMirror-trailingBreak");let o=new CR(this.top,[],r,null);n!=this.top?n.children.push(o):n.children.splice(this.index++,0,o),this.changed=!0}}isLocked(t){return this.lock&&(t==this.lock||t.nodeType==1&&t.contains(this.lock.parentNode))}}function x9(e,t){let n=t,r=n.children.length,o=e.childCount,i=new Map,s=[];e:for(;o>0;){let a;for(;;)if(r){let c=n.children[r-1];if(c instanceof Ha)n=c,r=c.children.length;else{a=c,r--;break}}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=e.child(o-1))break;--o,i.set(a,o),s.push(a)}}return{index:o,matched:i,matches:s.reverse()}}function b9(e,t){return e.type.side-t.type.side}function w9(e,t,n,r){let o=t.locals(e),i=0;if(o.length==0){for(let c=0;c<e.childCount;c++){let u=e.child(c);r(u,o,t.forChild(i,u),c),i+=u.nodeSize}return}let s=0,a=[],l=null;for(let c=0;;){let u,d;for(;s<o.length&&o[s].to==i;){let b=o[s++];b.widget&&(u?(d||(d=[u])).push(b):u=b)}if(u)if(d){d.sort(b9);for(let b=0;b<d.length;b++)n(d[b],c,!!l)}else n(u,c,!!l);let f,h;if(l)h=-1,f=l,l=null;else if(c<e.childCount)h=c,f=e.child(c++);else break;for(let b=0;b<a.length;b++)a[b].to<=i&&a.splice(b--,1);for(;s<o.length&&o[s].from<=i&&o[s].to>i;)a.push(o[s++]);let m=i+f.nodeSize;if(f.isText){let b=m;s<o.length&&o[s].from<b&&(b=o[s].from);for(let y=0;y<a.length;y++)a[y].to<b&&(b=a[y].to);b<m&&(l=f.cut(b-i),f=f.cut(0,b-i),m=b,h=-1)}else for(;s<o.length&&o[s].to<m;)s++;let g=f.isInline&&!f.isLeaf?a.filter(b=>!b.inline):a.slice();r(f,g,t.forChild(i,f),h),i=m}}function S9(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 k9(e,t){for(;;){if(e.nodeType==3)return e;if(e.nodeType==1&&t>0){if(e.childNodes.length>t&&e.childNodes[t].nodeType==3)return e.childNodes[t];e=e.childNodes[t-1],t=Ro(e)}else if(e.nodeType==1&&t<e.childNodes.length)e=e.childNodes[t],t=0;else return null}}function E9(e,t,n,r){for(let o=0,i=0;o<e.childCount&&i<=r;){let s=e.child(o++),a=i;if(i+=s.nodeSize,!s.isText)continue;let l=s.text;for(;o<e.childCount;){let c=e.child(o++);if(i+=c.nodeSize,!c.isText)break;l+=c.text}if(i>=n){if(i>=r&&l.slice(r-t.length-a,r-a)==t)return r-t.length;let c=a<r?l.lastIndexOf(t,r-a-1):-1;if(c>=0&&c+t.length+a>=n)return a+c;if(n==r&&l.length>=r+t.length-a&&l.slice(r-a,r-a+t.length)==t)return r}}return-1}function rx(e,t,n,r,o){let i=[];for(let s=0,a=0;s<e.length;s++){let l=e[s],c=a,u=a+=l.size;c>=n||u<=t?i.push(l):(c<t&&i.push(l.slice(0,t-c,r)),o&&(i.push(o),o=void 0),u>n&&i.push(l.slice(n-c,l.size,r)))}return i}function u1(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let o=e.docView.nearestDesc(n.focusNode),i=o&&o.size==0,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a=r.resolve(s),l,c;if(Eg(n)){for(l=a;o&&!o.node;)o=o.parent;let u=o.node;if(o&&u.isAtom&&ge.isSelectable(u)&&o.parent&&!(u.isInline&&G8(n.focusNode,n.focusOffset,o.dom))){let d=o.posBefore;c=new ge(s==d?a:r.resolve(d))}}else{let u=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(u<0)return null;l=r.resolve(u)}if(!c){let u=t=="pointer"||e.state.selection.head<a.pos&&!i?1:-1;c=d1(e,l,a,u)}return c}function MR(e){return e.editable?e.hasFocus():PR(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function yi(e,t=!1){let n=e.state.selection;if(RR(e,n),!!MR(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&mn){let r=e.domSelectionRange(),o=e.domObserver.currentSelection;if(r.anchorNode&&o.anchorNode&&Ua(r.anchorNode,r.anchorOffset,o.anchorNode,o.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)_9(e);else{let{anchor:r,head:o}=n,i,s;yE&&!(n instanceof Se)&&(n.$from.parent.inlineContent||(i=xE(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(s=xE(e,n.to))),e.docView.setSelection(r,o,e.root,t),yE&&(i&&bE(i),s&&bE(s)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&C9(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const yE=Mn||mn&&Z8<63;function xE(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),o=r<n.childNodes.length?n.childNodes[r]:null,i=r?n.childNodes[r-1]:null;if(Mn&&o&&o.contentEditable=="false")return ey(o);if((!o||o.contentEditable=="false")&&(!i||i.contentEditable=="false")){if(o)return ey(o);if(i)return ey(i)}}function ey(e){return e.contentEditable="true",Mn&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function bE(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function C9(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,o=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=o)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!MR(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function _9(e){let t=e.domSelection(),n=document.createRange(),r=e.cursorWrapper.dom,o=r.nodeName=="IMG";o?n.setEnd(r.parentNode,kn(r)+1):n.setEnd(r,0),n.collapse(!1),t.removeAllRanges(),t.addRange(n),!o&&!e.state.selection.visible&&Hn&&Ms<=11&&(r.disabled=!0,r.disabled=!1)}function RR(e,t){if(t instanceof ge){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(wE(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else wE(e)}function wE(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function d1(e,t,n,r){return e.someProp("createSelectionBetween",o=>o(e,t,n))||Se.between(t,n,r)}function SE(e){return e.editable&&!e.hasFocus()?!1:PR(e)}function PR(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 O9(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return Ua(t.node,t.offset,n.anchorNode,n.anchorOffset)}function ox(e,t){let{$anchor:n,$head:r}=e.selection,o=t>0?n.max(r):n.min(r),i=o.parent.inlineContent?o.depth?e.doc.resolve(t>0?o.after():o.before()):null:o;return i&&$e.findFrom(i,t)}function ss(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function kE(e,t,n){let r=e.state.selection;if(r instanceof Se)if(n.indexOf("s")>-1){let{$head:o}=r,i=o.textOffset?null:t<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let s=e.state.doc.resolve(o.pos+i.nodeSize*(t<0?-1:1));return ss(e,new Se(r.$anchor,s))}else if(r.empty){if(e.endOfTextblock(t>0?"forward":"backward")){let o=ox(e.state,t);return o&&o instanceof ge?ss(e,o):!1}else if(!(Sr&&n.indexOf("m")>-1)){let o=r.$head,i=o.textOffset?null:t<0?o.nodeBefore:o.nodeAfter,s;if(!i||i.isText)return!1;let a=t<0?o.pos-i.nodeSize:o.pos;return i.isAtom||(s=e.docView.descAt(a))&&!s.contentDOM?ge.isSelectable(i)?ss(e,new ge(t<0?e.state.doc.resolve(o.pos-i.nodeSize):o)):Ff?ss(e,new Se(e.state.doc.resolve(t<0?a:a+i.nodeSize))):!1:!1}}else return!1;else{if(r instanceof ge&&r.node.isInline)return ss(e,new Se(t>0?r.$to:r.$from));{let o=ox(e.state,t);return o?ss(e,o):!1}}}function mm(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function dd(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!="BR")}function hl(e,t){return t<0?T9(e):M9(e)}function T9(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o,i,s=!1;for(vo&&n.nodeType==1&&r<mm(n)&&dd(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(dd(a,-1))o=n,i=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(NR(n))break;{let a=n.previousSibling;for(;a&&dd(a,-1);)o=n.parentNode,i=kn(a),a=a.previousSibling;if(a)n=a,r=mm(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}s?ix(e,n,r):o&&ix(e,o,i)}function M9(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o=mm(n),i,s;for(;;)if(r<o){if(n.nodeType!=1)break;let a=n.childNodes[r];if(dd(a,1))i=n,s=++r;else break}else{if(NR(n))break;{let a=n.nextSibling;for(;a&&dd(a,1);)i=a.parentNode,s=kn(a)+1,a=a.nextSibling;if(a)n=a,r=0,o=mm(n);else{if(n=n.parentNode,n==e.dom)break;r=o=0}}}i&&ix(e,i,s)}function NR(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function R9(e,t){for(;e&&t==e.childNodes.length&&!l1(e);)t=kn(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 P9(e,t){for(;e&&!t&&!l1(e);)t=kn(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 ix(e,t,n){if(t.nodeType!=3){let i,s;(s=R9(t,n))?(t=s,n=0):(i=P9(t,n))&&(t=i,n=i.nodeValue.length)}let r=e.domSelection();if(Eg(r)){let i=document.createRange();i.setEnd(t,n),i.setStart(t,n),r.removeAllRanges(),r.addRange(i)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:o}=e;setTimeout(()=>{e.state==o&&yi(e)},50)}function EE(e,t){let n=e.state.doc.resolve(t);if(!(mn||J8)&&n.parent.inlineContent){let o=e.coordsAtPos(t);if(t>n.start()){let i=e.coordsAtPos(t-1),s=(i.top+i.bottom)/2;if(s>o.top&&s<o.bottom&&Math.abs(i.left-o.left)>1)return i.left<o.left?"ltr":"rtl"}if(t<n.end()){let i=e.coordsAtPos(t+1),s=(i.top+i.bottom)/2;if(s>o.top&&s<o.bottom&&Math.abs(i.left-o.left)>1)return i.left>o.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function CE(e,t,n){let r=e.state.selection;if(r instanceof Se&&!r.empty||n.indexOf("s")>-1||Sr&&n.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let s=ox(e.state,t);if(s&&s instanceof ge)return ss(e,s)}if(!o.parent.inlineContent){let s=t<0?o:i,a=r instanceof On?$e.near(s,t):$e.findFrom(s,t);return a?ss(e,a):!1}return!1}function _E(e,t){if(!(e.state.selection instanceof Se))return!0;let{$head:n,$anchor:r,empty:o}=e.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let i=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let s=e.state.tr;return t<0?s.delete(n.pos-i.nodeSize,n.pos):s.delete(n.pos,n.pos+i.nodeSize),e.dispatch(s),!0}return!1}function OE(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function N9(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 r=t.firstChild;OE(e,r,"true"),setTimeout(()=>OE(e,r,"false"),20)}return!1}function $9(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function D9(e,t){let n=t.keyCode,r=$9(t);if(n==8||Sr&&n==72&&r=="c")return _E(e,-1)||hl(e,-1);if(n==46&&!t.shiftKey||Sr&&n==68&&r=="c")return _E(e,1)||hl(e,1);if(n==13||n==27)return!0;if(n==37||Sr&&n==66&&r=="c"){let o=n==37?EE(e,e.state.selection.from)=="ltr"?-1:1:-1;return kE(e,o,r)||hl(e,o)}else if(n==39||Sr&&n==70&&r=="c"){let o=n==39?EE(e,e.state.selection.from)=="ltr"?1:-1:1;return kE(e,o,r)||hl(e,o)}else{if(n==38||Sr&&n==80&&r=="c")return CE(e,-1,r)||hl(e,-1);if(n==40||Sr&&n==78&&r=="c")return N9(e)||CE(e,1,r)||hl(e,1);if(r==(Sr?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function $R(e,t){e.someProp("transformCopied",h=>{t=h(t,e)});let n=[],{content:r,openStart:o,openEnd:i}=t;for(;o>1&&i>1&&r.childCount==1&&r.firstChild.childCount==1;){o--,i--;let h=r.firstChild;n.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),r=h.content}let s=e.someProp("clipboardSerializer")||oo.fromSchema(e.state.schema),a=zR(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c=l.firstChild,u,d=0;for(;c&&c.nodeType==1&&(u=jR[c.nodeName.toLowerCase()]);){for(let h=u.length-1;h>=0;h--){let m=a.createElement(u[h]);for(;l.firstChild;)m.appendChild(l.firstChild);l.appendChild(m),d++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${o} ${i}${d?` -${d}`:""} ${JSON.stringify(n)}`);let f=e.someProp("clipboardTextSerializer",h=>h(t,e))||t.content.textBetween(0,t.content.size,`
353
-
354
- `);return{dom:l,text:f}}function DR(e,t,n,r,o){let i=o.parent.type.spec.code,s,a;if(!n&&!t)return null;let l=t&&(r||i||!n);if(l){if(e.someProp("transformPastedText",f=>{t=f(t,i||r,e)}),i)return t?new Y(L.from(e.state.schema.text(t.replace(/\r\n?/g,`
355
- `))),0,0):Y.empty;let d=e.someProp("clipboardTextParser",f=>f(t,o,r,e));if(d)a=d;else{let f=o.marks(),{schema:h}=e.state,m=oo.fromSchema(h);s=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(g=>{let b=s.appendChild(document.createElement("p"));g&&b.appendChild(m.serializeNode(h.text(g,f)))})}}else e.someProp("transformPastedHTML",d=>{n=d(n,e)}),s=L9(n),Ff&&j9(s);let c=s&&s.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let d=+u[3];d>0;d--){let f=s.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;s=f}if(a||(a=(e.someProp("clipboardParser")||e.someProp("domParser")||xc.fromSchema(e.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||u),context:o,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!A9.test(f.parentNode.nodeName)?{ignore:!0}:null}})),u)a=z9(TE(a,+u[1],+u[2]),u[4]);else if(a=Y.maxOpen(I9(a.content,o),!0),a.openStart||a.openEnd){let d=0,f=0;for(let h=a.content.firstChild;d<a.openStart&&!h.type.spec.isolating;d++,h=h.firstChild);for(let h=a.content.lastChild;f<a.openEnd&&!h.type.spec.isolating;f++,h=h.lastChild);a=TE(a,d,f)}return e.someProp("transformPasted",d=>{a=d(a,e)}),a}const A9=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function I9(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let o=t.node(n).contentMatchAt(t.index(n)),i,s=[];if(e.forEach(a=>{if(!s)return;let l=o.findWrapping(a.type),c;if(!l)return s=null;if(c=s.length&&i.length&&IR(l,i,a,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=LR(s[s.length-1],i.length));let u=AR(a,l);s.push(u),o=o.matchType(u.type),i=l}}),s)return L.from(s)}return e}function AR(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,L.from(e));return e}function IR(e,t,n,r,o){if(o<e.length&&o<t.length&&e[o]==t[o]){let i=IR(e,t,n,r.lastChild,o+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(o==e.length-1?n.type:e[o+1]))return r.copy(r.content.append(L.from(AR(n,e,o+1))))}}function LR(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,LR(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(L.empty,!0);return e.copy(n.append(r))}function sx(e,t,n,r,o,i){let s=t<0?e.firstChild:e.lastChild,a=s.content;return e.childCount>1&&(i=0),o<r-1&&(a=sx(a,t,n,r,o+1,i)),o>=n&&(a=t<0?s.contentMatchAt(0).fillBefore(a,i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(L.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function TE(e,t,n){return t<e.openStart&&(e=new Y(sx(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new Y(sx(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const jR={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let ME=null;function zR(){return ME||(ME=document.implementation.createHTMLDocument("title"))}function L9(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=zR().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e),o;if((o=r&&jR[r[1].toLowerCase()])&&(e=o.map(i=>"<"+i+">").join("")+e+o.map(i=>"</"+i+">").reverse().join("")),n.innerHTML=e,o)for(let i=0;i<o.length;i++)n=n.querySelector(o[i])||n;return n}function j9(e){let t=e.querySelectorAll(mn?"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==" "&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}function z9(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:o,openStart:i,openEnd:s}=e;for(let a=r.length-2;a>=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;o=L.from(l.create(r[a+1],o)),i++,s++}return new Y(o,i,s)}const Rn={},Pn={},F9={touchstart:!0,touchmove:!0};class B9{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function V9(e){for(let t in Rn){let n=Rn[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=r=>{H9(e,r)&&!f1(e,r)&&(e.editable||!(r.type in Pn))&&n(e,r)},F9[t]?{passive:!0}:void 0)}Mn&&e.dom.addEventListener("input",()=>null),ax(e)}function vs(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function U9(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 ax(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=r=>f1(e,r))})}function f1(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function H9(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 W9(e,t){!f1(e,t)&&Rn[t.type]&&(e.editable||!(t.type in Pn))&&Rn[t.type](e,t)}Pn.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!BR(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Qr&&mn&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),Sc&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();e.input.lastIOSEnter=r,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==r&&(e.someProp("handleKeyDown",o=>o(e,fa(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",r=>r(e,n))||D9(e,n)?n.preventDefault():vs(e,"key")};Pn.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)};Pn.keypress=(e,t)=>{let n=t;if(BR(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Sr&&n.metaKey)return;if(e.someProp("handleKeyPress",o=>o(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof Se)||!r.$from.sameParent(r.$to)){let o=String.fromCharCode(n.charCode);!/[\r\n]/.test(o)&&!e.someProp("handleTextInput",i=>i(e,r.$from.pos,r.$to.pos,o))&&e.dispatch(e.state.tr.insertText(o).scrollIntoView()),n.preventDefault()}};function _g(e){return{left:e.clientX,top:e.clientY}}function K9(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function p1(e,t,n,r,o){if(r==-1)return!1;let i=e.state.doc.resolve(r);for(let s=i.depth+1;s>0;s--)if(e.someProp(t,a=>s>i.depth?a(e,n,i.nodeAfter,i.before(s),o,!0):a(e,n,i.node(s),i.before(s),o,!1)))return!0;return!1}function rc(e,t,n){e.focused||e.focus();let r=e.state.tr.setSelection(t);n=="pointer"&&r.setMeta("pointer",!0),e.dispatch(r)}function q9(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&ge.isSelectable(r)?(rc(e,new ge(n),"pointer"),!0):!1}function G9(e,t){if(t==-1)return!1;let n=e.state.selection,r,o;n instanceof ge&&(r=n.node);let i=e.state.doc.resolve(t);for(let s=i.depth+1;s>0;s--){let a=s>i.depth?i.nodeAfter:i.node(s);if(ge.isSelectable(a)){r&&n.$from.depth>0&&s>=n.$from.depth&&i.before(n.$from.depth+1)==n.$from.pos?o=i.before(n.$from.depth):o=i.before(s);break}}return o!=null?(rc(e,ge.create(e.state.doc,o),"pointer"),!0):!1}function Y9(e,t,n,r,o){return p1(e,"handleClickOn",t,n,r)||e.someProp("handleClick",i=>i(e,t,r))||(o?G9(e,n):q9(e,n))}function X9(e,t,n,r){return p1(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",o=>o(e,t,r))}function Z9(e,t,n,r){return p1(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",o=>o(e,t,r))||J9(e,n,r)}function J9(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?(rc(e,Se.create(r,0,r.content.size),"pointer"),!0):!1;let o=r.resolve(t);for(let i=o.depth+1;i>0;i--){let s=i>o.depth?o.nodeAfter:o.node(i),a=o.before(i);if(s.inlineContent)rc(e,Se.create(r,a+1,a+1+s.content.size),"pointer");else if(ge.isSelectable(s))rc(e,ge.create(r,a),"pointer");else continue;return!0}}function h1(e){return gm(e)}const FR=Sr?"metaKey":"ctrlKey";Rn.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=h1(e),o=Date.now(),i="singleClick";o-e.input.lastClick.time<500&&K9(n,e.input.lastClick)&&!n[FR]&&(e.input.lastClick.type=="singleClick"?i="doubleClick":e.input.lastClick.type=="doubleClick"&&(i="tripleClick")),e.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i};let s=e.posAtCoords(_g(n));s&&(i=="singleClick"?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new Q9(e,s,n,!!r)):(i=="doubleClick"?X9:Z9)(e,s.pos,s.inside,n)?n.preventDefault():vs(e,"pointer"))};class Q9{constructor(t,n,r,o){this.view=t,this.pos=n,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!r[FR],this.allowDefault=r.shiftKey;let i,s;if(n.inside>-1)i=t.state.doc.nodeAt(n.inside),s=n.inside;else{let u=t.state.doc.resolve(n.pos);i=u.parent,s=u.depth?u.before():0}const a=o?null:r.target,l=a?t.docView.nearestDesc(a,!0):null;this.target=l?l.dom:null;let{selection:c}=t.state;(r.button==0&&i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof ge&&c.from<=s&&c.to>s)&&(this.mightDrag={node:i,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&vo&&!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()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),vs(t,"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(()=>yi(this.view)),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(_g(t))),this.updateAllowDefault(t),this.allowDefault||!n?vs(this.view,"pointer"):Y9(this.view,n.pos,n.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||Mn&&this.mightDrag&&!this.mightDrag.node.isAtom||mn&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(rc(this.view,$e.near(this.view.state.doc.resolve(n.pos)),"pointer"),t.preventDefault()):vs(this.view,"pointer")}move(t){this.updateAllowDefault(t),vs(this.view,"pointer"),t.buttons==0&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}Rn.touchstart=e=>{e.input.lastTouch=Date.now(),h1(e),vs(e,"pointer")};Rn.touchmove=e=>{e.input.lastTouch=Date.now(),vs(e,"pointer")};Rn.contextmenu=e=>h1(e);function BR(e,t){return e.composing?!0:Mn&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const ez=Qr?5e3:-1;Pn.compositionstart=Pn.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))e.markCursor=e.state.storedMarks||n.marks(),gm(e,!0),e.markCursor=null;else if(gm(e),vo&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=e.domSelectionRange();for(let o=r.focusNode,i=r.focusOffset;o&&o.nodeType==1&&i!=0;){let s=i<0?o.lastChild:o.childNodes[i-1];if(!s)break;if(s.nodeType==3){e.domSelection().collapse(s,s.nodeValue.length);break}else o=s,i=-1}}e.input.composing=!0}VR(e,ez)};Pn.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.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,VR(e,20))};function VR(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>gm(e),t))}function UR(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=tz());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function tz(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function gm(e,t=!1){if(!(Qr&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),UR(e),t||e.docView&&e.docView.dirty){let n=u1(e);return n&&!n.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(n)):e.updateState(e.state),!0}return!1}}function nz(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(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}const Jd=Hn&&Ms<15||Sc&&Q8<604;Rn.copy=Pn.cut=(e,t)=>{let n=t,r=e.state.selection,o=n.type=="cut";if(r.empty)return;let i=Jd?null:n.clipboardData,s=r.content(),{dom:a,text:l}=$R(e,s);i?(n.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",l)):nz(e,a),o&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function rz(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function oz(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 o=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Qd(e,r.value,null,o,t):Qd(e,r.textContent,r.innerHTML,o,t)},50)}function Qd(e,t,n,r,o){let i=DR(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",l=>l(e,o,i||Y.empty)))return!0;if(!i)return!1;let s=rz(i),a=s?e.state.tr.replaceSelectionWith(s,r):e.state.tr.replaceSelection(i);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function HR(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," "):""}Pn.paste=(e,t)=>{let n=t;if(e.composing&&!Qr)return;let r=Jd?null:n.clipboardData,o=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&Qd(e,HR(r),r.getData("text/html"),o,n)?n.preventDefault():oz(e,n)};class WR{constructor(t,n,r){this.slice=t,this.move=n,this.node=r}}const KR=Sr?"altKey":"ctrlKey";Rn.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o=e.state.selection,i=o.empty?null:e.posAtCoords(_g(n)),s;if(!(i&&i.pos>=o.from&&i.pos<=(o instanceof ge?o.to-1:o.to))){if(r&&r.mightDrag)s=ge.create(e.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let u=e.docView.nearestDesc(n.target,!0);u&&u.node.type.spec.draggable&&u!=e.docView&&(s=ge.create(e.state.doc,u.posBefore))}}let a=(s||e.state.selection).content(),{dom:l,text:c}=$R(e,a);n.dataTransfer.clearData(),n.dataTransfer.setData(Jd?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",Jd||n.dataTransfer.setData("text/plain",c),e.dragging=new WR(a,!n[KR],s)};Rn.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)};Pn.dragover=Pn.dragenter=(e,t)=>t.preventDefault();Pn.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let o=e.posAtCoords(_g(n));if(!o)return;let i=e.state.doc.resolve(o.pos),s=r&&r.slice;s?e.someProp("transformPasted",m=>{s=m(s,e)}):s=DR(e,HR(n.dataTransfer),Jd?null:n.dataTransfer.getData("text/html"),!1,i);let a=!!(r&&!n[KR]);if(e.someProp("handleDrop",m=>m(e,n,s||Y.empty,a))){n.preventDefault();return}if(!s)return;n.preventDefault();let l=s?sR(e.state.doc,i.pos,s):i.pos;l==null&&(l=i.pos);let c=e.state.tr;if(a){let{node:m}=r;m?m.replace(c):c.deleteSelection()}let u=c.mapping.map(l),d=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,f=c.doc;if(d?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(f))return;let h=c.doc.resolve(u);if(d&&ge.isSelectable(s.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new ge(h));else{let m=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((g,b,y,v)=>m=v),c.setSelection(d1(e,h,c.doc.resolve(m)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))};Rn.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())&&yi(e)},20))};Rn.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(),e.focused=!1)};Rn.beforeinput=(e,t)=>{if(mn&&Qr&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:r}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=r||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",i=>i(e,fa(8,"Backspace")))))return;let{$cursor:o}=e.state.selection;o&&o.pos>0&&e.dispatch(e.state.tr.delete(o.pos-1,o.pos).scrollIntoView())},50)}};for(let e in Pn)Rn[e]=Pn[e];function ef(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}class vm{constructor(t,n){this.toDOM=t,this.spec=n||Oa,this.side=this.spec.side||0}map(t,n,r,o){let{pos:i,deleted:s}=t.mapResult(n.from+o,this.side<0?-1:1);return s?null:new dt(i-r,i-r,this)}valid(){return!0}eq(t){return this==t||t instanceof vm&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&ef(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class Ps{constructor(t,n){this.attrs=t,this.spec=n||Oa}map(t,n,r,o){let i=t.map(n.from+o,this.spec.inclusiveStart?-1:1)-r,s=t.map(n.to+o,this.spec.inclusiveEnd?1:-1)-r;return i>=s?null:new dt(i,s,this)}valid(t,n){return n.from<n.to}eq(t){return this==t||t instanceof Ps&&ef(this.attrs,t.attrs)&&ef(this.spec,t.spec)}static is(t){return t.type instanceof Ps}destroy(){}}class m1{constructor(t,n){this.attrs=t,this.spec=n||Oa}map(t,n,r,o){let i=t.mapResult(n.from+o,1);if(i.deleted)return null;let s=t.mapResult(n.to+o,-1);return s.deleted||s.pos<=i.pos?null:new dt(i.pos-r,s.pos-r,this)}valid(t,n){let{index:r,offset:o}=t.content.findIndex(n.from),i;return o==n.from&&!(i=t.child(r)).isText&&o+i.nodeSize==n.to}eq(t){return this==t||t instanceof m1&&ef(this.attrs,t.attrs)&&ef(this.spec,t.spec)}destroy(){}}class dt{constructor(t,n,r){this.from=t,this.to=n,this.type=r}copy(t,n){return new dt(t,n,this.type)}eq(t,n=0){return this.type.eq(t.type)&&this.from+n==t.from&&this.to+n==t.to}map(t,n,r){return this.type.map(t,this,n,r)}static widget(t,n,r){return new dt(t,t,new vm(n,r))}static inline(t,n,r,o){return new dt(t,n,new Ps(r,o))}static node(t,n,r,o){return new dt(t,n,new m1(r,o))}get spec(){return this.type.spec}get inline(){return this.type instanceof Ps}get widget(){return this.type instanceof vm}}const El=[],Oa={};class qe{constructor(t,n){this.local=t.length?t:El,this.children=n.length?n:El}static create(t,n){return n.length?ym(n,t,0,Oa):pn}find(t,n,r){let o=[];return this.findInner(t??0,n??1e9,o,0,r),o}findInner(t,n,r,o,i){for(let s=0;s<this.local.length;s++){let a=this.local[s];a.from<=n&&a.to>=t&&(!i||i(a.spec))&&r.push(a.copy(a.from+o,a.to+o))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<n&&this.children[s+1]>t){let a=this.children[s]+1;this.children[s+2].findInner(t-a,n-a,r,o+a,i)}}map(t,n,r){return this==pn||t.maps.length==0?this:this.mapInner(t,n,0,0,r||Oa)}mapInner(t,n,r,o,i){let s;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(t,r,o);l&&l.type.valid(n,l)?(s||(s=[])).push(l):i.onRemove&&i.onRemove(this.local[a].spec)}return this.children.length?iz(this.children,s||[],t,n,r,o,i):s?new qe(s.sort(Ta),El):pn}add(t,n){return n.length?this==pn?qe.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let o,i=0;t.forEach((a,l)=>{let c=l+r,u;if(u=GR(n,a,c)){for(o||(o=this.children.slice());i<o.length&&o[i]<l;)i+=3;o[i]==l?o[i+2]=o[i+2].addInner(a,u,c+1):o.splice(i,0,l,l+a.nodeSize,ym(u,a,c+1,Oa)),i+=3}});let s=qR(i?YR(n):n,-r);for(let a=0;a<s.length;a++)s[a].type.valid(t,s[a])||s.splice(a--,1);return new qe(s.length?this.local.concat(s).sort(Ta):this.local,o||this.children)}remove(t){return t.length==0||this==pn?this:this.removeInner(t,0)}removeInner(t,n){let r=this.children,o=this.local;for(let i=0;i<r.length;i+=3){let s,a=r[i]+n,l=r[i+1]+n;for(let u=0,d;u<t.length;u++)(d=t[u])&&d.from>a&&d.to<l&&(t[u]=null,(s||(s=[])).push(d));if(!s)continue;r==this.children&&(r=this.children.slice());let c=r[i+2].removeInner(s,a+1);c!=pn?r[i+2]=c:(r.splice(i,3),i-=3)}if(o.length){for(let i=0,s;i<t.length;i++)if(s=t[i])for(let a=0;a<o.length;a++)o[a].eq(s,n)&&(o==this.local&&(o=this.local.slice()),o.splice(a--,1))}return r==this.children&&o==this.local?this:o.length||r.length?new qe(o,r):pn}forChild(t,n){if(this==pn)return this;if(n.isLeaf)return qe.empty;let r,o;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=t){this.children[a]==t&&(r=this.children[a+2]);break}let i=t+1,s=i+n.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<s&&l.to>i&&l.type instanceof Ps){let c=Math.max(i,l.from)-i,u=Math.min(s,l.to)-i;c<u&&(o||(o=[])).push(l.copy(c,u))}}if(o){let a=new qe(o.sort(Ta),El);return r?new fs([a,r]):a}return r||pn}eq(t){if(this==t)return!0;if(!(t instanceof qe)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(t.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=t.children[n]||this.children[n+1]!=t.children[n+1]||!this.children[n+2].eq(t.children[n+2]))return!1;return!0}locals(t){return g1(this.localsInner(t))}localsInner(t){if(this==pn)return El;if(t.inlineContent||!this.local.some(Ps.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Ps||n.push(this.local[r]);return n}}qe.empty=new qe([],[]);qe.removeOverlap=g1;const pn=qe.empty;class fs{constructor(t){this.members=t}map(t,n){const r=this.members.map(o=>o.map(t,n,Oa));return fs.from(r)}forChild(t,n){if(n.isLeaf)return qe.empty;let r=[];for(let o=0;o<this.members.length;o++){let i=this.members[o].forChild(t,n);i!=pn&&(i instanceof fs?r=r.concat(i.members):r.push(i))}return fs.from(r)}eq(t){if(!(t instanceof fs)||t.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(t.members[n]))return!1;return!0}locals(t){let n,r=!0;for(let o=0;o<this.members.length;o++){let i=this.members[o].localsInner(t);if(i.length)if(!n)n=i;else{r&&(n=n.slice(),r=!1);for(let s=0;s<i.length;s++)n.push(i[s])}}return n?g1(r?n:n.sort(Ta)):El}static from(t){switch(t.length){case 0:return pn;case 1:return t[0];default:return new fs(t.every(n=>n instanceof qe)?t:t.reduce((n,r)=>n.concat(r instanceof qe?r:r.members),[]))}}}function iz(e,t,n,r,o,i,s){let a=e.slice();for(let c=0,u=i;c<n.maps.length;c++){let d=0;n.maps[c].forEach((f,h,m,g)=>{let b=g-m-(h-f);for(let y=0;y<a.length;y+=3){let v=a[y+1];if(v<0||f>v+u-d)continue;let w=a[y]+u-d;h>=w?a[y+1]=f<=w?-2:-1:f>=u&&b&&(a[y]+=b,a[y+1]+=b)}d+=b}),u=n.maps[c].map(u,-1)}let l=!1;for(let c=0;c<a.length;c+=3)if(a[c+1]<0){if(a[c+1]==-2){l=!0,a[c+1]=-1;continue}let u=n.map(e[c]+i),d=u-o;if(d<0||d>=r.content.size){l=!0;continue}let f=n.map(e[c+1]+i,-1),h=f-o,{index:m,offset:g}=r.content.findIndex(d),b=r.maybeChild(m);if(b&&g==d&&g+b.nodeSize==h){let y=a[c+2].mapInner(n,b,u+1,e[c]+i+1,s);y!=pn?(a[c]=d,a[c+1]=h,a[c+2]=y):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=sz(a,e,t,n,o,i,s),u=ym(c,r,0,s);t=u.local;for(let d=0;d<a.length;d+=3)a[d+1]<0&&(a.splice(d,3),d-=3);for(let d=0,f=0;d<u.children.length;d+=3){let h=u.children[d];for(;f<a.length&&a[f]<h;)f+=3;a.splice(f,0,u.children[d],u.children[d+1],u.children[d+2])}}return new qe(t.sort(Ta),a)}function qR(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let o=e[r];n.push(new dt(o.from+t,o.to+t,o.type))}return n}function sz(e,t,n,r,o,i,s){function a(l,c){for(let u=0;u<l.local.length;u++){let d=l.local[u].map(r,o,c);d?n.push(d):s.onRemove&&s.onRemove(l.local[u].spec)}for(let u=0;u<l.children.length;u+=3)a(l.children[u+2],l.children[u]+c+1)}for(let l=0;l<e.length;l+=3)e[l+1]==-1&&a(e[l+2],t[l]+i+1);return n}function GR(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,o=null;for(let i=0,s;i<e.length;i++)(s=e[i])&&s.from>n&&s.to<r&&((o||(o=[])).push(s),e[i]=null);return o}function YR(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function ym(e,t,n,r){let o=[],i=!1;t.forEach((a,l)=>{let c=GR(e,a,l+n);if(c){i=!0;let u=ym(c,a,n+l+1,r);u!=pn&&o.push(l,l+a.nodeSize,u)}});let s=qR(i?YR(e):e,-n).sort(Ta);for(let a=0;a<s.length;a++)s[a].type.valid(t,s[a])||(r.onRemove&&r.onRemove(s[a].spec),s.splice(a--,1));return s.length||o.length?new qe(s,o):pn}function Ta(e,t){return e.from-t.from||e.to-t.to}function g1(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let o=n+1;o<t.length;o++){let i=t[o];if(i.from==r.from){i.to!=r.to&&(t==e&&(t=e.slice()),t[o]=i.copy(i.from,r.to),RE(t,o+1,i.copy(r.to,i.to)));continue}else{i.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,i.from),RE(t,o,r.copy(i.from,r.to)));break}}}return t}function RE(e,t,n){for(;t<e.length&&Ta(n,e[t])>0;)t++;e.splice(t,0,n)}function ty(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=pn&&t.push(r)}),e.cursorWrapper&&t.push(qe.create(e.state.doc,[e.cursorWrapper.deco])),fs.from(t)}const az={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},lz=Hn&&Ms<=11;class cz{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class uz{constructor(t,n){this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new cz,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let o=0;o<r.length;o++)this.queue.push(r[o]);Hn&&Ms<=11&&r.some(o=>o.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():this.flush()}),lz&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,az)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let n=0;n<t.length;n++)this.queue.push(t[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(SE(this.view)){if(this.suppressingSelectionUpdates)return yi(this.view);if(Hn&&Ms<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&Ua(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let n=new Set,r;for(let i=t.focusNode;i;i=Zd(i))n.add(i);for(let i=t.anchorNode;i;i=Zd(i))if(n.has(i)){r=i;break}let o=r&&this.view.docView.nearestDesc(r);if(o&&o.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=t.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&SE(t)&&!this.ignoreSelectionChange(r),i=-1,s=-1,a=!1,l=[];if(t.editable)for(let u=0;u<n.length;u++){let d=this.registerMutation(n[u],l);d&&(i=i<0?d.from:Math.min(d.from,i),s=s<0?d.to:Math.max(d.to,s),d.typeOver&&(a=!0))}if(vo&&l.length>1){let u=l.filter(d=>d.nodeName=="BR");if(u.length==2){let d=u[0],f=u[1];d.parentNode&&d.parentNode.parentNode==f.parentNode?f.remove():d.remove()}}let c=null;i<0&&o&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&Eg(r)&&(c=u1(t))&&c.eq($e.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,yi(t),this.currentSelection.set(r),t.scrollToSelection()):(i>-1||o)&&(i>-1&&(t.docView.markDirty(i,s),dz(t)),this.handleDOMChange(i,s,a,l),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(r)||yi(t),this.currentSelection.set(r))}registerMutation(t,n){if(n.indexOf(t.target)>-1)return null;let r=this.view.docView.nearestDesc(t.target);if(t.type=="attributes"&&(r==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!r||r.ignoreMutation(t))return null;if(t.type=="childList"){for(let u=0;u<t.addedNodes.length;u++)n.push(t.addedNodes[u]);if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(t.target))return{from:r.posBefore,to:r.posAfter};let o=t.previousSibling,i=t.nextSibling;if(Hn&&Ms<=11&&t.addedNodes.length)for(let u=0;u<t.addedNodes.length;u++){let{previousSibling:d,nextSibling:f}=t.addedNodes[u];(!d||Array.prototype.indexOf.call(t.addedNodes,d)<0)&&(o=d),(!f||Array.prototype.indexOf.call(t.addedNodes,f)<0)&&(i=f)}let s=o&&o.parentNode==t.target?kn(o)+1:0,a=r.localPosFromDOM(t.target,s,-1),l=i&&i.parentNode==t.target?kn(i):t.target.childNodes.length,c=r.localPosFromDOM(t.target,l,1);return{from:a,to:c}}else return t.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:{from:r.posAtStart,to:r.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}}}let PE=new WeakMap,NE=!1;function dz(e){if(!PE.has(e)&&(PE.set(e,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=vo,NE)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."),NE=!0}}function fz(e){let t;function n(l){l.preventDefault(),l.stopImmediatePropagation(),t=l.getTargetRanges()[0]}e.dom.addEventListener("beforeinput",n,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",n,!0);let r=t.startContainer,o=t.startOffset,i=t.endContainer,s=t.endOffset,a=e.domAtPos(e.state.selection.anchor);return Ua(a.node,a.offset,i,s)&&([r,o,i,s]=[i,s,r,o]),{anchorNode:r,anchorOffset:o,focusNode:i,focusOffset:s}}function pz(e,t,n){let{node:r,fromOffset:o,toOffset:i,from:s,to:a}=e.docView.parseRange(t,n),l=e.domSelectionRange(),c,u=l.anchorNode;if(u&&e.dom.contains(u.nodeType==1?u:u.parentNode)&&(c=[{node:u,offset:l.anchorOffset}],Eg(l)||c.push({node:l.focusNode,offset:l.focusOffset})),mn&&e.input.lastKeyCode===8)for(let b=i;b>o;b--){let y=r.childNodes[b-1],v=y.pmViewDesc;if(y.nodeName=="BR"&&!v){i=b;break}if(!v||v.size)break}let d=e.state.doc,f=e.someProp("domParser")||xc.fromSchema(e.state.schema),h=d.resolve(s),m=null,g=f.parse(r,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:o,to:i,preserveWhitespace:h.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:hz,context:h});if(c&&c[0].pos!=null){let b=c[0].pos,y=c[1]&&c[1].pos;y==null&&(y=b),m={anchor:b+s,head:y+s}}return{doc:g,sel:m,from:s,to:a}}function hz(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 n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}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}const mz=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function gz(e,t,n,r,o){let i=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let R=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,$=u1(e,R);if($&&!e.state.selection.eq($)){if(mn&&Qr&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",z=>z(e,fa(13,"Enter"))))return;let j=e.state.tr.setSelection($);R=="pointer"?j.setMeta("pointer",!0):R=="key"&&j.scrollIntoView(),i&&j.setMeta("composition",i),e.dispatch(j)}return}let s=e.state.doc.resolve(t),a=s.sharedDepth(n);t=s.before(a+1),n=e.state.doc.resolve(n).after(a+1);let l=e.state.selection,c=pz(e,t,n),u=e.state.doc,d=u.slice(c.from,c.to),f,h;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(f=e.state.selection.to,h="end"):(f=e.state.selection.from,h="start"),e.input.lastKeyCode=null;let m=xz(d.content,c.doc.content,c.from,f,h);if((Sc&&e.input.lastIOSEnter>Date.now()-225||Qr)&&o.some(R=>R.nodeType==1&&!mz.test(R.nodeName))&&(!m||m.endA>=m.endB)&&e.someProp("handleKeyDown",R=>R(e,fa(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!m)if(r&&l instanceof Se&&!l.empty&&l.$head.sameParent(l.$anchor)&&!e.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))m={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let R=$E(e,e.state.doc,c.sel);if(R&&!R.eq(e.state.selection)){let $=e.state.tr.setSelection(R);i&&$.setMeta("composition",i),e.dispatch($)}}return}if(mn&&e.cursorWrapper&&c.sel&&c.sel.anchor==e.cursorWrapper.deco.from&&c.sel.head==c.sel.anchor){let R=m.endB-m.start;c.sel={anchor:c.sel.anchor+R,head:c.sel.anchor+R}}e.input.domChangeCount++,e.state.selection.from<e.state.selection.to&&m.start==m.endB&&e.state.selection instanceof Se&&(m.start>e.state.selection.from&&m.start<=e.state.selection.from+2&&e.state.selection.from>=c.from?m.start=e.state.selection.from:m.endA<e.state.selection.to&&m.endA>=e.state.selection.to-2&&e.state.selection.to<=c.to&&(m.endB+=e.state.selection.to-m.endA,m.endA=e.state.selection.to)),Hn&&Ms<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>c.from&&c.doc.textBetween(m.start-c.from-1,m.start-c.from+1)=="  "&&(m.start--,m.endA--,m.endB--);let g=c.doc.resolveNoCache(m.start-c.from),b=c.doc.resolveNoCache(m.endB-c.from),y=u.resolve(m.start),v=g.sameParent(b)&&g.parent.inlineContent&&y.end()>=m.endA,w;if((Sc&&e.input.lastIOSEnter>Date.now()-225&&(!v||o.some(R=>R.nodeName=="DIV"||R.nodeName=="P"))||!v&&g.pos<c.doc.content.size&&!g.sameParent(b)&&(w=$e.findFrom(c.doc.resolve(g.pos+1),1,!0))&&w.head==b.pos)&&e.someProp("handleKeyDown",R=>R(e,fa(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>m.start&&yz(u,m.start,m.endA,g,b)&&e.someProp("handleKeyDown",R=>R(e,fa(8,"Backspace")))){Qr&&mn&&e.domObserver.suppressSelectionUpdates();return}mn&&Qr&&m.endB==m.start&&(e.input.lastAndroidDelete=Date.now()),Qr&&!v&&g.start()!=b.start()&&b.parentOffset==0&&g.depth==b.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==m.endA&&(m.endB-=2,b=c.doc.resolveNoCache(m.endB-c.from),setTimeout(()=>{e.someProp("handleKeyDown",function(R){return R(e,fa(13,"Enter"))})},20));let S=m.start,k=m.endA,C,E,T;if(v){if(g.pos==b.pos)Hn&&Ms<=11&&g.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>yi(e),20)),C=e.state.tr.delete(S,k),E=u.resolve(m.start).marksAcross(u.resolve(m.endA));else if(m.endA==m.endB&&(T=vz(g.parent.content.cut(g.parentOffset,b.parentOffset),y.parent.content.cut(y.parentOffset,m.endA-y.start()))))C=e.state.tr,T.type=="add"?C.addMark(S,k,T.mark):C.removeMark(S,k,T.mark);else if(g.parent.child(g.index()).isText&&g.index()==b.index()-(b.textOffset?0:1)){let R=g.parent.textBetween(g.parentOffset,b.parentOffset);if(e.someProp("handleTextInput",$=>$(e,S,k,R)))return;C=e.state.tr.insertText(R,S,k)}}if(C||(C=e.state.tr.replace(S,k,c.doc.slice(m.start-c.from,m.endB-c.from))),c.sel){let R=$E(e,C.doc,c.sel);R&&!(mn&&Qr&&e.composing&&R.empty&&(m.start!=m.endB||e.input.lastAndroidDelete<Date.now()-100)&&(R.head==S||R.head==C.mapping.map(k)-1)||Hn&&R.empty&&R.head==S)&&C.setSelection(R)}E&&C.ensureMarks(E),i&&C.setMeta("composition",i),e.dispatch(C.scrollIntoView())}function $E(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:d1(e,t.resolve(n.anchor),t.resolve(n.head))}function vz(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,o=n,i=r,s,a,l;for(let u=0;u<r.length;u++)o=r[u].removeFromSet(o);for(let u=0;u<n.length;u++)i=n[u].removeFromSet(i);if(o.length==1&&i.length==0)a=o[0],s="add",l=u=>u.mark(a.addToSet(u.marks));else if(o.length==0&&i.length==1)a=i[0],s="remove",l=u=>u.mark(a.removeFromSet(u.marks));else return null;let c=[];for(let u=0;u<t.childCount;u++)c.push(l(t.child(u)));if(L.from(c).eq(e))return{mark:a,type:s}}function yz(e,t,n,r,o){if(!r.parent.isTextblock||n-t<=o.pos-r.pos||ny(r,!0,!1)<o.pos)return!1;let i=e.resolve(t);if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let s=e.resolve(ny(i,!0,!0));return!s.parent.isTextblock||s.pos>n||ny(s,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function ny(e,t,n){let r=e.depth,o=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,o++,t=!1;if(n){let i=e.node(r).maybeChild(e.indexAfter(r));for(;i&&!i.isLeaf;)i=i.firstChild,o++}return o}function xz(e,t,n,r,o){let i=e.findDiffStart(t,n);if(i==null)return null;let{a:s,b:a}=e.findDiffEnd(t,n+e.size,n+t.size);if(o=="end"){let l=Math.max(0,i-Math.min(s,a));r-=s+l-i}if(s<i&&e.size<t.size){let l=r<=i&&r>=s?i-r:0;i-=l,i&&i<t.size&&DE(t.textBetween(i-1,i+1))&&(i+=l?1:-1),a=i+(a-s),s=i}else if(a<i){let l=r<=i&&r>=a?i-r:0;i-=l,i&&i<e.size&&DE(e.textBetween(i-1,i+1))&&(i+=l?1:-1),s=i+(s-a),a=i}return{start:i,endA:s,endB:a}}function DE(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}class bz{constructor(t,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new B9,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(zE),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):typeof t=="function"?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=LE(this),IE(this),this.nodeViews=jE(this),this.docView=gE(this.state.doc,AE(this),ty(this),this.dom,this),this.domObserver=new uz(this,(r,o,i,s)=>gz(this,r,o,i,s)),this.domObserver.start(),V9(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let n in t)this._props[n]=t[n];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&ax(this);let n=this._props;this._props=t,t.plugins&&(t.plugins.forEach(zE),this.directPlugins=t.plugins),this.updateStateInner(t.state,n)}setProps(t){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in t)n[r]=t[r];this.update(n)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,n){var r;let o=this.state,i=!1,s=!1;t.storedMarks&&this.composing&&(UR(this),s=!0),this.state=t;let a=o.plugins!=t.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let h=jE(this);Sz(h,this.nodeViews)&&(this.nodeViews=h,i=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&ax(this),this.editable=LE(this),IE(this);let l=ty(this),c=AE(this),u=o.plugins!=t.plugins&&!o.doc.eq(t.doc)?"reset":t.scrollToSelection>o.scrollToSelection?"to selection":"preserve",d=i||!this.docView.matchesNode(t.doc,c,l);(d||!t.selection.eq(o.selection))&&(s=!0);let f=u=="preserve"&&s&&this.dom.style.overflowAnchor==null&&n9(this);if(s){this.domObserver.stop();let h=d&&(Hn||mn)&&!this.composing&&!o.selection.empty&&!t.selection.empty&&wz(o.selection,t.selection);if(d){let m=mn?this.trackWrites=this.domSelectionRange().focusNode:null;(i||!this.docView.update(t.doc,c,l,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=gE(t.doc,c,l,this.dom,this)),m&&!this.trackWrites&&(h=!0)}h||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&O9(this))?yi(this,h):(RR(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(o),!((r=this.dragging)===null||r===void 0)&&r.node&&!o.doc.eq(t.doc)&&this.updateDraggedNode(this.dragging,o),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():f&&r9(f)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof ge){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&uE(this,n.getBoundingClientRect(),t)}else uE(this,this.coordsAtPos(this.state.selection.head,1),t)}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(!t||t.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,t)}}updateDraggedNode(t,n){let r=t.node,o=-1;if(this.state.doc.nodeAt(r.from)==r.node)o=r.from;else{let i=r.from+(this.state.doc.content.size-n.doc.content.size);(i>0&&this.state.doc.nodeAt(i))==r.node&&(o=i)}this.dragging=new WR(t.slice,t.move,o<0?void 0:ge.create(this.state.doc,o))}someProp(t,n){let r=this._props&&this._props[t],o;if(r!=null&&(o=n?n(r):r))return o;for(let s=0;s<this.directPlugins.length;s++){let a=this.directPlugins[s].props[t];if(a!=null&&(o=n?n(a):a))return o}let i=this.state.plugins;if(i)for(let s=0;s<i.length;s++){let a=i[s].props[t];if(a!=null&&(o=n?n(a):a))return o}}hasFocus(){if(Hn){let t=this.root.activeElement;if(t==this.dom)return!0;if(!t||!this.dom.contains(t))return!1;for(;t&&this.dom!=t&&this.dom.contains(t);){if(t.contentEditable=="false")return!1;t=t.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&o9(this.dom),yi(this),this.domObserver.start()}get root(){let t=this._root;if(t==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return t||document}updateRoot(){this._root=null}posAtCoords(t){return c9(this,t)}coordsAtPos(t,n=1){return SR(this,t,n)}domAtPos(t,n=0){return this.docView.domFromPos(t,n)}nodeDOM(t){let n=this.docView.descAt(t);return n?n.nodeDOM:null}posAtDOM(t,n,r=-1){let o=this.docView.posFromDOM(t,n,r);if(o==null)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(t,n){return h9(this,n||this.state,t)}pasteHTML(t,n){return Qd(this,"",t,!1,n||new ClipboardEvent("paste"))}pasteText(t,n){return Qd(this,t,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(U9(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],ty(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return this.docView==null}dispatchEvent(t){return W9(this,t)}dispatch(t){let n=this._props.dispatchTransaction;n?n.call(this,t):this.updateState(this.state.apply(t))}domSelectionRange(){return Mn&&this.root.nodeType===11&&Y8(this.dom.ownerDocument)==this.dom?fz(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function AE(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 r in n)r=="class"?t.class+=" "+n[r]:r=="style"?t.style=(t.style?t.style+";":"")+n[r]:!t[r]&&r!="contenteditable"&&r!="nodeName"&&(t[r]=String(n[r]))}),t.translate||(t.translate="no"),[dt.node(0,e.state.doc.content.size,t)]}function IE(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:dt.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function LE(e){return!e.someProp("editable",t=>t(e.state)===!1)}function wz(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 jE(e){let t=Object.create(null);function n(r){for(let o in r)Object.prototype.hasOwnProperty.call(t,o)||(t[o]=r[o])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function Sz(e,t){let n=0,r=0;for(let o in e){if(e[o]!=t[o])return!0;n++}for(let o in t)r++;return n!=r}function zE(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var kz=e=>{if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")};const Ez=Ri(kz);var XR=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},_e=(e,t,n)=>(XR(e,t,"read from private field"),n?n.call(e):t.get(e)),Jo=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},rt=(e,t,n,r)=>(XR(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);function Cz(e){return!!(e.prev&&e.next&&e.prev.text.full!==e.next.text.full)}function _z(e){return!!(e.prev&&e.next&&e.prev.range.cursor!==e.next.range.cursor)}function Oz(e){return!!(!e.prev&&e.next)}function Tz(e){return!!(e.prev&&!e.next)}function Mz(e){return!!(e.prev&&e.next&&e.prev.range.from!==e.next.range.from)}function Rz(e){return e==="invalid-exit-split"}var Pz=["jump-backward-exit","jump-forward-exit"],Nz=["jump-backward-change","jump-forward-change"];function $z(e){var t,n;return go(Pz,(t=e.exit)==null?void 0:t.exitReason)||go(Nz,(n=e.change)==null?void 0:n.changeReason)}function FE(e){return!!(e&&e.query.full.length>=e.suggester.matchOffset)}function BE(e){return xn(e)&&e instanceof Se}function Fn(e){const{match:t,changeReason:n,exitReason:r}=e;return{...t,changeReason:n,exitReason:r}}function Dz(e,t){const{invalidPrefixCharacters:n,validPrefixCharacters:r}=t;return n?!new RegExp(cx(n)).test(e):new RegExp(cx(r)).test(e)}function Az(e){const{text:t,regexp:n,$pos:r,suggester:o}=e,i=r.start();let s;return Sg(t,n).forEach(a=>{const l=a.input.slice(Math.max(0,a.index-1),a.index);if(Dz(l,o)){const c=a.index+i,u=a[0],d=a[1];if(!xe(u)||!xe(d))return;const f=c+u.length,h=Math.min(f,r.pos),m=h-c;c<r.pos&&f>=r.pos&&(s={range:{from:c,to:f,cursor:h},match:a,query:{partial:u.slice(d.length,m),full:u.slice(d.length)},text:{partial:u.slice(0,m),full:u},textAfter:r.doc.textBetween(f,r.end(),ms,ms),textBefore:r.doc.textBetween(i,c,ms,ms),suggester:o})}}),s}function ZR(e){const{$pos:t,suggester:n}=e,{char:r,name:o,startOfLine:i,supportedCharacters:s,matchOffset:a,multiline:l,caseInsensitive:c,unicode:u}=n,d=Hz({char:r,matchOffset:a,startOfLine:i,supportedCharacters:s,multiline:l,caseInsensitive:c,unicode:u}),f=t.doc.textBetween(t.before(),t.end(),ms,ms);return Az({suggester:n,text:f,regexp:d,$pos:t,char:r,name:o})}function JR(e){const{state:t,match:n}=e;try{return ZR({$pos:t.doc.resolve(n.range.cursor),suggester:n.suggester})}catch{return}}function QR(e){const{prev:t,next:n,state:r}=e;return!n&&t.range.from>=r.doc.nodeSize?{exit:Fn({match:t,exitReason:"delete"})}:!n||!t.query.partial?{exit:Fn({match:t,exitReason:"invalid-exit-split"})}:t.range.to===n.range.cursor?{exit:Fn({match:n,exitReason:"exit-end"})}:t.query.partial?{exit:Fn({match:n,exitReason:"exit-split"})}:{}}function Iz(e){const{prev:t,next:n,state:r}=e,o=ce(),i=JR({state:r,match:t}),{exit:s}=i&&i.query.full!==t.query.full?QR({prev:t,next:i,state:r}):o;return t.range.from<n.range.from?{exit:s??Fn({match:t,exitReason:"jump-forward-exit"}),change:Fn({match:n,changeReason:"jump-forward-change"})}:{exit:s??Fn({match:t,exitReason:"jump-backward-exit"}),change:Fn({match:n,changeReason:"jump-backward-change"})}}function Lz(e){const{match:t,state:n,$pos:r}=e,{selection:o}=n,i=JR({match:t,state:n});return!i||i.text.full!==t.text.full?QR({prev:t,next:i,state:n}):!o.empty&&(o.from<=t.range.from||o.to>=t.range.to)?{exit:Fn({match:t,exitReason:"selection-outside"})}:r.pos>t.range.to?{exit:Fn({match:t,exitReason:"move-end"})}:r.pos<=t.range.from?{exit:Fn({match:t,exitReason:"move-start"})}:{}}function jz(e){const{prev:t,next:n,state:r,$pos:o}=e,i=ce();if(!t&&!n)return i;const s={prev:t,next:n};return Mz(s)?Iz({prev:s.prev,next:s.next,state:r}):Oz(s)?{change:Fn({match:s.next,changeReason:"start"})}:Tz(s)?Lz({$pos:o,match:s.prev,state:r}):Cz(s)?{change:Fn({match:s.next,changeReason:"change-character"})}:_z(s)?{change:Fn({match:s.next,changeReason:r.selection.empty?"move":"selection-inside"})}:i}function VE(e,t){for(let n=e.depth;n>0;n--){const r=e.node(n);if(t.includes(r.type.name))return!0}return!1}function lx(e,t){const{$from:n,$to:r}=e;return eP(e,t)?!0:DM(n.pos,r.pos).some(o=>zz(n.doc.resolve(o),t))}function eP(e,t){const{$from:n,$to:r}=e,o=new Set((n.marksAcross(r)??[]).map(i=>i.type.name));return t.some(i=>o.has(i))}function zz(e,t){const n=new Set(e.marks().map(r=>r.type.name));return t.some(r=>n.has(r))}function Fz(e,t){const{$cursor:n}=t,{validMarks:r,validNodes:o,invalidMarks:i,invalidNodes:s}=e;return!r&&!o&&zs(i)&&zs(s)?!0:!(r&&!eP(t,r)||o&&!VE(n,o)||!r&&lx(t,i)||!o&&VE(n,s))}function UE(e){const{suggesters:t,$pos:n,selectionEmpty:r}=e;for(const o of t)if(!(o.emptySelectionsOnly&&!r))try{const i=ZR({suggester:o,$pos:n});if(!i)continue;const s={$from:n.doc.resolve(i.range.from),$to:n.doc.resolve(i.range.to),$cursor:n};if(Fz(o,s)&&o.isValidPosition(s,i))return i}catch{}}function cx(e){return a7(e)?e.source:e}function Bz(e){return e?"^":""}function Vz(e,t){return`(?:${cx(e)}){${t},}`}function Uz(e){return xe(e)?new RegExp(Ez(e)):e}function Hz(e){const{char:t,matchOffset:n,startOfLine:r,supportedCharacters:o,captureChar:i=!0,caseInsensitive:s=!1,multiline:a=!1,unicode:l=!1}=e,c=`g${a?"m":""}${s?"i":""}${l?"u":""}`;let u=Uz(t).source;return i&&(u=`(${u})`),new RegExp(`${Bz(r)}${u}${Vz(o,n)}`,c)}var Wz={appendTransaction:!1,priority:50,ignoredTag:"span",matchOffset:0,disableDecorations:!1,startOfLine:!1,suggestClassName:"suggest",suggestTag:"span",supportedCharacters:/\w+/,validPrefixCharacters:/^[\s\0]?$/,invalidPrefixCharacters:null,ignoredClassName:null,invalidMarks:[],invalidNodes:[],validMarks:null,validNodes:null,isValidPosition:()=>!0,checkNextValidSelection:null,emptySelectionsOnly:!1,caseInsensitive:!1,multiline:!1,unicode:!1,captureChar:!0},tP="__ignore_prosemirror_suggest_update__",nh,Tu,Bt,Zi,Cl,_o,Nt,Ji,_l,nP=class{constructor(e){Jo(this,nh,!1),Jo(this,Tu,!1),Jo(this,Bt,void 0),Jo(this,Zi,void 0),Jo(this,Cl,void 0),Jo(this,_o,ce()),Jo(this,Nt,qe.empty),Jo(this,Ji,!1),Jo(this,_l,!1),this.setMarkRemoved=()=>{rt(this,Ji,!0)},this.findNextTextSelection=n=>{const r=n.$from.doc,o=Math.min(r.nodeSize-2,n.to+1),i=r.resolve(o),s=$e.findFrom(i,1,!0);if(BE(s))return s},this.ignoreNextExit=()=>{rt(this,Tu,!0)},this.addIgnored=({from:n,name:r,specific:o=!1})=>{const i=_e(this,Bt).find(u=>u.name===r);if(!i)throw new Error(`No suggester exists for the name provided: ${r}`);const s=xe(i.char)?i.char.length:1,a=n+s,l=i.ignoredClassName?{class:i.ignoredClassName}:{},c=dt.inline(n,a,{nodeName:i.ignoredTag,...l},{name:r,specific:o,char:i.char});rt(this,Nt,_e(this,Nt).add(this.view.state.doc,[c]))},this.removeIgnored=({from:n,name:r})=>{const o=_e(this,Bt).find(a=>a.name===r);if(!o)throw new Error(`No suggester exists for the name provided: ${r}`);const i=xe(o.char)?o.char.length:1,s=_e(this,Nt).find(n,n+i)[0];!s||s.spec.name!==r||rt(this,Nt,_e(this,Nt).remove([s]))},this.clearIgnored=n=>{if(!n){rt(this,Nt,qe.empty);return}const o=_e(this,Nt).find().filter(({spec:i})=>i.name===n);rt(this,Nt,_e(this,Nt).remove(o))},this.findMatchAtPosition=(n,r)=>{const o=r?_e(this,Bt).filter(i=>i.name===r):_e(this,Bt);return UE({suggesters:o,$pos:n,docChanged:!1,selectionEmpty:!0})},this.setLastChangeFromAppend=()=>{rt(this,_l,!0)};const t=HE();rt(this,Bt,e.map(t)),rt(this,Bt,Fa(_e(this,Bt),(n,r)=>r.priority-n.priority))}static create(e){return new nP(e)}get decorationSet(){return _e(this,Nt)}get removed(){return _e(this,Ji)}get match(){return _e(this,Zi)?_e(this,Zi):_e(this,Cl)&&_e(this,_o).exit?_e(this,Cl):void 0}init(e){return this.view=e,this}createProps(e){const{name:t,char:n}=e.suggester;return{view:this.view,addIgnored:this.addIgnored,clearIgnored:this.clearIgnored,ignoreNextExit:this.ignoreNextExit,setMarkRemoved:this.setMarkRemoved,name:t,char:n,...e}}shouldRunExit(){return _e(this,Tu)?(rt(this,Tu,!1),!1):!0}updateWithNextSelection(e){var t,n,r;const o=this.findNextTextSelection(e.selection);if(o)for(const i of _e(this,Bt)){const s=(t=_e(this,_o).change)==null?void 0:t.suggester.name,a=(n=_e(this,_o).exit)==null?void 0:n.suggester.name;(r=i.checkNextValidSelection)==null||r.call(i,o.$from,e,{change:s,exit:a})}}changeHandler(e,t){const{change:n,exit:r}=_e(this,_o),o=this.match;if(!n&&!r||!FE(o))return;const i=t===(r==null?void 0:r.suggester.appendTransaction)&&this.shouldRunExit(),s=t===(n==null?void 0:n.suggester.appendTransaction);if(!(!i&&!s)){if(n&&r&&$z({change:n,exit:r})){const a=this.createProps(r),l=this.createProps(n),c=r.range.from<n.range.from;i&&r.suggester.onChange(a,e),s&&n.suggester.onChange(l,e),i&&rt(this,Ji,!1);return}n&&s&&n.suggester.onChange(this.createProps(n),e),r&&i&&(r.suggester.onChange(this.createProps(r),e),rt(this,Ji,!1),Rz(r.exitReason)&&rt(this,_o,ce()))}}mapIgnoredDecorations(e){const t=_e(this,Nt).map(e.mapping,e.doc),r=t.find().filter(({from:o,to:i,spec:s})=>{const a=xe(s.char)?s.char.length:1;return i-o!==a});rt(this,Nt,t.remove(r))}shouldIgnoreMatch({range:e,suggester:{name:t}}){return _e(this,Nt).find().some(({spec:o,from:i})=>i!==e.from?!1:o.specific?o.name===t:!0)}resetState(){rt(this,_o,ce()),rt(this,Zi,void 0),rt(this,Ji,!1),rt(this,_l,!1)}updateReasons(e){const{$pos:t,state:n}=e,r=_e(this,nh),o=_e(this,Bt),i=n.selection.empty,s=BE(n.selection)?UE({suggesters:o,$pos:t,docChanged:r,selectionEmpty:i}):void 0;rt(this,Zi,s&&this.shouldIgnoreMatch(s)?void 0:s),rt(this,_o,jz({next:_e(this,Zi),prev:_e(this,Cl),state:n,$pos:t}))}addSuggester(e){const t=_e(this,Bt).find(r=>r.name===e.name),n=HE();if(t)rt(this,Bt,_e(this,Bt).map(r=>r===t?n(e):r));else{const r=[..._e(this,Bt),n(e)];rt(this,Bt,Fa(r,(o,i)=>i.priority-o.priority))}return()=>this.removeSuggester(e.name)}removeSuggester(e){const t=xe(e)?e:e.name;rt(this,Bt,_e(this,Bt).filter(n=>n.name!==t)),this.clearIgnored(t)}toJSON(){return this.match}apply(e){const{exit:t,change:n}=_e(this,_o);if(_e(this,_l)&&(rt(this,_l,!1),!(t!=null&&t.suggester.appendTransaction)&&!(n!=null&&n.suggester.appendTransaction)))return this;const{tr:r,state:o}=e,i=r.docChanged||r.selectionSet;return r.getMeta(tP)||!i&&!_e(this,Ji)?this:(rt(this,nh,r.docChanged),this.mapIgnoredDecorations(r),t&&this.resetState(),rt(this,Cl,_e(this,Zi)),this.updateReasons({$pos:r.selection.$from,state:o}),this)}createDecorations(e){const t=this.match;if(!FE(t))return _e(this,Nt);const{disableDecorations:n}=t.suggester;if(nt(n)?n(e,t):n)return _e(this,Nt);const{range:o,suggester:i}=t,{name:s,suggestTag:a,suggestClassName:l}=i,{from:c,to:u}=o;return this.shouldIgnoreMatch(t)?_e(this,Nt):_e(this,Nt).add(e.doc,[dt.inline(c,u,{nodeName:a,class:s?`${l} suggest-${s}`:l},{name:s})])}},Kz=nP;nh=new WeakMap;Tu=new WeakMap;Bt=new WeakMap;Zi=new WeakMap;Cl=new WeakMap;_o=new WeakMap;Nt=new WeakMap;Ji=new WeakMap;_l=new WeakMap;function HE(){const e=new Set;return t=>{if(e.has(t.name))throw new Error(`A suggester already exists with the name '${t.name}'. The name provided must be unique.`);const n={...Wz,...t};return e.add(t.name),n}}var rP=new Ic("suggest");function v1(e){return rP.getState(e)}function WE(e,t){return v1(e).addSuggester(t)}function KE(e){e.setMeta(tP,!0)}function qz(e,t){return v1(e).removeSuggester(t)}function Gz(...e){const t=Kz.create(e);return new $i({key:rP,view:n=>(t.init(n),{update:r=>t.changeHandler(r.state.tr,!1)}),state:{init:()=>t,apply:(n,r,o,i)=>t.apply({tr:n,state:i})},appendTransaction:(n,r,o)=>{const i=o.tr;return t.updateWithNextSelection(i),t.changeHandler(i,!0),i.docChanged||i.steps.length>0||i.selectionSet||i.storedMarksSet?(t.setLastChangeFromAppend(),i):null},props:{decorations:n=>t.createDecorations(n)}})}function y1(e,t){const n=Object.getPrototypeOf(t);let r=e.selection,o=e.doc,i=e.storedMarks;const s=ce();for(const[a,l]of Object.entries(t))s[a]={value:l};return Object.create(n,{...s,storedMarks:{get(){return i}},selection:{get(){return r}},doc:{get(){return o}},tr:{get(){return r=e.selection,o=e.doc,i=e.storedMarks,e}}})}function fd(e){return({state:t,dispatch:n,view:r,tr:o})=>e(y1(o,t),n,r)}function qE(e){return t=>{var n;return he(t.dispatch===void 0||t.dispatch===((n=t.view)==null?void 0:n.dispatch),{code:K.NON_CHAINABLE_COMMAND}),e(t)}}function Yz(...e){return({state:t,dispatch:n,view:r,tr:o,...i})=>{for(const s of e)if(s({state:t,dispatch:n,view:r,tr:o,...i}))return!0;return!1}}var eo={get isBrowser(){return!!(typeof window<"u"&&typeof window.document<"u"&&window.navigator&&window.navigator.userAgent)},get isJSDOM(){return eo.isBrowser&&window.navigator.userAgent.includes("jsdom")},get isNode(){return typeof process<"u"&&process.versions!=null&&process.versions.node!=null},get isIos(){return eo.isBrowser&&/iPod|iPhone|iPad/.test(navigator.platform)},get isMac(){return eo.isBrowser&&/Mac|iPod|iPhone|iPad/.test(navigator.platform)},get isApple(){return eo.isNode?process.platform==="darwin":eo.isBrowser?/Mac|iPod|iPhone|iPad/.test(window.navigator.platform):!1},get isDevelopment(){return!1},get isTest(){return!1},get isProduction(){return!0}};function Wi(e,t){var n;const r=wF(e);return((n=r==null?void 0:r.getComputedStyle(e))==null?void 0:n.getPropertyValue(t))??""}function fn(e,t){return Object.assign(e.style,t)}function ux(e){return xn(e)&&dr(e.nodeType)&&xe(e.nodeName)}function Vo(e){return ux(e)&&e.nodeType===1}function x1(e){const{types:t,node:n}=e;if(!n)return!1;const r=o=>o===n.type||o===n.type.name;return zt(t)?t.some(r):r(t)}function Xz(e,t){const{tr:n}=t;return e.forEach(r=>{r.steps.forEach(o=>{n.step(o)})}),n}function Og(e){const{predicate:t,selection:n}=e,r=iP(n)?n.selection.$from:S1(n)?n.$from:n;for(let o=r.depth;o>0;o--){const i=r.node(o),s=o>0?r.before(o):0,a=r.start(o),l=s+i.nodeSize;if(t(i,s))return{pos:s,depth:o,node:i,start:a,end:l}}}function Zz(e){const{depth:t}=e,n=t>0?e.before(t):0,r=e.node(t),o=e.start(t),i=n+r.nodeSize;return{pos:n,start:o,node:r,end:i,depth:t}}function tf(e){const{types:t,selection:n}=e;return Og({predicate:r=>x1({types:t,node:r}),selection:n})}function Jz(e){const{types:t,selection:n}=e;if(!(!Mg(n)||!x1({types:t,node:n.node})))return{pos:n.$from.pos,depth:n.$from.depth,start:n.$from.start(),end:n.$from.pos+n.node.nodeSize,node:n.node}}function b1(e){return S1(e)?e.empty:e.selection.empty}function Qz(e){return e.docChanged||e.selectionSet}function eF(e){return!!nf(e)}function nf(e){const{state:t,type:n,attrs:r}=e,{selection:o,doc:i}=t,s=xe(n)?i.type.schema.nodes[n]:n;he(s,{code:K.SCHEMA,message:`No node exists for ${n}`});const a=Jz({selection:o,types:n})??Og({predicate:l=>l.type===s,selection:o});return!r||om(r)||!a||a.node.hasMarkup(s,{...a.node.attrs,...r})?a:void 0}function xm(...e){return t=>{if(!Fk(e))return!1;const[n,...r]=e;let o=!1;const i=(...l)=>()=>{if(!Fk(l))return!1;o=!0;const[,...c]=l;return xm(...l)({...t,next:i(...c)})},s=i(...r),a=n({...t,next:s});return o||a?a:s()}}function tF(e,t){const n=new Map,r=ce();for(const o of e)for(const[i,s]of jt(o)){const l=[...n.get(i)??[],s],c=xm(...l);n.set(i,l),r[i]=t(c)}return r}function nF(e){return tF(e,t=>(n,r,o)=>t({state:n,dispatch:r,view:o,tr:n.tr,next:()=>!1}))}function w1(e,t){const n=e.attrs??{};return Object.entries(t).every(([r,o])=>n[r]===o)}function rF(e){return aP(e,[fi,Ot,Kt,io])}function Lc(e){return xn(e)}function jc(e,t){return zt(t)?go(t,e[Ci]):t===e[Ci]}function oF(e){return xn(e)&&e instanceof Y0}function iF(e,t){return xe(e)?vt(t.nodes,e):e}function oP(e){return xn(e)&&e instanceof jf}function sF(e,t){return xe(e)?vt(t.marks,e):e}function Tg(e){return xn(e)&&e instanceof Ts}function aF(e){return xn(e)&&e instanceof L}function lF(e){return xn(e)&&e instanceof Be}function iP(e){return xn(e)&&e instanceof xa}function tl(e){return xn(e)&&e instanceof Se}function cF(e){return xn(e)&&e instanceof On}function S1(e){return xn(e)&&e instanceof $e}function uF(e){return xn(e)&&e instanceof yc}function GE(e){const{trState:t,from:n,to:r,type:o,attrs:i={}}=e,{doc:s}=t,a=sF(o,s.type.schema);if(Object.keys(i).length===0)return s.rangeHasMark(n,r,a);let l=!1;return r>n&&s.nodesBetween(n,r,c=>l?!1:(l=(c.marks??[]).some(d=>d.type!==a?!1:w1(d,i)),!l)),l}function Mg(e){return xn(e)&&e instanceof ge}function bm(e){const{trState:t,type:n,attrs:r={},from:o,to:i}=e,{selection:s,doc:a,storedMarks:l}=t,c=xe(n)?a.type.schema.marks[n]:n;if(he(c,{code:K.SCHEMA,message:`Mark type: ${n} does not exist on the current schema.`}),o&&i)try{return Math.max(o,i)<a.nodeSize&&GE({...e,from:o,to:i})}catch{return!1}return s.empty?(l??s.$from.marks()).some(d=>d.type!==n?!1:w1(d,r??{})):GE({...e,from:s.from,to:s.to})}function k1(e,t={}){const n=dF(e.type.schema);if(!n)return!1;const{ignoreAttributes:r,ignoreDocAttributes:o}=t;return r?sP(n,e):o?n.content.eq(e.content):n.eq(e)}function sP(e,t){if(e===t)return!0;const n=e.type===t.type&&Be.sameSet(e.marks,t.marks);function r(){if(e.content===t.content)return!0;if(e.content.size!==t.content.size)return!1;const o=[],i=[];e.content.forEach(s=>o.push(s)),t.content.forEach(s=>i.push(s));for(const[s,a]of o.entries()){const l=i[s];if(!l||!sP(a,l))return!1}return!0}return n&&r()}function dF(e){var t;return((t=e.nodes.doc)==null?void 0:t.createAndFill())??void 0}function Rg(e){for(const t of Object.values(e.nodes))if(t.name!=="doc"&&(t.isBlock||t.isTextblock))return t;he(!1,{code:K.SCHEMA,message:"No default block node found for the provided schema."})}function fF(e){return e.type===Rg(e.type.schema)}function E1(e){return!!e&&e.type.isBlock&&!e.textContent&&!e.childCount}function _i(e,t,n){const r=e.parent.childAfter(e.parentOffset);if(!r.node)return;const o=xe(t)?t:t.name,i=r.node.marks.find(({type:d})=>d.name===o);let s=e.index(),a=e.start()+r.offset,l=s+1,c=a+r.node.nodeSize;if(!i)return n&&c<n.pos?_i(e.doc.resolve(c+1),t,n):void 0;for(;s>0&&i.isInSet(e.parent.child(s-1).marks);)s-=1,a-=e.parent.child(s).nodeSize;for(;l<e.parent.childCount&&i.isInSet(e.parent.child(l).marks);)c+=e.parent.child(l).nodeSize,l+=1;const u=e.doc.textBetween(a,c,kM,`
356
-
357
- `);return{from:a,to:c,text:u,mark:i}}function aP(e,t){return t.length===0||t.some(n=>e instanceof n)}function pF(e){return $M(e,({from:n,to:r,prevFrom:o,prevTo:i})=>`${n}_${r}_${o}_${i}`).filter((n,r,o)=>!o.some((i,s)=>r===s?!1:n.prevFrom>=i.prevFrom&&n.prevTo<=i.prevTo&&n.from>=i.from&&n.to<=i.to))}function hF(e,t=[]){const n=[],{steps:r,mapping:o}=e,i=o.invert();r.forEach((a,l)=>{if(!aP(a,t))return;const c=[],u=a.getMap(),d=o.slice(l);if(u.ranges.length===0&&rF(a)){const{from:f,to:h}=a;c.push({from:f,to:h})}else u.forEach((f,h)=>{c.push({from:f,to:h})});c.forEach(f=>{const h=d.map(f.from,-1),m=d.map(f.to);n.push({from:h,to:m,prevFrom:i.map(h,-1),prevTo:i.map(m)})})});const s=Fa(n,(a,l)=>a.from-l.from);return pF(s)}function mF(e){var t;return((t=e.content.firstChild)==null?void 0:t.textContent)??""}function gF(e,t){if(!tl(e.selection))return;let{from:n,to:r}=e.selection;const o=(s,a)=>mF(Se.between(e.doc.resolve(s),e.doc.resolve(a)).content());for(let s=o(n-1,n);s&&!t.test(s);n--,s=o(n-1,n));for(let s=o(r,r+1);s&&!t.test(s);r++,s=o(r,r+1));if(n===r)return;const i=e.doc.textBetween(n,r,kM,`
358
-
359
- `);return{from:n,to:r,text:i}}function lP(e){return gF(e,/\W/)}function pd(e,t=0){const n=zt(e)?e[t]:e;return MM(xe(n),`No match string found for match ${e}`),n??""}function vF(e){return tl(e)?e.$cursor:void 0}function yF(e,t){return Tg(e)?t?e.type===t.nodes.doc:e.type.name==="doc":!1}function xF(e){return xn(e)&&dr(e.anchor)&&dr(e.head)}function Dr(e,t){const n=t.nodeSize-2,r=0;let o;const i=l=>p7({min:r,max:n,value:l});if(S1(e))return e;if(e==="all")return new On(t);if(e==="start"?o=r:e==="end"?o=n:uF(e)?o=e.pos:o=e,dr(o))return o=i(o),Se.near(t.resolve(o));if(xF(o)){const l=i(o.anchor),c=i(o.head);return Se.between(t.resolve(l),t.resolve(c))}const s=i(o.from),a=i(o.to);return Se.between(t.resolve(s),t.resolve(a))}var bF=3;function cP(e){const{content:t,schema:n,document:r,stringHandler:o,onError:i,attempts:s=0}=e,a=i&&s<=bF||s===0;if(he(a,{code:K.INVALID_CONTENT,message:"The invalid content has been called recursively more than ${MAX_ATTEMPTS} times. The content is invalid and the error handler has not been able to recover properly."}),xe(t))return he(o,{code:K.INVALID_CONTENT,message:`The string '${t}' was added to the editor, but no \`stringHandler\` was added. Please provide a valid string handler which transforms your content to a \`ProsemirrorNode\` to prevent this error.`}),o({document:r,content:t,schema:n});if(iP(t))return t.doc;if(Tg(t))return t;try{return n.nodeFromJSON(t)}catch(l){const c=OF({schema:n,error:l,json:t}),u=i==null?void 0:i(c);return he(u,{code:K.INVALID_CONTENT,message:`An error occurred when processing the content. Please provide an \`onError\` handler to process the invalid content: ${JSON.stringify(c.invalidContent,null,2)}`}),cP({...e,content:u,attempts:s+1})}}function Pg(){const e=pR();if(e)return e;throw new Error(`Unable to retrieve the document from the global scope.
360
- It seems that you are running Remirror in a non-browser environment. Remirror need browser APIs to work.
361
- If you are using Jest (or other testing frameworks), make sure that you are using the JSDOM environment (https://jestjs.io/docs/29.0/configuration#testenvironment-string).
362
- If you are using Next.js (or other server-side rendering frameworks), please use dynamic import with \`ssr: false\` to load the editor component without rendering it on the server (https://nextjs.org/docs/advanced-features/dynamic-import#with-no-ssr).
363
- If you are using Node.js, you can install JSDOM and Remirror will try to use it automatically, or you can create a fake document and pass it to Remirror`)}function uP(e){var t;return(e==null?void 0:e.defaultView)??(typeof window<"u"?window:void 0)??((t=pR())==null?void 0:t.defaultView)}function wF(e){return uP(e==null?void 0:e.ownerDocument)}function SF(e){const t=uP(e)??Pg().defaultView;if(t)return t;throw new Error("Unable to retrieve the window from the global scope")}function kF(e,t=Pg()){const n=yF(e,e.type.schema)?e.content:L.from(e);return oo.fromSchema(e.type.schema).serializeFragment(n,{document:t})}function EF(e,t){return new(SF(t)).DOMParser().parseFromString(`<body>${e}</body>`,"text/html").body}function CF(e,t=Pg()){const n=t.createElement("div");return n.append(kF(e,t)),n.innerHTML}function dx(e){const{content:t,schema:n,document:r,fragment:o=!1,...i}=e,s=EF(t,r),a=xc.fromSchema(n);return o?a.parseSlice(s,{...YE,...i}).content:a.parse(s,{...YE,...i})}var YE={preserveWhitespace:!1};function dP(e,t){const n=Gd(t.defaults());return e1({...e},n)}var _F={remove(e,t){let n=e;for(const r of t)r.invalidParentNode||(n=g7(r.path,n));return n}};function OF({json:e,schema:t,...n}){const r=new Set(Gd(t.marks)),o=new Set(Gd(t.nodes)),i=fP({json:e,path:[],validNodes:o,validMarks:r});return{json:e,invalidContent:i,transformers:_F,...n}}function fP(e){const{json:t,validMarks:n,validNodes:r,path:o=[]}=e,i={validMarks:n,validNodes:r},s=[],{type:a,marks:l,content:c}=t;let{invalidParentMark:u=!1,invalidParentNode:d=!1}=e;if(l){const f=[];for(const[h,m]of l.entries()){const g=xe(m)?m:m.type;n.has(g)||(f.unshift({name:g,path:[...o,"marks",`${h}`],type:"mark",invalidParentMark:u,invalidParentNode:d}),u=!0)}s.push(...f)}if(r.has(a)||(s.push({name:a,type:"node",path:o,invalidParentMark:u,invalidParentNode:d}),d=!0),c){const f=[];for(const[h,m]of c.entries())f.unshift(...fP({...i,json:m,path:[...o,"content",`${h}`],invalidParentMark:u,invalidParentNode:d}));s.unshift(...f)}return s}function TF(e){return!!(tl(e)&&e.$cursor&&e.$cursor.parentOffset>=e.$cursor.parent.content.size)}function fx(e){return!!(tl(e)&&e.$cursor&&e.$cursor.parentOffset<=0)}function XE(e){const t=$e.atStart(e.$anchor.doc);return!!(fx(e)&&t.anchor===e.anchor)}function MF(e){return({dispatch:t,tr:n})=>{const{type:r,attrs:o=ce(),appendText:i,range:s}=e,a=s?Se.between(n.doc.resolve(s.from),n.doc.resolve(s.to)):n.selection,{$from:l,from:c,to:u}=a;let d=l.depth===0?n.doc.type.allowsMarkType(r):!1;return n.doc.nodesBetween(c,u,f=>{if(d)return!1;if(f.inlineContent&&f.type.allowsMarkType(r)){d=!0;return}}),d?(t==null||t(n.addMark(c,u,r.create(o))&&i?n.insertText(i):n),!0):!1}}function RF({tr:e,dispatch:t}){const{$from:n,$to:r}=e.selection,o=n.blockRange(r),i=o&&Ac(o);return!dr(i)||!o?!1:(t==null||t(e.lift(o,i).scrollIntoView()),!0)}function pP(e,t={},n){return function(r){const{tr:o,dispatch:i,state:s}=r,a=xe(e)?vt(s.schema.nodes,e):e,{from:l,to:c}=Dr(n??o.selection,o.doc),u=o.doc.resolve(l),d=o.doc.resolve(c),f=u.blockRange(d),h=f&&r1(f,a,t);return!h||!f?!1:(i==null||i(o.wrap(f,h).scrollIntoView()),!0)}}function PF(e,t={},n){return r=>{const{tr:o,state:i}=r,s=xe(e)?vt(i.schema.nodes,e):e;return nf({state:o,type:s,attrs:t})?RF(r):pP(e,t,n)(r)}}function wm(e,t,n,r=!0){return function(o){const{tr:i,dispatch:s,state:a}=o,l=xe(e)?vt(a.schema.nodes,e):e,{from:c,to:u}=Dr(n??i.selection,i.doc);let d=!1,f;return i.doc.nodesBetween(c,u,(h,m)=>{if(d)return!1;if(!h.isTextblock||h.hasMarkup(l,t))return;if(h.type===l){d=!0,f=h.attrs;return}const g=i.doc.resolve(m),b=g.index();d=g.parent.canReplaceWith(b,b+1,l),d&&(f=g.parent.attrs)}),d?(s==null||s(i.setBlockType(c,u,l,{...r?f:{},...t}).scrollIntoView()),!0):!1}}function hP(e){return t=>{const{tr:n,state:r}=t,{type:o,attrs:i,preserveAttrs:s=!0}=e,a=nf({state:n,type:o,attrs:i}),l=e.toggleType??Rg(r.schema);if(a)return wm(l,{...s?a.node.attrs:{},...i})(t);const c=nf({state:n,type:l,attrs:i});return wm(o,{...s?c==null?void 0:c.node.attrs:{},...i})(t)}}function NF(e=0){const t=navigator.userAgent.match(/Chrom(e|ium)\/(\d+)\./);return t?Number.parseInt(vt(t,2),10)>=e:!1}function $F(e,t){let{head:n,empty:r,anchor:o}=e;for(const i of t.steps)n=i.getMap().map(n);r?t.setSelection(Se.near(t.doc.resolve(n))):t.setSelection(Se.between(t.doc.resolve(o),t.doc.resolve(n)))}function DF(e){const{attrs:t={},appendText:n="",content:r="",keepSelection:o=!1,range:i}=e;return({state:s,tr:a,dispatch:l})=>{var c;const u=s.schema,d=Dr(e.selection??i??a.selection,a.doc),f=d.$from.index(),{from:h,to:m,$from:g}=d,b=xe(e.type)?u.nodes[e.type]??u.marks[e.type]:e.type;if(he(xe(e.type)?b:!0,{code:K.SCHEMA,message:`Schema contains no marks or nodes with name ${b}`}),oF(b)){if(!g.parent.canReplaceWith(f,f,b))return!1;a.replaceWith(h,m,b.create(t,r?u.text(r):void 0))}else he(r,{message:"`replaceText` cannot be called without content when using a mark type"}),a.replaceWith(h,m,u.text(r,oP(b)?[b.create(t)]:void 0));return n&&a.insertText(n),o&&$F(s.selection,a),l&&(NF(60)&&((c=document.getSelection())==null||c.empty()),l(a)),!0}}function mP(e,t){const n=e.parent.childAfter(e.parentOffset);if(!n.node)return;const{marks:r,nodeSize:o}=n.node;if(r[0])return r[0].type;const s=e.start()+n.offset+o;return mP(e.doc.resolve(s+1))}function gP(e){return({dispatch:t,tr:n,state:r})=>{const{type:o,expand:i=!0,range:s}=e,a=Dr(e.selection??s??n.selection,n.doc);let{from:l,to:c,$from:u,$to:d}=a;const f=xe(o)?r.schema.marks[o]:o;f!==null&&he(f,{code:K.SCHEMA,message:`Mark type: ${o} does not exist on the current schema.`});const h=f??mP(u);if(!h)return!1;const m=_i(u,h,d);return i&&m&&(l=Math.max(0,Math.min(l,m.from)),c=Math.min(Math.max(c,m.to),n.doc.nodeSize-2)),t==null||t(n.removeMark(l,dr(c)?c:l,oP(f)?f:void 0)),!0}}function Sm(e){const{regexp:t,type:n,getAttributes:r,ignoreWhitespace:o=!1,beforeDispatch:i,updateCaptured:s,shouldSkip:a,invalidMarks:l}=e;let c;const u=new jr(t,(d,f,h,m)=>{const{tr:g,schema:b}=d;c||(c=xe(n)?b.marks[n]:n,he(c,{code:K.SCHEMA,message:`Mark type: ${n} does not exist on the current schema.`}));let y=f[1],v=f[0];const w=AF({captureGroup:y,fullMatch:v,end:m,start:h,rule:u,state:d,ignoreWhitespace:o,invalidMarks:l,shouldSkip:a,updateCaptured:s});if(!w)return null;({start:h,end:m,captureGroup:y,fullMatch:v}=w);const S=nt(r)?r(f):r;let k=m,C=[];if(y){const E=v.search(/\S/),T=h+v.indexOf(y),R=T+y.length;C=g.storedMarks??[],R<m&&g.delete(R,m),T>h&&g.delete(h+E,T),k=h+E+y.length}return g.addMark(h,k,c.create(S)),g.setStoredMarks(C),i==null||i({tr:g,match:f,start:h,end:m}),g});return u}function AF({captureGroup:e,fullMatch:t,end:n,start:r,rule:o,ignoreWhitespace:i,shouldSkip:s,updateCaptured:a,state:l,invalidMarks:c}){var u;if(t==null)return null;const d=(a==null?void 0:a({captureGroup:e,fullMatch:t,start:r,end:n}))??{};e=d.captureGroup??e,t=d.fullMatch??t,r=d.start??r,n=d.end??n;const f=l.doc.resolve(r),h=l.doc.resolve(n);return c&&lx({$from:f,$to:h},c)||o.invalidMarks&&lx({$from:f,$to:h},o.invalidMarks)||i&&(e==null?void 0:e.trim())===""||s!=null&&s({state:l,captureGroup:e,fullMatch:t,start:r,end:n,ruleType:"mark"})||(u=o.shouldSkip)!=null&&u.call(o,{state:l,captureGroup:e,fullMatch:t,start:r,end:n,ruleType:"mark"})?null:{captureGroup:e,end:n,fullMatch:t,start:r}}var IF=function(){const t=Array.prototype.slice.call(arguments).filter(Boolean),n={},r=[];t.forEach(i=>{(i?i.split(" "):[]).forEach(a=>{if(a.startsWith("atm_")){const[,l]=a.split("_");n[l]=a}else r.push(a)})});const o=[];for(const i in n)Object.prototype.hasOwnProperty.call(n,i)&&o.push(n[i]);return o.push(...r),o.join(" ")},LF=IF;const vP=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function jF(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const yP=(e,t,n)=>{let r=jF(e,n);if(!r)return!1;let o=xP(r);if(!o){let s=r.blockRange(),a=s&&Ac(s);return a==null?!1:(t&&t(e.tr.lift(s,a).scrollIntoView()),!0)}let i=o.nodeBefore;if(!i.type.spec.isolating&&SP(e,o,t))return!0;if(r.parent.content.size==0&&(kc(i,"end")||ge.isSelectable(i))){let s=o1(e.doc,r.before(),r.after(),Y.empty);if(s&&s.slice.size<s.to-s.from){if(t){let a=e.tr.step(s);a.setSelection(kc(i,"end")?$e.findFrom(a.doc.resolve(a.mapping.map(o.pos,-1)),-1):ge.create(a.doc,o.pos-i.nodeSize)),t(a.scrollIntoView())}return!0}}return i.isAtom&&o.depth==r.depth-1?(t&&t(e.tr.delete(o.pos-i.nodeSize,o.pos).scrollIntoView()),!0):!1};function kc(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}const zF=(e,t,n)=>{let{$head:r,empty:o}=e.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;i=xP(r)}let s=i&&i.nodeBefore;return!s||!ge.isSelectable(s)?!1:(t&&t(e.tr.setSelection(ge.create(e.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)};function xP(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 FF(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}const BF=(e,t,n)=>{let r=FF(e,n);if(!r)return!1;let o=bP(r);if(!o)return!1;let i=o.nodeAfter;if(SP(e,o,t))return!0;if(r.parent.content.size==0&&(kc(i,"start")||ge.isSelectable(i))){let s=o1(e.doc,r.before(),r.after(),Y.empty);if(s&&s.slice.size<s.to-s.from){if(t){let a=e.tr.step(s);a.setSelection(kc(i,"start")?$e.findFrom(a.doc.resolve(a.mapping.map(o.pos)),1):ge.create(a.doc,a.mapping.map(o.pos))),t(a.scrollIntoView())}return!0}}return i.isAtom&&o.depth==r.depth-1?(t&&t(e.tr.delete(o.pos,o.pos+i.nodeSize).scrollIntoView()),!0):!1},VF=(e,t,n)=>{let{$head:r,empty:o}=e.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;i=bP(r)}let s=i&&i.nodeAfter;return!s||!ge.isSelectable(s)?!1:(t&&t(e.tr.setSelection(ge.create(e.doc,i.pos)).scrollIntoView()),!0)};function bP(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}const UF=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
364
- `).scrollIntoView()),!0)};function C1(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const wP=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),i=n.indexAfter(-1),s=C1(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(t){let a=n.after(),l=e.tr.replaceWith(a,a,s.createAndFill());l.setSelection($e.near(l.doc.resolve(a),1)),t(l.scrollIntoView())}return!0},HF=(e,t)=>{let n=e.selection,{$from:r,$to:o}=n;if(n instanceof On||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=C1(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(t){let s=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,a=e.tr.insert(s,i.createAndFill());a.setSelection(Se.create(a.doc,s+1)),t(a.scrollIntoView())}return!0},WF=(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 i=n.before();if(tc(e.doc,i))return t&&t(e.tr.split(i).scrollIntoView()),!0}let r=n.blockRange(),o=r&&Ac(r);return o==null?!1:(t&&t(e.tr.lift(r,o).scrollIntoView()),!0)};function KF(e){return(t,n)=>{let{$from:r,$to:o}=t.selection;if(t.selection instanceof ge&&t.selection.node.isBlock)return!r.parentOffset||!tc(t.doc,r.pos)?!1:(n&&n(t.tr.split(r.pos).scrollIntoView()),!0);if(!r.parent.isBlock)return!1;if(n){let i=o.parentOffset==o.parent.content.size,s=t.tr;(t.selection instanceof Se||t.selection instanceof On)&&s.deleteSelection();let a=r.depth==0?null:C1(r.node(-1).contentMatchAt(r.indexAfter(-1))),l=e&&e(o.parent,i),c=l?[l]:i&&a?[{type:a}]:void 0,u=tc(s.doc,s.mapping.map(r.pos),1,c);if(!c&&!u&&tc(s.doc,s.mapping.map(r.pos),1,a?[{type:a}]:void 0)&&(a&&(c=[{type:a}]),u=!0),u&&(s.split(s.mapping.map(r.pos),1,c),!i&&!r.parentOffset&&r.parent.type!=a)){let d=s.mapping.map(r.before()),f=s.doc.resolve(d);a&&r.node(-1).canReplaceWith(f.index(),f.index()+1,a)&&s.setNodeMarkup(s.mapping.map(r.before()),a)}n(s.scrollIntoView())}return!0}}const qF=KF(),GF=(e,t)=>{let{$from:n,to:r}=e.selection,o,i=n.sharedDepth(r);return i==0?!1:(o=n.before(i),t&&t(e.tr.setSelection(ge.create(e.doc,o))),!0)},YF=(e,t)=>(t&&t(e.tr.setSelection(new On(e.doc))),!0);function XF(e,t,n){let r=t.nodeBefore,o=t.nodeAfter,i=t.index();return!r||!o||!r.type.compatibleContent(o.type)?!1:!r.content.size&&t.parent.canReplace(i-1,i)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(i,i+1)||!(o.isTextblock||zf(e.doc,t.pos))?!1:(n&&n(e.tr.clearIncompatible(t.pos,r.type,r.contentMatchAt(r.childCount)).join(t.pos).scrollIntoView()),!0)}function SP(e,t,n){let r=t.nodeBefore,o=t.nodeAfter,i,s;if(r.type.spec.isolating||o.type.spec.isolating)return!1;if(XF(e,t,n))return!0;let a=t.parent.canReplace(t.index(),t.index()+1);if(a&&(i=(s=r.contentMatchAt(r.childCount)).findWrapping(o.type))&&s.matchType(i[0]||o.type).validEnd){if(n){let d=t.pos+o.nodeSize,f=L.empty;for(let g=i.length-1;g>=0;g--)f=L.from(i[g].create(null,f));f=L.from(r.copy(f));let h=e.tr.step(new Ot(t.pos-1,d,t.pos,d,new Y(f,1,0),i.length,!0)),m=d+2*i.length;zf(h.doc,m)&&h.join(m),n(h.scrollIntoView())}return!0}let l=$e.findFrom(t,1),c=l&&l.$from.blockRange(l.$to),u=c&&Ac(c);if(u!=null&&u>=t.depth)return n&&n(e.tr.lift(c,u).scrollIntoView()),!0;if(a&&kc(o,"start",!0)&&kc(r,"end")){let d=r,f=[];for(;f.push(d),!d.isTextblock;)d=d.lastChild;let h=o,m=1;for(;!h.isTextblock;h=h.firstChild)m++;if(d.canReplace(d.childCount,d.childCount,h.content)){if(n){let g=L.empty;for(let y=f.length-1;y>=0;y--)g=L.from(f[y].copy(g));let b=e.tr.step(new Ot(t.pos-f.length,t.pos+o.nodeSize,t.pos+m,t.pos+o.nodeSize-m,new Y(g,f.length,0),0,!0));n(b.scrollIntoView())}return!0}}return!1}function kP(e){return function(t,n){let r=t.selection,o=e<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return o.node(i).isTextblock?(n&&n(t.tr.setSelection(Se.create(t.doc,e<0?o.start(i):o.end(i)))),!0):!1}}const ZF=kP(-1),JF=kP(1);function QF(e,t,n){for(let r=0;r<t.length;r++){let{$from:o,$to:i}=t[r],s=o.depth==0?e.inlineContent&&e.type.allowsMarkType(n):!1;if(e.nodesBetween(o.pos,i.pos,a=>{if(s)return!1;s=a.inlineContent&&a.type.allowsMarkType(n)}),s)return!0}return!1}function eB(e,t=null){return function(n,r){let{empty:o,$cursor:i,ranges:s}=n.selection;if(o&&!i||!QF(n.doc,s,e))return!1;if(r)if(i)e.isInSet(n.storedMarks||i.marks())?r(n.tr.removeStoredMark(e)):r(n.tr.addStoredMark(e.create(t)));else{let a=!1,l=n.tr;for(let c=0;!a&&c<s.length;c++){let{$from:u,$to:d}=s[c];a=n.doc.rangeHasMark(u.pos,d.pos,e)}for(let c=0;c<s.length;c++){let{$from:u,$to:d}=s[c];if(a)l.removeMark(u.pos,d.pos,e);else{let f=u.pos,h=d.pos,m=u.nodeAfter,g=d.nodeBefore,b=m&&m.isText?/^\s*/.exec(m.text)[0].length:0,y=g&&g.isText?/\s*$/.exec(g.text)[0].length:0;f+b<h&&(f+=b,h-=y),l.addMark(f,h,e.create(t))}}r(l.scrollIntoView())}return!0}}function Ng(...e){return function(t,n,r){for(let o=0;o<e.length;o++)if(e[o](t,n,r))return!0;return!1}}let ry=Ng(vP,yP,zF),ZE=Ng(vP,BF,VF);const ci={Enter:Ng(UF,HF,WF,qF),"Mod-Enter":wP,Backspace:ry,"Mod-Backspace":ry,"Shift-Backspace":ry,Delete:ZE,"Mod-Delete":ZE,"Mod-a":YF},EP={"Ctrl-h":ci.Backspace,"Alt-Backspace":ci["Mod-Backspace"],"Ctrl-d":ci.Delete,"Ctrl-Alt-Backspace":ci["Mod-Delete"],"Alt-Delete":ci["Mod-Delete"],"Alt-d":ci["Mod-Delete"],"Ctrl-a":ZF,"Ctrl-e":JF};for(let e in ci)EP[e]=ci[e];const tB=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform?os.platform()=="darwin":!1,oy=tB?EP:ci;var Bs={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:"'"},km={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},nB=typeof navigator<"u"&&/Mac/.test(navigator.platform),rB=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var tn=0;tn<10;tn++)Bs[48+tn]=Bs[96+tn]=String(tn);for(var tn=1;tn<=24;tn++)Bs[tn+111]="F"+tn;for(var tn=65;tn<=90;tn++)Bs[tn]=String.fromCharCode(tn+32),km[tn]=String.fromCharCode(tn);for(var iy in Bs)km.hasOwnProperty(iy)||(km[iy]=Bs[iy]);function oB(e){var t=nB&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||rB&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?km:Bs)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const iB=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function sB(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n=="Space"&&(n=" ");let r,o,i,s;for(let a=0;a<t.length-1;a++){let l=t[a];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))o=!0;else if(/^s(hift)?$/i.test(l))i=!0;else if(/^mod$/i.test(l))iB?s=!0:o=!0;else throw new Error("Unrecognized modifier name: "+l)}return r&&(n="Alt-"+n),o&&(n="Ctrl-"+n),s&&(n="Meta-"+n),i&&(n="Shift-"+n),n}function aB(e){let t=Object.create(null);for(let n in e)t[sB(n)]=e[n];return t}function sy(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 CP(e){let t=aB(e);return function(n,r){let o=oB(r),i,s=t[sy(o,r)];if(s&&s(n.state,n.dispatch,n))return!0;if(o.length==1&&o!=" "){if(r.shiftKey){let a=t[sy(o,r,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((r.shiftKey||r.altKey||r.metaKey||o.charCodeAt(0)>127)&&(i=Bs[r.keyCode])&&i!=o){let a=t[sy(i,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}function lB(e){const t=Fa(e,(i,s)=>(s.priority??Je.Low)-(i.priority??Je.Low)),n=[],r=[];for(const i of t)mB(i)?n.push(i):r.push(i);let o;return new $i({key:cB,view:i=>(o=i,{}),props:{transformPasted:i=>{var s,a,l;const c=o.state.selection.$from,u=c.node().type.name,d=new Set(c.marks().map(f=>f.type.name));for(const f of n){if((s=f.ignoredNodes)!=null&&s.includes(u)||(a=f.ignoredMarks)!=null&&a.some(v=>d.has(v)))continue;const h=((l=i.content.firstChild)==null?void 0:l.textContent)??"",m=!o.state.selection.empty&&i.content.childCount===1&&h,g=Sg(h,f.regexp)[0];if(m&&g&&f.type==="mark"&&f.replaceSelection){const{from:v,to:w}=o.state.selection,S=o.state.doc.slice(v,w),k=S.content.textBetween(0,S.content.size);if(typeof f.replaceSelection!="boolean"?f.replaceSelection(k):f.replaceSelection){const C=[],{getAttributes:E,markType:T}=f,R=nt(E)?E(g,!0):E,$=T.create(R);return S.content.forEach(j=>{if(j.isText){const z=$.addToSet(j.marks);C.push(j.mark(z))}}),Y.maxOpen(L.fromArray(C))}}const{nodes:b,transformed:y}=pB(i.content,f,o.state.schema);y&&(i=f.type==="node"&&f.nodeType.isBlock?new Y(L.fromArray(b),0,0):new Y(L.fromArray(b),i.openStart,i.openEnd))}return xB(i)},handleDOMEvents:{paste:(i,s)=>{var a,l;const c=s;if(!((l=(a=i.props).editable)!=null&&l.call(a,i.state)))return!1;const{clipboardData:u}=c;if(!u)return!1;const d=[...u.items].map(h=>h.getAsFile()).filter(h=>!!h);if(d.length===0)return!1;const{selection:f}=i.state;for(const{fileHandler:h,regexp:m}of r){const g=m?d.filter(b=>m.test(b.type)):d;if(g.length!==0&&h({event:c,files:g,selection:f,view:i,type:"paste"}))return c.preventDefault(),!0}return!1},drop:(i,s)=>{var a,l,c;const u=s;if(!((l=(a=i.props).editable)!=null&&l.call(a,i.state)))return!1;const{dataTransfer:d,clientX:f,clientY:h}=u;if(!d)return!1;const m=yB(u);if(m.length===0)return!1;const g=((c=i.posAtCoords({left:f,top:h}))==null?void 0:c.pos)??i.state.selection.anchor;for(const{fileHandler:b,regexp:y}of r){const v=y?m.filter(w=>y.test(w.type)):m;if(v.length!==0&&b({event:u,files:v,pos:g,view:i,type:"drop"}))return u.preventDefault(),!0}return!1}}}})}var cB=new Ic("pasteRule");function ay(e,t){return function n(r){const{fragment:o,rule:i,nodes:s}=r,{regexp:a,ignoreWhitespace:l,ignoredMarks:c,ignoredNodes:u}=i;let d=!1;return o.forEach(f=>{if(u!=null&&u.includes(f.type.name)||gB(f)){s.push(f);return}if(!f.isText){const g=n({fragment:f.content,rule:i,nodes:[]});d||(d=g.transformed);const b=L.fromArray(g.nodes);f.type.validContent(b)?s.push(f.copy(b)):s.push(...g.nodes);return}if(f.marks.some(g=>vB(g)||(c==null?void 0:c.includes(g.type.name)))){s.push(f);return}const h=f.text??"";let m=0;for(const g of Sg(h,a)){const b=g[1],y=g[0];if(l&&(b==null?void 0:b.trim())===""||!y)return;const v=g.index,w=v+y.length;v>m&&s.push(f.cut(m,v));let S=f.cut(v,w);if(y&&b){const k=y.search(/\S/),C=v+y.indexOf(b),E=C+b.length;k&&s.push(f.cut(v,v+k)),S=f.cut(C,E)}e({nodes:s,rule:i,textNode:S,match:g,schema:t}),d=!0,m=w}h&&m<h.length&&s.push(f.cut(m))}),{nodes:s,transformed:d}}}function uB(e){const{nodes:t,rule:n,textNode:r,match:o,schema:i}=e,{transformMatch:s,getAttributes:a,markType:l}=n,c=nt(a)?a(o,!1):a,u=r.text??"",d=l.create(c),f=s==null?void 0:s(o);if(f==="")return;if(f===!1){t.push(i.text(u,r.marks));return}const h=d.addToSet(r.marks);t.push(i.text(f??u,h))}function dB(e){const{nodes:t,rule:n,textNode:r,match:o,schema:i}=e,{transformMatch:s}=n,a=s==null?void 0:s(o);if(a===""||a===!1)return;const l=a??r.text??"";t.push(i.text(l,r.marks))}function fB(e){const{nodes:t,rule:n,textNode:r,match:o}=e,{getAttributes:i,nodeType:s,getContent:a}=n,l=nt(i)?i(o,!1):i,c=(a?a(o):r)||void 0;t.push(s.createChecked(l,c))}function pB(e,t,n){const r=[];switch(t.type){case"mark":return ay(uB,n)({fragment:e,nodes:r,rule:t});case"node":return ay(fB,n)({fragment:e,nodes:r,rule:t});default:return ay(dB,n)({fragment:e,nodes:r,rule:t})}}var hB=["mark","node","text"];function mB(e){return go(hB,e.type)}function gB(e){var t;return e.type.spec.code||((t=e.type.spec.group)==null?void 0:t.split(" ").includes("code"))}function vB(e){var t;return e.type.name==="code"||((t=e.type.spec.group)==null?void 0:t.split(" ").includes("code"))}function yB(e){var t,n;const{dataTransfer:r}=e;return r?((t=r.files)==null?void 0:t.length)>0?[...r.files]:(n=r.items)!=null&&n.length?[...r.items].map(o=>o.getAsFile()).filter(o=>!!o):[]:[]}function xB(e){const t=Y.maxOpen(e.content);return t.openStart<e.openStart||t.openEnd<e.openEnd?t:e}var bB=Object.defineProperty,wB=Object.getOwnPropertyDescriptor,oe=(e,t,n,r)=>{for(var o=r>1?void 0:r?wB(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&bB(t,n,o),o},_P=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},Z=(e,t,n)=>(_P(e,t,"read from private field"),n?n.call(e):t.get(e)),Mt=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Ut=(e,t,n,r)=>(_P(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);function SB(e,t){return e===t}function JE(e){const{previousOptions:t,update:n,equals:r=SB}=e,o=ya({...t,...n}),i=ce(),s=Gd(t);for(const l of s){const c=t[l],u=o[l];if(r(c,u)){i[l]={changed:!1};continue}i[l]={changed:!0,previousValue:c,value:u}}const a=l=>{const c=ce();for(const u of l){const d=i[u];d!=null&&d.changed&&(c[u]=d.value)}return c};return{changes:ya(i),options:o,pickChanged:a}}var kB={[K.DUPLICATE_HELPER_NAMES]:"helper method",[K.DUPLICATE_COMMAND_NAMES]:"command method"};function OP(e){const{name:t,set:n,code:r}=e,o=kB[r];he(!n.has(t),{code:r,message:`There is a naming conflict for the name: ${t} used in this '${o}'. Please rename or remove from the editor to avoid runtime errors.`}),n.add(t)}function px(...e){return Yd(LF(...e).split(" ")).join(" ")}var QE="__IGNORE__",EB="__ALL__",zc=class{constructor(e,...[t]){this["~O"]={},this._mappedHandlers=ce(),this.populateMappedHandlers(),this._options=this._initialOptions=f7(e,this.constructor.defaultOptions,t??ce(),this.createDefaultHandlerOptions()),this._dynamicKeys=this.getDynamicKeys(),this.init()}get options(){return this._options}get dynamicKeys(){return this._dynamicKeys}get initialOptions(){return this._initialOptions}init(){}getDynamicKeys(){const e=[],{customHandlerKeys:t,handlerKeys:n,staticKeys:r}=this.constructor;for(const o of Gd(this._options))r.includes(o)||n.includes(o)||t.includes(o)||e.push(o);return e}ensureAllKeysAreDynamic(e){}setOptions(e){var t;const n=this.getDynamicOptions();this.ensureAllKeysAreDynamic(e);const{changes:r,options:o,pickChanged:i}=JE({previousOptions:n,update:e});this.updateDynamicOptions(o),(t=this.onSetOptions)==null||t.call(this,{reason:"set",changes:r,options:o,pickChanged:i,initialOptions:this._initialOptions})}resetOptions(){var e;const t=this.getDynamicOptions(),{changes:n,options:r,pickChanged:o}=JE({previousOptions:t,update:this._initialOptions});this.updateDynamicOptions(r),(e=this.onSetOptions)==null||e.call(this,{reason:"reset",options:r,changes:n,pickChanged:o,initialOptions:this._initialOptions})}getDynamicOptions(){return e1(this._options,[...this.constructor.customHandlerKeys,...this.constructor.handlerKeys])}updateDynamicOptions(e){this._options={...this._options,...e}}populateMappedHandlers(){for(const e of this.constructor.handlerKeys)this._mappedHandlers[e]=[]}createDefaultHandlerOptions(){const e=ce();for(const t of this.constructor.handlerKeys)e[t]=(...n)=>{var r;const{handlerKeyOptions:o}=this.constructor,i=(r=o[t])==null?void 0:r.reducer;let s=i==null?void 0:i.getDefault(...n);for(const[,a]of this._mappedHandlers[t]){const l=a(...n);if(s=i?i.accumulator(s,l,...n):l,CB(o,s,t))return s}return s};return e}addHandler(e,t,n=Je.Default){return this._mappedHandlers[e].push([n,t]),this.sortHandlers(e),()=>this._mappedHandlers[e]=this._mappedHandlers[e].filter(([,r])=>r!==t)}hasHandlers(e){return(this._mappedHandlers[e]??[]).length>0}sortHandlers(e){this._mappedHandlers[e]=Fa(this._mappedHandlers[e],([t],[n])=>n-t)}addCustomHandler(e,t){var n;return((n=this.onAddCustomHandler)==null?void 0:n.call(this,{[e]:t}))??NM}};zc.defaultOptions={};zc.staticKeys=[];zc.handlerKeys=[];zc.handlerKeyOptions={};zc.customHandlerKeys=[];function CB(e,t,n){const{[EB]:r}=e,o=e[n];return!r&&!o?!1:!!(o&&o.earlyReturnValue!==QE&&(nt(o.earlyReturnValue)?o.earlyReturnValue(t)===!0:t===o.earlyReturnValue)||r&&r.earlyReturnValue!==QE&&(nt(r.earlyReturnValue)?r.earlyReturnValue(t)===!0:t===r.earlyReturnValue))}var $g=class extends zc{constructor(...e){super(_B,...e),this["~E"]={},this._extensions=$M(this.createExtensions(),t=>t.constructor),this.extensionMap=new Map;for(const t of this._extensions)this.extensionMap.set(t.constructor,t)}get priority(){return this.priorityOverride??this.options.priority??this.constructor.defaultPriority}get constructorName(){return`${TM(this.name)}Extension`}get store(){return he(this._store,{code:K.MANAGER_PHASE_ERROR,message:"An error occurred while attempting to access the 'extension.store' when the Manager has not yet set created the lifecycle methods."}),ya(this._store,{requireKeys:!0})}get extensions(){return this._extensions}replaceChildExtension(e,t){this.extensionMap.has(e)&&(this.extensionMap.set(e,t),this._extensions=this.extensions.map(n=>t.constructor===e?t:n))}createExtensions(){return[]}getExtension(e){const t=this.extensionMap.get(e);return he(t,{code:K.INVALID_GET_EXTENSION,message:`'${e.name}' does not exist within the preset: '${this.name}'`}),t}isOfType(e){return this.constructor===e}setStore(e){this._store||(this._store=e)}clone(...e){return new this.constructor(...e)}setPriority(e){this.priorityOverride=e}};$g.defaultPriority=Je.Default;var ft=class extends $g{static get[Ci](){return Yt.PlainExtensionConstructor}get[Ci](){return Yt.PlainExtension}},Vf=class extends $g{static get[Ci](){return Yt.MarkExtensionConstructor}get[Ci](){return Yt.MarkExtension}get type(){return vt(this.store.schema.marks,this.name)}constructor(...e){super(...e)}};Vf.disableExtraAttributes=!1;var zr=class extends $g{static get[Ci](){return Yt.NodeExtensionConstructor}get[Ci](){return Yt.NodeExtension}get type(){return vt(this.store.schema.nodes,this.name)}constructor(...e){super(...e)}};zr.disableExtraAttributes=!1;var _B={priority:void 0,extraAttributes:{},disableExtraAttributes:!1,exclude:{}};function TP(e){return Lc(e)&&jc(e,[Yt.PlainExtension,Yt.MarkExtension,Yt.NodeExtension])}function OB(e){return Lc(e)&&jc(e,[Yt.PlainExtensionConstructor,Yt.MarkExtensionConstructor,Yt.NodeExtensionConstructor])}function MP(e){return Lc(e)&&jc(e,Yt.PlainExtension)}function Uf(e){return Lc(e)&&jc(e,Yt.NodeExtension)}function Dg(e){return Lc(e)&&jc(e,Yt.MarkExtension)}function He(e){return t=>{const{defaultOptions:n,customHandlerKeys:r,handlerKeys:o,staticKeys:i,defaultPriority:s,handlerKeyOptions:a,...l}=e,c=t;n&&(c.defaultOptions=n),s&&(c.defaultPriority=s),a&&(c.handlerKeyOptions=a),c.staticKeys=i??[],c.handlerKeys=o??[],c.customHandlerKeys=r??[];for(const[u,d]of Object.entries(l))c[u]||(c[u]=d);return c}}var TB=class extends ft{constructor(){super(...arguments),this.attributeList=[],this.attributeObject=ce(),this.updateAttributes=(e=!0)=>{this.transformAttributes(),e&&this.store.commands.forceUpdate("attributes")}}get name(){return"attributes"}onCreate(){this.transformAttributes(),this.store.setExtensionStore("updateAttributes",this.updateAttributes)}transformAttributes(){var e,t,n;if(this.attributeObject=ce(),(e=this.store.managerSettings.exclude)!=null&&e.attributes){this.store.setStoreKey("attributes",this.attributeObject);return}this.attributeList=[];for(const r of this.store.extensions){if((t=r.options.exclude)!=null&&t.attributes)continue;const o=(n=r.createAttributes)==null?void 0:n.call(r),i={...o,class:px(...r.classNames??[],o==null?void 0:o.class)};this.attributeList.unshift(i)}for(const r of this.attributeList)this.attributeObject={...this.attributeObject,...r,class:px(this.attributeObject.class,r.class)};this.store.setStoreKey("attributes",this.attributeObject)}};function St(e={}){return(t,n,r)=>{(t.decoratedHelpers??(t.decoratedHelpers={}))[n]=e}}function ie(e={}){return(t,n,r)=>{(t.decoratedCommands??(t.decoratedCommands={}))[n]=e}}function yr(e){return(t,n,r)=>{(t.decoratedKeybindings??(t.decoratedKeybindings={}))[n]=e}}var MB=class{constructor(e){this.promiseCreator=e,this.failureHandlers=[],this.successHandlers=[],this.validateHandlers=[],this.generateCommand=()=>t=>{let n=!0;const{view:r,tr:o,dispatch:i}=t;if(!r)return!1;for(const a of this.validateHandlers)if(!a({...t,dispatch:()=>{}})){n=!1;break}return!i||!n?n:(this.promiseCreator(t).then(a=>{this.runHandlers(this.successHandlers,{value:a,state:r.state,tr:r.state.tr,dispatch:r.dispatch,view:r})}).catch(a=>{this.runHandlers(this.failureHandlers,{error:a,state:r.state,tr:r.state.tr,dispatch:r.dispatch,view:r})}),i(o),!0)}}validate(e,t="push"){return this.validateHandlers[t](e),this}success(e,t="push"){return this.successHandlers[t](e),this}failure(e,t="push"){return this.failureHandlers[t](e),this}runHandlers(e,t){var n;for(const r of e)if(!r({...t,dispatch:()=>{}}))break;(n=t.dispatch)==null||n.call(t,t.tr)}};function rf(e){const{type:t,attrs:n,range:r,selection:o}=e;return i=>{const{dispatch:s,tr:a,state:l}=i,c=xe(t)?l.schema.marks[t]:t;if(he(c,{code:K.SCHEMA,message:`Mark type: ${t} does not exist on the current schema.`}),r||o){const{from:u,to:d}=Dr(o??r??a.selection,a.doc);return bm({trState:a,type:t,...r})?s==null||s(a.removeMark(u,d,c)):s==null||s(a.addMark(u,d,c.create(n))),!0}return fd(eB(c,n))(i)}}function RB(e,t,n){for(const{$from:r,$to:o}of n){let i=r.depth===0?t.type.allowsMarkType(e):!1;if(t.nodesBetween(r.pos,o.pos,s=>{if(i)return!1;i=s.inlineContent&&s.type.allowsMarkType(e)}),i)return!0}return!1}function PB(e,t,n){return({tr:r,dispatch:o,state:i})=>{const s=Dr(n??r.selection,r.doc),a=vF(s),l=xe(e)?i.schema.marks[e]:e;if(he(l,{code:K.SCHEMA,message:`Mark type: ${e} does not exist on the current schema.`}),s.empty&&!a||!RB(l,r.doc,s.ranges))return!1;if(!o)return!0;if(a)return r.removeStoredMark(l),t&&r.addStoredMark(l.create(t)),o(r),!0;let c=!1;for(const{$from:u,$to:d}of s.ranges){if(c)break;c=r.doc.rangeHasMark(u.pos,d.pos,l)}for(const{$from:u,$to:d}of s.ranges)c&&r.removeMark(u.pos,d.pos,l),t&&r.addMark(u.pos,d.pos,l.create(t));return o(r),!0}}function NB(e,t={}){return({tr:n,dispatch:r,state:o})=>{const i=o.schema,s=n.selection,{from:a=s.from,to:l=a??s.to,marks:c={}}=t;if(!r)return!0;n.insertText(e,a,l);const u=vt(n.steps,n.steps.length-1).getMap().map(l);for(const[d,f]of jt(c))n.addMark(a,u,vt(i.marks,d).create(f));return r(n),!0}}var De=class extends ft{constructor(){super(...arguments),this.decorated=new Map,this.forceUpdateTransaction=(e,...t)=>{const{forcedUpdates:n}=this.getCommandMeta(e);return this.setCommandMeta(e,{forcedUpdates:Yd([...n,...t])}),e}}get name(){return"commands"}get transaction(){const e=this.store.getState();this._transaction||(this._transaction=e.tr);const t=this._transaction.before.eq(e.doc),n=!zs(this._transaction.steps);if(!t){const r=e.tr;if(n)for(const o of this._transaction.steps)r.step(o);this._transaction=r}return this._transaction}onCreate(){this.store.setStoreKey("getForcedUpdates",this.getForcedUpdates.bind(this))}onView(e){var t;const{extensions:n,helpers:r}=this.store,o=ce(),i=new Set;let s=ce();const a=c=>{var u;const d=ce(),f=()=>c??this.transaction;let h=[];const m=()=>h;for(const[b,y]of Object.entries(o))(u=s[b])!=null&&u.disableChaining||(d[b]=this.chainedFactory({chain:d,command:y.original,getTr:f,getChain:m}));const g=b=>{he(b===f(),{message:"Chaining currently only supports `CommandFunction` methods which do not use the `state.tr` property. Instead you should use the provided `tr` property."})};return d.run=(b={})=>{const y=h;h=[];for(const v of y)if(!v(g)&&b.exitEarly)return;e.dispatch(f())},d.tr=()=>{const b=h;h=[];for(const y of b)y(g);return f()},d.enabled=()=>{for(const b of h)if(!b())return!1;return!0},d.new=b=>a(b),d};for(const c of n){const u=((t=c.createCommands)==null?void 0:t.call(c))??{},d=c.decoratedCommands??{},f={};s={...s,decoratedCommands:d};for(const[h,m]of Object.entries(d)){const g=xe(m.shortcut)&&m.shortcut.startsWith("_|")?{shortcut:r.getNamedShortcut(m.shortcut,c.options)}:void 0;this.updateDecorated(h,{...m,name:c.name,...g}),u[h]=c[h].bind(c),m.active&&(f[h]=()=>{var b;return((b=m.active)==null?void 0:b.call(m,c.options,this.store))??!1})}om(u)||this.addCommands({active:f,names:i,commands:o,extensionCommands:u})}const l=a();for(const[c,u]of Object.entries(l))a[c]=u;this.store.setStoreKey("commands",o),this.store.setStoreKey("chain",a),this.store.setExtensionStore("commands",o),this.store.setExtensionStore("chain",a)}onStateUpdate({state:e}){this._transaction=e.tr}createPlugin(){return{}}customDispatch(e){return e}insertText(e,t={}){return xe(e)?NB(e,t):this.store.createPlaceholderCommand({promise:e,placeholder:{type:"inline"},onSuccess:(n,r,o)=>this.insertText(n,{...t,...r})(o)}).generateCommand()}selectText(e,t={}){return({tr:n,dispatch:r})=>{const o=Dr(e,n.doc);return n.selection.anchor===o.anchor&&n.selection.head===o.head&&!t.forceUpdate?!1:(r==null||r(n.setSelection(o)),!0)}}selectMark(e){return t=>{const{tr:n}=t,r=_i(n.selection.$from,e);return r?this.store.commands.selectText.original({from:r.from,to:r.to})(t):!1}}delete(e){return({tr:t,dispatch:n})=>{const{from:r,to:o}=e??t.selection;return n==null||n(t.delete(r,o)),!0}}emptyUpdate(e){return({tr:t,dispatch:n})=>(n&&(e==null||e(),n(t)),!0)}forceUpdate(...e){return({tr:t,dispatch:n})=>(n==null||n(this.forceUpdateTransaction(t,...e)),!0)}updateNodeAttributes(e,t){return({tr:n,dispatch:r})=>(r==null||r(n.setNodeMarkup(e,void 0,t)),!0)}setContent(e,t){return n=>{const{tr:r,dispatch:o}=n,i=this.store.manager.createState({content:e,selection:t});return i?(o==null||o(r.replaceRangeWith(0,r.doc.nodeSize-2,i.doc)),!0):!1}}resetContent(){return e=>{const{tr:t,dispatch:n}=e,r=this.store.manager.createEmptyDoc();return r?this.setContent(r)(e):(n==null||n(t.delete(0,t.doc.nodeSize)),!0)}}emptySelection(){return({tr:e,dispatch:t})=>e.selection.empty?!1:(t==null||t(e.setSelection(Se.near(e.selection.$anchor))),!0)}insertNewLine(){return({dispatch:e,tr:t})=>tl(t.selection)?(e==null||e(t.insertText(`
365
- `)),!0):!1}insertNode(e,t={}){return({dispatch:n,tr:r,state:o})=>{var i;const{attrs:s,range:a,selection:l,replaceEmptyParentBlock:c=!1}=t,{from:u,to:d,$from:f}=Dr(l??a??r.selection,r.doc);if(Tg(e)||aF(e)){const y=f.before(f.depth);return n==null||n(c&&u===d&&E1(f.parent)?r.replaceWith(y,y+f.parent.nodeSize,e):r.replaceWith(u,d,e)),!0}const h=xe(e)?o.schema.nodes[e]:e;he(h,{code:K.SCHEMA,message:`The requested node type ${e} does not exist in the schema.`});const m=(i=t.marks)==null?void 0:i.map(y=>{if(y instanceof Be)return y;const v=xe(y)?o.schema.marks[y]:y;return he(v,{code:K.SCHEMA,message:`The requested mark type ${y} does not exist in the schema.`}),v.create()}),g=h.createAndFill(s,xe(t.content)?o.schema.text(t.content):t.content,m);if(!g)return!1;const b=u!==d;return n==null||n(b?r.replaceRangeWith(u,d,g):r.insert(u,g)),!0}}focus(e){return t=>{const{dispatch:n,tr:r}=t,{view:o}=this.store;if(e===!1||o.hasFocus()&&(e===void 0||e===!0))return!1;if(e===void 0||e===!0){const{from:i=0,to:s=i}=r.selection;e={from:i,to:s}}return n&&this.delayedFocus(),this.selectText(e)(t)}}blur(e){return t=>{const{view:n}=this.store;return n.hasFocus()?(requestAnimationFrame(()=>{n.dom.blur()}),e?this.selectText(e)(t):!0):!1}}setBlockNodeType(e,t,n,r=!0){return wm(e,t,n,r)}toggleWrappingNode(e,t,n){return PF(e,t,n)}toggleBlockNodeItem(e){return hP(e)}wrapInNode(e,t,n){return pP(e,t,n)}applyMark(e,t,n){return PB(e,t,n)}toggleMark(e){return rf(e)}removeMark(e){return gP(e)}setMeta(e,t){return({tr:n})=>(n.setMeta(e,t),!0)}selectAll(){return this.selectText("all")}copy(){return e=>e.tr.selection.empty?!1:(e.dispatch&&document.execCommand("copy"),!0)}paste(){return this.store.createPlaceholderCommand({promise:async()=>{var e;return(e=navigator.clipboard)!=null&&e.readText?await navigator.clipboard.readText():""},placeholder:{type:"inline"},onSuccess:(e,t,n)=>this.insertNode(dx({content:e,schema:n.state.schema}),{selection:t})(n)}).generateCommand()}cut(){return e=>e.tr.selection.empty?!1:(e.dispatch&&document.execCommand("cut"),!0)}replaceText(e){return DF(e)}getAllCommandOptions(){const e={};for(const[t,n]of this.decorated)om(n)||(e[t]=n);return e}getCommandOptions(e){return this.decorated.get(e)}getCommandProp(){return{tr:this.transaction,dispatch:this.store.view.dispatch,state:this.store.view.state,view:this.store.view}}updateDecorated(e,t){if(!t){this.decorated.delete(e);return}const n=this.decorated.get(e)??{name:""};this.decorated.set(e,{...n,...t})}handleIosFocus(){eo.isIos&&this.store.view.dom.focus()}delayedFocus(){this.handleIosFocus(),requestAnimationFrame(()=>{this.store.view.focus(),this.store.view.dispatch(this.transaction.scrollIntoView())})}getForcedUpdates(e){return this.getCommandMeta(e).forcedUpdates}getCommandMeta(e){const t=e.getMeta(this.pluginKey)??{};return{...$B,...t}}setCommandMeta(e,t){const n=this.getCommandMeta(e);e.setMeta(this.pluginKey,{...n,...t})}addCommands(e){const{extensionCommands:t,commands:n,names:r,active:o}=e;for(const[i,s]of jt(t))OP({name:i,set:r,code:K.DUPLICATE_COMMAND_NAMES}),he(!DB.has(i),{code:K.DUPLICATE_COMMAND_NAMES,message:"The command name you chose is forbidden."}),n[i]=this.createUnchainedCommand(s,o[i])}unchainedFactory(e){return(...t)=>{const{shouldDispatch:n=!0,command:r}=e,{view:o}=this.store,{state:i}=o;let s;return n&&(s=o.dispatch),r(...t)({state:i,dispatch:s,view:o,tr:i.tr})}}createUnchainedCommand(e,t){const n=this.unchainedFactory({command:e});return n.enabled=this.unchainedFactory({command:e,shouldDispatch:!1}),n.isEnabled=n.enabled,n.original=e,n.active=t,n}chainedFactory(e){return(...t)=>{const{chain:n,command:r,getTr:o,getChain:i}=e,s=i(),{view:a}=this.store,{state:l}=a;return s.push(c=>r(...t)({state:l,dispatch:c,view:a,tr:o()})),n}}};oe([ie()],De.prototype,"customDispatch",1);oe([ie()],De.prototype,"insertText",1);oe([ie()],De.prototype,"selectText",1);oe([ie()],De.prototype,"selectMark",1);oe([ie()],De.prototype,"delete",1);oe([ie()],De.prototype,"emptyUpdate",1);oe([ie()],De.prototype,"forceUpdate",1);oe([ie()],De.prototype,"updateNodeAttributes",1);oe([ie()],De.prototype,"setContent",1);oe([ie()],De.prototype,"resetContent",1);oe([ie()],De.prototype,"emptySelection",1);oe([ie()],De.prototype,"insertNewLine",1);oe([ie()],De.prototype,"insertNode",1);oe([ie()],De.prototype,"focus",1);oe([ie()],De.prototype,"blur",1);oe([ie()],De.prototype,"setBlockNodeType",1);oe([ie()],De.prototype,"toggleWrappingNode",1);oe([ie()],De.prototype,"toggleBlockNodeItem",1);oe([ie()],De.prototype,"wrapInNode",1);oe([ie()],De.prototype,"applyMark",1);oe([ie()],De.prototype,"toggleMark",1);oe([ie()],De.prototype,"removeMark",1);oe([ie()],De.prototype,"setMeta",1);oe([ie({description:({t:e})=>e(Fs.SELECT_ALL_DESCRIPTION),label:({t:e})=>e(Fs.SELECT_ALL_LABEL),shortcut:q.SelectAll})],De.prototype,"selectAll",1);oe([ie({description:({t:e})=>e(Fs.COPY_DESCRIPTION),label:({t:e})=>e(Fs.COPY_LABEL),shortcut:q.Copy,icon:"fileCopyLine"})],De.prototype,"copy",1);oe([ie({description:({t:e})=>e(Fs.PASTE_DESCRIPTION),label:({t:e})=>e(Fs.PASTE_LABEL),shortcut:q.Paste,icon:"clipboardLine"})],De.prototype,"paste",1);oe([ie({description:({t:e})=>e(Fs.CUT_DESCRIPTION),label:({t:e})=>e(Fs.CUT_LABEL),shortcut:q.Cut,icon:"scissorsFill"})],De.prototype,"cut",1);oe([ie()],De.prototype,"replaceText",1);oe([St()],De.prototype,"getAllCommandOptions",1);oe([St()],De.prototype,"getCommandOptions",1);oe([St()],De.prototype,"getCommandProp",1);De=oe([He({defaultPriority:Je.Highest,defaultOptions:{trackerClassName:"remirror-tracker-position",trackerNodeName:"span"},staticKeys:["trackerClassName","trackerNodeName"]})],De);var $B={forcedUpdates:[]},DB=new Set(["run","chain","original","raw","enabled","tr","new"]),yo=class extends ft{constructor(){super(...arguments),this.placeholders=qe.empty,this.placeholderWidgets=new Map,this.createPlaceholderCommand=e=>{const t=sm(),{promise:n,placeholder:r,onFailure:o,onSuccess:i}=e;return new MB(n).validate(s=>this.addPlaceholder(t,r)(s)).success(s=>{const{state:a,tr:l,dispatch:c,view:u,value:d}=s,f=this.store.helpers.findPlaceholder(t);if(!f){const h=new Error("The placeholder has been removed");return(o==null?void 0:o({error:h,state:a,tr:l,dispatch:c,view:u}))??!1}return this.removePlaceholder(t)({state:a,tr:l,view:u,dispatch:()=>{}}),i(d,f,{state:a,tr:l,dispatch:c,view:u})}).failure(s=>(this.removePlaceholder(t)({...s,dispatch:()=>{}}),(o==null?void 0:o(s))??!1))}}get name(){return"decorations"}onCreate(){this.store.setExtensionStore("createPlaceholderCommand",this.createPlaceholderCommand)}createPlugin(){return{state:{init:()=>{},apply:e=>{var t,n,r,o,i,s;const{added:a,clearTrackers:l,removed:c,updated:u}=this.getMeta(e);if(l){this.placeholders=qe.empty;for(const[,d]of this.placeholderWidgets)(n=(t=d.spec).onDestroy)==null||n.call(t,this.store.view,d.spec.element);this.placeholderWidgets.clear();return}this.placeholders=this.placeholders.map(e.mapping,e.doc,{onRemove:d=>{var f,h;const m=this.placeholderWidgets.get(d.id);m&&((h=(f=m.spec).onDestroy)==null||h.call(f,this.store.view,m.spec.element))}});for(const[,d]of this.placeholderWidgets)(o=(r=d.spec).onUpdate)==null||o.call(r,this.store.view,d.from,d.spec.element,d.spec.data);for(const d of a){if(d.type==="inline"){this.addInlinePlaceholder(d,e);continue}if(d.type==="node"){this.addNodePlaceholder(d,e);continue}if(d.type==="widget"){this.addWidgetPlaceholder(d,e);continue}}for(const{id:d,data:f}of u){const h=this.placeholderWidgets.get(d);if(!h)continue;const m=dt.widget(h.from,h.spec.element,{...h.spec,data:f});this.placeholders=this.placeholders.remove([h]).add(e.doc,[m]),this.placeholderWidgets.set(d,m)}for(const d of c){const f=this.placeholders.find(void 0,void 0,m=>m.id===d&&m.__type===ml),h=this.placeholderWidgets.get(d);h&&((s=(i=h.spec).onDestroy)==null||s.call(i,this.store.view,h.spec.element)),this.placeholders=this.placeholders.remove(f),this.placeholderWidgets.delete(d)}}},props:{decorations:e=>{let t=this.options.decorations(e);t=t.add(e.doc,this.placeholders.find());for(const n of this.store.extensions){if(!n.createDecorations)continue;const r=n.createDecorations(e).find();t=t.add(e.doc,r)}return t},handleDOMEvents:{blur:e=>(this.options.persistentSelectionClass&&e.dispatch(e.state.tr.setMeta(eC,!1)),!1),focus:e=>(this.options.persistentSelectionClass&&e.dispatch(e.state.tr.setMeta(eC,!0)),!1)}}}}updateDecorations(){return({tr:e,dispatch:t})=>(t==null||t(e),!0)}addPlaceholder(e,t,n){return({dispatch:r,tr:o})=>this.addPlaceholderTransaction(e,t,o,!r)?(r==null||r(n?o.deleteSelection():o),!0):!1}updatePlaceholder(e,t){return({dispatch:n,tr:r})=>this.updatePlaceholderTransaction({id:e,data:t,tr:r,checkOnly:!n})?(n==null||n(r),!0):!1}removePlaceholder(e){return({dispatch:t,tr:n})=>this.removePlaceholderTransaction({id:e,tr:n,checkOnly:!t})?(t==null||t(n),!0):!1}clearPlaceholders(){return({tr:e,dispatch:t})=>this.clearPlaceholdersTransaction({tr:e,checkOnly:!t})?(t==null||t(e),!0):!1}findPlaceholder(e){return this.findAllPlaceholders().get(e)}findAllPlaceholders(){const e=new Map,t=this.placeholders.find(void 0,void 0,n=>n.__type===ml);for(const n of t)e.set(n.spec.id,{from:n.from,to:n.to});return e}createDecorations(e){var t,n,r;const{persistentSelectionClass:o}=this.options;return!o||(t=this.store.view)!=null&&t.hasFocus()||(r=(n=this.store.helpers).isInteracting)!=null&&r.call(n)?qe.empty:IB(e,qe.empty,{class:xe(o)?o:"selection"})}onApplyState(){}addWidgetPlaceholder(e,t){const{pos:n,createElement:r,onDestroy:o,onUpdate:i,className:s,nodeName:a,id:l,type:c}=e,u=(r==null?void 0:r(this.store.view,n))??document.createElement(a);u.classList.add(s);const d=dt.widget(n,u,{id:l,__type:ml,type:c,element:u,onDestroy:o,onUpdate:i});this.placeholderWidgets.set(l,d),this.placeholders=this.placeholders.add(t.doc,[d])}addInlinePlaceholder(e,t){const{from:n=t.selection.from,to:r=t.selection.to,className:o,nodeName:i,id:s,type:a}=e;let l;if(n===r){const c=document.createElement(i);c.classList.add(o),l=dt.widget(n,c,{id:s,type:a,__type:ml,widget:c})}else l=dt.inline(n,r,{nodeName:i,class:o},{id:s,__type:ml});this.placeholders=this.placeholders.add(t.doc,[l])}addNodePlaceholder(e,t){const{pos:n,className:r,nodeName:o,id:i}=e,s=dr(n)?t.doc.resolve(n):t.selection.$from,a=dr(n)?s.nodeAfter?{pos:n,end:s.nodeAfter.nodeSize}:void 0:Zz(s);if(!a)return;const l=dt.node(a.pos,a.end,{nodeName:o,class:r},{id:i,__type:ml});this.placeholders=this.placeholders.add(t.doc,[l])}withRequiredBase(e,t){const{placeholderNodeName:n,placeholderClassName:r}=this.options,{nodeName:o=n,className:i,...s}=t,a=(i?[r,i]:[r]).join(" ");return{nodeName:o,className:a,...s,id:e}}getMeta(e){const t=e.getMeta(this.pluginKey)??{};return{...AB,...t}}setMeta(e,t){const n=this.getMeta(e);e.setMeta(this.pluginKey,{...n,...t})}addPlaceholderTransaction(e,t,n,r=!1){if(this.findPlaceholder(e))return!1;if(r)return!0;const{added:i}=this.getMeta(n);return this.setMeta(n,{added:[...i,this.withRequiredBase(e,t)]}),!0}updatePlaceholderTransaction(e){const{id:t,tr:n,checkOnly:r=!1,data:o}=e;if(!this.findPlaceholder(t))return!1;if(r)return!0;const{updated:s}=this.getMeta(n);return this.setMeta(n,{updated:Yd([...s,{id:t,data:o}])}),!0}removePlaceholderTransaction(e){const{id:t,tr:n,checkOnly:r=!1}=e;if(!this.findPlaceholder(t))return!1;if(r)return!0;const{removed:i}=this.getMeta(n);return this.setMeta(n,{removed:Yd([...i,t])}),!0}clearPlaceholdersTransaction(e){const{tr:t,checkOnly:n=!1}=e;return this.getPluginState()===qe.empty?!1:(n||this.setMeta(t,{clearTrackers:!0}),!0)}};oe([ie()],yo.prototype,"updateDecorations",1);oe([ie()],yo.prototype,"addPlaceholder",1);oe([ie()],yo.prototype,"updatePlaceholder",1);oe([ie()],yo.prototype,"removePlaceholder",1);oe([ie()],yo.prototype,"clearPlaceholders",1);oe([St()],yo.prototype,"findPlaceholder",1);oe([St()],yo.prototype,"findAllPlaceholders",1);yo=oe([He({defaultOptions:{persistentSelectionClass:void 0,placeholderClassName:"placeholder",placeholderNodeName:"span"},staticKeys:["placeholderClassName","placeholderNodeName"],handlerKeys:["decorations"],handlerKeyOptions:{decorations:{reducer:{accumulator:(e,t,n)=>e.add(n.doc,t.find()),getDefault:()=>qe.empty}}},defaultPriority:Je.Low})],yo);var AB={added:[],updated:[],clearTrackers:!1,removed:[]},ml="placeholderDecoration",eC="persistentSelectionFocus";function IB(e,t,n){const{selection:r,doc:o}=e;if(r.empty)return t;const{from:i,to:s}=r,a=Mg(r)?dt.node(i,s,n):dt.inline(i,s,n);return t.add(o,[a])}var Em=class extends ft{get name(){return"docChanged"}onStateUpdate(e){const{firstUpdate:t,transactions:n,tr:r}=e;t||(n??[r]).some(o=>o==null?void 0:o.docChanged)&&this.options.docChanged(e)}};Em=oe([He({handlerKeys:["docChanged"],handlerKeyOptions:{docChanged:{earlyReturnValue:!1}},defaultPriority:Je.Lowest})],Em);var Ar=class extends ft{get name(){return"helpers"}onCreate(){var e;this.store.setStringHandler("text",this.textToProsemirrorNode.bind(this)),this.store.setStringHandler("html",dx);const t=ce(),n=ce(),r=ce(),o=new Set;for(const i of this.store.extensions){Uf(i)&&(n[i.name]=a=>eF({state:this.store.getState(),type:i.type,attrs:a}),r[i.name]=a=>{var l;return(l=nf({state:this.store.getState(),type:i.type,attrs:a}))==null?void 0:l.node.attrs}),Dg(i)&&(n[i.name]=a=>bm({trState:this.store.getState(),type:i.type,attrs:a}),r[i.name]=a=>{const l=_i(this.store.getState().selection.$from,i.type);if(!l||!a)return l==null?void 0:l.mark.attrs;if(w1(l.mark,a))return l.mark.attrs});const s=((e=i.createHelpers)==null?void 0:e.call(i))??{};for(const a of Object.keys(i.decoratedHelpers??{}))s[a]=i[a].bind(i);if(!om(s))for(const[a,l]of jt(s))OP({name:a,set:o,code:K.DUPLICATE_HELPER_NAMES}),t[a]=l}this.store.setStoreKey("attrs",r),this.store.setStoreKey("active",n),this.store.setStoreKey("helpers",t),this.store.setExtensionStore("attrs",r),this.store.setExtensionStore("active",n),this.store.setExtensionStore("helpers",t)}isSelectionEmpty(e=this.store.getState()){return b1(e)}isViewEditable(e=this.store.getState()){var t,n;return((n=(t=this.store.view.props).editable)==null?void 0:n.call(t,e))??!1}getStateJSON(e=this.store.getState()){return e.toJSON()}getJSON(e=this.store.getState()){return e.doc.toJSON()}getRemirrorJSON(e=this.store.getState()){return this.getJSON(e)}insertHtml(e,t){return n=>{const{state:r}=n,o=dx({content:e,schema:r.schema,fragment:!0});return this.store.commands.insertNode.original(o,t)(n)}}getText({lineBreakDivider:e=`
366
-
367
- `,state:t=this.store.getState()}={}){return t.doc.textBetween(0,t.doc.content.size,e,ms)}getTextBetween(e,t,n=this.store.getState().doc){return n.textBetween(e,t,`
368
-
369
- `,ms)}getHTML(e=this.store.getState()){return CF(e.doc,this.store.document)}textToProsemirrorNode(e){const t=`<pre>${e.content}</pre>`;return this.store.stringHandlers.html({...e,content:t})}};oe([St()],Ar.prototype,"isSelectionEmpty",1);oe([St()],Ar.prototype,"isViewEditable",1);oe([St()],Ar.prototype,"getStateJSON",1);oe([St()],Ar.prototype,"getJSON",1);oe([St()],Ar.prototype,"getRemirrorJSON",1);oe([ie()],Ar.prototype,"insertHtml",1);oe([St()],Ar.prototype,"getText",1);oe([St()],Ar.prototype,"getTextBetween",1);oe([St()],Ar.prototype,"getHTML",1);Ar=oe([He({})],Ar);var hx=class extends ft{get name(){return"inputRules"}onCreate(){this.store.setExtensionStore("rebuildInputRules",this.rebuildInputRules.bind(this))}createExternalPlugins(){return[this.generateInputRulesPlugin()]}generateInputRulesPlugin(){var e,t;const n=[],r=this.store.markTags[Me.ExcludeInputRules];for(const o of this.store.extensions)if(!((e=this.store.managerSettings.exclude)!=null&&e.inputRules||!o.createInputRules||(t=o.options.exclude)!=null&&t.inputRules))for(const i of o.createInputRules())i.shouldSkip=this.options.shouldSkipInputRule,i.invalidMarks=r,n.push(i);return H8({rules:n})}rebuildInputRules(){this.store.updateExtensionPlugins(this)}};hx=oe([He({defaultPriority:Je.Default,handlerKeys:["shouldSkipInputRule"],handlerKeyOptions:{shouldSkipInputRule:{earlyReturnValue:!0}}})],hx);var to=class extends ft{constructor(){super(...arguments),this.extraKeyBindings=[],this.backwardMarkExitTracker=new Map,this.keydownHandler=null,this.onAddCustomHandler=({keymap:e})=>{var t,n;if(e)return this.extraKeyBindings=[...this.extraKeyBindings,e],(n=(t=this.store).rebuildKeymap)==null||n.call(t),()=>{var r,o;this.extraKeyBindings=this.extraKeyBindings.filter(i=>i!==e),(o=(r=this.store).rebuildKeymap)==null||o.call(r)}},this.rebuildKeymap=()=>{this.setupKeydownHandler()}}get name(){return"keymap"}get shortcutMap(){const{shortcuts:e}=this.options;return xe(e)?FB[e]:e}onCreate(){this.store.setExtensionStore("rebuildKeymap",this.rebuildKeymap)}createExternalPlugins(){var e;return(e=this.store.managerSettings.exclude)!=null&&e.keymap?[]:(this.setupKeydownHandler(),[new $i({props:{handleKeyDown:(t,n)=>{var r;return(r=this.keydownHandler)==null?void 0:r.call(this,t,n)}}})])}setupKeydownHandler(){const e=this.generateKeymapBindings();this.keydownHandler=CP(e)}generateKeymapBindings(){var e;const t=[],n=this.shortcutMap,r=this.store.getExtension(De),o=a=>l=>rh({shortcut:l,map:n,store:this.store,options:a.options});for(const a of this.store.extensions){const l=a.decoratedKeybindings??{};if(!((e=a.options.exclude)!=null&&e.keymap)){a.createKeymap&&t.push(jB(a.createKeymap(o(a)),n));for(const[c,u]of jt(l)){if(u.isActive&&!u.isActive(a.options,this.store))continue;const d=a[c].bind(a),f=rh({shortcut:u.shortcut,map:n,options:a.options,store:this.store}),h=nt(u.priority)?u.priority(a.options,this.store):u.priority??Je.Low,m=ce();for(const g of f)m[g]=d;t.push([h,m]),u.command&&r.updateDecorated(u.command,{shortcut:f})}}}const i=this.sortKeymaps([...this.extraKeyBindings,...t]);return nF(i)}arrowRightShortcut(e){const t=this.store.markTags[Me.PreventExits],n=this.store.nodeTags[Me.PreventExits];return this.exitMarkForwards(t,n)(e)}arrowLeftShortcut(e){const t=this.store.markTags[Me.PreventExits],n=this.store.nodeTags[Me.PreventExits];return xm(this.exitNodeBackwards(n),this.exitMarkBackwards(t,n))(e)}backspace(e){const t=this.store.markTags[Me.PreventExits],n=this.store.nodeTags[Me.PreventExits];return xm(this.exitNodeBackwards(n,!0),this.exitMarkBackwards(t,n,!0))(e)}createKeymap(){const{selectParentNodeOnEscape:e,undoInputRuleOnBackspace:t,excludeBaseKeymap:n}=this.options,r=ce();if(!n)for(const[o,i]of jt(oy))r[o]=fd(i);return t&&oy.Backspace&&(r.Backspace=fd(Ng(W8,oy.Backspace))),e&&(r.Escape=fd(GF)),[Je.Low,r]}getNamedShortcut(e,t={}){return e.startsWith("_|")?rh({shortcut:e,map:this.shortcutMap,store:this.store,options:t}):[e]}onSetOptions(e){var t,n;const{changes:r}=e;(r.excludeBaseKeymap.changed||r.selectParentNodeOnEscape.changed||r.undoInputRuleOnBackspace.changed)&&((n=(t=this.store).rebuildKeymap)==null||n.call(t))}sortKeymaps(e){return Fa(e.map(t=>zt(t)?t:[Je.Default,t]),(t,n)=>n[0]-t[0]).map(t=>t[1])}exitMarkForwards(e,t){return n=>{const{tr:r,dispatch:o}=n;if(!TF(r.selection)||tf({selection:r.selection,types:t}))return!1;const a=r.selection.$from.marks().filter(l=>!e.includes(l.type.name));if(zs(a))return!1;if(!o)return!0;for(const l of a)r.removeStoredMark(l);return o(r.insertText(" ",r.selection.from)),!0}}exitNodeBackwards(e,t=!1){return n=>{const{tr:r}=n;if(!(t?XE:fx)(r.selection))return!1;const i=r.selection.$anchor.node();return!E1(i)||fF(i)||e.includes(i.type.name)?!1:this.store.commands.toggleBlockNodeItem.original({type:i.type})(n)}}exitMarkBackwards(e,t,n=!1){return r=>{const{tr:o,dispatch:i}=r;if(!(n?XE:fx)(o.selection)||this.backwardMarkExitTracker.has(o.selection.anchor))return this.backwardMarkExitTracker.clear(),!1;if(tf({selection:o.selection,types:t}))return!1;const l=[...o.storedMarks??[],...o.selection.$from.marks()].filter(c=>!e.includes(c.type.name));if(zs(l))return!1;if(!i)return!0;for(const c of l)o.removeStoredMark(c);return this.backwardMarkExitTracker.set(o.selection.anchor,!0),i(o),!0}}};oe([yr({shortcut:"ArrowRight",isActive:e=>e.exitMarksOnArrowPress})],to.prototype,"arrowRightShortcut",1);oe([yr({shortcut:"ArrowLeft",isActive:e=>e.exitMarksOnArrowPress})],to.prototype,"arrowLeftShortcut",1);oe([yr({shortcut:"Backspace",isActive:e=>e.exitMarksOnArrowPress})],to.prototype,"backspace",1);oe([St()],to.prototype,"getNamedShortcut",1);to=oe([He({defaultPriority:Je.Low,defaultOptions:{shortcuts:"default",undoInputRuleOnBackspace:!0,selectParentNodeOnEscape:!1,excludeBaseKeymap:!1,exitMarksOnArrowPress:!0},customHandlerKeys:["keymap"]})],to);function LB(e){return go(bg(q),e)}function rh({shortcut:e,map:t,options:n,store:r}){return xe(e)?[mx(e,t)]:zt(e)?e.map(o=>mx(o,t)):(e=e(n,r),rh({shortcut:e,map:t,options:n,store:r}))}function mx(e,t){return LB(e)?t[e]:e}function jB(e,t){const n={};let r,o;zt(e)?[o,r]=e:r=e;for(const[i,s]of jt(r))n[mx(i,t)]=s;return wg(o)?n:[o,n]}var RP={[q.Copy]:"Mod-c",[q.Cut]:"Mod-x",[q.Paste]:"Mod-v",[q.PastePlain]:"Mod-Shift-v",[q.SelectAll]:"Mod-a",[q.Undo]:"Mod-z",[q.Redo]:eo.isMac?"Shift-Mod-z":"Mod-y",[q.Bold]:"Mod-b",[q.Italic]:"Mod-i",[q.Underline]:"Mod-u",[q.Strike]:"Mod-d",[q.Code]:"Mod-`",[q.Paragraph]:"Mod-Shift-0",[q.H1]:"Mod-Shift-1",[q.H2]:"Mod-Shift-2",[q.H3]:"Mod-Shift-3",[q.H4]:"Mod-Shift-4",[q.H5]:"Mod-Shift-5",[q.H6]:"Mod-Shift-6",[q.TaskList]:"Mod-Shift-7",[q.BulletList]:"Mod-Shift-8",[q.OrderedList]:"Mod-Shift-9",[q.Quote]:"Mod->",[q.Divider]:"Mod-Shift-|",[q.Codeblock]:"Mod-Shift-~",[q.ClearFormatting]:"Mod-Shift-C",[q.Superscript]:"Mod-.",[q.Subscript]:"Mod-,",[q.LeftAlignment]:"Mod-Shift-L",[q.CenterAlignment]:"Mod-Shift-E",[q.RightAlignment]:"Mod-Shift-R",[q.JustifyAlignment]:"Mod-Shift-J",[q.InsertLink]:"Mod-k",[q.Find]:"Mod-f",[q.FindBackwards]:"Mod-Shift-f",[q.FindReplace]:"Mod-Shift-H",[q.AddFootnote]:"Mod-Alt-f",[q.AddComment]:"Mod-Alt-m",[q.ContextMenu]:"Mod-Shift-\\",[q.IncreaseFontSize]:"Mod-Shift-.",[q.DecreaseFontSize]:"Mod-Shift-,",[q.IncreaseIndent]:"Tab",[q.DecreaseIndent]:"Shift-Tab",[q.Shortcuts]:"Mod-/",[q.Format]:eo.isMac?"Alt-Shift-f":"Shift-Ctrl-f"},zB={...RP,[q.Strike]:"Mod-Shift-S",[q.Code]:"Mod-Shift-M",[q.Paragraph]:"Mod-Alt-0",[q.H1]:"Mod-Alt-1",[q.H2]:"Mod-Alt-2",[q.H3]:"Mod-Alt-3",[q.H4]:"Mod-Alt-4",[q.H5]:"Mod-Alt-5",[q.H6]:"Mod-Alt-6",[q.OrderedList]:"Mod-Alt-7",[q.BulletList]:"Mod-Alt-8",[q.Quote]:"Mod-Alt-9",[q.ClearFormatting]:"Mod-\\",[q.IncreaseIndent]:"Mod-[",[q.DecreaseIndent]:"Mod-]"},FB={default:RP,googleDoc:zB},BB=class extends ft{get name(){return"nodeViews"}createPlugin(){const e=[],t=ce();for(const n of this.store.extensions){if(!n.createNodeViews)continue;const r=n.createNodeViews();e.unshift(nt(r)?{[n.name]:r}:r)}e.unshift(this.store.managerSettings.nodeViews??{});for(const n of e)Object.assign(t,n);return{props:{nodeViews:t}}}},VB=class extends ft{get name(){return"pasteRules"}createExternalPlugins(){return[this.generatePasteRulesPlugin()]}generatePasteRulesPlugin(){var e,t;const n=[];for(const r of this.store.extensions){if((e=this.store.managerSettings.exclude)!=null&&e.pasteRules||!r.createPasteRules||(t=r.options.exclude)!=null&&t.pasteRules)continue;const o=r.createPasteRules(),i=zt(o)?o:[o];n.push(...i)}return lB(n)}},gx=class extends ft{constructor(){super(...arguments),this.plugins=[],this.managerPlugins=[],this.applyStateHandlers=[],this.initStateHandlers=[],this.appendTransactionHandlers=[],this.pluginKeys=ce(),this.stateGetters=new Map,this.getPluginStateCreator=e=>t=>e.getState(t??this.store.getState()),this.getStateByName=e=>{const t=this.stateGetters.get(e);return he(t,{message:"No plugin exists for the requested extension name."}),t()}}get name(){return"plugins"}onCreate(){const{setStoreKey:e,setExtensionStore:t,managerSettings:n,extensions:r}=this.store;this.updateExtensionStore();const{plugins:o=[]}=n;this.updatePlugins(o,this.managerPlugins);for(const i of r)i.onApplyState&&this.applyStateHandlers.push(i.onApplyState.bind(i)),i.onInitState&&this.initStateHandlers.push(i.onInitState.bind(i)),i.onAppendTransaction&&this.appendTransactionHandlers.push(i.onAppendTransaction.bind(i)),this.extractExtensionPlugins(i);this.managerPlugins=o,this.store.setStoreKey("plugins",this.plugins),e("pluginKeys",this.pluginKeys),e("getPluginState",this.getStateByName),t("getPluginState",this.getStateByName)}createPlugin(){return{appendTransaction:(e,t,n)=>{const r=n.tr,o={previousState:t,tr:r,transactions:e,state:n};for(const i of this.appendTransactionHandlers)i(o);return this.options.appendTransaction(o),r.docChanged||r.steps.length>0||r.selectionSet||r.storedMarksSet?r:void 0},state:{init:(e,t)=>{for(const n of this.initStateHandlers)n(t)},apply:(e,t,n,r)=>{const o={previousState:n,state:r,tr:e};for(const i of this.applyStateHandlers)i(o);this.options.applyState(o)}}}}extractExtensionPlugins(e){var t,n;if(!(!e.createPlugin&&!e.createExternalPlugins||(t=this.store.managerSettings.exclude)!=null&&t.plugins||(n=e.options.exclude)!=null&&n.plugins)){if(e.createPlugin){const o=new Ic(e.name);this.pluginKeys[e.name]=o;const i=this.getPluginStateCreator(o);e.pluginKey=o,e.getPluginState=i,this.stateGetters.set(e.name,i),this.stateGetters.set(e.constructor,i);const s={...e.createPlugin(),key:o},a=new $i(s);this.updatePlugins([a],e.plugin?[e.plugin]:void 0),e.plugin=a}if(e.createExternalPlugins){const o=e.createExternalPlugins();this.updatePlugins(o,e.externalPlugins),e.externalPlugins=o}}}updatePlugins(e,t){if(!t||zs(t)){this.plugins=[...this.plugins,...e];return}if(e.length!==t.length){this.plugins=[...this.plugins.filter(r=>!t.includes(r)),...e];return}const n=new Map;for(const[r,o]of e.entries())n.set(vt(t,r),o);this.plugins=this.plugins.map(r=>t.includes(r)?n.get(r):r)}updateExtensionStore(){const{setExtensionStore:e}=this.store;e("updatePlugins",this.updatePlugins.bind(this)),e("dispatchPluginUpdate",this.dispatchPluginUpdate.bind(this)),e("updateExtensionPlugins",this.updateExtensionPlugins.bind(this))}updateExtensionPlugins(e){const t=TP(e)?e:OB(e)?this.store.manager.getExtension(e):this.store.extensions.find(n=>n.name===e);he(t,{code:K.INVALID_MANAGER_EXTENSION,message:`The extension ${e} does not exist within the editor.`}),this.extractExtensionPlugins(t),this.store.setStoreKey("plugins",this.plugins),this.dispatchPluginUpdate()}dispatchPluginUpdate(){he(this.store.phase>=In.EditorView,{code:K.MANAGER_PHASE_ERROR,message:"`dispatchPluginUpdate` should only be called after the view has been added to the manager."});const{view:e,updateState:t}=this.store,n=e.state.reconfigure({plugins:this.plugins});t(n)}};gx=oe([He({defaultPriority:Je.Highest,handlerKeys:["applyState","appendTransaction"]})],gx);var vx=class extends ft{constructor(){super(...arguments),this.dynamicAttributes={marks:ce(),nodes:ce()}}get name(){return"schema"}onCreate(){const{managerSettings:e,tags:t,markNames:n,nodeNames:r,extensions:o}=this.store,{defaultBlockNode:i,disableExtraAttributes:s,nodeOverride:a,markOverride:l}=e,c=m=>!!(m&&t[Me.Block].includes(m));if(e.schema){const{nodes:m,marks:g}=XB(e.schema);this.addSchema(e.schema,m,g);return}const u=c(i)?{doc:ce(),[i]:ce()}:ce(),d=ce(),f=UB({settings:e,gatheredSchemaAttributes:this.gatherExtraAttributes(o),nodeNames:r,markNames:n,tags:t});for(const m of o){f[m.name]={...f[m.name],...m.options.extraAttributes};const g=s===!0||m.options.disableExtraAttributes===!0||m.constructor.disableExtraAttributes===!0;if(Uf(m)){const{spec:b,dynamic:y}=tC({createExtensionSpec:(v,w)=>m.createNodeSpec(v,w),extraAttributes:vt(f,m.name),override:{...a,...m.options.nodeOverride},ignoreExtraAttributes:g,name:m.constructorName,tags:m.tags});m.spec=b,u[m.name]=b,Object.keys(y).length>0&&(this.dynamicAttributes.nodes[m.name]=y)}if(Dg(m)){const{spec:b,dynamic:y}=tC({createExtensionSpec:(v,w)=>m.createMarkSpec(v,w),extraAttributes:vt(f,m.name),override:{...l,...m.options.markOverride},ignoreExtraAttributes:g,name:m.constructorName,tags:m.tags??[]});m.spec=b,d[m.name]=b,Object.keys(y).length>0&&(this.dynamicAttributes.marks[m.name]=y)}}const h=new A7({nodes:u,marks:d,topNode:"doc"});this.addSchema(h,u,d)}createPlugin(){return{appendTransaction:(e,t,n)=>{const{tr:r}=n;return!e.some(i=>i.docChanged)||Object.keys(this.dynamicAttributes.nodes).length===0&&Object.keys(this.dynamicAttributes.marks).length===0?null:(r.doc.descendants((i,s)=>(this.checkAndUpdateDynamicNodes(i,s,r),this.checkAndUpdateDynamicMarks(i,s,r),!0)),r.steps.length>0?r:null)}}}addSchema(e,t,n){this.store.setStoreKey("nodes",t),this.store.setStoreKey("marks",n),this.store.setStoreKey("schema",e),this.store.setExtensionStore("schema",e),this.store.setStoreKey("defaultBlockNode",Rg(e).name);for(const r of Object.values(e.nodes))if(r.name!=="doc"&&(r.isBlock||r.isTextblock))break}checkAndUpdateDynamicNodes(e,t,n){for(const[r,o]of jt(this.dynamicAttributes.nodes))if(e.type.name===r)for(const[i,s]of jt(o)){if(!js(e.attrs[i]))continue;const a={...e.attrs,[i]:s(e)};n.setNodeMarkup(t,void 0,a),KE(n)}}checkAndUpdateDynamicMarks(e,t,n){for(const[r,o]of jt(this.dynamicAttributes.marks)){const i=vt(this.store.schema.marks,r),s=e.marks.find(a=>a.type.name===r);if(s)for(const[a,l]of jt(o)){if(!js(s.attrs[a]))continue;const c=_i(n.doc.resolve(t),i);if(!c)continue;const{from:u,to:d}=c,f=i.create({...s.attrs,[a]:l(s)});n.removeMark(u,d,i).addMark(u,d,f),KE(n)}}}gatherExtraAttributes(e){const t=[];for(const n of e)n.createSchemaAttributes&&t.push(...n.createSchemaAttributes());return t}};vx=oe([He({defaultPriority:Je.Highest})],vx);function UB(e){const{settings:t,gatheredSchemaAttributes:n,nodeNames:r,markNames:o,tags:i}=e,s=ce();if(t.disableExtraAttributes)return s;const a=[...n,...t.extraAttributes??[]];for(const l of a??[]){const c=WB({identifiers:l.identifiers,nodeNames:r,markNames:o,tags:i});for(const u of c){const d=s[u]??{};s[u]={...d,...l.attributes}}}return s}function HB(e){return el(e)&&zt(e.tags)}function WB(e){const{identifiers:t,nodeNames:n,markNames:r,tags:o}=e;if(t==="nodes")return n;if(t==="marks")return r;if(t==="all")return[...n,...r];if(zt(t))return t;he(HB(t),{code:K.EXTENSION_EXTRA_ATTRIBUTES,message:"Invalid value passed as an identifier when creating `extraAttributes`."});const{tags:i=[],names:s=[],behavior:a="any",excludeNames:l,excludeTags:c,type:u}=t,d=new Set,f=u==="mark"?r:u==="node"?n:[...r,...n],h=g=>f.includes(g)&&!(l!=null&&l.includes(g));for(const g of s)h(g)&&d.add(g);const m=new Map;for(const g of i)if(!(c!=null&&c.includes(g)))for(const b of o[g]){if(!h(b))continue;if(a==="any"){d.add(b);continue}const y=m.get(b)??new Set;y.add(g),m.set(b,y)}for(const[g,b]of m)b.size===i.length&&d.add(g);return[...d]}function tC(e){var t;const{createExtensionSpec:n,extraAttributes:r,ignoreExtraAttributes:o,name:i,tags:s,override:a}=e,l=ce();function c(b,y){l[b]=y}let u=!1;function d(){u=!0}const f=KB(r,o,d,c),h=qB(r,o),m=GB(r,o),g=n({defaults:f,parse:h,dom:m},a);return he(o||u,{code:K.EXTENSION_SPEC,message:`When creating a node specification you must call the 'defaults', and parse, and 'dom' methods. To avoid this error you can set the static property 'disableExtraAttributes' of '${i}' to 'true'.`}),g.group=[...((t=g.group)==null?void 0:t.split(" "))??[],...s].join(" ")||void 0,{spec:g,dynamic:l}}function _1(e){return xe(e)||nt(e)?{default:e}:(he(e,{message:`${RM(e)} is not supported`,code:K.EXTENSION_EXTRA_ATTRIBUTES}),e)}function KB(e,t,n,r){return()=>{n();const o=ce();if(t)return o;for(const[i,s]of jt(e)){let l=_1(s).default;nt(l)&&(r(i,l),l=null),o[i]=l===void 0?{}:{default:l}}return o}}function qB(e,t){return n=>{const r=ce();if(t)return r;for(const[o,i]of jt(e)){const{parseDOM:s,...a}=_1(i);if(Vo(n)){if(js(s)){r[o]=n.getAttribute(o)??a.default;continue}if(nt(s)){r[o]=s(n)??a.default;continue}r[o]=n.getAttribute(s)??a.default}}return r}}function GB(e,t){return n=>{const r=ce();if(t)return r;function o(i,s){if(i){if(xe(i)){r[s]=i;return}if(zt(i)){const[a,l]=i;r[a]=l??n.attrs[s];return}for(const[a,l]of jt(i))r[a]=l}}for(const[i,s]of jt(e)){const{toDOM:a,parseDOM:l}=_1(s);if(js(a)){const c=xe(l)?l:i;r[c]=n.attrs[i];continue}if(nt(a)){o(a(n.attrs,YB(n)),i);continue}o(a,i)}return r}}function YB(e){return Tg(e)?{node:e}:lF(e)?{mark:e}:{}}function XB(e){const t=ce(),n=ce();for(const[r,o]of Object.entries(e.nodes))t[r]=o.spec;for(const[r,o]of Object.entries(e.marks))n[r]=o.spec;return{nodes:t,marks:n}}var Ec=class extends ft{constructor(){super(...arguments),this.onAddCustomHandler=({suggester:e})=>{var t;if(!(!e||(t=this.store.managerSettings.exclude)!=null&&t.suggesters))return WE(this.store.getState(),e)}}get name(){return"suggest"}onCreate(){this.store.setExtensionStore("addSuggester",e=>WE(this.store.getState(),e)),this.store.setExtensionStore("removeSuggester",e=>qz(this.store.getState(),e))}createExternalPlugins(){var e,t;const n=[];for(const r of this.store.extensions){if((e=this.store.managerSettings.exclude)!=null&&e.suggesters)break;if(!r.createSuggesters||(t=r.options.exclude)!=null&&t.suggesters)continue;const o=r.createSuggesters(),i=zt(o)?o:[o];n.push(...i)}return[Gz(...n)]}getSuggestState(e){return v1(e??this.store.getState())}getSuggestMethods(){const{addIgnored:e,clearIgnored:t,removeIgnored:n,ignoreNextExit:r,setMarkRemoved:o,findMatchAtPosition:i,findNextTextSelection:s,setLastChangeFromAppend:a}=this.getSuggestState();return{addIgnored:e,clearIgnored:t,removeIgnored:n,ignoreNextExit:r,setMarkRemoved:o,findMatchAtPosition:i,findNextTextSelection:s,setLastChangeFromAppend:a}}isSuggesterActive(e){var t;return go(zt(e)?e:[e],(t=this.getSuggestState().match)==null?void 0:t.suggester.name)}};oe([St()],Ec.prototype,"getSuggestState",1);oe([St()],Ec.prototype,"getSuggestMethods",1);oe([St()],Ec.prototype,"isSuggesterActive",1);Ec=oe([He({customHandlerKeys:["suggester"]})],Ec);var yx=class extends ft{constructor(){super(...arguments),this.allTags=ce(),this.plainTags=ce(),this.markTags=ce(),this.nodeTags=ce()}get name(){return"tags"}onCreate(){this.resetTags();for(const e of this.store.extensions)this.updateTagForExtension(e);this.store.setStoreKey("tags",this.allTags),this.store.setExtensionStore("tags",this.allTags),this.store.setStoreKey("plainTags",this.plainTags),this.store.setExtensionStore("plainTags",this.plainTags),this.store.setStoreKey("markTags",this.markTags),this.store.setExtensionStore("markTags",this.markTags),this.store.setStoreKey("nodeTags",this.nodeTags),this.store.setExtensionStore("nodeTags",this.nodeTags)}resetTags(){const e=ce(),t=ce(),n=ce(),r=ce();for(const o of bg(Me))e[o]=[],t[o]=[],n[o]=[],r[o]=[];this.allTags=e,this.plainTags=t,this.markTags=n,this.nodeTags=r}updateTagForExtension(e){var t,n;const r=new Set([...e.tags??[],...((t=e.createTags)==null?void 0:t.call(e))??[],...e.options.extraTags??[],...((n=this.store.managerSettings.extraTags)==null?void 0:n[e.name])??[]]);for(const o of r)he(ZB(o),{code:K.EXTENSION,message:`The tag provided by the extension: ${e.constructorName} is not supported by the editor. To add custom tags you can use the 'mutateTag' method.`}),this.allTags[o].push(e.name),MP(e)&&this.plainTags[o].push(e.name),Dg(e)&&this.markTags[o].push(e.name),Uf(e)&&this.nodeTags[o].push(e.name);e.tags=[...r]}};yx=oe([He({defaultPriority:Je.Highest})],yx);function ZB(e){return go(bg(Me),e)}var JB=new Ic("remirrorFilePlaceholderPlugin");function QB(){const e=new $i({key:JB,state:{init(){return{set:qe.empty,payloads:new Map}},apply(t,{set:n,payloads:r}){n=n.map(t.mapping,t.doc);const o=t.getMeta(e);if(o)if(o.type===0){const i=document.createElement("placeholder"),s=dt.widget(o.pos,i,{id:o.id});n=n.add(t.doc,[s]),r.set(o.id,o.payload)}else o.type===1&&(n=n.remove(n.find(void 0,void 0,i=>i.id===o.id)),r.delete(o.id));return{set:n,payloads:r}}},props:{decorations(t){var n;return((n=e.getState(t))==null?void 0:n.set)??null}}});return e}var eV=class extends ft{get name(){return"upload"}createExternalPlugins(){return[QB()]}};function tV(e={}){e={...{exitMarksOnArrowPress:to.defaultOptions.exitMarksOnArrowPress,excludeBaseKeymap:to.defaultOptions.excludeBaseKeymap,selectParentNodeOnEscape:to.defaultOptions.selectParentNodeOnEscape,undoInputRuleOnBackspace:to.defaultOptions.undoInputRuleOnBackspace,persistentSelectionClass:yo.defaultOptions.persistentSelectionClass},...e};const n=W0(e,["excludeBaseKeymap","selectParentNodeOnEscape","undoInputRuleOnBackspace"]),r=W0(e,["persistentSelectionClass"]);return[new yx,new vx,new TB,new gx,new hx,new VB,new BB,new Ec,new De,new Ar,new to(n),new Em,new eV,new yo(r)]}var nC=class extends ft{get name(){return"meta"}onCreate(){if(this.store.setStoreKey("getCommandMeta",this.getCommandMeta.bind(this)),!!this.options.capture)for(const e of this.store.extensions)this.captureCommands(e),this.captureKeybindings(e)}createPlugin(){return{}}captureCommands(e){const t=e.decoratedCommands??{},n=e.createCommands;for(const r of Object.keys(t)){const o=e[r];e[r]=(...i)=>s=>{var a;const l=o(...i)(s);return s.dispatch&&l&&this.setCommandMeta(s.tr,{type:"command",chain:s.dispatch!==((a=s.view)==null?void 0:a.dispatch),name:r,extension:e.name,decorated:!0}),l}}n&&(e.createCommands=()=>{const r=n();for(const[o,i]of Object.entries(r))r[o]=(...s)=>a=>{var l;const c=i(...s)(a);return a.dispatch&&c&&this.setCommandMeta(a.tr,{type:"command",chain:a.dispatch!==((l=a.view)==null?void 0:l.dispatch),name:o,extension:e.name,decorated:!1}),c};return r})}captureKeybindings(e){}getCommandMeta(e){return e.getMeta(this.pluginKey)??[]}setCommandMeta(e,t){const n=this.getCommandMeta(e);e.setMeta(this.pluginKey,[...n,t])}};nC=oe([He({defaultOptions:{capture:eo.isDevelopment},staticKeys:["capture"],defaultPriority:Je.Highest})],nC);var oh,Mu,ih,Ol,Qi,sh,ah,nV=class{constructor(e){Mt(this,oh,sm()),Mt(this,Mu,void 0),Mt(this,ih,void 0),Mt(this,Ol,!0),Mt(this,Qi,xg()),Mt(this,sh,void 0),Mt(this,ah,void 0),this.getState=()=>this.view.state??this.initialEditorState,this.getPreviousState=()=>this.previousState,this.dispatchTransaction=i=>{var s,a;he(!this.manager.destroyed,{code:K.MANAGER_PHASE_ERROR,message:"A transaction was dispatched to a manager that has already been destroyed. Please check your set up, or open an issue."}),i=((a=(s=this.props).onDispatchTransaction)==null?void 0:a.call(s,i,this.getState()))??i;const l=this.getState(),{state:c,transactions:u}=l.applyTransaction(i);Ut(this,ih,l),this.updateState({state:c,tr:i,transactions:u});const d=this.manager.store.getForcedUpdates(i);zs(d)||this.updateViewProps(...d)},this.onChange=(i=ce())=>{var s,a;const l=this.eventListenerProps(i);Z(this,Ol)&&Ut(this,Ol,!1),(a=(s=this.props).onChange)==null||a.call(s,l)},this.onBlur=i=>{var s,a;const l=this.eventListenerProps();(a=(s=this.props).onBlur)==null||a.call(s,l,i),Z(this,Qi).emit("blur",l,i)},this.onFocus=i=>{var s,a;const l=this.eventListenerProps();(a=(s=this.props).onFocus)==null||a.call(s,l,i),Z(this,Qi).emit("focus",l,i)},this.setContent=(i,{triggerChange:s=!1}={})=>{const{doc:a}=this.manager.createState({content:i}),l=this.getState(),{state:c}=this.getState().applyTransaction(l.tr.replaceRangeWith(0,l.doc.nodeSize-2,a));if(s)return this.updateState({state:c,triggerChange:s});this.view.updateState(c)},this.clearContent=({triggerChange:i=!1}={})=>{this.setContent(this.manager.createEmptyDoc(),{triggerChange:i})},this.createStateFromContent=(i,s)=>this.manager.createState({content:i,selection:s}),this.focus=i=>{this.manager.store.commands.focus(i)},this.blur=i=>{this.manager.store.commands.blur(i)};const{getProps:t,initialEditorState:n,element:r}=e;if(Ut(this,Mu,t),Ut(this,ah,n),this.manager.attachFramework(this,this.updateListener.bind(this)),this.manager.view)return;const o=this.createView(n,r);this.manager.addView(o)}get addHandler(){return Z(this,sh)??Ut(this,sh,Z(this,Qi).on.bind(Z(this,Qi)))}get updatableViewProps(){return{attributes:()=>this.getAttributes(),editable:()=>this.props.editable??!0}}get firstRender(){return Z(this,Ol)}get props(){return Z(this,Mu).call(this)}get previousState(){return this.previousStateOverride??Z(this,ih)??this.initialEditorState}get manager(){return this.props.manager}get view(){return this.manager.view}get uid(){return Z(this,oh)}get initialEditorState(){return Z(this,ah)}updateListener(e){const{state:t,tr:n}=e;return Z(this,Qi).emit("updated",this.eventListenerProps({state:t,tr:n}))}update(e){const{getProps:t}=e;return Ut(this,Mu,t),this}updateViewProps(...e){const t=W0(this.updatableViewProps,e);this.view.setProps({...this.view.props,...t})}getAttributes(e){var t;const{attributes:n,autoFocus:r,classNames:o=[],label:i,editable:s}=this.props,a=(t=this.manager.store)==null?void 0:t.attributes,l=nt(n)?n(this.eventListenerProps()):n;let c={};(r||dr(r))&&(c=e?{autoFocus:!0}:{autofocus:"true"});const u=Yd(px(e&&"Prosemirror","remirror-editor",a==null?void 0:a.class,...o).split(" ")).join(" "),d={role:"textbox",...c,"aria-multiline":"true",...s??!0?{}:{"aria-readonly":"true"},"aria-label":i??"",...a,class:u};return u7({...d,...l})}addFocusListeners(){this.view.dom.addEventListener("blur",this.onBlur),this.view.dom.addEventListener("focus",this.onFocus)}removeFocusListeners(){this.view.dom.removeEventListener("blur",this.onBlur),this.view.dom.removeEventListener("focus",this.onFocus)}destroy(){Z(this,Qi).emit("destroy"),this.view&&this.removeFocusListeners()}eventListenerProps(e=ce()){const{state:t,tr:n,transactions:r}=e;return{tr:n,transactions:r,internalUpdate:!n,view:this.view,firstRender:Z(this,Ol),state:t??this.getState(),createStateFromContent:this.createStateFromContent,previousState:this.previousState,helpers:this.manager.store.helpers}}get baseOutput(){return{manager:this.manager,...this.manager.store,addHandler:this.addHandler,focus:this.focus,blur:this.blur,uid:Z(this,oh),view:this.view,getState:this.getState,getPreviousState:this.getPreviousState,getExtension:this.manager.getExtension.bind(this.manager),hasExtension:this.manager.hasExtension.bind(this.manager),clearContent:this.clearContent,setContent:this.setContent}}};oh=new WeakMap;Mu=new WeakMap;ih=new WeakMap;Ol=new WeakMap;Qi=new WeakMap;sh=new WeakMap;ah=new WeakMap;function rV(e,t){const n=[],r=new WeakMap,o=[],i=new WeakMap;let s=[];const a={duplicateMap:i,parentExtensions:o,gatheredExtensions:s,settings:t};for(const d of e)PP(a,{extension:d});s=Fa(s,(d,f)=>f.priority-d.priority);const l=new WeakSet,c=new Set;for(const d of s){const f=d.constructor,h=d.name,m=i.get(f);he(m,{message:`No entries were found for the ExtensionConstructor ${d.name}`,code:K.INTERNAL}),!(l.has(f)||c.has(h))&&(l.add(f),c.add(h),n.push(d),r.set(f,d),m.forEach(g=>g==null?void 0:g.replaceChildExtension(f,d)))}const u=[];for(const d of n)oV({extension:d,found:l,missing:u});return he(zs(u),{code:K.MISSING_REQUIRED_EXTENSION,message:u.map(({Constructor:d,extension:f})=>`The extension '${f.name}' requires '${d.name} in order to run correctly.`).join(`
370
- `)}),{extensions:n,extensionMap:r}}function PP(e,t){var n;const{gatheredExtensions:r,duplicateMap:o,parentExtensions:i,settings:s}=e,{extension:a,parentExtension:l}=t;let{names:c=[]}=t;he(TP(a),{code:K.INVALID_MANAGER_EXTENSION,message:`An invalid extension: ${a} was provided to the [[\`RemirrorManager\`]].`});const u=a.extensions;if(a.setPriority((n=s.priority)==null?void 0:n[a.name]),r.push(a),iV({duplicateMap:o,extension:a,parentExtension:l}),u.length!==0){if(c.includes(a.name)){`${c.join(" > ")}${a.name}`;return}c=[...c,a.name],i.push(a);for(const d of u)PP(e,{names:c,extension:d,parentExtension:a})}}function oV(e){const{extension:t,found:n,missing:r}=e;if(t.requiredExtensions)for(const o of t.requiredExtensions??[])n.has(o)||r.push({Constructor:o,extension:t})}function iV(e){const{duplicateMap:t,extension:n,parentExtension:r}=e,o=n.constructor,i=t.get(o),s=r?[r]:[];t.set(o,i?[...i,...s]:s)}function sV(e){var t,n,r,o;const{extension:i,nodeNames:s,markNames:a,plainNames:l,store:c,handlers:u}=e;i.setStore(c);const d=(t=i.onCreate)==null?void 0:t.bind(i),f=(n=i.onView)==null?void 0:n.bind(i),h=(r=i.onStateUpdate)==null?void 0:r.bind(i),m=(o=i.onDestroy)==null?void 0:o.bind(i);d&&u.create.push(d),f&&u.view.push(f),h&&u.update.push(h),m&&u.destroy.push(m),Dg(i)&&a.push(i.name),Uf(i)&&i.name!=="doc"&&s.push(i.name),MP(i)&&l.push(i.name)}var es,Ru,Wr,ti,Pu,Zn,ra,Nu,oa,$u,ia,Kr,Du,lh=class{constructor(e,t={}){Mt(this,es,void 0),Mt(this,Ru,ce()),Mt(this,Wr,ce()),Mt(this,ti,void 0),Mt(this,Pu,void 0),Mt(this,Zn,In.None),Mt(this,ra,void 0),Mt(this,Nu,!0),Mt(this,oa,{create:[],view:[],update:[],destroy:[]}),Mt(this,$u,[]),Mt(this,ia,xg()),Mt(this,Kr,void 0),Mt(this,Du,void 0),this.getState=()=>{var o;return Z(this,Zn)>=In.EditorView?this.view.state:(he(Z(this,Kr),{code:K.MANAGER_PHASE_ERROR,message:"`getState` can only be called after the `Framework` or the `EditorView` has been added to the manager`. Check your plugins to make sure that the decorations callback uses the state argument."}),(o=Z(this,Kr))==null?void 0:o.initialEditorState)},this.updateState=o=>{const i=this.getState();this.view.updateState(o),this.onStateUpdate({previousState:i,state:o})};const{extensions:n,extensionMap:r}=rV(e,t);Ut(this,ra,t),Ut(this,ti,ya(n)),Ut(this,Pu,r),Ut(this,es,this.createExtensionStore()),Ut(this,Zn,In.Create),this.setupLifecycleHandlers();for(const o of Z(this,oa).create){const i=o();i&&Z(this,$u).push(i)}}static create(e,t={}){return new lh([...AM(e),...tV(t.builtin)],t)}get[Ci](){return Yt.Manager}get destroyed(){return Z(this,Zn)===In.Destroy}get mounted(){return Z(this,Zn)>=In.EditorView&&Z(this,Zn)<In.Destroy}get output(){var e;return(e=Z(this,Kr))==null?void 0:e.frameworkOutput}get frameworkAttached(){return!!Z(this,Kr)}get extensions(){return Z(this,ti)}get stringHandlers(){return Z(this,Ru)}get store(){return ya(Z(this,Wr))}get extensionStore(){return ya(Z(this,es))}get tr(){return this.getExtension(De).transaction}get nodes(){return Z(this,Wr).nodes}get marks(){return Z(this,Wr).marks}get schema(){return Z(this,Wr).schema}get extensionTags(){return Z(this,Wr).tags}get view(){return Z(this,Wr).view}get settings(){return Z(this,ra)}get document(){return Z(this,ra).document??Pg()}setupLifecycleHandlers(){const e=Z(this,es),t=Z(this,oa),n=[],r=[],o=[];e.nodeNames=n,e.markNames=r,e.plainNames=o;for(const i of Z(this,ti))sV({extension:i,nodeNames:n,markNames:r,plainNames:o,handlers:t,store:e})}setStringHandler(e,t){Z(this,Ru)[e]=t}setStoreKey(e,t){Z(this,Wr)[e]=t}getStoreKey(e){const t=Z(this,Wr)[e];return he(!js(t),{code:K.MANAGER_PHASE_ERROR,message:"`getStoreKey` should not be called before the values are available."}),t}setExtensionStore(e,t){he(Z(this,Zn)<=In.EditorView,{code:K.MANAGER_PHASE_ERROR,message:"`setExtensionStore` should only be called during the `onCreate` lifecycle hook. Make sure to only call it within the returned methods."}),Z(this,es)[e]=t}createExtensionStore(){const e=ce(),t=!0;let n,r;return Object.defineProperties(e,{extensions:{get:()=>Z(this,ti),enumerable:t},phase:{get:()=>Z(this,Zn),enumerable:t},view:{get:()=>this.view,enumerable:t},managerSettings:{get:()=>ya(Z(this,ra)),enumerable:t},getState:{value:this.getState,enumerable:t},updateState:{value:this.updateState,enumerable:t},isMounted:{value:()=>this.mounted,enumerable:t},getExtension:{value:this.getExtension.bind(this),enumerable:t},manager:{get:()=>this,enumerable:t},document:{get:()=>this.document,enumerable:t},stringHandlers:{get:()=>Z(this,Ru),enumerable:t},currentState:{get:()=>n??(n=this.getState()),set:o=>{n=o},enumerable:t},previousState:{get:()=>r,set:o=>{r=o},enumerable:t}}),e.getStoreKey=this.getStoreKey.bind(this),e.setStoreKey=this.setStoreKey.bind(this),e.setExtensionStore=this.setExtensionStore.bind(this),e.setStringHandler=this.setStringHandler.bind(this),e}addView(e){if(Z(this,Zn)>=In.EditorView)return this;Ut(this,Nu,!0),Ut(this,Zn,In.EditorView),Z(this,Wr).view=e;for(const t of Z(this,oa).view){const n=t(e);n&&Z(this,$u).push(n)}return this}attachFramework(e,t){var n;Z(this,Kr)!==e&&(Z(this,Kr)&&(Z(this,Kr).destroy(),(n=Z(this,Du))==null||n.call(this)),Ut(this,Kr,e),Ut(this,Du,this.addHandler("stateUpdate",t)))}createEmptyDoc(){var e;const t=(e=this.schema.nodes.doc)==null?void 0:e.createAndFill();return he(t,{code:K.INVALID_CONTENT,message:"An empty node could not be created due to an invalid schema."}),t}createState(e={}){const{onError:t,defaultSelection:n="end"}=this.settings,{content:r=this.createEmptyDoc(),selection:o=n,stringHandler:i=this.settings.stringHandler}=e,{schema:s,plugins:a}=this.store,l=cP({stringHandler:xe(i)?this.stringHandlers[i]:i,document:this.document,content:r,onError:t,schema:s,selection:o});return xa.create({schema:s,doc:l,plugins:a,selection:Dr(o,l)})}addHandler(e,t){return Z(this,ia).on(e,t)}onStateUpdate(e){const t=Z(this,Nu);Z(this,es).currentState=e.state,Z(this,es).previousState=e.previousState,t&&(Ut(this,Zn,In.Runtime),Ut(this,Nu,!1));const n={...e,firstUpdate:t};for(const r of Z(this,oa).update)r(n);Z(this,ia).emit("stateUpdate",n)}getExtension(e){const t=Z(this,Pu).get(e);return he(t,{code:K.INVALID_MANAGER_EXTENSION,message:`'${e.name}' doesn't exist within this manager. Make sure it is properly added before attempting to use it.`}),t}hasExtension(e){return!!Z(this,Pu).get(e)}clone(){const e=Z(this,ti).map(n=>n.clone(n.options)),t=lh.create(()=>e,Z(this,ra));return Z(this,ia).emit("clone",t),t}recreate(e=[],t={}){const n=Z(this,ti).map(o=>o.clone(o.initialOptions)),r=lh.create(()=>[...n,...e],t);return Z(this,ia).emit("recreate",r),r}destroy(){var e,t,n,r,o,i;Ut(this,Zn,In.Destroy);for(const s of((e=this.view)==null?void 0:e.state.plugins)??[])(n=(t=s.getState(this.view.state))==null?void 0:t.destroy)==null||n.call(t);(r=Z(this,Kr))==null||r.destroy(),(o=Z(this,Du))==null||o.call(this);for(const s of Z(this,$u))s();for(const s of Z(this,oa).destroy)s();(i=this.view)==null||i.destroy(),Z(this,ia).emit("destroy")}includes(e){const t=[],n=[];for(const r of Z(this,ti))t.push(r.name,r.constructorName),n.push(r.constructor);return e.every(r=>xe(r)?go(t,r):go(n,r))}},aV=lh;es=new WeakMap;Ru=new WeakMap;Wr=new WeakMap;ti=new WeakMap;Pu=new WeakMap;Zn=new WeakMap;ra=new WeakMap;Nu=new WeakMap;oa=new WeakMap;$u=new WeakMap;ia=new WeakMap;Kr=new WeakMap;Du=new WeakMap;function lV(e,t){return!Lc(e)||!jc(e,Yt.Manager)?!1:t?e.includes(t):!0}var cV=Object.defineProperty,uV=Object.getOwnPropertyDescriptor,dV=(e,t,n,r)=>{for(var o=r>1?void 0:r?uV(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&cV(t,n,o),o},NP=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},ae=(e,t,n)=>(NP(e,t,"read from private field"),n?n.call(e):t.get(e)),Jn=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Xn=(e,t,n,r)=>(NP(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Au,fV=class{constructor(){this.portals=new Map,Jn(this,Au,xg()),this.on=e=>ae(this,Au).on("update",e),this.once=e=>{const t=ae(this,Au).on("update",n=>{t(),e(n)});return t}}update(){ae(this,Au).emit("update",this.portals)}render({Component:e,container:t}){const n=this.portals.get(t);this.portals.set(t,{Component:e,key:(n==null?void 0:n.key)??sm()}),this.update()}forceUpdate(){for(const[e,{Component:t}]of this.portals)this.portals.set(e,{Component:t,key:sm()})}remove(e){this.portals.delete(e),this.update()}};Au=new WeakMap;var pV=e=>{const{portals:t}=e;return H.createElement(H.Fragment,null,t.map(([n,{Component:r,key:o}])=>At.createPortal(H.createElement(r,null),n,o)))};function hV(e){const[t,n]=p.useState(()=>Array.from(e.portals.entries()));return p.useEffect(()=>e.on(r=>{n(Array.from(r.entries()))}),[e]),p.useMemo(()=>t,[t])}var ht,Iu,sa,Lu,ch,ju,Tl,zu,uh,ni,bn,xx,$P=class{constructor({getPosition:e,node:t,portalContainer:n,view:r,ReactComponent:o,options:i}){Jn(this,ht,void 0),Jn(this,Iu,[]),Jn(this,sa,void 0),Jn(this,Lu,void 0),Jn(this,ch,void 0),Jn(this,ju,void 0),Jn(this,Tl,void 0),Jn(this,zu,!1),Jn(this,uh,void 0),Jn(this,ni,void 0),Jn(this,bn,void 0),Jn(this,xx,l=>{l&&(he(ae(this,ni),{code:K.REACT_NODE_VIEW,message:`You have applied a ref to a node view provided for '${ae(this,ht).type.name}' which doesn't support content.`}),l.append(ae(this,ni)))}),this.Component=()=>{const l=ae(this,ch);return he(l,{code:K.REACT_NODE_VIEW,message:`The custom react node view provided for ${ae(this,ht).type.name} doesn't have a valid ReactComponent`}),H.createElement(l,{updateAttributes:this.updateAttributes,selected:this.selected,view:ae(this,sa),getPosition:ae(this,ju),node:ae(this,ht),forwardRef:ae(this,xx),decorations:ae(this,Iu)})},this.updateAttributes=l=>{if(!ae(this,sa).editable)return;const c=ae(this,ju).call(this);if(c==null)return;const u=ae(this,sa).state.tr.setNodeMarkup(c,void 0,{...ae(this,ht).attrs,...l});ae(this,sa).dispatch(u)},he(nt(e),{message:"You are attempting to use a node view for a mark type. This is not supported yet. Please check your configuration."}),Xn(this,ht,t),Xn(this,sa,r),Xn(this,Lu,n),Xn(this,ch,o),Xn(this,ju,e),Xn(this,Tl,i),Xn(this,bn,this.createDom());const{contentDOM:s,wrapper:a}=this.createContentDom()??{};Xn(this,uh,s??void 0),Xn(this,ni,a),ae(this,ni)&&ae(this,bn).append(ae(this,ni)),this.setDomAttributes(ae(this,ht),ae(this,bn)),this.Component.displayName=TM(`${ae(this,ht).type.name}NodeView`),this.renderComponent()}static create(e){const{portalContainer:t,ReactComponent:n,options:r}=e;return(o,i,s)=>new $P({options:r,node:o,view:i,getPosition:s,portalContainer:t,ReactComponent:n})}get selected(){return ae(this,zu)}get contentDOM(){return ae(this,uh)}get dom(){return ae(this,bn)}renderComponent(){ae(this,Lu).render({Component:this.Component,container:ae(this,bn)})}createDom(){const{defaultBlockNode:e,defaultInlineNode:t}=ae(this,Tl),n=ae(this,ht).isInline?document.createElement(t):document.createElement(e);return n.classList.add(`${zk(ae(this,ht).type.name)}-node-view-wrapper`),n}createContentDom(){var e,t;if(ae(this,ht).isLeaf)return;const n=(t=(e=ae(this,ht).type.spec).toDOM)==null?void 0:t.call(e,ae(this,ht));if(!n)return;const{contentDOM:r,dom:o}=oo.renderSpec(document,n);let i;if(Vo(o))return i=o,o===r&&(i=document.createElement("span"),i.classList.add(`${zk(ae(this,ht).type.name)}-node-view-content-wrapper`),i.append(r)),Vo(r),{wrapper:i,contentDOM:r}}update(e,t){return x1({types:ae(this,ht).type,node:e})?(ae(this,ht)===e&&ae(this,Iu)===t||(ae(this,ht).sameMarkup(e)||this.setDomAttributes(e,ae(this,bn)),Xn(this,ht,e),Xn(this,Iu,t),this.renderComponent()),!0):!1}setDomAttributes(e,t){const{toDOM:n}=ae(this,ht).type.spec;let r=e.attrs;if(n){const o=n(e);if(xe(o)||mV(o))return;el(o[1])&&(r=o[1])}for(const[o,i]of jt(r))t.setAttribute(o,i)}selectNode(){Xn(this,zu,!0),ae(this,bn)&&ae(this,bn).classList.add(Ak),this.renderComponent()}deselectNode(){Xn(this,zu,!1),ae(this,bn)&&ae(this,bn).classList.remove(Ak),this.renderComponent()}destroy(){ae(this,Lu).remove(ae(this,bn))}ignoreMutation(e){return e.type==="selection"?!ae(this,ht).type.spec.selectable:ae(this,ni)?!ae(this,ni).contains(e.target):!0}stopEvent(e){var t;if(!ae(this,bn))return!1;if(nt(ae(this,Tl).stopEvent))return ae(this,Tl).stopEvent({event:e});const n=e.target;if(!(ae(this,bn).contains(n)&&!((t=this.contentDOM)!=null&&t.contains(n))))return!1;const o=e.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(n.tagName)||n.isContentEditable)&&!o)return!0;const s=!!ae(this,ht).type.spec.draggable,a=ge.isSelectable(ae(this,ht)),l=e.type==="copy",c=e.type==="paste",u=e.type==="cut",d=e.type==="mousedown",f=e.type.startsWith("drag");return!s&&a&&f&&e.preventDefault(),!(f||o||l||c||u||d&&a)}},rC=$P;ht=new WeakMap;Iu=new WeakMap;sa=new WeakMap;Lu=new WeakMap;ch=new WeakMap;ju=new WeakMap;Tl=new WeakMap;zu=new WeakMap;uh=new WeakMap;ni=new WeakMap;bn=new WeakMap;xx=new WeakMap;function mV(e){return ux(e)||el(e)&&ux(e.dom)}var of=class extends ft{constructor(){super(...arguments),this.portalContainer=new fV}get name(){return"reactComponent"}onCreate(){this.store.setStoreKey("portalContainer",this.portalContainer)}createNodeViews(){const e=ce(),t=this.store.managerSettings.nodeViewComponents??{};for(const r of this.store.extensions)!r.ReactComponent||!Uf(r)||r.reactComponentEnvironment==="ssr"||(e[r.name]=rC.create({options:this.options,ReactComponent:r.ReactComponent,portalContainer:this.portalContainer}));const n=jt({...this.options.nodeViewComponents,...t});for(const[r,o]of n)e[r]=rC.create({options:this.options,ReactComponent:o,portalContainer:this.portalContainer});return e}};of=dV([He({defaultOptions:{defaultBlockNode:"div",defaultInlineNode:"span",defaultContentNode:"span",defaultEnvironment:"both",nodeViewComponents:{},stopEvent:null},staticKeys:["defaultBlockNode","defaultInlineNode","defaultContentNode","defaultEnvironment"]})],of);function gV(e){const t=p.createContext(null),n=vV(t);return[o=>{const i=e(o);return H.createElement(t.Provider,{value:i},o.children)},n,t]}function vV(e){return(t,n)=>{const r=p.useContext(e),o=yV(r);if(!r)throw new Error("`useContextHook` must be placed inside the `Provider` returned by the `createContextState` method");if(!t)return r;if(typeof t!="function")throw new TypeError("invalid arguments passed to `useContextHook`. This hook must be called with zero arguments, a getter function or a path string.");const i=t(r);if(!o||!n)return i;const s=t(o);return n(s,i)?s:i}}function yV(e){const t=p.useRef();return xV(()=>{t.current=e}),t.current}var xV=typeof document<"u"?p.useLayoutEffect:p.useEffect;function bV(e,t){return gV(n=>{const r=p.useRef(null),o=p.useRef(),i=t==null?void 0:t(n),[s,a]=p.useState(()=>e({get:oC(r),set:iC(o),previousContext:void 0,props:n,state:i})),l=[...Object.values(n),i];return p.useEffect(()=>{l.length!==0&&a(c=>e({get:oC(r),set:iC(o),previousContext:c,props:n,state:i}))},l),r.current=s,o.current=a,s})}function oC(e){return t=>{if(!e.current)throw new Error("`get` called outside of function scope. `get` can only be called within a function.");if(!t)return e.current;if(typeof t!="function")throw new TypeError("Invalid arguments passed to `useContextHook`. The hook must be called with zero arguments, a getter function or a path string.");return t(e.current)}}function iC(e){return t=>{if(!e.current)throw new Error("`set` called outside of function scope. `set` can only be called within a function.");e.current(n=>({...n,...typeof t=="function"?t(n):t}))}}var DP={},AP={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.errorMessages=e.ErrorType=void 0;var t;(function(n){n.MalformedUnicode="MALFORMED_UNICODE",n.MalformedHexadecimal="MALFORMED_HEXADECIMAL",n.CodePointLimit="CODE_POINT_LIMIT",n.OctalDeprecation="OCTAL_DEPRECATION",n.EndOfString="END_OF_STRING"})(t=e.ErrorType||(e.ErrorType={})),e.errorMessages=new Map([[t.MalformedUnicode,"malformed Unicode character escape sequence"],[t.MalformedHexadecimal,"malformed hexadecimal character escape sequence"],[t.CodePointLimit,"Unicode codepoint must not be greater than 0x10FFFF in escape sequence"],[t.OctalDeprecation,'"0"-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the "0o" prefix instead'],[t.EndOfString,"malformed escape sequence at end of string"]])})(AP);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.unraw=e.errorMessages=e.ErrorType=void 0;const t=AP;Object.defineProperty(e,"ErrorType",{enumerable:!0,get:function(){return t.ErrorType}}),Object.defineProperty(e,"errorMessages",{enumerable:!0,get:function(){return t.errorMessages}});function n(h){return!h.match(/[^a-f0-9]/i)?parseInt(h,16):NaN}function r(h,m,g){const b=n(h);if(Number.isNaN(b)||g!==void 0&&g!==h.length)throw new SyntaxError(t.errorMessages.get(m));return b}function o(h){const m=r(h,t.ErrorType.MalformedHexadecimal,2);return String.fromCharCode(m)}function i(h,m){const g=r(h,t.ErrorType.MalformedUnicode,4);if(m!==void 0){const b=r(m,t.ErrorType.MalformedUnicode,4);return String.fromCharCode(g,b)}return String.fromCharCode(g)}function s(h){return h.charAt(0)==="{"&&h.charAt(h.length-1)==="}"}function a(h){if(!s(h))throw new SyntaxError(t.errorMessages.get(t.ErrorType.MalformedUnicode));const m=h.slice(1,-1),g=r(m,t.ErrorType.MalformedUnicode);try{return String.fromCodePoint(g)}catch(b){throw b instanceof RangeError?new SyntaxError(t.errorMessages.get(t.ErrorType.CodePointLimit)):b}}function l(h,m=!1){if(m)throw new SyntaxError(t.errorMessages.get(t.ErrorType.OctalDeprecation));const g=parseInt(h,8);return String.fromCharCode(g)}const c=new Map([["b","\b"],["f","\f"],["n",`
371
- `],["r","\r"],["t"," "],["v","\v"],["0","\0"]]);function u(h){return c.get(h)||h}const d=/\\(?:(\\)|x([\s\S]{0,2})|u(\{[^}]*\}?)|u([\s\S]{4})\\u([^{][\s\S]{0,3})|u([\s\S]{0,4})|([0-3]?[0-7]{1,2})|([\s\S])|$)/g;function f(h,m=!1){return h.replace(d,function(g,b,y,v,w,S,k,C,E){if(b!==void 0)return"\\";if(y!==void 0)return o(y);if(v!==void 0)return a(v);if(w!==void 0)return i(w,S);if(k!==void 0)return i(k);if(C==="0")return"\0";if(C!==void 0)return l(C,!m);if(E!==void 0)return u(E);throw new SyntaxError(t.errorMessages.get(t.ErrorType.EndOfString))})}e.unraw=f,e.default=f})(DP);const wV=Ri(DP),Ma=e=>typeof e=="string",SV=e=>typeof e=="function",sC=new Map,IP="en";function O1(e){return[...Array.isArray(e)?e:[e],IP]}function LP(e,t,n){const r=O1(e);return Cm(()=>_m("date",r,n),()=>new Intl.DateTimeFormat(r,n)).format(Ma(t)?new Date(t):t)}function bx(e,t,n){const r=O1(e);return Cm(()=>_m("number",r,n),()=>new Intl.NumberFormat(r,n)).format(t)}function aC(e,t,n,{offset:r=0,...o}){const i=O1(e),s=t?Cm(()=>_m("plural-ordinal",i),()=>new Intl.PluralRules(i,{type:"ordinal"})):Cm(()=>_m("plural-cardinal",i),()=>new Intl.PluralRules(i,{type:"cardinal"}));return o[n]??o[s.select(n-r)]??o.other}function Cm(e,t){const n=e();let r=sC.get(n);return r||(r=t(),sC.set(n,r)),r}function _m(e,t,n){const r=t.join("-");return`${e}-${r}-${JSON.stringify(n)}`}const jP=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/g,kV=(e,t,n={})=>{const r=t||e,o=s=>typeof s=="object"?s:n[s]||{style:s},i=(s,a)=>{const l=Object.keys(n).length?o("number"):void 0,c=bx(r,s,l);return a.replace("#",c)};return{plural:(s,a)=>{const{offset:l=0}=a,c=aC(r,!1,s,a);return i(s-l,c)},selectordinal:(s,a)=>{const{offset:l=0}=a,c=aC(r,!0,s,a);return i(s-l,c)},select:EV,number:(s,a)=>bx(r,s,o(a)),date:(s,a)=>LP(r,s,o(a)),undefined:CV}},EV=(e,t)=>t[e]??t.other,CV=e=>e;function _V(e,t,n){return(r={},o)=>{const i=kV(t,n,o),s=l=>Array.isArray(l)?l.reduce((c,u)=>{if(Ma(u))return c+u;const[d,f,h]=u;let m={};h!=null&&typeof h=="object"?Object.entries(h).forEach(([y,v])=>{m[y]=s(v)}):m=h;const g=i[f],b=g(r[d],m);return b==null?c:c+b},""):l,a=s(e);return Ma(a)&&jP.test(a)?wV(a.trim()):Ma(a)?a.trim():a?String(a):""}}var OV=Object.defineProperty,TV=(e,t,n)=>t in e?OV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,MV=(e,t,n)=>(TV(e,typeof t!="symbol"?t+"":t,n),n);class RV{constructor(){MV(this,"_events",{})}on(t,n){var r;return(r=this._events)[t]??(r[t]=[]),this._events[t].push(n),()=>this.removeListener(t,n)}removeListener(t,n){const r=this._getListeners(t);if(!r)return;const o=r.indexOf(n);~o&&r.splice(o,1)}emit(t,...n){const r=this._getListeners(t);r&&r.map(o=>o.apply(this,n))}_getListeners(t){const n=this._events[t];return Array.isArray(n)?n:!1}}var PV=Object.defineProperty,NV=(e,t,n)=>t in e?PV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gl=(e,t,n)=>(NV(e,typeof t!="symbol"?t+"":t,n),n);class $V extends RV{constructor(t){super(),gl(this,"_locale",""),gl(this,"_locales"),gl(this,"_localeData",{}),gl(this,"_messages",{}),gl(this,"_missing"),gl(this,"t",this._.bind(this)),t.missing!=null&&(this._missing=t.missing),t.messages!=null&&this.load(t.messages),t.localeData!=null&&this.loadLocaleData(t.localeData),(typeof t.locale=="string"||t.locales)&&this.activate(t.locale??IP,t.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){return this._messages[this._locale]??{}}get localeData(){return this._localeData[this._locale]??{}}_loadLocaleData(t,n){const r=this._localeData[t];r?Object.assign(r,n):this._localeData[t]=n}loadLocaleData(t,n){n!=null?this._loadLocaleData(t,n):Object.keys(t).forEach(r=>this._loadLocaleData(r,t[r])),this.emit("change")}_load(t,n){const r=this._messages[t];r?Object.assign(r,n):this._messages[t]=n}load(t,n){typeof t=="string"&&typeof n=="object"?this._load(t,n):Object.entries(t).forEach(([r,o])=>this._load(r,o)),this.emit("change")}loadAndActivate({locale:t,locales:n,messages:r}){this._locale=t,this._locales=n||void 0,this._messages[this._locale]=r,this.emit("change")}activate(t,n){this._locale=t,this._locales=n,this.emit("change")}_(t,n,r){let o=r==null?void 0:r.message;Ma(t)||(n=t.values||n,o=t.message,t=t.id);const i=this.messages[t],s=i===void 0,a=this._missing;if(a&&s)return SV(a)?a(this._locale,t):a;s&&this.emit("missing",{id:t,locale:this._locale});let l=i||o||t;return Ma(l)&&jP.test(l)?JSON.parse(`"${l}"`):Ma(l)?l:_V(l,this._locale,this._locales)(n,r==null?void 0:r.formats)}date(t,n){return LP(this._locales||this._locale,t,n)}number(t,n){return bx(this._locales||this._locale,t,n)}}function DV(e={}){return new $V(e)}const Ag=DV();function G(e,t){return t?"other":e==1?"one":"other"}function Di(e,t){return t?"other":e==0||e==1?"one":"other"}function Wn(e,t){var n=String(e).split("."),r=!n[1];return t?"other":e==1&&r?"one":"other"}function Ye(e,t){return"other"}function Zs(e,t){return t?"other":e==1?"one":e==2?"two":"other"}const AV=Ye,IV=G,LV=Di;function jV(e,t){return t?"other":e>=0&&e<=1?"one":"other"}const zV=G;function FV(e,t){var n=String(e).split("."),r=Number(n[0])==e,o=r&&n[0].slice(-2);return t?"other":e==0?"zero":e==1?"one":e==2?"two":o>=3&&o<=10?"few":o>=11&&o<=99?"many":"other"}function BV(e,t){var n=String(e).split("."),r=Number(n[0])==e,o=r&&n[0].slice(-2);return t?"other":e==0?"zero":e==1?"one":e==2?"two":o>=3&&o<=10?"few":o>=11&&o<=99?"many":"other"}function VV(e,t){return t?e==1||e==5||e==7||e==8||e==9||e==10?"one":e==2||e==3?"two":e==4?"few":e==6?"many":"other":e>=0&&e<=1?"one":"other"}const UV=G,HV=Wn;function WV(e,t){var n=String(e).split("."),r=n[0],o=r.slice(-1),i=r.slice(-2),s=r.slice(-3);return t?o==1||o==2||o==5||o==7||o==8||i==20||i==50||i==70||i==80?"one":o==3||o==4||s==100||s==200||s==300||s==400||s==500||s==600||s==700||s==800||s==900?"few":r==0||o==6||i==40||i==60||i==90?"many":"other":e==1?"one":"other"}function KV(e,t){var n=String(e).split("."),r=Number(n[0])==e,o=r&&n[0].slice(-1),i=r&&n[0].slice(-2);return t?(o==2||o==3)&&i!=12&&i!=13?"few":"other":o==1&&i!=11?"one":o>=2&&o<=4&&(i<12||i>14)?"few":r&&o==0||o>=5&&o<=9||i>=11&&i<=14?"many":"other"}const qV=G,GV=G,YV=G,XV=Di,ZV=Ye;function JV(e,t){return t?e==1||e==5||e==7||e==8||e==9||e==10?"one":e==2||e==3?"two":e==4?"few":e==6?"many":"other":e>=0&&e<=1?"one":"other"}const QV=Ye;function eU(e,t){var n=String(e).split("."),r=Number(n[0])==e,o=r&&n[0].slice(-1),i=r&&n[0].slice(-2),s=r&&n[0].slice(-6);return t?"other":o==1&&i!=11&&i!=71&&i!=91?"one":o==2&&i!=12&&i!=72&&i!=92?"two":(o==3||o==4||o==9)&&(i<10||i>19)&&(i<70||i>79)&&(i<90||i>99)?"few":e!=0&&r&&s==0?"many":"other"}const tU=G;function nU(e,t){var n=String(e).split("."),r=n[0],o=n[1]||"",i=!n[1],s=r.slice(-1),a=r.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?"other":i&&s==1&&a!=11||l==1&&c!=11?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"}function rU(e,t){var n=String(e).split("."),r=!n[1];return t?e==1||e==3?"one":e==2?"two":e==4?"few":"other":e==1&&r?"one":"other"}const oU=G;function iU(e,t){var n=String(e).split("."),r=n[0],o=n[1]||"",i=!n[1],s=r.slice(-1),a=o.slice(-1);return t?"other":i&&(r==1||r==2||r==3)||i&&s!=4&&s!=6&&s!=9||!i&&a!=4&&a!=6&&a!=9?"one":"other"}const sU=G,aU=G,lU=G;function cU(e,t){var n=String(e).split("."),r=n[0],o=!n[1];return t?"other":e==1&&o?"one":r>=2&&r<=4&&o?"few":o?"other":"many"}function uU(e,t){return t?e==0||e==7||e==8||e==9?"zero":e==1?"one":e==2?"two":e==3||e==4?"few":e==5||e==6?"many":"other":e==0?"zero":e==1?"one":e==2?"two":e==3?"few":e==6?"many":"other"}function dU(e,t){var n=String(e).split("."),r=n[0],o=Number(n[0])==e;return t?"other":e==1||!o&&(r==0||r==1)?"one":"other"}const fU=Wn;function pU(e,t){var n=String(e).split("."),r=n[0],o=n[1]||"",i=!n[1],s=r.slice(-2),a=o.slice(-2);return t?"other":i&&s==1||a==1?"one":i&&s==2||a==2?"two":i&&(s==3||s==4)||a==3||a==4?"few":"other"}const hU=G,mU=Ye,gU=G,vU=G;function yU(e,t){var n=String(e).split("."),r=!n[1],o=Number(n[0])==e,i=o&&n[0].slice(-1),s=o&&n[0].slice(-2);return t?i==1&&s!=11?"one":i==2&&s!=12?"two":i==3&&s!=13?"few":"other":e==1&&r?"one":"other"}const xU=G,bU=G,wU=Wn,SU=G;function kU(e,t){return t?"other":e>=0&&e<=1?"one":"other"}function EU(e,t){return t?"other":e>=0&&e<2?"one":"other"}const CU=Wn;function _U(e,t){var n=String(e).split("."),r=n[0],o=n[1]||"",i=!n[1],s=r.slice(-1),a=o.slice(-1);return t?e==1?"one":"other":i&&(r==1||r==2||r==3)||i&&s!=4&&s!=6&&s!=9||!i&&a!=4&&a!=6&&a!=9?"one":"other"}const OU=G;function TU(e,t){return t?e==1?"one":"other":e>=0&&e<2?"one":"other"}const MU=G,RU=Wn;function PU(e,t){var n=String(e).split("."),r=Number(n[0])==e;return t?e==1?"one":"other":e==1?"one":e==2?"two":r&&e>=3&&e<=6?"few":r&&e>=7&&e<=10?"many":"other"}function NU(e,t){var n=String(e).split("."),r=Number(n[0])==e;return t?e==1||e==11?"one":e==2||e==12?"two":e==3||e==13?"few":"other":e==1||e==11?"one":e==2||e==12?"two":r&&e>=3&&e<=10||r&&e>=13&&e<=19?"few":"other"}const $U=Wn,DU=G;function AU(e,t){return t?e==1?"one":e==2||e==3?"two":e==4?"few":e==6?"many":"other":e>=0&&e<=1?"one":"other"}const IU=Di;function LU(e,t){var n=String(e).split("."),r=n[0],o=!n[1],i=r.slice(-1),s=r.slice(-2);return t?"other":o&&i==1?"one":o&&i==2?"two":o&&(s==0||s==20||s==40||s==60||s==80)?"few":o?"other":"many"}const jU=G,zU=G;function FU(e,t){var n=String(e).split("."),r=n[0],o=!n[1],i=Number(n[0])==e,s=i&&n[0].slice(-1);return t?"other":e==1&&o?"one":r==2&&o?"two":o&&(e<0||e>10)&&i&&s==0?"many":"other"}function BU(e,t){return t?e==1?"one":e==2||e==3?"two":e==4?"few":e==6?"many":"other":e>=0&&e<=1?"one":"other"}function VU(e,t){var n=String(e).split("."),r=n[0],o=n[1]||"",i=!n[1],s=r.slice(-1),a=r.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?"other":i&&s==1&&a!=11||l==1&&c!=11?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"}function UU(e,t){var n=String(e).split("."),r=n[0],o=n[1]||"",i=!n[1],s=r.slice(-2),a=o.slice(-2);return t?"other":i&&s==1||a==1?"one":i&&s==2||a==2?"two":i&&(s==3||s==4)||a==3||a==4?"few":"other"}function HU(e,t){return t?e==1||e==5?"one":"other":e==1?"one":"other"}function WU(e,t){return t?e==1?"one":"other":e>=0&&e<2?"one":"other"}const KU=Wn,qU=Ye,GU=Ye,YU=Ye,XU=Wn;function ZU(e,t){var n=String(e).split("."),r=n[0],o=Number(n[0])==e,i=r.slice(-1),s=r.slice(-2);return t?"other":o&&i==1&&s!=11||!o?"one":"other"}function JU(e,t){var n=String(e).split("."),r=!n[1];return t?e==11||e==8||e==80||e==800?"many":"other":e==1&&r?"one":"other"}const QU=Zs;function eH(e,t){var n=String(e).split("."),r=n[0],o=!n[1],i=Number(n[0])==e,s=i&&n[0].slice(-1);return t?"other":e==1&&o?"one":r==2&&o?"two":o&&(e<0||e>10)&&i&&s==0?"many":"other"}const tH=Ye,nH=Ye,rH=G,oH=Wn,iH=G,sH=Ye,aH=Ye;function lH(e,t){var n=String(e).split("."),r=n[0],o=r.slice(-2);return t?r==1?"one":r==0||o>=2&&o<=20||o==40||o==60||o==80?"many":"other":e==1?"one":"other"}function cH(e,t){return t?"other":e>=0&&e<2?"one":"other"}const uH=G,dH=G,fH=Ye,pH=Ye;function hH(e,t){var n=String(e).split("."),r=Number(n[0])==e,o=r&&n[0].slice(-1);return t?o==6||o==9||r&&o==0&&e!=0?"many":"other":e==1?"one":"other"}const mH=G,gH=G,vH=Ye;function yH(e,t){return t?"other":e>=0&&e<=1?"one":"other"}const xH=Ye,bH=G,wH=G;function SH(e,t){return t?"other":e==0?"zero":e==1?"one":"other"}const kH=G;function EH(e,t){var n=String(e).split("."),r=Number(n[0])==e,o=r&&n[0].slice(-2),i=r&&n[0].slice(-3),s=r&&n[0].slice(-5),a=r&&n[0].slice(-6);return t?r&&e>=1&&e<=4||o>=1&&o<=4||o>=21&&o<=24||o>=41&&o<=44||o>=61&&o<=64||o>=81&&o<=84?"one":e==5||o==5?"many":"other":e==0?"zero":e==1?"one":o==2||o==22||o==42||o==62||o==82||r&&i==0&&(s>=1e3&&s<=2e4||s==4e4||s==6e4||s==8e4)||e!=0&&a==1e5?"two":o==3||o==23||o==43||o==63||o==83?"few":e!=1&&(o==1||o==21||o==41||o==61||o==81)?"many":"other"}const CH=G;function _H(e,t){var n=String(e).split("."),r=n[0];return t?"other":e==0?"zero":(r==0||r==1)&&e!=0?"one":"other"}const OH=G,TH=G,MH=Ye,RH=Di;function PH(e,t){return t&&e==1?"one":"other"}function NH(e,t){var n=String(e).split("."),r=n[1]||"",o=Number(n[0])==e,i=o&&n[0].slice(-1),s=o&&n[0].slice(-2);return t?"other":i==1&&(s<11||s>19)?"one":i>=2&&i<=9&&(s<11||s>19)?"few":r!=0?"many":"other"}function $H(e,t){var n=String(e).split("."),r=n[1]||"",o=r.length,i=Number(n[0])==e,s=i&&n[0].slice(-1),a=i&&n[0].slice(-2),l=r.slice(-2),c=r.slice(-1);return t?"other":i&&s==0||a>=11&&a<=19||o==2&&l>=11&&l<=19?"zero":s==1&&a!=11||o==2&&c==1&&l!=11||o!=2&&c==1?"one":"other"}const DH=G,AH=Di,IH=G;function LH(e,t){var n=String(e).split("."),r=n[0],o=n[1]||"",i=!n[1],s=r.slice(-1),a=r.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?s==1&&a!=11?"one":s==2&&a!=12?"two":(s==7||s==8)&&a!=17&&a!=18?"many":"other":i&&s==1&&a!=11||l==1&&c!=11?"one":"other"}const jH=G,zH=G;function FH(e,t){var n=String(e).split("."),r=!n[1],o=Number(n[0])==e,i=o&&n[0].slice(-2);return t?e==1?"one":"other":e==1&&r?"one":!r||e==0||i>=2&&i<=19?"few":"other"}function BH(e,t){return t?e==1?"one":e==2||e==3?"two":e==4?"few":"other":e==1?"one":"other"}function VH(e,t){return t&&e==1?"one":"other"}function UH(e,t){var n=String(e).split("."),r=Number(n[0])==e,o=r&&n[0].slice(-2);return t?"other":e==1?"one":e==0||o>=2&&o<=10?"few":o>=11&&o<=19?"many":"other"}const HH=Ye,WH=G,KH=Zs,qH=G,GH=G;function YH(e,t){var n=String(e).split("."),r=Number(n[0])==e;return t?r&&e>=1&&e<=4?"one":"other":e==1?"one":"other"}const XH=Wn,ZH=G,JH=G,QH=G,eW=Ye,tW=G,nW=Di,rW=G,oW=G,iW=G;function sW(e,t){var n=String(e).split("."),r=Number(n[0])==e;return t?e==1||e==5||r&&e>=7&&e<=9?"one":e==2||e==3?"two":e==4?"few":e==6?"many":"other":e==1?"one":"other"}const aW=G,lW=Ye,cW=Di,uW=G;function dW(e,t){var n=String(e).split("."),r=n[0],o=!n[1],i=r.slice(-1),s=r.slice(-2);return t?"other":e==1&&o?"one":o&&i>=2&&i<=4&&(s<12||s>14)?"few":o&&r!=1&&(i==0||i==1)||o&&i>=5&&i<=9||o&&s>=12&&s<=14?"many":"other"}function fW(e,t){var n=String(e).split("."),r=n[1]||"",o=r.length,i=Number(n[0])==e,s=i&&n[0].slice(-1),a=i&&n[0].slice(-2),l=r.slice(-2),c=r.slice(-1);return t?"other":i&&s==0||a>=11&&a<=19||o==2&&l>=11&&l<=19?"zero":s==1&&a!=11||o==2&&c==1&&l!=11||o!=2&&c==1?"one":"other"}const pW=G;function hW(e,t){var n=String(e).split("."),r=n[0];return t?"other":r==0||r==1?"one":"other"}const mW=Wn,gW=G;function vW(e,t){var n=String(e).split("."),r=!n[1],o=Number(n[0])==e,i=o&&n[0].slice(-2);return t?e==1?"one":"other":e==1&&r?"one":!r||e==0||i>=2&&i<=19?"few":"other"}const yW=G,xW=Ye;function bW(e,t){var n=String(e).split("."),r=n[0],o=!n[1],i=r.slice(-1),s=r.slice(-2);return t?"other":o&&i==1&&s!=11?"one":o&&i>=2&&i<=4&&(s<12||s>14)?"few":o&&i==0||o&&i>=5&&i<=9||o&&s>=11&&s<=14?"many":"other"}const wW=G,SW=Ye,kW=G;function EW(e,t){var n=String(e).split("."),r=!n[1];return t?e==11||e==8||e==80||e==800?"many":"other":e==1&&r?"one":"other"}function CW(e,t){var n=String(e).split("."),r=!n[1];return t?e==11||e==8||e==80||e==800?"many":"other":e==1&&r?"one":"other"}const _W=G,OW=G,TW=Zs,MW=G,RW=Ye,PW=Ye;function NW(e,t){var n=String(e).split("."),r=n[0],o=n[1]||"",i=!n[1],s=r.slice(-1),a=r.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?"other":i&&s==1&&a!=11||l==1&&c!=11?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"}function $W(e,t){var n=String(e).split("."),r=Number(n[0])==e;return t?"other":e>=0&&e<=1?"one":r&&e>=2&&e<=10?"few":"other"}function DW(e,t){var n=String(e).split("."),r=n[0],o=n[1]||"";return t?"other":e==0||e==1||r==0&&o==1?"one":"other"}function AW(e,t){var n=String(e).split("."),r=n[0],o=!n[1];return t?"other":e==1&&o?"one":r>=2&&r<=4&&o?"few":o?"other":"many"}function IW(e,t){var n=String(e).split("."),r=n[0],o=!n[1],i=r.slice(-2);return t?"other":o&&i==1?"one":o&&i==2?"two":o&&(i==3||i==4)||!o?"few":"other"}const LW=Zs,jW=Zs,zW=Zs,FW=Zs,BW=Zs,VW=G,UW=G;function HW(e,t){var n=String(e).split("."),r=Number(n[0])==e,o=r&&n[0].slice(-1),i=r&&n[0].slice(-2);return t?e==1?"one":o==4&&i!=14?"many":"other":e==1?"one":"other"}function WW(e,t){var n=String(e).split("."),r=n[0],o=n[1]||"",i=!n[1],s=r.slice(-1),a=r.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?"other":i&&s==1&&a!=11||l==1&&c!=11?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"}const KW=G,qW=G,GW=G,YW=Ye;function XW(e,t){var n=String(e).split("."),r=!n[1],o=Number(n[0])==e,i=o&&n[0].slice(-1),s=o&&n[0].slice(-2);return t?(i==1||i==2)&&s!=11&&s!=12?"one":"other":e==1&&r?"one":"other"}const ZW=Wn,JW=G,QW=G,eK=G,tK=G,nK=Ye,rK=Di,oK=G;function iK(e,t){var n=String(e).split("."),r=Number(n[0])==e,o=r&&n[0].slice(-1);return t?o==6||o==9||e==10?"few":"other":e==1?"one":"other"}function sK(e,t){var n=String(e).split("."),r=n[0],o=n[1]||"",i=!n[1],s=r.slice(-1),a=o.slice(-1);return t?e==1?"one":"other":i&&(r==1||r==2||r==3)||i&&s!=4&&s!=6&&s!=9||!i&&a!=4&&a!=6&&a!=9?"one":"other"}const aK=G,lK=Ye,cK=G,uK=G;function dK(e,t){var n=String(e).split("."),r=Number(n[0])==e;return t?"other":e==0||e==1||r&&e>=11&&e<=99?"one":"other"}const fK=G;function pK(e,t){var n=String(e).split("."),r=n[0],o=!n[1],i=Number(n[0])==e,s=i&&n[0].slice(-1),a=i&&n[0].slice(-2),l=r.slice(-1),c=r.slice(-2);return t?s==3&&a!=13?"few":"other":o&&l==1&&c!=11?"one":o&&l>=2&&l<=4&&(c<12||c>14)?"few":o&&l==0||o&&l>=5&&l<=9||o&&c>=11&&c<=14?"many":"other"}const hK=Wn,mK=G,gK=G;function vK(e,t){return t&&e==1?"one":"other"}const yK=G,xK=G,bK=Di,wK=G,SK=Ye,kK=G,EK=G,CK=Wn,_K=Ye,OK=Ye,TK=Ye;function MK(e,t){return t?"other":e>=0&&e<=1?"one":"other"}const RK=Object.freeze(Object.defineProperty({__proto__:null,_in:AV,af:IV,ak:LV,am:jV,an:zV,ar:FV,ars:BV,as:VV,asa:UV,ast:HV,az:WV,be:KV,bem:qV,bez:GV,bg:YV,bho:XV,bm:ZV,bn:JV,bo:QV,br:eU,brx:tU,bs:nU,ca:rU,ce:oU,ceb:iU,cgg:sU,chr:aU,ckb:lU,cs:cU,cy:uU,da:dU,de:fU,dsb:pU,dv:hU,dz:mU,ee:gU,el:vU,en:yU,eo:xU,es:bU,et:wU,eu:SU,fa:kU,ff:EU,fi:CU,fil:_U,fo:OU,fr:TU,fur:MU,fy:RU,ga:PU,gd:NU,gl:$U,gsw:DU,gu:AU,guw:IU,gv:LU,ha:jU,haw:zU,he:FU,hi:BU,hr:VU,hsb:UU,hu:HU,hy:WU,ia:KU,id:qU,ig:GU,ii:YU,io:XU,is:ZU,it:JU,iu:QU,iw:eH,ja:tH,jbo:nH,jgo:rH,ji:oH,jmc:iH,jv:sH,jw:aH,ka:lH,kab:cH,kaj:uH,kcg:dH,kde:fH,kea:pH,kk:hH,kkj:mH,kl:gH,km:vH,kn:yH,ko:xH,ks:bH,ksb:wH,ksh:SH,ku:kH,kw:EH,ky:CH,lag:_H,lb:OH,lg:TH,lkt:MH,ln:RH,lo:PH,lt:NH,lv:$H,mas:DH,mg:AH,mgo:IH,mk:LH,ml:jH,mn:zH,mo:FH,mr:BH,ms:VH,mt:UH,my:HH,nah:WH,naq:KH,nb:qH,nd:GH,ne:YH,nl:XH,nn:ZH,nnh:JH,no:QH,nqo:eW,nr:tW,nso:nW,ny:rW,nyn:oW,om:iW,or:sW,os:aW,osa:lW,pa:cW,pap:uW,pl:dW,prg:fW,ps:pW,pt:hW,pt_PT:mW,rm:gW,ro:vW,rof:yW,root:xW,ru:bW,rwk:wW,sah:SW,saq:kW,sc:EW,scn:CW,sd:_W,sdh:OW,se:TW,seh:MW,ses:RW,sg:PW,sh:NW,shi:$W,si:DW,sk:AW,sl:IW,sma:LW,smi:jW,smj:zW,smn:FW,sms:BW,sn:VW,so:UW,sq:HW,sr:WW,ss:KW,ssy:qW,st:GW,su:YW,sv:XW,sw:ZW,syr:JW,ta:QW,te:eK,teo:tK,th:nK,ti:rK,tig:oK,tk:iK,tl:sK,tn:aK,to:lK,tr:cK,ts:uK,tzm:dK,ug:fK,uk:pK,ur:hK,uz:mK,ve:gK,vi:vK,vo:yK,vun:xK,wa:bK,wae:wK,wo:SK,xh:kK,xog:EK,yi:CK,yo:_K,yue:OK,zh:TK,zu:MK},Symbol.toStringTag,{value:"Module"}));var PK=Object.defineProperty,NK=Object.getOwnPropertyDescriptor,$K=Object.getOwnPropertyNames,DK=Object.prototype.hasOwnProperty,lC=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of $K(t))!DK.call(e,o)&&o!==n&&PK(e,o,{get:()=>t[o],enumerable:!(r=NK(t,o))||r.enumerable});return e},AK=(e,t,n)=>(lC(e,t,"default"),n&&lC(n,t,"default")),IK=JSON.parse('{"extension.command.toggle-upper-case.label":[["case","select",{"upper":"Uppercase","lower":"Lowercase","capitalize":"Sentence case","smallCaps":"Small caps","other":"Text case"}]],"extension.table.column_count":[["count","plural",{"one":["#"," column"],"other":["#"," columns"]}]],"extension.table.row_count":[["count","plural",{"one":["#"," row"],"other":["#"," rows"]}]],"extension.command.toggle-columns.description":[["count","select",{"2":"Split the block into two columns","3":"Split the current block into three columns","4":"Split the current block into four columns","other":"Split the current block into multiple columns"}]],"extension.command.toggle-columns.label":[["count","select",{"2":"Two Column Block","3":"Three Column Block","4":"Four Column Block","other":"Multi Column Block"}]],"extension.command.set-text-direction.label":[["dir","select",{"ltr":"Left-To-Right","rtl":"Right-To-Left","other":"Reset Direction"}]],"extension.command.set-text-direction.description":[["dir","select",{"ltr":"Set the text direction from left to right","rtl":"Set the text direction from right to left","other":"Reset text direction"}]],"extension.command.toggle-heading.label":[["level","select",{"1":"Heading 1","2":"Heading 2","3":"Heading 3","4":"Heading 4","5":"Heading 5","6":"Heading 6","other":"Heading"}]],"extension.command.toggle-callout.description":[["type","select",{"info":"Create an information callout block","warning":"Create a warning callout block","error":"Create an error callout block","success":"Create a success callout block","other":"Create a callout block"}]],"extension.command.toggle-callout.label":[["type","select",{"info":"Information Callout","warning":"Warning Callout","error":"Error Callout","success":"Success Callout","other":"Callout"}]],"extension.command.toggle-code-block.description":"Add a code block","extension.command.add-annotation.label":"Add annotation","extension.command.toggle-blockquote.description":"Add blockquote formatting to the selected text","extension.command.toggle-bold.description":"Add bold formatting to the selected text","extension.command.toggle-code.description":"Add inline code formatting to the selected text","keyboard.shortcut.alt":"Alt","keyboard.shortcut.arrowDown":"Arrow Down","keyboard.shortcut.arrowLeft":"Arrow Left","keyboard.shortcut.arrowRight":"Arrow Right","keyboard.shortcut.arrowUp":"Arrow Up","keyboard.shortcut.backspace":"Backspace","ui.text-color.black":"Black","extension.command.toggle-blockquote.label":"Blockquote","ui.text-color.blue":"Blue","ui.text-color.blue.hue":["Blue ",["hue"]],"extension.command.toggle-bold.label":"Bold","extension.command.toggle-bullet-list.description":"Bulleted list","keyboard.shortcut.capsLock":"Caps Lock","extension.command.center-align.label":"Center align","extension.command.toggle-code.label":"Code","extension.command.toggle-code-block.label":"Codeblock","keyboard.shortcut.command":"Command","QcPNd6":"Image description","ogrUzJ":"Add a short description here.","yqdyzr":"Image","6/02F4":"Image source","X8H91v":"Image","zhQ7Zt":"Italic","ZL7E7l":"Underline","keyboard.shortcut.control":"Control","extension.command.convert-paragraph.description":"Convert current block into a paragraph block.","extension.command.convert-paragraph.label":"Convert Paragraph","extension.command.copy.label":"Copy","extension.command.copy.description":"Copy the selected text","extension.command.create-table.description":"Create a table with set number of rows and columns.","extension.command.create-table.label":"Create table","extension.command.cut.label":"Cut","extension.command.cut.description":"Cut the selected text","ui.text-color.cyan":"Cyan","ui.text-color.cyan.hue":["Cyan ",["hue"]],"extension.command.decrease-font-size.label":"Decrease","extension.command.decrease-indent.label":"Decrease indentation","extension.command.decrease-font-size.description":"Decrease the font size.","keyboard.shortcut.delete":"Delete","extension.command.insert-horizontal-rule.label":"Divider","keyboard.shortcut.end":"End","keyboard.shortcut.escape":"Enter","keyboard.shortcut.enter":"Enter","6PjrOF":"Add annotation","OTq5WC":"Center align","oeZ3ox":"Convert current block into a paragraph block.","m1khs+":"Convert Paragraph","w/1U+3":"Copy the selected text","kdodi0":"Copy","k0KR/u":"Create a table with set number of rows and columns.","zrwMyD":"Create table","D/nWxh":"Cut the selected text","jHPv5m":"Cut","5cNgRx":"Decrease the font size.","vyRNWx":"Decrease","Jgiol4":"Decrease indentation","1gJSHH":"Increase the font size","OQXJXz":"Increase","72TLhr":"Increase indentation","HFlfzJ":"Insert Emoji","RPq9fY":"Separate content with a diving horizontal line","OKQF+e":"Divider","zjYb9C":"Insert a new paragraph","4M4sXC":"Insert Paragraph","1Q+eVc":"Justify","ejWWtP":"Left align","wVqrpS":"Paste content into the editor","07v9aw":"Paste","zUYfou":"Redo the most recent action","9Nq9zr":"Redo","0uxaZe":"Remove annotation","iJWZAz":"Right align","g5WpPn":"Select all content within the editor","2+pZDT":"Select all","yChCR1":"Set text case","GMzAC/":"Set the font size for the selected text.","vzEyrv":"Font size","7VCkJ8":"Set the text color for the selected text.","qjWFaR":"Text color","LVWgFu":[["dir","select",{"ltr":"Set the text direction from left to right","rtl":"Set the text direction from right to left","other":"Reset text direction"}]],"WXwRy1":[["dir","select",{"ltr":"Left-To-Right","rtl":"Right-To-Left","other":"Reset Direction"}]],"G/o315":"Set the text highlight color for the selected text.","xtHg6d":"Text highlight","1p1W/p":"Add blockquote formatting to the selected text","6+rh6I":"Blockquote","0yB3LV":"Add bold formatting to the selected text","sFMo4Z":"Bold","SMKG/s":"Bulleted list","/BYCMi":[["type","select",{"info":"Create an information callout block","warning":"Create a warning callout block","error":"Create an error callout block","success":"Create a success callout block","other":"Create a callout block"}]],"V+3IBe":[["type","select",{"info":"Information Callout","warning":"Warning Callout","error":"Error Callout","success":"Success Callout","other":"Callout"}]],"hbIo4L":"Add a code block","7GkMcx":"Codeblock","2r4JYl":"Add inline code formatting to the selected text","Up8Tpe":"Code","ATHSPS":[["count","select",{"2":"Split the block into two columns","3":"Split the current block into three columns","4":"Split the current block into four columns","other":"Split the current block into multiple columns"}]],"7DC1VE":[["count","select",{"2":"Two Column Block","3":"Three Column Block","4":"Four Column Block","other":"Multi Column Block"}]],"hnrBeo":[["level","select",{"1":"Heading 1","2":"Heading 2","3":"Heading 3","4":"Heading 4","5":"Heading 5","6":"Heading 6","other":"Heading"}]],"NkZAcw":"Italicize the selected text","2fTW9e":"Italic","c759Ra":"Ordered list","uQwrZu":"Strikethrough the selected text","pT3qly":"Strikethrough","BHk+zu":"Subscript","18BVwM":"Superscript","tOIVCV":"Tasked list","4Janx3":"Underline the selected text","dCHt+D":"Underline","YYAprs":[["case","select",{"upper":"Uppercase","lower":"Lowercase","capitalize":"Sentence case","smallCaps":"Small caps","other":"Text case"}]],"tczyZL":"Show hidden whitespace characters in your editor.","0qAX23":"Toggle Whitespace","ezMADU":"Undo the most recent action","N3P7EC":"Undo","2nj/+s":"Update annotation","dWD7u4":[["count","plural",{"one":["#"," column"],"other":["#"," columns"]}]],"qXqgVT":[["count","plural",{"one":["#"," row"],"other":["#"," rows"]}]],"extension.command.set-font-size.label":"Font size","ui.text-color.grape":"Grape","ui.text-color.grape.hue":["Grape ",["hue"]],"ui.text-color.gray":"Gray","ui.text-color.gray.hue":["Gray ",["hue"]],"ui.text-color.green":"Green","ui.text-color.green.hue":["Green ",["hue"]],"keyboard.shortcut.home":"Home","extension.command.increase-font-size.label":"Increase","extension.command.increase-indent.label":"Increase indentation","extension.command.increase-font-size.description":"Increase the font size","ui.text-color.indigo":"Indigo","ui.text-color.indigo.hue":["Indigo ",["hue"]],"extension.command.insert-paragraph.description":"Insert a new paragraph","extension.command.insert-emoji.label":"Insert Emoji","extension.command.insert-paragraph.label":"Insert Paragraph","extension.command.toggle-italic.label":"Italic","extension.command.toggle-italic.description":"Italicize the selected text","extension.command.justify-align.label":"Justify","R7NlCw":"Alt","RbDiK5":"Arrow Down","Dgyd+E":"Arrow Left","8pdCk4":"Arrow Right","Gp/343":"Arrow Up","PFPV0A":"Backspace","0IRYvp":"Caps Lock","X7HX0D":"Command","zq0AdD":"Control","8SfToN":"Delete","Ys/uah":"End","3K5hww":"Enter","veQt1j":"Enter","ySv7i+":"Home","e6RUI1":"Page Down","EEJk31":"Page Up","7sbhAU":"Shift","Q4eplT":"Space","SUhVVC":"Tab","extension.command.left-align.label":"Left align","ui.text-color.lime":"Lime","ui.text-color.lime.hue":["Lime ",["hue"]],"react-components.mention-atom-component.zero-items":"No items available","ui.text-color.orange":"Orange","ui.text-color.orange.hue":["Orange ",["hue"]],"extension.command.toggle-ordered-list.label":"Ordered list","keyboard.shortcut.pageDown":"Page Down","keyboard.shortcut.pageUp":"Page Up","extension.command.paste.label":"Paste","extension.command.paste.description":"Paste content into the editor","ui.text-color.pink":"Pink","ui.text-color.pink.hue":["Pink ",["hue"]],"zvMfIA":"No items available","pEjhti":"Static Menu","ui.text-color.red":"Red","ui.text-color.red.hue":["Red ",["hue"]],"extension.command.redo.label":"Redo","extension.command.redo.description":"Redo the most recent action","extension.command.remove-annotation.label":"Remove annotation","extension.command.right-align.label":"Right align","extension.command.select-all.label":"Select all","extension.command.select-all.description":"Select all content within the editor","extension.command.insert-horizontal-rule.description":"Separate content with a diving horizontal line","extension.command.set-casing.label":"Set text case","extension.command.set-font-size.description":"Set the font size for the selected text.","extension.command.set-text-color.description":"Set the text color for the selected text.","extension.command.set-text-highlight.description":"Set the text highlight color for the selected text.","keyboard.shortcut.shift":"Shift","extension.command.toggle-whitespace.description":"Show hidden whitespace characters in your editor.","keyboard.shortcut.space":"Space","extension.command.toggle-strike.label":"Strikethrough","extension.command.toggle-strike.description":"Strikethrough the selected text","extension.command.toggle-subscript.label":"Subscript","extension.command.toggle-superscript.label":"Superscript","keyboard.shortcut.tab":"Tab","extension.command.toggle-task-list.description":"Tasked list","ui.text-color.teal":"Teal","ui.text-color.teal.hue":["Teal ",["hue"]],"extension.command.set-text-color.label":"Text color","extension.command.set-text-highlight.label":"Text highlight","extension.command.toggle-whitespace.label":"Toggle Whitespace","ui.text-color.transparent":"Transparent","slrB1c":"Black","6QML30":"Blue","xw+keN":["Blue ",["hue"]],"38RHqP":"Cyan","D89yPf":["Cyan ",["hue"]],"VjBLnd":"Grape","Rp40yv":["Grape ",["hue"]],"5Dm9D1":"Gray","HGjXjC":["Gray ",["hue"]],"b9fz+n":"Green","18jo3M":["Green ",["hue"]],"CFzqCV":"Indigo","aVlDku":["Indigo ",["hue"]],"04PfLc":"Lime","KRTK6Y":["Lime ",["hue"]],"pSnXFd":"Orange","ve/MJZ":["Orange ",["hue"]],"OvCgDa":"Pink","l7NqyT":["Pink ",["hue"]],"IT9k0j":"Red","AdyJ7/":["Red ",["hue"]],"3D2UWc":"Teal","Dcq0Y1":["Teal ",["hue"]],"bsi2ik":"Transparent","Tj3PRR":"Violet","xxMH5N":["Violet ",["hue"]],"Rum0ah":"White","4gaw/Q":"Yellow","hhauc3":["Yellow ",["hue"]],"extension.command.toggle-underline.label":"Underline","extension.command.toggle-underline.description":"Underline the selected text","extension.command.undo.label":"Undo","extension.command.undo.description":"Undo the most recent action","extension.command.update-annotation.label":"Update annotation","ui.text-color.violet":"Violet","ui.text-color.violet.hue":["Violet ",["hue"]],"ui.text-color.white":"White","ui.text-color.yellow":"Yellow","ui.text-color.yellow.hue":["Yellow ",["hue"]]}'),zP={};AK(zP,RK);Ag.loadLocaleData("en",{plurals:zP.en});Ag.load("en",IK);Ag.activate("en");var LK=Object.defineProperty,jK=Object.getOwnPropertyDescriptor,T1=(e,t,n,r)=>{for(var o=r>1?void 0:r?jK(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&LK(t,n,o),o},Cc=class extends zr{get name(){return"doc"}createNodeSpec(e,t){const{docAttributes:n,content:r}=this.options,o=ce();if(el(n))for(const[i,s]of jt(n))o[i]={default:s};else for(const i of n)o[i]={default:null};return{attrs:o,content:r,...t}}setDocAttributes(e){return({tr:t,dispatch:n})=>{if(n){for(const[r,o]of Object.entries(e))t.step(new sf(r,o));n(t)}return!0}}isDefaultDocNode({state:e=this.store.getState(),options:t}={}){return k1(e.doc,t)}};T1([ie()],Cc.prototype,"setDocAttributes",1);T1([St()],Cc.prototype,"isDefaultDocNode",1);Cc=T1([He({defaultOptions:{content:"block+",docAttributes:[]},defaultPriority:Je.Medium,staticKeys:["content","docAttributes"],disableExtraAttributes:!0})],Cc);var FP="SetDocAttribute",BP="RevertSetDocAttribute",sf=class extends Ft{constructor(e,t,n=FP){super(),this.stepType=n,this.key=e,this.value=t}static fromJSON(e,t){return new sf(t.key,t.value,t.stepType)}apply(e){this.previous=e.attrs[this.key];const t={...e.attrs,[this.key]:this.value};return _t.ok(e.type.create(t,e.content,e.marks))}invert(){return new sf(this.key,this.previous,BP)}map(){return this}toJSON(){return{stepType:this.stepType,key:this.key,value:this.value}}};try{Ft.jsonID(FP,sf),Ft.jsonID(BP,sf)}catch(e){if(!e.message.startsWith("Duplicate use of step JSON ID"))throw e}var zK=Object.defineProperty,FK=Object.getOwnPropertyDescriptor,VP=(e,t,n,r)=>{for(var o=r>1?void 0:r?FK(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&zK(t,n,o),o};function BK(e,t,n,r){const o=e.docView.posFromDOM(t,n,r);return o===null||o<0?null:o}function VK(e,t){const n=t.target;if(n){const r=BK(e,n,0);if(r!==null){const o=e.state.doc.resolve(r),i=o.node().isLeaf?0:1,s=o.start()-i;return{pos:r,inside:s}}}return e.posAtCoords({left:t.clientX,top:t.clientY})??void 0}var Om=class extends ft{constructor(){super(...arguments),this.mousedown=!1,this.mouseover=!1,this.createMouseEventHandler=e=>(t,n)=>{const r=n,o=VK(t,r);if(!o)return!1;const i=[],s=[],{inside:a,pos:l}=o;if(a===-1)return!1;const c=t.state.doc.resolve(l),u=c.depth+1;for(const d of DM(u,1))i.push({node:d>c.depth&&c.nodeAfter?c.nodeAfter:c.node(d),pos:c.before(d)});for(const{type:d}of c.marksAcross(c)??[]){const f=_i(c,d);f&&s.push(f)}return e(r,{view:t,nodes:i,marks:s,getMark:d=>{const f=xe(d)?t.state.schema.marks[d]:d;return he(f,{code:K.EXTENSION,message:`The mark ${d} being checked does not exist within the editor schema.`}),s.find(h=>h.mark.type===f)},getNode:d=>{var f;const h=xe(d)?t.state.schema.nodes[d]:d;he(h,{code:K.EXTENSION,message:"The node being checked does not exist"});const m=i.find(({node:g})=>g.type===h);if(m)return{...m,isRoot:!!((f=i[0])!=null&&f.node.eq(m.node))}}})}}get name(){return"events"}onView(){var e,t;if(!((e=this.store.managerSettings.exclude)!=null&&e.clickHandler))for(const n of this.store.extensions){if(!n.createEventHandlers||(t=n.options.exclude)!=null&&t.clickHandler)continue;const r=n.createEventHandlers();for(const[o,i]of jt(r))this.addHandler(o,i)}}createPlugin(){const e=new WeakMap,t=(n,r,o,i,s,a,l,c)=>{const u=this.store.currentState,{schema:d,doc:f}=u,h=f.resolve(i),m=e.has(l),g=UK({$pos:h,handled:m,view:o,state:u});let b=!1;m||(b=n(l,g)||b);const y={...g,pos:i,direct:c,nodeWithPosition:{node:s,pos:a},getNode:v=>{const w=xe(v)?d.nodes[v]:v;return he(w,{code:K.EXTENSION,message:"The node being checked does not exist"}),w===s.type?{node:s,pos:a}:void 0}};return e.set(l,!0),r(l,y)||b};return{props:{handleKeyPress:(n,r)=>this.options.keypress(r)||!1,handleKeyDown:(n,r)=>this.options.keydown(r)||!1,handleTextInput:(n,r,o,i)=>this.options.textInput({from:r,to:o,text:i})||!1,handleClickOn:(n,r,o,i,s,a)=>t(this.options.clickMark,this.options.click,n,r,o,i,s,a),handleDoubleClickOn:(n,r,o,i,s,a)=>t(this.options.doubleClickMark,this.options.doubleClick,n,r,o,i,s,a),handleTripleClickOn:(n,r,o,i,s,a)=>t(this.options.tripleClickMark,this.options.tripleClick,n,r,o,i,s,a),handleDOMEvents:{focus:(n,r)=>this.options.focus(r)||!1,blur:(n,r)=>this.options.blur(r)||!1,mousedown:(n,r)=>(this.startMouseover(),this.options.mousedown(r)||!1),mouseup:(n,r)=>(this.endMouseover(),this.options.mouseup(r)||!1),mouseleave:(n,r)=>(this.mouseover=!1,this.options.mouseleave(r)||!1),mouseenter:(n,r)=>(this.mouseover=!0,this.options.mouseenter(r)||!1),keyup:(n,r)=>this.options.keyup(r)||!1,mouseout:this.createMouseEventHandler((n,r)=>{const o={...r,hovering:!1};return this.options.hover(n,o)||!1}),mouseover:this.createMouseEventHandler((n,r)=>{const o={...r,hovering:!0};return this.options.hover(n,o)||!1}),contextmenu:this.createMouseEventHandler((n,r)=>this.options.contextmenu(n,r)||!1),scroll:(n,r)=>this.options.scroll(r)||!1,copy:(n,r)=>this.options.copy(r)||!1,cut:(n,r)=>this.options.cut(r)||!1,paste:(n,r)=>this.options.paste(r)||!1}},view:n=>{let r=n.editable;const o=this.options;return{update(i){const s=i.editable;s!==r&&(o.editable(s),r=s)}}}}}isInteracting(){return this.mousedown&&this.mouseover}startMouseover(){this.mouseover=!0,!this.mousedown&&(this.mousedown=!0,this.store.document.documentElement.addEventListener("mouseup",()=>{this.endMouseover()},{once:!0}))}endMouseover(){this.mousedown&&(this.mousedown=!1,this.store.commands.emptyUpdate())}};VP([St()],Om.prototype,"isInteracting",1);Om=VP([He({handlerKeys:["blur","focus","mousedown","mouseup","mouseenter","mouseleave","textInput","keypress","keyup","keydown","click","clickMark","doubleClick","doubleClickMark","tripleClick","tripleClickMark","contextmenu","hover","scroll","copy","cut","paste","editable"],handlerKeyOptions:{blur:{earlyReturnValue:!0},focus:{earlyReturnValue:!0},mousedown:{earlyReturnValue:!0},mouseleave:{earlyReturnValue:!0},mouseup:{earlyReturnValue:!0},click:{earlyReturnValue:!0},doubleClick:{earlyReturnValue:!0},tripleClick:{earlyReturnValue:!0},hover:{earlyReturnValue:!0},contextmenu:{earlyReturnValue:!0},scroll:{earlyReturnValue:!0},copy:{earlyReturnValue:!0},cut:{earlyReturnValue:!0},paste:{earlyReturnValue:!0}},defaultPriority:Je.High})],Om);function UK(e){const{handled:t,view:n,$pos:r,state:o}=e,i={getMark:NM,markRanges:[],view:n,state:o};if(t)return i;for(const{type:s}of r.marksAcross(r)??[]){const a=_i(r,s);a&&i.markRanges.push(a)}return i.getMark=s=>{const a=xe(s)?o.schema.marks[s]:s;return he(a,{code:K.EXTENSION,message:`The mark ${s} being checked does not exist within the editor schema.`}),i.markRanges.find(l=>l.mark.type===a)},i}class wt extends $e{constructor(t){super(t,t)}map(t,n){let r=t.resolve(n.map(this.head));return wt.valid(r)?new wt(r):$e.near(r)}content(){return Y.empty}eq(t){return t instanceof wt&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new wt(t.resolve(n.pos))}getBookmark(){return new M1(this.anchor)}static valid(t){let n=t.parent;if(n.isTextblock||!HK(t)||!WK(t))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let o=n.contentMatchAt(t.index()).defaultType;return o&&o.isTextblock}static findGapCursorFrom(t,n,r=!1){e:for(;;){if(!r&&wt.valid(t))return t;let o=t.pos,i=null;for(let s=t.depth;;s--){let a=t.node(s);if(n>0?t.indexAfter(s)<a.childCount:t.index(s)>0){i=a.child(n>0?t.indexAfter(s):t.index(s)-1);break}else if(s==0)return null;o+=n;let l=t.doc.resolve(o);if(wt.valid(l))return l}for(;;){let s=n>0?i.firstChild:i.lastChild;if(!s){if(i.isAtom&&!i.isText&&!ge.isSelectable(i)){t=t.doc.resolve(o+i.nodeSize*n),r=!1;continue e}break}i=s,o+=n;let a=t.doc.resolve(o);if(wt.valid(a))return a}return null}}}wt.prototype.visible=!1;wt.findFrom=wt.findGapCursorFrom;$e.jsonID("gapcursor",wt);class M1{constructor(t){this.pos=t}map(t){return new M1(t.map(this.pos))}resolve(t){let n=t.resolve(this.pos);return wt.valid(n)?new wt(n):$e.near(n)}}function HK(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 o=r.child(n-1);;o=o.lastChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function WK(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 o=r.child(n);;o=o.firstChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function KK(){return new $i({props:{decorations:XK,createSelectionBetween(e,t,n){return t.pos==n.pos&&wt.valid(n)?new wt(n):null},handleClick:GK,handleKeyDown:qK,handleDOMEvents:{beforeinput:YK}}})}const qK=CP({ArrowLeft:Mp("horiz",-1),ArrowRight:Mp("horiz",1),ArrowUp:Mp("vert",-1),ArrowDown:Mp("vert",1)});function Mp(e,t){const n=e=="vert"?t>0?"down":"up":t>0?"right":"left";return function(r,o,i){let s=r.selection,a=t>0?s.$to:s.$from,l=s.empty;if(s instanceof Se){if(!i.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=r.doc.resolve(t>0?a.after():a.before())}let c=wt.findGapCursorFrom(a,t,l);return c?(o&&o(r.tr.setSelection(new wt(c))),!0):!1}}function GK(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!wt.valid(r))return!1;let o=e.posAtCoords({left:n.clientX,top:n.clientY});return o&&o.inside>-1&&ge.isSelectable(e.state.doc.nodeAt(o.inside))?!1:(e.dispatch(e.state.tr.setSelection(new wt(r))),!0)}function YK(e,t){if(t.inputType!="insertCompositionText"||!(e.state.selection instanceof wt))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 o=L.empty;for(let s=r.length-1;s>=0;s--)o=L.from(r[s].createAndFill(null,o));let i=e.state.tr.replace(n.pos,n.pos,new Y(o,0,0));return i.setSelection(Se.near(i.doc.resolve(n.pos+1))),e.dispatch(i),!1}function XK(e){if(!(e.selection instanceof wt))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",qe.create(e.doc,[dt.widget(e.selection.head,t,{key:"gapcursor"})])}var ZK=Object.defineProperty,JK=Object.getOwnPropertyDescriptor,QK=(e,t,n,r)=>{for(var o=r>1?void 0:r?JK(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&ZK(t,n,o),o},wx=class extends ft{get name(){return"gapCursor"}createExternalPlugins(){return[KK()]}};wx=QK([He({})],wx);var Tm=200,Xt=function(){};Xt.prototype.append=function(t){return t.length?(t=Xt.from(t),!this.length&&t||t.length<Tm&&this.leafAppend(t)||this.length<Tm&&t.leafPrepend(this)||this.appendInner(t)):this};Xt.prototype.prepend=function(t){return t.length?Xt.from(t).append(this):this};Xt.prototype.appendInner=function(t){return new eq(this,t)};Xt.prototype.slice=function(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.length),t>=n?Xt.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))};Xt.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};Xt.prototype.forEach=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(t,n,r,0):this.forEachInvertedInner(t,n,r,0)};Xt.prototype.map=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var o=[];return this.forEach(function(i,s){return o.push(t(i,s))},n,r),o};Xt.from=function(t){return t instanceof Xt?t:t&&t.length?new UP(t):Xt.empty};var UP=function(e){function t(r){e.call(this),this.values=r}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(o,i){return o==0&&i==this.length?this:new t(this.values.slice(o,i))},t.prototype.getInner=function(o){return this.values[o]},t.prototype.forEachInner=function(o,i,s,a){for(var l=i;l<s;l++)if(o(this.values[l],a+l)===!1)return!1},t.prototype.forEachInvertedInner=function(o,i,s,a){for(var l=i-1;l>=s;l--)if(o(this.values[l],a+l)===!1)return!1},t.prototype.leafAppend=function(o){if(this.length+o.length<=Tm)return new t(this.values.concat(o.flatten()))},t.prototype.leafPrepend=function(o){if(this.length+o.length<=Tm)return new t(o.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(Xt);Xt.empty=new UP([]);var eq=function(e){function t(n,r){e.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.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(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},t.prototype.forEachInner=function(r,o,i,s){var a=this.left.length;if(o<a&&this.left.forEachInner(r,o,Math.min(i,a),s)===!1||i>a&&this.right.forEachInner(r,Math.max(o-a,0),Math.min(this.length,i)-a,s+a)===!1)return!1},t.prototype.forEachInvertedInner=function(r,o,i,s){var a=this.left.length;if(o>a&&this.right.forEachInvertedInner(r,o-a,Math.max(i,a)-a,s+a)===!1||i<a&&this.left.forEachInvertedInner(r,Math.min(o,a),i,s)===!1)return!1},t.prototype.sliceInner=function(r,o){if(r==0&&o==this.length)return this;var i=this.left.length;return o<=i?this.left.slice(r,o):r>=i?this.right.slice(r-i,o-i):this.left.slice(r,i).append(this.right.slice(0,o-i))},t.prototype.leafAppend=function(r){var o=this.right.leafAppend(r);if(o)return new t(this.left,o)},t.prototype.leafPrepend=function(r){var o=this.left.leafPrepend(r);if(o)return new t(o,this.right)},t.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new t(this.left,new t(this.right,r)):new t(this,r)},t}(Xt);const tq=500;class no{constructor(t,n){this.items=t,this.eventCount=n}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 o,i;n&&(o=this.remapping(r,this.items.length),i=o.maps.length);let s=t.tr,a,l,c=[],u=[];return this.items.forEach((d,f)=>{if(!d.step){o||(o=this.remapping(r,f+1),i=o.maps.length),i--,u.push(d);return}if(o){u.push(new To(d.map));let h=d.step.map(o.slice(i)),m;h&&s.maybeStep(h).doc&&(m=s.mapping.maps[s.mapping.maps.length-1],c.push(new To(m,void 0,void 0,c.length+u.length))),i--,m&&o.appendMap(m,i)}else s.maybeStep(d.step);if(d.selection)return a=o?d.selection.map(o.slice(i)):d.selection,l=new no(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:a}}addTransform(t,n,r,o){let i=[],s=this.eventCount,a=this.items,l=!o&&a.length?a.get(a.length-1):null;for(let u=0;u<t.steps.length;u++){let d=t.steps[u].invert(t.docs[u]),f=new To(t.mapping.maps[u],d,n),h;(h=l&&l.merge(f))&&(f=h,u?i.pop():a=a.slice(0,a.length-1)),i.push(f),n&&(s++,n=void 0),o||(l=f)}let c=s-r.depth;return c>rq&&(a=nq(a,c),s-=c),new no(a.append(i),s)}remapping(t,n){let r=new ec;return this.items.forEach((o,i)=>{let s=o.mirrorOffset!=null&&i-o.mirrorOffset>=t?r.maps.length-o.mirrorOffset:void 0;r.appendMap(o.map,s)},t,n),r}addMaps(t){return this.eventCount==0?this:new no(this.items.append(t.map(n=>new To(n))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],o=Math.max(0,this.items.length-n),i=t.mapping,s=t.steps.length,a=this.eventCount;this.items.forEach(f=>{f.selection&&a--},o);let l=n;this.items.forEach(f=>{let h=i.getMirror(--l);if(h==null)return;s=Math.min(s,h);let m=i.maps[h];if(f.step){let g=t.steps[h].invert(t.docs[h]),b=f.selection&&f.selection.map(i.slice(l+1,h));b&&a++,r.push(new To(m,g,b))}else r.push(new To(m))},o);let c=[];for(let f=n;f<s;f++)c.push(new To(i.maps[f]));let u=this.items.slice(0,o).append(c).append(r),d=new no(u,a);return d.emptyItemCount()>tq&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let t=0;return this.items.forEach(n=>{n.step||t++}),t}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,o=[],i=0;return this.items.forEach((s,a)=>{if(a>=t)o.push(s),s.selection&&i++;else if(s.step){let l=s.step.map(n.slice(r)),c=l&&l.getMap();if(r--,c&&n.appendMap(c,r),l){let u=s.selection&&s.selection.map(n.slice(r));u&&i++;let d=new To(c.invert(),l,u),f,h=o.length-1;(f=o.length&&o[h].merge(d))?o[h]=f:o.push(d)}}else s.map&&r--},this.items.length,0),new no(Xt.from(o.reverse()),i)}}no.empty=new no(Xt.empty,0);function nq(e,t){let n;return e.forEach((r,o)=>{if(r.selection&&t--==0)return n=o,!1}),e.slice(n)}class To{constructor(t,n,r,o){this.map=t,this.step=n,this.selection=r,this.mirrorOffset=o}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new To(n.getMap().invert(),n,this.selection)}}}class as{constructor(t,n,r,o,i){this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=o,this.prevComposition=i}}const rq=20;function oq(e,t,n,r){let o=n.getMeta(Io),i;if(o)return o.historyState;n.getMeta(sq)&&(e=new as(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return e;if(s&&s.getMeta(Io))return s.getMeta(Io).redo?new as(e.done.addTransform(n,void 0,r,dh(t)),e.undone,cC(n.mapping.maps[n.steps.length-1]),e.prevTime,e.prevComposition):new as(e.done,e.undone.addTransform(n,void 0,r,dh(t)),null,e.prevTime,e.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=e.prevTime==0||!s&&e.prevComposition!=a&&(e.prevTime<(n.time||0)-r.newGroupDelay||!iq(n,e.prevRanges)),c=s?ly(e.prevRanges,n.mapping):cC(n.mapping.maps[n.steps.length-1]);return new as(e.done.addTransform(n,l?t.selection.getBookmark():void 0,r,dh(t)),no.empty,c,n.time,a??e.prevComposition)}else return(i=n.getMeta("rebased"))?new as(e.done.rebased(n,i),e.undone.rebased(n,i),ly(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new as(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),ly(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function iq(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((r,o)=>{for(let i=0;i<t.length;i+=2)r<=t[i+1]&&o>=t[i]&&(n=!0)}),n}function cC(e){let t=[];return e.forEach((n,r,o,i)=>t.push(o,i)),t}function ly(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let o=t.map(e[r],1),i=t.map(e[r+1],-1);o<=i&&n.push(o,i)}return n}function HP(e,t,n,r){let o=dh(t),i=Io.get(t).spec.config,s=(r?e.undone:e.done).popEvent(t,o);if(!s)return;let a=s.selection.resolve(s.transform.doc),l=(r?e.done:e.undone).addTransform(s.transform,t.selection.getBookmark(),i,o),c=new as(r?l:s.remaining,r?s.remaining:l,null,0,-1);n(s.transform.setSelection(a).setMeta(Io,{redo:r,historyState:c}).scrollIntoView())}let cy=!1,uC=null;function dh(e){let t=e.plugins;if(uC!=t){cy=!1,uC=t;for(let n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){cy=!0;break}}return cy}const Io=new Ic("history"),sq=new Ic("closeHistory");function aq(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new $i({key:Io,state:{init(){return new as(no.empty,no.empty,null,0,-1)},apply(t,n,r){return oq(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(t,n){let r=n.inputType,o=r=="historyUndo"?fh:r=="historyRedo"?Fu:null;return o?(n.preventDefault(),o(t.state,t.dispatch)):!1}}}})}const fh=(e,t)=>{let n=Io.getState(e);return!n||n.done.eventCount==0?!1:(t&&HP(n,e,t,!1),!0)},Fu=(e,t)=>{let n=Io.getState(e);return!n||n.undone.eventCount==0?!1:(t&&HP(n,e,t,!0),!0)};function Sx(e){let t=Io.getState(e);return t?t.done.eventCount:0}function lq(e){let t=Io.getState(e);return t?t.undone.eventCount:0}var cq=Object.defineProperty,uq=Object.getOwnPropertyDescriptor,nl=(e,t,n,r)=>{for(var o=r>1?void 0:r?uq(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&cq(t,n,o),o},Uo=class extends ft{constructor(){super(...arguments),this.wrapMethod=(e,t)=>({state:n,dispatch:r,view:o})=>{const{getState:i,getDispatch:s}=this.options,a=nt(i)?i():n,l=nt(s)&&r?s():r,c=e(a,l,o);return t==null||t(c),c}}get name(){return"history"}createKeymap(){return{"Mod-y":eo.isMac?()=>!1:this.wrapMethod(Fu,this.options.onRedo),"Mod-z":this.wrapMethod(fh,this.options.onUndo),"Shift-Mod-z":this.wrapMethod(Fu,this.options.onRedo)}}undoShortcut(e){return this.wrapMethod(fh,this.options.onUndo)(e)}redoShortcut(e){return this.wrapMethod(Fu,this.options.onRedo)(e)}createExternalPlugins(){const{depth:e,newGroupDelay:t}=this.options;return[aq({depth:e,newGroupDelay:t})]}undo(){return qE(this.wrapMethod(fh,this.options.onUndo))}redo(){return qE(this.wrapMethod(Fu,this.options.onRedo))}undoDepth(e=this.store.getState()){return Sx(e)}redoDepth(e=this.store.getState()){return lq(e)}};nl([yr({shortcut:q.Undo,command:"undo"})],Uo.prototype,"undoShortcut",1);nl([yr({shortcut:q.Redo,command:"redo"})],Uo.prototype,"redoShortcut",1);nl([ie({disableChaining:!0,description:({t:e})=>e(pm.UNDO_DESCRIPTION),label:({t:e})=>e(pm.UNDO_LABEL),icon:"arrowGoBackFill"})],Uo.prototype,"undo",1);nl([ie({disableChaining:!0,description:({t:e})=>e(pm.REDO_DESCRIPTION),label:({t:e})=>e(pm.REDO_LABEL),icon:"arrowGoForwardFill"})],Uo.prototype,"redo",1);nl([St()],Uo.prototype,"undoDepth",1);nl([St()],Uo.prototype,"redoDepth",1);Uo=nl([He({defaultOptions:{depth:100,newGroupDelay:500,getDispatch:void 0,getState:void 0},staticKeys:["depth","newGroupDelay"],handlerKeys:["onUndo","onRedo"]})],Uo);var dq=Object.defineProperty,fq=Object.getOwnPropertyDescriptor,Ig=(e,t,n,r)=>{for(var o=r>1?void 0:r?fq(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&dq(t,n,o),o},pq={icon:"paragraph",label:({t:e})=>e(hm.INSERT_LABEL),description:({t:e})=>e(hm.INSERT_DESCRIPTION)},hq={icon:"paragraph",label:({t:e})=>e(hm.CONVERT_LABEL),description:({t:e})=>e(hm.CONVERT_DESCRIPTION)},Wa=class extends zr{get name(){return"paragraph"}createTags(){return[Me.LastNodeCompatible,Me.TextBlock,Me.Block,Me.FormattingNode]}createNodeSpec(e,t){return{content:"inline*",draggable:!1,...t,attrs:{...e.defaults()},parseDOM:[{tag:"p",getAttrs:n=>({...e.parse(n)})},...t.parseDOM??[]],toDOM:n=>["p",e.dom(n),0]}}convertParagraph(e={}){const{attrs:t,selection:n,preserveAttrs:r}=e;return this.store.commands.setBlockNodeType.original(this.type,t,n,r)}insertParagraph(e,t={}){const{selection:n,attrs:r}=t;return this.store.commands.insertNode.original(this.type,{content:e,selection:n,attrs:r})}shortcut(e){return this.convertParagraph()(e)}};Ig([ie(hq)],Wa.prototype,"convertParagraph",1);Ig([ie(pq)],Wa.prototype,"insertParagraph",1);Ig([yr({shortcut:q.Paragraph,command:"convertParagraph"})],Wa.prototype,"shortcut",1);Wa=Ig([He({defaultPriority:Je.Medium})],Wa);function pi(e,t,n){return Math.min(Math.max(e,n),t)}class mq extends Error{constructor(t){super(`Failed to parse color: "${t}"`)}}var Bu=mq;function R1(e){if(typeof e!="string")throw new Bu(e);if(e.trim().toLowerCase()==="transparent")return[0,0,0,0];let t=e.trim();t=kq.test(e)?yq(e):e;const n=xq.exec(t);if(n){const s=Array.from(n).slice(1);return[...s.slice(0,3).map(a=>parseInt(af(a,2),16)),parseInt(af(s[3]||"f",2),16)/255]}const r=bq.exec(t);if(r){const s=Array.from(r).slice(1);return[...s.slice(0,3).map(a=>parseInt(a,16)),parseInt(s[3]||"ff",16)/255]}const o=wq.exec(t);if(o){const s=Array.from(o).slice(1);return[...s.slice(0,3).map(a=>parseInt(a,10)),parseFloat(s[3]||"1")]}const i=Sq.exec(t);if(i){const[s,a,l,c]=Array.from(i).slice(1).map(parseFloat);if(pi(0,100,a)!==a)throw new Bu(e);if(pi(0,100,l)!==l)throw new Bu(e);return[...Eq(s,a,l),Number.isNaN(c)?1:c]}throw new Bu(e)}function gq(e){let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return(t>>>0)%2341}const dC=e=>parseInt(e.replace(/_/g,""),36),vq="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((e,t)=>{const n=dC(t.substring(0,3)),r=dC(t.substring(3)).toString(16);let o="";for(let i=0;i<6-r.length;i++)o+="0";return e[n]=`${o}${r}`,e},{});function yq(e){const t=e.toLowerCase().trim(),n=vq[gq(t)];if(!n)throw new Bu(e);return`#${n}`}const af=(e,t)=>Array.from(Array(t)).map(()=>e).join(""),xq=new RegExp(`^#${af("([a-f0-9])",3)}([a-f0-9])?$`,"i"),bq=new RegExp(`^#${af("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),wq=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${af(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),Sq=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,kq=/^[a-z]+$/i,fC=e=>Math.round(e*255),Eq=(e,t,n)=>{let r=n/100;if(t===0)return[r,r,r].map(fC);const o=(e%360+360)%360/60,i=(1-Math.abs(2*r-1))*(t/100),s=i*(1-Math.abs(o%2-1));let a=0,l=0,c=0;o>=0&&o<1?(a=i,l=s):o>=1&&o<2?(a=s,l=i):o>=2&&o<3?(l=i,c=s):o>=3&&o<4?(l=s,c=i):o>=4&&o<5?(a=s,c=i):o>=5&&o<6&&(a=i,c=s);const u=r-i/2,d=a+u,f=l+u,h=c+u;return[d,f,h].map(fC)};function Cq(e){const[t,n,r,o]=R1(e).map((d,f)=>f===3?d:d/255),i=Math.max(t,n,r),s=Math.min(t,n,r),a=(i+s)/2;if(i===s)return[0,0,a,o];const l=i-s,c=a>.5?l/(2-i-s):l/(i+s);return[60*(t===i?(n-r)/l+(n<r?6:0):n===i?(r-t)/l+2:(t-n)/l+4),c,a,o]}function _q(e,t,n,r){return`hsla(${(e%360).toFixed()}, ${pi(0,100,t*100).toFixed()}%, ${pi(0,100,n*100).toFixed()}%, ${parseFloat(pi(0,1,r).toFixed(3))})`}function nr(e,t){const[n,r,o,i]=Cq(e);return _q(n,r,o-t,i)}function Oq(e){if(e==="transparent")return 0;function t(i){const s=i/255;return s<=.04045?s/12.92:Math.pow((s+.055)/1.055,2.4)}const[n,r,o]=R1(e);return .2126*t(n)+.7152*t(r)+.0722*t(o)}function Tq(e,t,n,r){return`rgba(${pi(0,255,e).toFixed()}, ${pi(0,255,t).toFixed()}, ${pi(0,255,n).toFixed()}, ${parseFloat(pi(0,1,r).toFixed(3))})`}function ph(e,t){return nr(e,-t)}function Mm(e,t){const[n,r,o,i]=R1(e);return Tq(n,r,o,i-t)}function Mq(e){return Oq(e)>.179}function oc(e){return Mq(e)?"#000":"#fff"}const Rq="remirror-editor-wrapper",Pq="remirror-button-active",Nq="remirror-button",$q="remirror-composite",Dq="remirror-dialog",Aq="remirror-dialog-backdrop",Iq="remirror-form",Lq="remirror-form-message",jq="remirror-form-label",zq="remirror-form-group",Fq="remirror-group",Bq="remirror-input",Vq="remirror-menu",Uq="remirror-menu-pane",Hq="remirror-menu-pane-active",Wq="remirror-menu-dropdown-label",Kq="remirror-menu-pane-icon",qq="remirror-menu-pane-label",Gq="remirror-menu-pane-shortcut",Yq="remirror-menu-button-left",Xq="remirror-menu-button-right",Zq="remirror-menu-button-nested-left",Jq="remirror-menu-button-nested-right",Qq="remirror-menu-button",eG="remirror-menu-bar",tG="remirror-flex-column",nG="remirror-flex-row",rG="remirror-menu-item",oG="remirror-menu-item-row",iG="remirror-menu-item-column",sG="remirror-menu-item-checkbox",aG="remirror-menu-item-radio",lG="remirror-menu-group",cG="remirror-floating-popover",uG="remirror-popover",dG="remirror-animated-popover",fG="remirror-role",pG="remirror-separator",hG="remirror-tab",mG="remirror-tab-list",gG="remirror-tabbable",vG="remirror-toolbar",yG="remirror-tooltip",xG="remirror-table-size-editor",bG="remirror-table-size-editor-body",wG="remirror-table-size-editor-cell",SG="remirror-table-size-editor-cell-selected",kG="remirror-table-size-editor-footer",EG="remirror-color-picker",CG="remirror-color-picker-cell",_G="remirror-color-picker-cell-selected";var OG=Object.freeze({__proto__:null,ANIMATED_POPOVER:dG,BUTTON:Nq,BUTTON_ACTIVE:Pq,COLOR_PICKER:EG,COLOR_PICKER_CELL:CG,COLOR_PICKER_CELL_SELECTED:_G,COMPOSITE:$q,DIALOG:Dq,DIALOG_BACKDROP:Aq,EDITOR_WRAPPER:Rq,FLEX_COLUMN:tG,FLEX_ROW:nG,FLOATING_POPOVER:cG,FORM:Iq,FORM_GROUP:zq,FORM_LABEL:jq,FORM_MESSAGE:Lq,GROUP:Fq,INPUT:Bq,MENU:Vq,MENU_BAR:eG,MENU_BUTTON:Qq,MENU_BUTTON_LEFT:Yq,MENU_BUTTON_NESTED_LEFT:Zq,MENU_BUTTON_NESTED_RIGHT:Jq,MENU_BUTTON_RIGHT:Xq,MENU_DROPDOWN_LABEL:Wq,MENU_GROUP:lG,MENU_ITEM:rG,MENU_ITEM_CHECKBOX:sG,MENU_ITEM_COLUMN:iG,MENU_ITEM_RADIO:aG,MENU_ITEM_ROW:oG,MENU_PANE:Uq,MENU_PANE_ACTIVE:Hq,MENU_PANE_ICON:Kq,MENU_PANE_LABEL:qq,MENU_PANE_SHORTCUT:Gq,POPOVER:uG,ROLE:fG,SEPARATOR:pG,TAB:hG,TABBABLE:gG,TABLE_SIZE_EDITOR:xG,TABLE_SIZE_EDITOR_BODY:bG,TABLE_SIZE_EDITOR_CELL:wG,TABLE_SIZE_EDITOR_CELL_SELECTED:SG,TABLE_SIZE_EDITOR_FOOTER:kG,TAB_LIST:mG,TOOLBAR:vG,TOOLTIP:yG});const TG="remirror-image-loader";var MG=Object.freeze({__proto__:null,IMAGE_LOADER:TG});const RG="remirror-list-item-with-custom-mark",PG="remirror-ul-list-content",NG="remirror-editor",$G="remirror-list-item-marker-container",DG="remirror-list-item-checkbox",AG="remirror-collapsible-list-item-closed",IG="remirror-collapsible-list-item-button",LG="remirror-list-spine";var Vs=Object.freeze({__proto__:null,COLLAPSIBLE_LIST_ITEM_BUTTON:IG,COLLAPSIBLE_LIST_ITEM_CLOSED:AG,EDITOR:NG,LIST_ITEM_CHECKBOX:DG,LIST_ITEM_MARKER_CONTAINER:$G,LIST_ITEM_WITH_CUSTOM_MARKER:RG,LIST_SPINE:LG,UL_LIST_CONTENT:PG});const jG="remirror-is-empty";var zG=Object.freeze({__proto__:null,IS_EMPTY:jG});const FG="remirror-editor",BG="remirror-positioner",VG="remirror-positioner-widget";var UG=Object.freeze({__proto__:null,EDITOR:FG,POSITIONER:BG,POSITIONER_WIDGET:VG});const qr={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"]},hi="#000000",P1="#ffffff",HG="#252103",N1=Mm(hi,.75),Lg="#7963d2",$1="#bcd263",WG="#fff",KG="#fff",D1=qr.gray[1],pC="rgba(10,31,68,0.08)",hC="rgba(10,31,68,0.10)",mC="rgba(10,31,68,0.12)",qG=ph(Mm(hi,.1),.13),A1={background:P1,border:N1,foreground:hi,muted:D1,primary:Lg,secondary:$1,primaryText:WG,secondaryText:KG,text:HG,faded:qG},GG={...A1,background:nr(P1,.15),border:nr(N1,.15),foreground:nr(hi,.15),muted:nr(D1,.15),primary:nr(Lg,.15),secondary:nr($1,.15),get text(){return oc(this.background)},get primaryText(){return oc(this.primary)},get secondaryText(){return oc(this.secondary)}},YG={...A1,background:nr(P1,.075),border:nr(N1,.075),foreground:nr(hi,.075),muted:nr(D1,.075),primary:nr(Lg,.075),secondary:nr($1,.075),get text(){return oc(this.background)},get primaryText(){return oc(this.primary)},get secondaryText(){return oc(this.secondary)}};({...A1,backdrop:Mm(hi,.1),outline:Mm(Lg,.6),table:(ph(hi,.8),ph(hi,.4),qr.gray[3],qr.blue[7],qr.blue[1],qr.blue[5],qr.blue[7],ph(hi,.4),qr.blue[5],qr.red[7],qr.red[1],qr.red[5])},`${pC}`,`${hC}`,`${mC}`);var XG=Object.defineProperty,ZG=Object.getOwnPropertyDescriptor,I1=(e,t,n,r)=>{for(var o=r>1?void 0:r?ZG(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&XG(t,n,o),o},WP=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},Pt=(e,t,n)=>(WP(e,t,"read from private field"),n?n.call(e):t.get(e)),Qo=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Ki=(e,t,n,r)=>(WP(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Vu,Uu,Ml,Hu,hh,Wu,Ku,qu,Gu,mh=class{constructor(e){Qo(this,Vu,xg()),Qo(this,Uu,[]),Qo(this,Ml,new Map),Qo(this,Hu,[]),Qo(this,hh,!1),Qo(this,Wu,void 0),Qo(this,Ku,void 0),Qo(this,qu,void 0),Qo(this,Gu,void 0),this.addListener=(t,n)=>Pt(this,Vu).on(t,n),Ki(this,Wu,e),Ki(this,Ku,e.getActive),Ki(this,Gu,e.getPosition),Ki(this,qu,e.getID),this.hasChanged=e.hasChanged,this.events=e.events??["state","scroll"]}static create(e){return new mh(e)}static fromPositioner(e,t){return mh.create({...e.basePositioner,...t})}get basePositioner(){return{getActive:Pt(this,Ku),getPosition:Pt(this,Gu),hasChanged:this.hasChanged,events:this.events,getID:Pt(this,qu)}}onActiveChanged(e){this.recentUpdate=e;const t=Pt(this,Ku).call(this,e);Ki(this,Uu,t),Ki(this,Ml,new Map),Ki(this,hh,!1),Ki(this,Hu,[]);const n=[];for(const[r,o]of t.entries()){const i=this.getID(o,r);Pt(this,Hu).push(i),n.push({setElement:s=>this.addProps({...e,data:o,element:s},r),id:i,data:o})}Pt(this,Vu).emit("update",n)}getID(e,t){var n;return((n=Pt(this,qu))==null?void 0:n.call(this,e,t))??t.toString()}addProps(e,t){if(Pt(this,hh)||(Pt(this,Ml).set(t,e),Pt(this,Ml).size<Pt(this,Uu).length))return;const n=[];for(const r of Pt(this,Uu).keys()){const o=Pt(this,Ml).get(r);he(o,{code:K.INTERNAL,message:"Something went wrong when retrieving the parameters"});const i=Pt(this,Hu)[r];if(!i)return;n.push({position:Pt(this,Gu).call(this,o),element:o.element,id:i})}Pt(this,Vu).emit("done",n)}clone(e){return mh.create({...Pt(this,Wu),...nt(e)?e(Pt(this,Wu)):e})}active(e){const t=nt(e)?e:()=>e;return this.clone(n=>({getActive:r=>n.getActive(r).filter(t)}))}},fo=mh;Vu=new WeakMap;Uu=new WeakMap;Ml=new WeakMap;Hu=new WeakMap;hh=new WeakMap;Wu=new WeakMap;Ku=new WeakMap;qu=new WeakMap;Gu=new WeakMap;fo.EMPTY=[];function JG(e,t=YP){const{key:n}=(e==null?void 0:e.getMeta(GP))??{};return n===t}function KP(e){const{tr:t,state:n,previousState:r}=e;return!r||t&&JG(t)?!0:t?Qz(t):!n.doc.eq(r.doc)||!n.selection.eq(r.selection)}function qP(e,t,n={}){const r=t.getBoundingClientRect(),{accountForPadding:o=!1}=n;let i=0,s=0,a=0,l=0;if(Vo(t)&&o){const u=Number.parseFloat(Wi(t,"padding-left").replace("px","")),d=Number.parseFloat(Wi(t,"padding-right").replace("px","")),f=Number.parseFloat(Wi(t,"padding-top").replace("px","")),h=Number.parseFloat(Wi(t,"padding-bottom").replace("px","")),m=Number.parseFloat(Wi(t,"border-left").replace("px","")),g=Number.parseFloat(Wi(t,"border-right").replace("px","")),b=Number.parseFloat(Wi(t,"border-top").replace("px","")),y=Number.parseFloat(Wi(t,"border-bottom").replace("px","")),v=t.offsetWidth-t.clientWidth,w=t.offsetHeight-t.clientHeight;i+=u+m+(t.dir==="rtl"?v:0),s+=d+g+(t.dir==="rtl"?0:v),a+=f+b,l+=h+y+w}const c=new DOMRect(r.left+i,r.top+a,r.width-s,r.height-l);for(const[u,d]of[[e.top,e.left],[e.top,e.right],[e.bottom,e.left],[e.bottom,e.right]])if(Bk(u,c.top,c.bottom)&&Bk(d,c.left,c.right))return!0;return!1}var QG="remirror-positioner-widget",GP="positionerUpdate",YP="__all_positioners__",XP={y:-999999,x:-999999,width:0,height:0},gC={...XP,left:-999999,top:-999999,bottom:-999999,right:-999999},eY={...XP,rect:{...gC,toJSON:()=>gC},visible:!1},tY=fo.create({hasChanged:KP,getActive(e){const{state:t}=e;if(!b1(t)||t.selection.$anchor.depth>2)return fo.EMPTY;const n=Og({predicate:r=>r.type.isBlock,selection:t});return n?[n]:fo.EMPTY},getPosition(e){const{view:t,data:n}=e,r=t.nodeDOM(n.pos);if(!Vo(r))return eY;const o=r.getBoundingClientRect(),i=t.dom.getBoundingClientRect(),s=o.height,a=o.width,l=t.dom.scrollLeft+o.left-i.left,c=t.dom.scrollTop+o.top-i.top,u=qP(o,t.dom);return{y:c,x:l,height:s,width:a,rect:o,visible:u}}}),ZP=tY.clone(({getActive:e})=>({getActive:t=>{const[n]=e(t);return n&&E1(n.node)&&n.node.type===Rg(t.state.schema)?[n]:fo.EMPTY}}));ZP.clone(({getPosition:e})=>({getPosition:t=>({...e(t),width:1})}));ZP.clone(({getPosition:e})=>({getPosition:t=>{const{width:n,x:r,y:o,height:i}=e(t);return{...e(t),width:1,x:n+r,rect:new DOMRect(n+r,o,1,i)}}}));function L1(e){return fo.create({hasChanged:KP,getActive:t=>{const{state:n,view:r}=t;if(!e(n)||!tl(n.selection))return fo.EMPTY;try{const{head:o,anchor:i}=n.selection;return[{from:r.coordsAtPos(i),to:r.coordsAtPos(o)}]}catch{return fo.EMPTY}},getPosition(t){const{element:n,data:r,view:o}=t,{from:i,to:s}=r,a=n.offsetParent??o.dom,l=a.getBoundingClientRect(),c=Math.abs(s.bottom-i.top),u=c>i.bottom-i.top,d=Math.min(i.left,s.left),f=Math.min(i.top,s.top),h=a.scrollLeft+(u?s.left-l.left:d-l.left),m=a.scrollTop+f-l.top,g=u?1:Math.abs(i.left-s.right),b=new DOMRect(u?s.left:d,f,g,c),y=qP(b,o.dom);return{rect:b,y:m,x:h,height:c,width:g,visible:y}}})}var nY=L1(e=>!e.selection.empty);L1(e=>e.selection.empty);L1(()=>!0);nY.clone(()=>({getActive:e=>{const{state:t,view:n}=e;if(!t.selection.empty)return fo.EMPTY;const r=lP(t);if(!r)return fo.EMPTY;try{return[{from:n.coordsAtPos(r.from),to:n.coordsAtPos(r.to)}]}catch{return fo.EMPTY}}}));var lf=class extends ft{constructor(){super(...arguments),this.positioners=[],this.onAddCustomHandler=({positioner:e})=>{if(e)return this.positioners=[...this.positioners,e],this.store.commands.forceUpdate(),()=>{this.positioners=this.positioners.filter(t=>t!==e)}}}get name(){return"positioner"}createAttributes(){return{class:UG.EDITOR}}init(){this.onScroll=n7(this.options.scrollDebounce,this.onScroll.bind(this))}createEventHandlers(){return{scroll:()=>(this.onScroll(),!1),hover:(e,t)=>(this.positioner(this.getBaseProps("hover",{hover:t})),!1),contextmenu:(e,t)=>(this.positioner(this.getBaseProps("contextmenu",{contextmenu:t})),!1)}}onStateUpdate(e){this.positioner({...e,previousState:e.firstUpdate?void 0:e.previousState,event:"state",helpers:this.store.helpers})}createDecorations(e){if(this.element??(this.element=this.createElement()),!this.element.hasChildNodes())return qe.empty;const t=dt.widget(0,this.element,{key:"positioner-widget",side:-1,stopEvent:()=>!0});return qe.create(e.doc,[t])}forceUpdatePositioners(e=YP){return({tr:t,dispatch:n})=>(n==null||n(t.setMeta(GP,{key:e})),!0)}getPositionerWidget(){return this.element??(this.element=this.createElement())}createElement(){const e=document.createElement("span");return e.dataset.id=QG,e.setAttribute("role","presentation"),e}triggerPositioner(e,t){e.hasChanged(t)&&e.onActiveChanged({...t,view:this.store.view})}positioner(e){for(const t of this.positioners)t.events.includes(e.event)&&this.triggerPositioner(t,e)}getBaseProps(e,t){const n=this.store.getState(),r=this.store.previousState;return{helpers:this.store.helpers,event:e,firstUpdate:!1,previousState:r,state:n,...t}}onScroll(){this.positioner(this.getBaseProps("scroll",{scroll:{scrollTop:this.store.view.dom.scrollTop}}))}};I1([ie()],lf.prototype,"forceUpdatePositioners",1);I1([St()],lf.prototype,"getPositionerWidget",1);lf=I1([He({defaultOptions:{scrollDebounce:100},customHandlerKeys:["positioner"],staticKeys:["scrollDebounce"]})],lf);var rY=Object.defineProperty,oY=Object.getOwnPropertyDescriptor,iY=(e,t,n,r)=>{for(var o=r>1?void 0:r?oY(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&rY(t,n,o),o},kx=class extends zr{get name(){return"text"}createTags(){return[Me.InlineNode]}createNodeSpec(){return{}}};kx=iY([He({disableExtraAttributes:!0,defaultPriority:Je.Medium})],kx);var sY={...Cc.defaultOptions,...Wa.defaultOptions,...Uo.defaultOptions,excludeExtensions:[]};function aY(e={}){e={...sY,...e};const{content:t,depth:n,getDispatch:r,getState:o,newGroupDelay:i,excludeExtensions:s}=e,a={};for(const c of s??[])a[c]=!0;const l=[];if(!a.history){const c=new Uo({depth:n,getDispatch:r,getState:o,newGroupDelay:i});l.push(c)}return a.doc||l.push(new Cc({content:t})),a.text||l.push(new kx),a.paragraph||l.push(new Wa),a.positioner||l.push(new lf),a.gapCursor||l.push(new wx),a.events||l.push(new Om),l}var lY=Object.defineProperty,cY=Object.getOwnPropertyDescriptor,uY=(e,t,n,r)=>{for(var o=r>1?void 0:r?cY(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&lY(t,n,o),o},Ka=class extends ft{get name(){return"placeholder"}createAttributes(){return{"aria-placeholder":this.options.placeholder}}createPlugin(){return{state:{init:(e,t)=>({...this.options,empty:k1(t.doc,{ignoreAttributes:!0})}),apply:(e,t,n,r)=>dY({pluginState:t,tr:e,extension:this,state:r})},props:{decorations:e=>fY({state:e,extension:this})}}}onSetOptions(e){const{changes:t}=e;t.placeholder.changed&&this.store.phase>=In.EditorView&&this.store.updateAttributes()}};Ka=uY([He({defaultOptions:{emptyNodeClass:zG.IS_EMPTY,placeholder:""}})],Ka);function dY(e){const{pluginState:t,extension:n,tr:r,state:o}=e;return r.docChanged?{...n.options,empty:k1(o.doc)}:t}function fY(e){const{extension:t,state:n}=e,{empty:r}=t.pluginKey.getState(n),{emptyNodeClass:o,placeholder:i}=t.options;if(!r)return null;const s=[];return n.doc.descendants((a,l)=>{const c=dt.node(l,l+a.nodeSize,{class:o,"data-placeholder":i});s.push(c)}),qe.create(n.doc,s)}var pY=Object.defineProperty,hY=Object.getOwnPropertyDescriptor,mY=(e,t,n,r)=>{for(var o=r>1?void 0:r?hY(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&pY(t,n,o),o},gY={...Ka.defaultOptions,...of.defaultOptions},vY=[...Ka.staticKeys,...of.staticKeys],cf=class extends ft{get name(){return"react"}onSetOptions(e){const{pickChanged:t}=e;this.getExtension(Ka).setOptions(t(["placeholder"]))}createExtensions(){const{emptyNodeClass:e,placeholder:t,defaultBlockNode:n,defaultContentNode:r,defaultEnvironment:o,defaultInlineNode:i,nodeViewComponents:s}=this.options;return[new Ka({emptyNodeClass:e,placeholder:t,priority:Je.Low}),new of({defaultBlockNode:n,defaultContentNode:r,defaultEnvironment:o,defaultInlineNode:i,nodeViewComponents:s})]}};cf=mY([He({defaultOptions:gY,staticKeys:vY})],cf);var JP={};Object.defineProperty(JP,"__esModule",{value:!0});function yY(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===2)return yC(e[0],e[1])||null;var n=e.slice(1).reduce(function(r,o){return yC(r,o)},e[0]);return n||null}var hu=JP.default=yY,vC=new WeakMap;function yC(e,t){if(e&&t){var n=vC.get(e)||new WeakMap;vC.set(e,n);var r=n.get(t)||function(o){xC(e,o),xC(t,o)};return n.set(t,r),r}return e||t}function xC(e,t){typeof e=="function"?e(t):e.current=t}var QP=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},uy=(e,t,n)=>(QP(e,t,"read from private field"),n?n.call(e):t.get(e)),xY=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},bY=(e,t,n,r)=>(QP(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);function wY(){const[,e]=p.useState(ce());return p.useCallback(()=>{e(ce())},[])}var eN=p.createContext(null);function Fc(e){const t=p.useContext(eN),n=p.useRef(wY());he(t,{code:K.REACT_PROVIDER_CONTEXT});const{addHandler:r}=t;return p.useEffect(()=>{let o=e;if(o){if(el(o)){const{autoUpdate:i}=o;o=i?()=>n.current():void 0}if(nt(o))return r("updated",o)}},[r,e]),t}function SY(e=!0){return Fc({autoUpdate:e}).active}function kY(e=!1){return Fc(e?{autoUpdate:!0}:void 0).attrs}function tN(){return Fc().chain.new()}function EY(e,t=void 0,n){const{getExtension:r}=Fc(),o=p.useMemo(()=>r(e),[e,r]);let i;if(nt(t)?i=n?[o,...n]:[o,t]:i=t?[o,...Object.values(t)]:[],p.useEffect(()=>{nt(t)||!t||o.setOptions(t)},i),p.useEffect(()=>{if(nt(t))return t({addHandler:o.addHandler.bind(o),addCustomHandler:o.addCustomHandler.bind(o),extension:o})},i),!t)return o}function CY(e,t,n){const r=p.useCallback(({addHandler:o})=>o(t,n),[n,t]);return EY(e,r)}function _Y(e){CY(Em,"docChanged",e)}function OY(e=!1){return Fc(e?{autoUpdate:!0}:void 0).helpers}var[TY,qle]=bV(({props:e})=>{const t=e.locale??"en",n=e.i18n??Ag,r=e.supportedLocales??[t],o=n._.bind(n);return{locale:t,i18n:n,supportedLocales:r,t:o}});function bC(e,t={}){const{core:n,react:r,...o}=t;return lV(e)?e:aV.create(()=>[...AM(e),new cf(r),...aY(n)],o)}function MY(e,t={}){const n=p.useRef(e),r=p.useRef(t),[o,i]=p.useState(()=>bC(e,t));return n.current=e,r.current=t,p.useEffect(()=>o.addHandler("destroy",()=>{i(()=>bC(n.current,r.current))}),[o]),o}var RY=typeof hu=="object"&&hu.__esModule&&hu.default?hu.default:hu,Rl,PY=class extends nV{constructor(e){if(super(e),xY(this,Rl,void 0),this.rootPropsConfig={called:!1,count:0},this.getRootProps=t=>this.internalGetRootProps(t,null),this.internalGetRootProps=(t,n)=>{this.rootPropsConfig.called=!0;const{refKey:r="ref",ref:o,...i}=t??ce();return{[r]:RY(o,this.onRef),key:this.uid,...i,children:n}},this.onRef=t=>{t&&(this.rootPropsConfig.count+=1,he(this.rootPropsConfig.count<=1,{code:K.REACT_GET_ROOT_PROPS,message:`Called ${this.rootPropsConfig.count} times`}),bY(this,Rl,t),this.onRefLoad())},this.manager.view){this.manager.view.setProps({state:this.manager.view.state,dispatchTransaction:this.dispatchTransaction,attributes:()=>this.getAttributes(),editable:()=>this.props.editable??!0});return}this.manager.getExtension(Ka).setOptions({placeholder:this.props.placeholder??""})}get name(){return"react"}update(e){return super.update(e),this}createView(e){return new bz(null,{state:e,dispatchTransaction:this.dispatchTransaction,attributes:()=>this.getAttributes(),editable:()=>this.props.editable??!0,plugins:[]})}updateState({state:e,...t}){const{triggerChange:n=!0,tr:r,transactions:o}=t;if(this.props.state){const{onChange:i}=this.props;he(i,{code:K.REACT_CONTROLLED,message:"You are required to provide the `onChange` handler when creating a controlled editor."}),he(n,{code:K.REACT_CONTROLLED,message:"Controlled editors do not support `clearContent` or `setContent` where `triggerChange` is `true`. Update the `state` prop instead."}),this.previousStateOverride||(this.previousStateOverride=this.getState()),this.onChange({state:e,tr:r,transactions:o});return}!r&&!o&&(e=e.apply(e.tr.setMeta(Ik,{}))),this.view.updateState(e),n&&(o==null?void 0:o.length)!==0&&this.onChange({state:e,tr:r,transactions:o}),this.manager.onStateUpdate({previousState:this.previousState,state:e,tr:r,transactions:o})}updateControlledState(e,t){this.previousStateOverride=t,e=e.apply(e.tr.setMeta(Ik,{})),this.view.updateState(e),this.manager.onStateUpdate({previousState:this.previousState,state:e}),this.previousStateOverride=void 0}addProsemirrorViewToDom(e,t){this.props.insertPosition==="start"?e.insertBefore(t,e.firstChild):e.append(t)}onRefLoad(){he(uy(this,Rl),{code:K.REACT_EDITOR_VIEW,message:"Something went wrong when initializing the text editor. Please check your setup."});const{autoFocus:e}=this.props;this.addProsemirrorViewToDom(uy(this,Rl),this.view.dom),e&&this.focus(e),this.onChange(),this.addFocusListeners()}onUpdate(){this.view&&uy(this,Rl)&&this.view.setProps({...this.view.props,editable:()=>this.props.editable??!0})}get frameworkOutput(){return{...this.baseOutput,getRootProps:this.getRootProps,portalContainer:this.manager.store.portalContainer}}resetRender(){this.rootPropsConfig.called=!1,this.rootPropsConfig.count=0}};Rl=new WeakMap;var nN=typeof document<"u"?p.useLayoutEffect:p.useEffect;function NY(e){const t=p.useRef();return nN(()=>{t.current=e}),t.current}function $Y(e){const{manager:t,state:n}=e,{placeholder:r,editable:o}=e;p.useRef(!0).current&&!js(r)&&t.getExtension(cf).setOptions({placeholder:r}),p.useEffect(()=>{r!=null&&t.getExtension(cf).setOptions({placeholder:r})},[r,t]);const[s]=p.useState(()=>{if(n)return n;const l=t.createEmptyDoc(),[c,u]=zt(e.initialContent)?e.initialContent:[e.initialContent??l];return t.createState({content:c,selection:u})}),a=DY({initialEditorState:s,getProps:()=>e});return p.useEffect(()=>()=>{a.destroy()},[a]),p.useEffect(()=>{a.onUpdate()},[o,a]),AY(a),a.frameworkOutput}function DY(e){const t=p.useRef(e);t.current=e;const n=p.useMemo(()=>new PY(t.current),[]);return n.update(e),n}function AY(e){const{state:t}=e.props,n=p.useRef(!!t),r=NY(t);nN(()=>{const o=t?n.current===!0:n.current===!1;he(o,{code:K.REACT_CONTROLLED,message:n.current?"You have attempted to switch from a controlled to an uncontrolled editor. Once you set up an editor as a controlled editor it must always provide a `state` prop.":"You have provided a `state` prop to an uncontrolled editor. In order to set up your editor as controlled you must provide the `state` prop from the very first render."}),!(!t||t===r)&&e.updateControlledState(t,r??void 0)},[t,r,e])}function IY(e={}){const{content:t,document:n,selection:r,extensions:o,...i}=e,s=MY(o??(()=>[]),i),[a,l]=p.useState(()=>s.createState({selection:r,content:t??s.createEmptyDoc()})),c=p.useCallback(({state:d})=>{l(d)},[]),u=p.useCallback(()=>s.output,[s]);return p.useMemo(()=>({state:a,setState:l,manager:s,onChange:c,getContext:u}),[u,s,c,a])}var LY=({onChange:e})=>{const{getJSON:t}=OY();return _Y(p.useCallback(({state:n})=>{const r=t(n);e(r)},[e,t])),null},Ex=()=>H.createElement("div",{className:OG.EDITOR_WRAPPER,...Fc().getRootProps()}),jY=e=>(e.hook(),null);function zY(e){const{children:t,autoRender:n,i18n:r,locale:o,supportedLocales:i,hooks:s=[],...a}=e,l=$Y(a),c=hV(l.portalContainer),u=n==="start"||n===!0||!t&&js(n),d=n==="end";return H.createElement(TY,{i18n:r,locale:o,supportedLocales:i},H.createElement(eN.Provider,{value:l},H.createElement(pV,{portals:c}),s.map((f,h)=>H.createElement(jY,{hook:f,key:h})),u&&H.createElement(Ex,null),t,d&&H.createElement(Ex,null)))}var rN={exports:{}},FY="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",BY=FY,VY=BY;function oN(){}function iN(){}iN.resetWarningCache=oN;var UY=function(){function e(r,o,i,s,a,l){if(l!==VY){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:iN,resetWarningCache:oN};return n.PropTypes=n,n};rN.exports=UY();var jg=rN.exports;const HY=["top","right","bottom","left"],Us=Math.min,rr=Math.max,Rm=Math.round,Rp=Math.floor,Hs=e=>({x:e,y:e}),WY={left:"right",right:"left",bottom:"top",top:"bottom"},KY={start:"end",end:"start"};function Cx(e,t,n){return rr(e,Us(t,n))}function Oi(e,t){return typeof e=="function"?e(t):e}function Ti(e){return e.split("-")[0]}function Bc(e){return e.split("-")[1]}function j1(e){return e==="x"?"y":"x"}function z1(e){return e==="y"?"height":"width"}function Vc(e){return["top","bottom"].includes(Ti(e))?"y":"x"}function F1(e){return j1(Vc(e))}function qY(e,t,n){n===void 0&&(n=!1);const r=Bc(e),o=F1(e),i=z1(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Pm(s)),[s,Pm(s)]}function GY(e){const t=Pm(e);return[_x(e),t,_x(t)]}function _x(e){return e.replace(/start|end/g,t=>KY[t])}function YY(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}function XY(e,t,n,r){const o=Bc(e);let i=YY(Ti(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(_x)))),i}function Pm(e){return e.replace(/left|right|bottom|top/g,t=>WY[t])}function ZY(e){return{top:0,right:0,bottom:0,left:0,...e}}function sN(e){return typeof e!="number"?ZY(e):{top:e,right:e,bottom:e,left:e}}function Nm(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function wC(e,t,n){let{reference:r,floating:o}=e;const i=Vc(t),s=F1(t),a=z1(s),l=Ti(t),c=i==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let h;switch(l){case"top":h={x:u,y:r.y-o.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(Bc(t)){case"start":h[s]-=f*(n&&c?-1:1);break;case"end":h[s]+=f*(n&&c?-1:1);break}return h}const JY=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=wC(c,r,l),f=r,h={},m=0;for(let g=0;g<a.length;g++){const{name:b,fn:y}=a[g],{x:v,y:w,data:S,reset:k}=await y({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:h,rects:c,platform:s,elements:{reference:e,floating:t}});if(u=v??u,d=w??d,h={...h,[b]:{...h[b],...S}},k&&m<=50){m++,typeof k=="object"&&(k.placement&&(f=k.placement),k.rects&&(c=k.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):k.rects),{x:u,y:d}=wC(c,f,l)),g=-1;continue}}return{x:u,y:d,placement:f,strategy:o,middlewareData:h}};async function uf(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=Oi(t,e),m=sN(h),b=a[f?d==="floating"?"reference":"floating":d],y=Nm(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(b)))==null||n?b:b.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),v=d==="floating"?{...s.floating,x:r,y:o}:s.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),S=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},k=Nm(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:v,offsetParent:w,strategy:l}):v);return{top:(y.top-k.top+m.top)/S.y,bottom:(k.bottom-y.bottom+m.bottom)/S.y,left:(y.left-k.left+m.left)/S.x,right:(k.right-y.right+m.right)/S.x}}const QY=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=Oi(e,t)||{};if(c==null)return{};const d=sN(u),f={x:n,y:r},h=F1(o),m=z1(h),g=await s.getDimensions(c),b=h==="y",y=b?"top":"left",v=b?"bottom":"right",w=b?"clientHeight":"clientWidth",S=i.reference[m]+i.reference[h]-f[h]-i.floating[m],k=f[h]-i.reference[h],C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let E=C?C[w]:0;(!E||!await(s.isElement==null?void 0:s.isElement(C)))&&(E=a.floating[w]||i.floating[m]);const T=S/2-k/2,R=E/2-g[m]/2-1,$=Us(d[y],R),j=Us(d[v],R),z=$,ee=E-g[m]-j,V=E/2-g[m]/2+T,U=Cx(z,V,ee),O=!l.arrow&&Bc(o)!=null&&V!=U&&i.reference[m]/2-(V<z?$:j)-g[m]/2<0,M=O?V<z?V-z:V-ee:0;return{[h]:f[h]+M,data:{[h]:U,centerOffset:V-U-M,...O&&{alignmentOffset:M}},reset:O}}}),eX=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...b}=Oi(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const y=Ti(o),v=Ti(a)===a,w=await(l.isRTL==null?void 0:l.isRTL(c.floating)),S=f||(v||!g?[Pm(a)]:GY(a));!f&&m!=="none"&&S.push(...XY(a,g,m,w));const k=[a,...S],C=await uf(t,b),E=[];let T=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&E.push(C[y]),d){const z=qY(o,s,w);E.push(C[z[0]],C[z[1]])}if(T=[...T,{placement:o,overflows:E}],!E.every(z=>z<=0)){var R,$;const z=(((R=i.flip)==null?void 0:R.index)||0)+1,ee=k[z];if(ee)return{data:{index:z,overflows:T},reset:{placement:ee}};let V=($=T.filter(U=>U.overflows[0]<=0).sort((U,O)=>U.overflows[1]-O.overflows[1])[0])==null?void 0:$.placement;if(!V)switch(h){case"bestFit":{var j;const U=(j=T.map(O=>[O.placement,O.overflows.filter(M=>M>0).reduce((M,_)=>M+_,0)]).sort((O,M)=>O[1]-M[1])[0])==null?void 0:j[0];U&&(V=U);break}case"initialPlacement":V=a;break}if(o!==V)return{reset:{placement:V}}}return{}}}};function SC(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function kC(e){return HY.some(t=>e[t]>=0)}const tX=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Oi(e,t);switch(r){case"referenceHidden":{const i=await uf(t,{...o,elementContext:"reference"}),s=SC(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:kC(s)}}}case"escaped":{const i=await uf(t,{...o,altBoundary:!0}),s=SC(i,n.floating);return{data:{escapedOffsets:s,escaped:kC(s)}}}default:return{}}}}};async function nX(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Ti(n),a=Bc(n),l=Vc(n)==="y",c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=Oi(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&typeof m=="number"&&(h=a==="end"?m*-1:m),l?{x:h*u,y:f*c}:{x:f*c,y:h*u}}const rX=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await nX(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},oX=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:b=>{let{x:y,y:v}=b;return{x:y,y:v}}},...l}=Oi(e,t),c={x:n,y:r},u=await uf(t,l),d=Vc(Ti(o)),f=j1(d);let h=c[f],m=c[d];if(i){const b=f==="y"?"top":"left",y=f==="y"?"bottom":"right",v=h+u[b],w=h-u[y];h=Cx(v,h,w)}if(s){const b=d==="y"?"top":"left",y=d==="y"?"bottom":"right",v=m+u[b],w=m-u[y];m=Cx(v,m,w)}const g=a.fn({...t,[f]:h,[d]:m});return{...g,data:{x:g.x-n,y:g.y-r}}}}},iX=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=Oi(e,t),u={x:n,y:r},d=Vc(o),f=j1(d);let h=u[f],m=u[d];const g=Oi(a,t),b=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const w=f==="y"?"height":"width",S=i.reference[f]-i.floating[w]+b.mainAxis,k=i.reference[f]+i.reference[w]-b.mainAxis;h<S?h=S:h>k&&(h=k)}if(c){var y,v;const w=f==="y"?"width":"height",S=["top","left"].includes(Ti(o)),k=i.reference[d]-i.floating[w]+(S&&((y=s.offset)==null?void 0:y[d])||0)+(S?0:b.crossAxis),C=i.reference[d]+i.reference[w]+(S?0:((v=s.offset)==null?void 0:v[d])||0)-(S?b.crossAxis:0);m<k?m=k:m>C&&(m=C)}return{[f]:h,[d]:m}}}},sX=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:s=()=>{},...a}=Oi(e,t),l=await uf(t,a),c=Ti(n),u=Bc(n),d=Vc(n)==="y",{width:f,height:h}=r.floating;let m,g;c==="top"||c==="bottom"?(m=c,g=u===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(g=c,m=u==="end"?"top":"bottom");const b=h-l[m],y=f-l[g],v=!t.middlewareData.shift;let w=b,S=y;if(d){const C=f-l.left-l.right;S=u||v?Us(y,C):C}else{const C=h-l.top-l.bottom;w=u||v?Us(b,C):C}if(v&&!u){const C=rr(l.left,0),E=rr(l.right,0),T=rr(l.top,0),R=rr(l.bottom,0);d?S=f-2*(C!==0||E!==0?C+E:rr(l.left,l.right)):w=h-2*(T!==0||R!==0?T+R:rr(l.top,l.bottom))}await s({...t,availableWidth:S,availableHeight:w});const k=await o.getDimensions(i.floating);return f!==k.width||h!==k.height?{reset:{rects:!0}}:{}}}};function Ws(e){return aN(e)?(e.nodeName||"").toLowerCase():"#document"}function ar(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ai(e){var t;return(t=(aN(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function aN(e){return e instanceof Node||e instanceof ar(e).Node}function Mi(e){return e instanceof Element||e instanceof ar(e).Element}function Ho(e){return e instanceof HTMLElement||e instanceof ar(e).HTMLElement}function EC(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ar(e).ShadowRoot}function Hf(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ir(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function aX(e){return["table","td","th"].includes(Ws(e))}function B1(e){const t=V1(),n=Ir(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function lX(e){let t=_c(e);for(;Ho(t)&&!zg(t);){if(B1(t))return t;t=_c(t)}return null}function V1(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function zg(e){return["html","body","#document"].includes(Ws(e))}function Ir(e){return ar(e).getComputedStyle(e)}function Fg(e){return Mi(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function _c(e){if(Ws(e)==="html")return e;const t=e.assignedSlot||e.parentNode||EC(e)&&e.host||Ai(e);return EC(t)?t.host:t}function lN(e){const t=_c(e);return zg(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ho(t)&&Hf(t)?t:lN(t)}function df(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=lN(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=ar(o);return i?t.concat(s,s.visualViewport||[],Hf(o)?o:[],s.frameElement&&n?df(s.frameElement):[]):t.concat(o,df(o,[],n))}function cN(e){const t=Ir(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ho(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Rm(n)!==i||Rm(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function U1(e){return Mi(e)?e:e.contextElement}function ic(e){const t=U1(e);if(!Ho(t))return Hs(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=cN(t);let s=(i?Rm(n.width):n.width)/r,a=(i?Rm(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const cX=Hs(0);function uN(e){const t=ar(e);return!V1()||!t.visualViewport?cX:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function uX(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ar(e)?!1:t}function qa(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=U1(e);let s=Hs(1);t&&(r?Mi(r)&&(s=ic(r)):s=ic(e));const a=uX(i,n,r)?uN(i):Hs(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const f=ar(i),h=r&&Mi(r)?ar(r):r;let m=f.frameElement;for(;m&&r&&h!==f;){const g=ic(m),b=m.getBoundingClientRect(),y=Ir(m),v=b.left+(m.clientLeft+parseFloat(y.paddingLeft))*g.x,w=b.top+(m.clientTop+parseFloat(y.paddingTop))*g.y;l*=g.x,c*=g.y,u*=g.x,d*=g.y,l+=v,c+=w,m=ar(m).frameElement}}return Nm({width:u,height:d,x:l,y:c})}function dX(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=Ho(n),i=Ai(n);if(n===i)return t;let s={scrollLeft:0,scrollTop:0},a=Hs(1);const l=Hs(0);if((o||!o&&r!=="fixed")&&((Ws(n)!=="body"||Hf(i))&&(s=Fg(n)),Ho(n))){const c=qa(n);a=ic(n),l.x=c.x+n.clientLeft,l.y=c.y+n.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-s.scrollLeft*a.x+l.x,y:t.y*a.y-s.scrollTop*a.y+l.y}}function fX(e){return Array.from(e.getClientRects())}function dN(e){return qa(Ai(e)).left+Fg(e).scrollLeft}function pX(e){const t=Ai(e),n=Fg(e),r=e.ownerDocument.body,o=rr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=rr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+dN(e);const a=-n.scrollTop;return Ir(r).direction==="rtl"&&(s+=rr(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function hX(e,t){const n=ar(e),r=Ai(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const c=V1();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}function mX(e,t){const n=qa(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Ho(e)?ic(e):Hs(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:s,height:a,x:l,y:c}}function CC(e,t,n){let r;if(t==="viewport")r=hX(e,n);else if(t==="document")r=pX(Ai(e));else if(Mi(t))r=mX(t,n);else{const o=uN(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return Nm(r)}function fN(e,t){const n=_c(e);return n===t||!Mi(n)||zg(n)?!1:Ir(n).position==="fixed"||fN(n,t)}function gX(e,t){const n=t.get(e);if(n)return n;let r=df(e,[],!1).filter(a=>Mi(a)&&Ws(a)!=="body"),o=null;const i=Ir(e).position==="fixed";let s=i?_c(e):e;for(;Mi(s)&&!zg(s);){const a=Ir(s),l=B1(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Hf(s)&&!l&&fN(e,s))?r=r.filter(u=>u!==s):o=a,s=_c(s)}return t.set(e,r),r}function vX(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?gX(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const d=CC(t,u,o);return c.top=rr(d.top,c.top),c.right=Us(d.right,c.right),c.bottom=Us(d.bottom,c.bottom),c.left=rr(d.left,c.left),c},CC(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function yX(e){const{width:t,height:n}=cN(e);return{width:t,height:n}}function xX(e,t,n){const r=Ho(t),o=Ai(t),i=n==="fixed",s=qa(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Hs(0);if(r||!r&&!i)if((Ws(t)!=="body"||Hf(o))&&(a=Fg(t)),r){const c=qa(t,!0,i,t);l.x=c.x+t.clientLeft,l.y=c.y+t.clientTop}else o&&(l.x=dN(o));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function _C(e,t){return!Ho(e)||Ir(e).position==="fixed"?null:t?t(e):e.offsetParent}function pN(e,t){const n=ar(e);if(!Ho(e))return n;let r=_C(e,t);for(;r&&aX(r)&&Ir(r).position==="static";)r=_C(r,t);return r&&(Ws(r)==="html"||Ws(r)==="body"&&Ir(r).position==="static"&&!B1(r))?n:r||lX(e)||n}const bX=async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||pN,i=this.getDimensions;return{reference:xX(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}};function wX(e){return Ir(e).direction==="rtl"}const SX={convertOffsetParentRelativeRectToViewportRelativeRect:dX,getDocumentElement:Ai,getClippingRect:vX,getOffsetParent:pN,getElementRects:bX,getClientRects:fX,getDimensions:yX,getScale:ic,isElement:Mi,isRTL:wX};function kX(e,t){let n=null,r;const o=Ai(e);function i(){clearTimeout(r),n&&n.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const{left:c,top:u,width:d,height:f}=e.getBoundingClientRect();if(a||t(),!d||!f)return;const h=Rp(u),m=Rp(o.clientWidth-(c+d)),g=Rp(o.clientHeight-(u+f)),b=Rp(c),v={rootMargin:-h+"px "+-m+"px "+-g+"px "+-b+"px",threshold:rr(0,Us(1,l))||1};let w=!0;function S(k){const C=k[0].intersectionRatio;if(C!==l){if(!w)return s();C?s(!1,C):r=setTimeout(()=>{s(!1,1e-7)},100)}w=!1}try{n=new IntersectionObserver(S,{...v,root:o.ownerDocument})}catch{n=new IntersectionObserver(S,v)}n.observe(e)}return s(!0),i}function EX(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=U1(e),u=o||i?[...c?df(c):[],...df(t)]:[];u.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const d=c&&a?kX(c,n):null;let f=-1,h=null;s&&(h=new ResizeObserver(y=>{let[v]=y;v&&v.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{h&&h.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let m,g=l?qa(e):null;l&&b();function b(){const y=qa(e);g&&(y.x!==g.x||y.y!==g.y||y.width!==g.width||y.height!==g.height)&&n(),g=y,m=requestAnimationFrame(b)}return n(),()=>{u.forEach(y=>{o&&y.removeEventListener("scroll",n),i&&y.removeEventListener("resize",n)}),d&&d(),h&&h.disconnect(),h=null,l&&cancelAnimationFrame(m)}}const CX=oX,_X=eX,OX=sX,TX=tX,OC=QY,MX=iX,RX=(e,t,n)=>{const r=new Map,o={platform:SX,...n},i={...o.platform,_c:r};return JY(e,t,{...o,platform:i})},PX=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?OC({element:r.current,padding:o}).fn(n):{}:r?OC({element:r,padding:o}).fn(n):{}}}};var gh=typeof document<"u"?p.useLayoutEffect:p.useEffect;function $m(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,o;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(!$m(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!$m(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function hN(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function TC(e,t){const n=hN(e);return Math.round(t*n)/n}function MC(e){const t=p.useRef(e);return gh(()=>{t.current=e}),t}function NX(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,d]=p.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,h]=p.useState(r);$m(f,r)||h(r);const[m,g]=p.useState(null),[b,y]=p.useState(null),v=p.useCallback(O=>{O!=C.current&&(C.current=O,g(O))},[g]),w=p.useCallback(O=>{O!==E.current&&(E.current=O,y(O))},[y]),S=i||m,k=s||b,C=p.useRef(null),E=p.useRef(null),T=p.useRef(u),R=MC(l),$=MC(o),j=p.useCallback(()=>{if(!C.current||!E.current)return;const O={placement:t,strategy:n,middleware:f};$.current&&(O.platform=$.current),RX(C.current,E.current,O).then(M=>{const _={...M,isPositioned:!0};z.current&&!$m(T.current,_)&&(T.current=_,At.flushSync(()=>{d(_)}))})},[f,t,n,$]);gh(()=>{c===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(O=>({...O,isPositioned:!1})))},[c]);const z=p.useRef(!1);gh(()=>(z.current=!0,()=>{z.current=!1}),[]),gh(()=>{if(S&&(C.current=S),k&&(E.current=k),S&&k){if(R.current)return R.current(S,k,j);j()}},[S,k,j,R]);const ee=p.useMemo(()=>({reference:C,floating:E,setReference:v,setFloating:w}),[v,w]),V=p.useMemo(()=>({reference:S,floating:k}),[S,k]),U=p.useMemo(()=>{const O={position:n,left:0,top:0};if(!V.floating)return O;const M=TC(V.floating,u.x),_=TC(V.floating,u.y);return a?{...O,transform:"translate("+M+"px, "+_+"px)",...hN(V.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:M,top:_}},[n,a,V.floating,u.x,u.y]);return p.useMemo(()=>({...u,update:j,refs:ee,elements:V,floatingStyles:U}),[u,j,ee,V,U])}function $X(e,t=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),a=!1,l=s;if(!s)return!1;if(s.depth>=2&&o.node(s.depth-1).type.compatibleContent(e)&&s.startIndex==0){if(o.index(s.depth-1)==0)return!1;let u=n.doc.resolve(s.start-2);l=new Ba(u,u,s.depth),s.endIndex<s.parent.childCount&&(s=new Ba(o,n.doc.resolve(i.end(s.depth)),s.depth)),a=!0}let c=r1(l,e,t,s);return c?(r&&r(DX(n.tr,s,c,a,e).scrollIntoView()),!0):!1}}function DX(e,t,n,r,o){let i=L.empty;for(let u=n.length-1;u>=0;u--)i=L.from(n[u].type.create(n[u].attrs,i));e.step(new Ot(t.start-(r?2:0),t.end,t.start,t.end,new Y(i,0,0),n.length,!0));let s=0;for(let u=0;u<n.length;u++)n[u].type==o&&(s=u+1);let a=n.length-s,l=t.start+n.length-(r?2:0),c=t.parent;for(let u=t.startIndex,d=t.endIndex,f=!0;u<d;u++,f=!1)!f&&tc(e.doc,l,a)&&(e.split(l,a),l+=2*a),l+=c.child(u).nodeSize;return e}function AX(e){return function(t,n){let{$from:r,$to:o}=t.selection,i=r.blockRange(o,s=>s.childCount>0&&s.firstChild.type==e);return i?n?r.node(i.depth-1).type==e?IX(t,n,e,i):LX(t,n,i):!0:!1}}function IX(e,t,n,r){let o=e.tr,i=r.end,s=r.$to.end(r.depth);i<s&&(o.step(new Ot(i-1,s,i,s,new Y(L.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Ba(o.doc.resolve(r.$from.pos),o.doc.resolve(s),r.depth));const a=Ac(r);if(a==null)return!1;o.lift(r,a);let l=o.mapping.map(i,-1)-1;return zf(o.doc,l)&&o.join(l),t(o.scrollIntoView()),!0}function LX(e,t,n){let r=e.tr,o=n.parent;for(let h=n.end,m=n.endIndex-1,g=n.startIndex;m>g;m--)h-=o.child(m).nodeSize,r.delete(h-1,h+1);let i=r.doc.resolve(n.start),s=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==o.childCount,c=i.node(-1),u=i.index(-1);if(!c.canReplace(u+(a?0:1),u+1,s.content.append(l?L.empty:L.from(o))))return!1;let d=i.pos,f=d+s.nodeSize;return r.step(new Ot(d-(a?1:0),f+(l?1:0),d+1,f-1,new Y((a?L.empty:L.from(o.copy(L.empty))).append(l?L.empty:L.from(o.copy(L.empty))),a?0:1,l?0:1),a?0:1)),t(r.scrollIntoView()),!0}var jX=Object.defineProperty,zX=Object.getOwnPropertyDescriptor,Fr=(e,t,n,r)=>{for(var o=r>1?void 0:r?zX(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&jX(t,n,o),o};function Ox(e){var t;return!!((t=e.spec.group)!=null&&t.includes(Me.ListContainerNode))}function FX(e){var t;return!!((t=e.spec.group)!=null&&t.includes(Me.ListItemNode))}function Ks(e){return Ox(e.type)}function Ns(e){return FX(e.type)}function H1(e,t){return n=>{const{dispatch:r,tr:o}=n,i=y1(o,n.state),{$from:s,$to:a}=o.selection,l=s.blockRange(a);if(!l)return!1;const c=Og({predicate:u=>Ox(u.type),selection:o.selection});if(c&&l.depth-c.depth<=1&&l.startIndex===0){if(c.node.type===e)return vN(t)(n);if(Ox(c.node.type))return e.validContent(c.node.content)?(r==null||r(o.setNodeMarkup(c.pos,e)),!0):BX(o,c,e,t)?(r==null||r(o.scrollIntoView()),!0):!1}return $X(e)(i,r)}}function mN(e,t=["checked"]){return function({tr:n,dispatch:r,state:o}){var i,s;const a=iF(e,o.schema),{$from:l,$to:c}=n.selection;if(Mg(n.selection)&&n.selection.node.isBlock||l.depth<2||!l.sameParent(c))return!1;const u=l.node(-1);if(u.type!==a)return!1;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(r){const g=l.index(-1)>0;let b=L.empty;for(let w=l.depth-(g?1:2);w>=l.depth-3;w--)b=L.from(l.node(w).copy(b));const y=((i=a.contentMatch.defaultType)==null?void 0:i.createAndFill())||void 0;b=b.append(L.from(a.createAndFill(null,y)||void 0));const v=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3;n.replace(l.before(g?void 0:-1),l.after(-v),new Y(b,g?3:2,2)),n.setSelection(n.selection.constructor.near(n.doc.resolve(l.pos+(g?3:2)))),r(n.scrollIntoView())}return!0}if(u.attrs.closed&&l.sameParent(c)&&c.pos===c.end()){if(r){const g=l.after(-1),b=((s=a.contentMatch.defaultType)==null?void 0:s.createAndFill())||void 0,y=a.createAndFill(null,b);y&&(n.insert(g,y),n.setSelection(Se.near(n.doc.resolve(g+1)))),n.delete(l.pos,c.pos),r(n.scrollIntoView())}return!0}const d=Object.fromEntries(Object.entries(u.attrs).filter(([g])=>!t.includes(g))),f=c.pos===l.end()?u.contentMatchAt(0).defaultType:null,h={...l.node().attrs};n.delete(l.pos,c.pos);const m=f?[{type:a,attrs:d},{type:f,attrs:h}]:[{type:a,attrs:d}];return tc(n.doc,l.pos,2)?(r&&r(n.split(l.pos,2,m).scrollIntoView()),!0):!1}}function BX(e,t,n,r){const o=t.node,i=e.doc.resolve(t.start),s=i.node(-1),a=i.index(-1);if(!s||!s.canReplace(a,a+1,L.from(n.create())))return!1;const l=[];for(let h=0;h<o.childCount;h++){const m=o.child(h);if(!r.validContent(m.content))return!1;const g=r.createChecked(null,m.content);l.push(g)}const c=n.createChecked(null,l),u=t.pos,d=u+o.nodeSize,f=e.selection.from;return e.replaceRangeWith(u,d,c),e.setSelection(e.selection.constructor.near(e.doc.resolve(f))),!0}function VX({listType:e,itemType:t,tr:n,range:r}){var o;const i=r.parent,s=n.doc.slice(r.start,r.end);if(i.type===e&&((o=s.content.firstChild)==null?void 0:o.type)===t)return!1;const a=[];for(let c=0;c<s.content.childCount;c++){const u=s.content.child(c);if(!t.validContent(u.content))return!1;const d=t.createChecked(null,u.content);a.push(d)}const l=e.createChecked(null,a);return n.replaceRange(r.start,r.end,new Y(L.from(l),0,0)),!0}function Oc({listType:e,itemType:t,tr:n}){const r=Dm(n.selection);if(!r)return!1;const o=r.startIndex===0,{from:i,to:s}=n.selection;return VX({listType:e,itemType:t,tr:n,range:r})?(n.setSelection(Se.between(n.doc.resolve(o?i:i+2),n.doc.resolve(o?s:s+2))),n.scrollIntoView(),!0):!1}function UX(e,t,n){const r=e.tr,o=n.parent,i=r.mapping.maps.length;for(let m=n.end,g=n.endIndex-1,b=n.startIndex;g>b;g--)m-=o.child(g).nodeSize,r.delete(m-1,m+1);const s=r.doc.resolve(n.start),a=s.nodeAfter;if(!a||r.mapping.slice(i).map(n.end)!==n.start+a.nodeSize)return!1;const l=n.startIndex===0,c=n.endIndex===o.childCount,u=s.node(-1),d=s.index(-1);if(!u.canReplace(d+(l?0:1),d+1,a.content.append(c?L.empty:L.from(o))))return!1;const f=s.pos,h=f+a.nodeSize;return r.step(new Ot(f-(l?1:0),h+(c?1:0),f+1,h-1,new Y((l?L.empty:L.from(o.copy(L.empty))).append(c?L.empty:L.from(o.copy(L.empty))),l?0:1,c?0:1),l?0:1)),t(r.scrollIntoView()),!0}function gN(e,t){const n=t||e.selection.$from;let r=[],o,i,s,a;for(let c=n.depth;c>=0;c--){if(i=n.node(c),o=n.index(c),s=i.maybeChild(o-1),a=i.maybeChild(o),s&&a&&s.type.name===a.type.name&&Ks(s)){const u=n.before(c+1);r.push(u)}if(o=n.indexAfter(c),s=i.maybeChild(o-1),a=i.maybeChild(o),s&&a&&s.type.name===a.type.name&&Ks(s)){const u=n.after(c+1);r.push(u)}}r=[...new Set(r)].sort((c,u)=>u-c);let l=!1;for(const c of r)zf(e.doc,c)&&(e.join(c),l=!0);return l}function vN(e){return t=>{const{dispatch:n,tr:r}=t,o=y1(r,t.state),i=HX(e,r.selection);return i?(n&&UX(o,n,i),!0):!1}}function HX(e,t){const{$from:n,$to:r}=t;return n.blockRange(r,i=>{var s;return((s=i.firstChild)==null?void 0:s.type)===e})}function Dm(e){const{$from:t,$to:n}=e;return t.blockRange(n,Ks)}function WX(e){const t=e.selection.$from,n=t.blockRange();if(!n||!Ns(n.parent)||n.startIndex!==0)return!1;const r=t.node(n.depth-2),o=t.index(n.depth),i=t.index(n.depth-1),s=t.index(n.depth-2),a=r.maybeChild(s-1),l=a==null?void 0:a.lastChild;if(o!==0||i!==0)return!1;if(a&&Ks(a)&&l&&Ns(l))return Oc({listType:a.type,itemType:l.type,tr:e});if(Ns(r)){const c=r,u=t.node(n.depth-3);if(Ks(u))return Oc({listType:u.type,itemType:c.type,tr:e})}return!1}function RC({view:e}){if(!e)return!1;{const t=e.state.selection.$cursor;if(!t||t.parentOffset>0)return!1;const n=t.blockRange();if(!n||!Ns(n.parent)||n.startIndex!==0)return!1}{const t=e.state.tr;WX(t)&&e.dispatch(t)}{const t=e.state.selection.$cursor;if(!t||t.parentOffset>0)return!1;const n=t.blockRange();if(!n||!Ns(n.parent)||n.startIndex!==0)return!1;const r=t.index(n.depth),o=t.index(n.depth-1),i=t.index(n.depth-2),s=n.depth-2>=1&&Ns(t.node(n.depth-2));r===0&&o===0&&i<=1&&s&&AX(n.parent.type)(e.state,e.dispatch)}return yP(e.state,e.dispatch,e),!0}function yN({node:e,mark:t,updateDOM:n,updateMark:r}){const o=document.createElement("label");o.contentEditable="false",o.classList.add(Vs.LIST_ITEM_MARKER_CONTAINER),o.append(t);const i=document.createElement("div"),s=document.createElement("li");s.classList.add(Vs.LIST_ITEM_WITH_CUSTOM_MARKER),s.append(o),s.append(i);const a=l=>l.type!==e.type?!1:(e=l,n(e,s),r(e,t),!0);return a(e),{dom:s,contentDOM:i,update:a}}function KX(e,t){const n=e.node(t.depth-1),r=e.node(t.depth-2);return!Ns(n)||!Ks(r)?!1:{parentItem:n,parentList:r}}function qX(e,t){const n=t.parent,r=t.parent.child(t.endIndex-1),o=t.end,i=t.$to.end(t.depth);return o<i?(e.step(new Ot(o-1,i,o,i,new Y(L.from(r.type.create(null,n.copy())),1,0),1,!0)),new Ba(e.doc.resolve(t.$from.pos),e.doc.resolve(i),t.depth)):t}function GX(e,t){const n=t.parent,r=t.parent.child(t.endIndex-1),o=t.end,i=t.$to.end(t.depth-1);return o+1<i?(e.step(new Ot(o-1,i,o+1,i,new Y(L.from(n.type.create(null,r.type.create(null))),2,0),0,!0)),new Ba(e.selection.$from,e.selection.$to,t.depth)):t}function YX(e,t,n,r){return Oc({listType:n.type,itemType:r.type,tr:e})?new Ba(e.selection.$from,e.selection.$to,t.depth):t}function XX(e){let t=Dm(e.selection);if(!t)return!1;const n=KX(e.selection.$from,t);if(!n)return!1;const{parentItem:r,parentList:o}=n;t=qX(e,t),t=GX(e,t),t=YX(e,t,o,r);const i=Ac(t);return typeof i!="number"||(e.lift(t,i),t=Dm(e.selection),t&&gN(e,e.doc.resolve(t.end-2))),!0}var ZX=({tr:e,dispatch:t})=>XX(e)?(t==null||t(e.scrollIntoView()),!0):!1;function JX(e,t,n){let r,o,i,s;const a=t.doc;if(n.startIndex>=1){r=e.child(n.startIndex-1),o=e,s=a.resolve(n.start).start(n.depth),i=s+1;for(let l=0;l<n.startIndex-1;l++)i+=o.child(l).nodeSize}else{const l=t.index(n.depth-1);if(l>=1){const c=t.node(n.depth-1),u=t.start(n.depth-1);if(o=c.child(l-1),!Ks(o))return!1;s=u+1;for(let d=0;d<l-1;d++)s+=c.child(d).nodeSize;if(r=o.child(o.childCount-1),i=s+o.nodeSize-r.nodeSize-1,!Ns(r))return!1}else return!1}return{previousItem:r,previousList:o,previousItemStart:i,previousListStart:s}}function QX(e,t,n){let r,o;const i=n.start,s=t.depth>=n.depth+2?t.end(n.depth+2):n.end-1,a=n.end;return s+1>=a?(r=e.slice(i,a),o=null):(r=e.slice(i,s),o=e.slice(s+1,a-1)),{selectedSlice:r,unselectedSlice:o}}function eZ(e){const{$from:t,$to:n}=e.selection,r=Dm(e.selection);if(!r)return!1;const o=e.doc.resolve(r.start).node();if(!Ks(o))return!1;const i=JX(o,t,r);if(!i)return!1;const{previousItem:s,previousList:a,previousItemStart:l}=i,{selectedSlice:c,unselectedSlice:u}=QX(e.doc,n,r),d=s.content.append(L.fromArray([o.copy(c.content)])).append(u?u.content:L.empty);e.deleteRange(r.start,r.end);const f=l+s.nodeSize-2,h=s.copy(d);return h.check(),e.replaceRangeWith(l-1,f+1,h),e.setSelection(a===o?Se.between(e.doc.resolve(t.pos),e.doc.resolve(n.pos)):Se.between(e.doc.resolve(t.pos-2),e.doc.resolve(n.pos-2))),!0}var tZ=({tr:e,dispatch:t})=>eZ(e)?(t==null||t(e.scrollIntoView()),!0):!1,xN=class extends ft{get name(){return"listItemShared"}createKeymap(){const e={Tab:tZ,"Shift-Tab":ZX,Backspace:RC,"Mod-Backspace":RC};if(eo.isMac){const t={"Ctrl-h":e.Backspace,"Alt-Backspace":e["Mod-Backspace"]};return{...e,...t}}return e}createPlugin(){return{appendTransaction:(e,t,n)=>{const r=n.tr;return gN(r)?r:null}}}},Tc=class extends zr{get name(){return"listItem"}createTags(){return[Me.ListItemNode]}createNodeSpec(e,t){return{content:"paragraph block*",defining:!0,draggable:!1,...t,attrs:{...e.defaults(),closed:{default:!1},nested:{default:!1}},parseDOM:[{tag:"li",getAttrs:e.parse,priority:Je.Lowest},...t.parseDOM??[]],toDOM:n=>["li",e.dom(n),0]}}createNodeViews(){return this.options.enableCollapsible?(e,t,n)=>{const r=document.createElement("div");return r.classList.add(Vs.COLLAPSIBLE_LIST_ITEM_BUTTON),r.contentEditable="false",r.addEventListener("click",()=>{if(r.classList.contains("disabled"))return;const o=n(),i=ge.create(t.state.doc,o);return t.dispatch(t.state.tr.setSelection(i)),this.store.commands.toggleListItemClosed(),!0}),yN({mark:r,node:e,updateDOM:nZ,updateMark:rZ})}:{}}createKeymap(){return{Enter:mN(this.type)}}createExtensions(){return[new xN]}toggleListItemClosed(e){return({state:{tr:t,selection:n},dispatch:r})=>{if(!Mg(n)||n.node.type.name!==this.name)return!1;const{node:o,from:i}=n;return e=i7(e)?e:!o.attrs.closed,r==null||r(t.setNodeMarkup(i,void 0,{...o.attrs,closed:e})),!0}}liftListItemOutOfList(e){return vN(e??this.type)}};Fr([ie()],Tc.prototype,"toggleListItemClosed",1);Fr([ie()],Tc.prototype,"liftListItemOutOfList",1);Tc=Fr([He({defaultOptions:{enableCollapsible:!1},staticKeys:["enableCollapsible"]})],Tc);function nZ(e,t){e.attrs.closed?t.classList.add(Vs.COLLAPSIBLE_LIST_ITEM_CLOSED):t.classList.remove(Vs.COLLAPSIBLE_LIST_ITEM_CLOSED)}function rZ(e,t){e.childCount<=1?t.classList.add("disabled"):t.classList.remove("disabled")}var ff=class extends zr{get name(){return"bulletList"}createTags(){return[Me.Block,Me.ListContainerNode]}createNodeSpec(e,t){return{content:"listItem+",...t,attrs:e.defaults(),parseDOM:[{tag:"ul",getAttrs:e.parse},...t.parseDOM??[]],toDOM:n=>["ul",e.dom(n),0]}}createNodeViews(){return this.options.enableSpine?(e,t,n)=>{var r;const o=document.createElement("div");o.style.position="relative";const i=n(),s=t.state.doc.resolve(i+1),a=s.node(s.depth-1);if(!(((r=a==null?void 0:a.type)==null?void 0:r.name)!=="listItem")){const u=document.createElement("div");u.contentEditable="false",u.classList.add(Vs.LIST_SPINE),u.addEventListener("click",d=>{const f=n(),h=t.state.doc.resolve(f+1),m=h.start(h.depth-1),g=ge.create(t.state.doc,m-1);t.dispatch(t.state.tr.setSelection(g)),this.store.commands.toggleListItemClosed(),d.preventDefault(),d.stopPropagation()}),o.append(u)}const c=document.createElement("ul");return c.classList.add(Vs.UL_LIST_CONTENT),o.append(c),{dom:o,contentDOM:c}}:{}}createExtensions(){return[new Tc({priority:Je.Low,enableCollapsible:this.options.enableSpine})]}toggleBulletList(){return H1(this.type,vt(this.store.schema.nodes,"listItem"))}listShortcut(e){return this.toggleBulletList()(e)}createInputRules(){const e=/^\s*([*+-])\s$/;return[a1(e,this.type),new jr(e,(t,n,r,o)=>{const i=t.tr;return i.deleteRange(r,o),Oc({listType:this.type,itemType:vt(this.store.schema.nodes,"listItem"),tr:i})?i:null})]}};Fr([ie({icon:"listUnordered",label:({t:e})=>e(s1.BULLET_LIST_LABEL)})],ff.prototype,"toggleBulletList",1);Fr([yr({shortcut:q.BulletList,command:"toggleBulletList"})],ff.prototype,"listShortcut",1);ff=Fr([He({defaultOptions:{enableSpine:!1},staticKeys:["enableSpine"]})],ff);var pf=class extends zr{get name(){return"orderedList"}createTags(){return[Me.Block,Me.ListContainerNode]}createNodeSpec(e,t){return{content:"listItem+",...t,attrs:{...e.defaults(),order:{default:1}},parseDOM:[{tag:"ol",getAttrs:n=>Vo(n)?{...e.parse(n),order:+(n.getAttribute("start")??1)}:{}},...t.parseDOM??[]],toDOM:n=>{const r=e.dom(n);return n.attrs.order===1?["ol",r,0]:["ol",{...r,start:n.attrs.order},0]}}}createExtensions(){return[new Tc({priority:Je.Low})]}toggleOrderedList(){return H1(this.type,vt(this.store.schema.nodes,"listItem"))}listShortcut(e){return this.toggleOrderedList()(e)}createInputRules(){const e=/^(\d+)\.\s$/;return[a1(e,this.type,t=>({order:+vt(t,1)}),(t,n)=>n.childCount+n.attrs.order===+vt(t,1)),new jr(e,(t,n,r,o)=>{const i=t.tr;if(i.deleteRange(r,o),!Oc({listType:this.type,itemType:vt(this.store.schema.nodes,"listItem"),tr:i}))return null;const a=+vt(n,1);if(a!==1){const l=tf({selection:i.selection,types:this.type});l&&i.setNodeMarkup(l.pos,void 0,{order:a})}return i})]}};Fr([ie({icon:"listOrdered",label:({t:e})=>e(s1.ORDERED_LIST_LABEL)})],pf.prototype,"toggleOrderedList",1);Fr([yr({shortcut:q.OrderedList,command:"toggleOrderedList"})],pf.prototype,"listShortcut",1);pf=Fr([He({})],pf);var bN=class extends zr{get name(){return"taskListItem"}createTags(){return[Me.ListItemNode]}createNodeSpec(e,t){return{content:"paragraph block*",defining:!0,draggable:!1,...t,attrs:{...e.defaults(),checked:{default:!1}},parseDOM:[{tag:"li[data-task-list-item]",getAttrs:n=>{let r=!1;return Vo(n)&&n.getAttribute("data-checked")!==null&&(r=!0),{checked:r,...e.parse(n)}},priority:Je.Medium},...t.parseDOM??[]],toDOM:n=>["li",{...e.dom(n),"data-task-list-item":"","data-checked":n.attrs.checked?"":void 0},0]}}createNodeViews(){return(e,t,n)=>{const r=document.createElement("input");return r.type="checkbox",r.classList.add(Vs.LIST_ITEM_CHECKBOX),r.contentEditable="false",r.addEventListener("click",o=>{t.editable||o.preventDefault()}),r.addEventListener("change",()=>{const o=n(),i=t.state.doc.resolve(o+1);this.store.commands.toggleCheckboxChecked({$pos:i})}),r.checked=e.attrs.checked,yN({node:e,mark:r,updateDOM:oZ,updateMark:iZ})}}createKeymap(){return{Enter:mN(this.type)}}createExtensions(){return[new xN]}toggleCheckboxChecked(e){let t,n;return typeof e=="boolean"?t=e:e&&(t=e.checked,n=e.$pos),({tr:r,dispatch:o})=>{const i=tf({selection:n??r.selection.$from,types:this.type});if(!i)return!1;const{node:s,pos:a}=i,l={...s.attrs,checked:t??!s.attrs.checked};return o==null||o(r.setNodeMarkup(a,void 0,l)),!0}}createInputRules(){const e=/^\s*(\[( ?|x|X)]\s)$/;return[a1(e,this.type,t=>({checked:["x","X"].includes(pd(t,2))})),new jr(e,(t,n,r,o)=>{const i=t.tr;if(i.deleteRange(r,o),!Oc({listType:vt(this.store.schema.nodes,"taskList"),itemType:this.type,tr:i}))return null;const a=["x","X"].includes(pd(n,2));if(a){const l=tf({selection:i.selection,types:this.type});l&&i.setNodeMarkup(l.pos,void 0,{checked:a})}return i})]}};Fr([ie()],bN.prototype,"toggleCheckboxChecked",1);function oZ(e,t){e.attrs.checked?t.setAttribute("data-checked",""):t.removeAttribute("data-checked"),t.setAttribute("data-task-list-item","")}function iZ(e,t){t.checked=!!e.attrs.checked}var wN=class extends zr{get name(){return"taskList"}createTags(){return[Me.Block,Me.ListContainerNode]}createNodeSpec(e,t){return{content:"taskListItem+",...t,attrs:e.defaults(),parseDOM:[{tag:"ul[data-task-list]",getAttrs:e.parse,priority:Je.Medium},...t.parseDOM??[]],toDOM:n=>["ul",{...e.dom(n),"data-task-list":""},0]}}createExtensions(){return[new bN({})]}toggleTaskList(){return H1(this.type,vt(this.store.schema.nodes,"taskListItem"))}listShortcut(e){return this.toggleTaskList()(e)}};Fr([ie({icon:"checkboxMultipleLine",label:({t:e})=>e(s1.TASK_LIST_LABEL)})],wN.prototype,"toggleTaskList",1);Fr([yr({shortcut:q.TaskList,command:"toggleTaskList"})],wN.prototype,"listShortcut",1);var sZ=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},vl=new WeakMap,Pp=new WeakMap,Np={},dy=0,SN=function(e){return e&&(e.host||SN(e.parentNode))},aZ=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=SN(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},lZ=function(e,t,n,r){var o=aZ(t,Array.isArray(e)?e:[e]);Np[n]||(Np[n]=new WeakMap);var i=Np[n],s=[],a=new Set,l=new Set(o),c=function(d){!d||a.has(d)||(a.add(d),c(d.parentNode))};o.forEach(c);var u=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(f){if(a.has(f))u(f);else{var h=f.getAttribute(r),m=h!==null&&h!=="false",g=(vl.get(f)||0)+1,b=(i.get(f)||0)+1;vl.set(f,g),i.set(f,b),s.push(f),g===1&&m&&Pp.set(f,!0),b===1&&f.setAttribute(n,"true"),m||f.setAttribute(r,"true")}})};return u(t),a.clear(),dy++,function(){s.forEach(function(d){var f=vl.get(d)-1,h=i.get(d)-1;vl.set(d,f),i.set(d,h),f||(Pp.has(d)||d.removeAttribute(r),Pp.delete(d)),h||d.removeAttribute(n)}),dy--,dy||(vl=new WeakMap,vl=new WeakMap,Pp=new WeakMap,Np={})}},Bg=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||sZ(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),lZ(r,o,n,"aria-hidden")):function(){return null}};function xo({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=cZ({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=qt(n),l=p.useCallback(c=>{if(i){const d=typeof c=="function"?c(e):c;d!==e&&a(d)}else o(c)},[i,e,o,a]);return[s,l]}function cZ({defaultProp:e,onChange:t}){const n=p.useState(e),[r]=n,o=p.useRef(r),i=qt(t);return p.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}function Vg(e){const t=e+"CollectionProvider",[n,r]=vr(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=h=>{const{scope:m,children:g}=h,b=H.useRef(null),y=H.useRef(new Map).current;return H.createElement(o,{scope:m,itemMap:y,collectionRef:b},g)},a=e+"CollectionSlot",l=H.forwardRef((h,m)=>{const{scope:g,children:b}=h,y=i(a,g),v=Le(m,y.collectionRef);return H.createElement(ki,{ref:v},b)}),c=e+"CollectionItemSlot",u="data-radix-collection-item",d=H.forwardRef((h,m)=>{const{scope:g,children:b,...y}=h,v=H.useRef(null),w=Le(m,v),S=i(c,g);return H.useEffect(()=>(S.itemMap.set(v,{ref:v,...y}),()=>void S.itemMap.delete(v))),H.createElement(ki,{[u]:"",ref:w},b)});function f(h){const m=i(e+"CollectionConsumer",h);return H.useCallback(()=>{const b=m.collectionRef.current;if(!b)return[];const y=Array.from(b.querySelectorAll(`[${u}]`));return Array.from(m.itemMap.values()).sort((S,k)=>y.indexOf(S.ref.current)-y.indexOf(k.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:s,Slot:l,ItemSlot:d},f,r]}function uZ(e,t=globalThis==null?void 0:globalThis.document){const n=qt(e);p.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const Tx="dismissableLayer.update",dZ="dismissableLayer.pointerDownOutside",fZ="dismissableLayer.focusOutside";let PC;const pZ=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ug=p.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:a,onDismiss:l,...c}=e,u=p.useContext(pZ),[d,f]=p.useState(null),h=(n=d==null?void 0:d.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,m]=p.useState({}),g=Le(t,T=>f(T)),b=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=b.indexOf(y),w=d?b.indexOf(d):-1,S=u.layersWithOutsidePointerEventsDisabled.size>0,k=w>=v,C=hZ(T=>{const R=T.target,$=[...u.branches].some(j=>j.contains(R));!k||$||(i==null||i(T),a==null||a(T),T.defaultPrevented||l==null||l())},h),E=mZ(T=>{const R=T.target;[...u.branches].some(j=>j.contains(R))||(s==null||s(T),a==null||a(T),T.defaultPrevented||l==null||l())},h);return uZ(T=>{w===u.layers.size-1&&(o==null||o(T),!T.defaultPrevented&&l&&(T.preventDefault(),l()))},h),p.useEffect(()=>{if(d)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(PC=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),NC(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=PC)}},[d,h,r,u]),p.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),NC())},[d,u]),p.useEffect(()=>{const T=()=>m({});return document.addEventListener(Tx,T),()=>document.removeEventListener(Tx,T)},[]),p.createElement(we.div,D({},c,{ref:g,style:{pointerEvents:S?k?"auto":"none":void 0,...e.style},onFocusCapture:re(e.onFocusCapture,E.onFocusCapture),onBlurCapture:re(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:re(e.onPointerDownCapture,C.onPointerDownCapture)}))});function hZ(e,t=globalThis==null?void 0:globalThis.document){const n=qt(e),r=p.useRef(!1),o=p.useRef(()=>{});return p.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let u=function(){kN(dZ,n,c,{discrete:!0})};var l=u;const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=u,t.addEventListener("click",o.current,{once:!0})):u()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function mZ(e,t=globalThis==null?void 0:globalThis.document){const n=qt(e),r=p.useRef(!1);return p.useEffect(()=>{const o=i=>{i.target&&!r.current&&kN(fZ,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function NC(){const e=new CustomEvent(Tx);document.dispatchEvent(e)}function kN(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?m2(o,i):o.dispatchEvent(i)}let fy=0;function Hg(){p.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:$C()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:$C()),fy++,()=>{fy===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),fy--}},[])}function $C(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}const py="focusScope.autoFocusOnMount",hy="focusScope.autoFocusOnUnmount",DC={bubbles:!1,cancelable:!0},Wg=p.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=p.useState(null),c=qt(o),u=qt(i),d=p.useRef(null),f=Le(t,g=>l(g)),h=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(r){let v=function(C){if(h.paused||!a)return;const E=C.target;a.contains(E)?d.current=E:ts(d.current,{select:!0})},w=function(C){if(h.paused||!a)return;const E=C.relatedTarget;E!==null&&(a.contains(E)||ts(d.current,{select:!0}))},S=function(C){if(document.activeElement===document.body)for(const T of C)T.removedNodes.length>0&&ts(a)};var g=v,b=w,y=S;document.addEventListener("focusin",v),document.addEventListener("focusout",w);const k=new MutationObserver(S);return a&&k.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",w),k.disconnect()}}},[r,a,h.paused]),p.useEffect(()=>{if(a){IC.add(h);const g=document.activeElement;if(!a.contains(g)){const y=new CustomEvent(py,DC);a.addEventListener(py,c),a.dispatchEvent(y),y.defaultPrevented||(gZ(wZ(EN(a)),{select:!0}),document.activeElement===g&&ts(a))}return()=>{a.removeEventListener(py,c),setTimeout(()=>{const y=new CustomEvent(hy,DC);a.addEventListener(hy,u),a.dispatchEvent(y),y.defaultPrevented||ts(g??document.body,{select:!0}),a.removeEventListener(hy,u),IC.remove(h)},0)}}},[a,c,u,h]);const m=p.useCallback(g=>{if(!n&&!r||h.paused)return;const b=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,y=document.activeElement;if(b&&y){const v=g.currentTarget,[w,S]=vZ(v);w&&S?!g.shiftKey&&y===S?(g.preventDefault(),n&&ts(w,{select:!0})):g.shiftKey&&y===w&&(g.preventDefault(),n&&ts(S,{select:!0})):y===v&&g.preventDefault()}},[n,r,h.paused]);return p.createElement(we.div,D({tabIndex:-1},s,{ref:f,onKeyDown:m}))});function gZ(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ts(r,{select:t}),document.activeElement!==n)return}function vZ(e){const t=EN(e),n=AC(t,e),r=AC(t.reverse(),e);return[n,r]}function EN(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function AC(e,t){for(const n of e)if(!yZ(n,{upTo:t}))return n}function yZ(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function xZ(e){return e instanceof HTMLInputElement&&"select"in e}function ts(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&xZ(e)&&t&&e.select()}}const IC=bZ();function bZ(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=LC(e,t),e.unshift(t)},remove(t){var n;e=LC(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function LC(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function wZ(e){return e.filter(t=>t.tagName!=="A")}const SZ=UA.useId||(()=>{});let kZ=0;function Pr(e){const[t,n]=p.useState(SZ());return ur(()=>{e||n(r=>r??String(kZ++))},[e]),e||(t?`radix-${t}`:"")}function W1(e){const[t,n]=p.useState(void 0);return ur(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,a=c.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const CN="Popper",[_N,Uc]=vr(CN),[EZ,ON]=_N(CN),CZ=e=>{const{__scopePopper:t,children:n}=e,[r,o]=p.useState(null);return p.createElement(EZ,{scope:t,anchor:r,onAnchorChange:o},n)},_Z="PopperAnchor",OZ=p.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=ON(_Z,n),s=p.useRef(null),a=Le(t,s);return p.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:p.createElement(we.div,D({},o,{ref:a}))}),TN="PopperContent",[TZ,Gle]=_N(TN),MZ=p.forwardRef((e,t)=>{var n,r,o,i,s,a,l,c;const{__scopePopper:u,side:d="bottom",sideOffset:f=0,align:h="center",alignOffset:m=0,arrowPadding:g=0,avoidCollisions:b=!0,collisionBoundary:y=[],collisionPadding:v=0,sticky:w="partial",hideWhenDetached:S=!1,updatePositionStrategy:k="optimized",onPlaced:C,...E}=e,T=ON(TN,u),[R,$]=p.useState(null),j=Le(t,ln=>$(ln)),[z,ee]=p.useState(null),V=W1(z),U=(n=V==null?void 0:V.width)!==null&&n!==void 0?n:0,O=(r=V==null?void 0:V.height)!==null&&r!==void 0?r:0,M=d+(h!=="center"?"-"+h:""),_=typeof v=="number"?v:{top:0,right:0,bottom:0,left:0,...v},P=Array.isArray(y)?y:[y],N=P.length>0,I={padding:_,boundary:P.filter(RZ),altBoundary:N},{refs:B,floatingStyles:de,placement:ue,isPositioned:Ae,middlewareData:me}=NX({strategy:"fixed",placement:M,whileElementsMounted:(...ln)=>EX(...ln,{animationFrame:k==="always"}),elements:{reference:T.anchor},middleware:[rX({mainAxis:f+O,alignmentAxis:m}),b&&CX({mainAxis:!0,crossAxis:!1,limiter:w==="partial"?MX():void 0,...I}),b&&_X({...I}),OX({...I,apply:({elements:ln,rects:qn,availableWidth:Li,availableHeight:Qf})=>{const{width:Xc,height:ko}=qn.reference,Yo=ln.floating.style;Yo.setProperty("--radix-popper-available-width",`${Li}px`),Yo.setProperty("--radix-popper-available-height",`${Qf}px`),Yo.setProperty("--radix-popper-anchor-width",`${Xc}px`),Yo.setProperty("--radix-popper-anchor-height",`${ko}px`)}}),z&&PX({element:z,padding:g}),PZ({arrowWidth:U,arrowHeight:O}),S&&TX({strategy:"referenceHidden",...I})]}),[X,Ne]=MN(ue),Pe=qt(C);ur(()=>{Ae&&(Pe==null||Pe())},[Ae,Pe]);const se=(o=me.arrow)===null||o===void 0?void 0:o.x,ze=(i=me.arrow)===null||i===void 0?void 0:i.y,Te=((s=me.arrow)===null||s===void 0?void 0:s.centerOffset)!==0,[Tt,pt]=p.useState();return ur(()=>{R&&pt(window.getComputedStyle(R).zIndex)},[R]),p.createElement("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...de,transform:Ae?de.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Tt,"--radix-popper-transform-origin":[(a=me.transformOrigin)===null||a===void 0?void 0:a.x,(l=me.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:e.dir},p.createElement(TZ,{scope:u,placedSide:X,onArrowChange:ee,arrowX:se,arrowY:ze,shouldHideArrow:Te},p.createElement(we.div,D({"data-side":X,"data-align":Ne},E,{ref:j,style:{...E.style,animation:Ae?void 0:"none",opacity:(c=me.hide)!==null&&c!==void 0&&c.referenceHidden?0:void 0}}))))});function RZ(e){return e!==null}const PZ=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o,i,s;const{placement:a,rects:l,middlewareData:c}=t,d=((n=c.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,f=d?0:e.arrowWidth,h=d?0:e.arrowHeight,[m,g]=MN(a),b={start:"0%",center:"50%",end:"100%"}[g],y=((r=(o=c.arrow)===null||o===void 0?void 0:o.x)!==null&&r!==void 0?r:0)+f/2,v=((i=(s=c.arrow)===null||s===void 0?void 0:s.y)!==null&&i!==void 0?i:0)+h/2;let w="",S="";return m==="bottom"?(w=d?b:`${y}px`,S=`${-h}px`):m==="top"?(w=d?b:`${y}px`,S=`${l.floating.height+h}px`):m==="right"?(w=`${-h}px`,S=d?b:`${v}px`):m==="left"&&(w=`${l.floating.width+h}px`,S=d?b:`${v}px`),{data:{x:w,y:S}}}});function MN(e){const[t,n="center"]=e.split("-");return[t,n]}const K1=CZ,q1=OZ,G1=MZ,Kg=p.forwardRef((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...o}=e;return r?q3.createPortal(p.createElement(we.div,D({},o,{ref:t})),r):null}),my="rovingFocusGroup.onEntryFocus",NZ={bubbles:!1,cancelable:!0},Y1="RovingFocusGroup",[Mx,RN,$Z]=Vg(Y1),[DZ,PN]=vr(Y1,[$Z]),[AZ,IZ]=DZ(Y1),LZ=p.forwardRef((e,t)=>p.createElement(Mx.Provider,{scope:e.__scopeRovingFocusGroup},p.createElement(Mx.Slot,{scope:e.__scopeRovingFocusGroup},p.createElement(jZ,D({},e,{ref:t}))))),jZ=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,...u}=e,d=p.useRef(null),f=Le(t,d),h=$f(i),[m=null,g]=xo({prop:s,defaultProp:a,onChange:l}),[b,y]=p.useState(!1),v=qt(c),w=RN(n),S=p.useRef(!1),[k,C]=p.useState(0);return p.useEffect(()=>{const E=d.current;if(E)return E.addEventListener(my,v),()=>E.removeEventListener(my,v)},[v]),p.createElement(AZ,{scope:n,orientation:r,dir:h,loop:o,currentTabStopId:m,onItemFocus:p.useCallback(E=>g(E),[g]),onItemShiftTab:p.useCallback(()=>y(!0),[]),onFocusableItemAdd:p.useCallback(()=>C(E=>E+1),[]),onFocusableItemRemove:p.useCallback(()=>C(E=>E-1),[])},p.createElement(we.div,D({tabIndex:b||k===0?-1:0,"data-orientation":r},u,{ref:f,style:{outline:"none",...e.style},onMouseDown:re(e.onMouseDown,()=>{S.current=!0}),onFocus:re(e.onFocus,E=>{const T=!S.current;if(E.target===E.currentTarget&&T&&!b){const R=new CustomEvent(my,NZ);if(E.currentTarget.dispatchEvent(R),!R.defaultPrevented){const $=w().filter(U=>U.focusable),j=$.find(U=>U.active),z=$.find(U=>U.id===m),V=[j,z,...$].filter(Boolean).map(U=>U.ref.current);NN(V)}}S.current=!1}),onBlur:re(e.onBlur,()=>y(!1))})))}),zZ="RovingFocusGroupItem",FZ=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,a=Pr(),l=i||a,c=IZ(zZ,n),u=c.currentTabStopId===l,d=RN(n),{onFocusableItemAdd:f,onFocusableItemRemove:h}=c;return p.useEffect(()=>{if(r)return f(),()=>h()},[r,f,h]),p.createElement(Mx.ItemSlot,{scope:n,id:l,focusable:r,active:o},p.createElement(we.span,D({tabIndex:u?0:-1,"data-orientation":c.orientation},s,{ref:t,onMouseDown:re(e.onMouseDown,m=>{r?c.onItemFocus(l):m.preventDefault()}),onFocus:re(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:re(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){c.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const g=UZ(m,c.orientation,c.dir);if(g!==void 0){m.preventDefault();let y=d().filter(v=>v.focusable).map(v=>v.ref.current);if(g==="last")y.reverse();else if(g==="prev"||g==="next"){g==="prev"&&y.reverse();const v=y.indexOf(m.currentTarget);y=c.loop?HZ(y,v+1):y.slice(v+1)}setTimeout(()=>NN(y))}})})))}),BZ={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function VZ(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function UZ(e,t,n){const r=VZ(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return BZ[r]}function NN(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function HZ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const WZ=LZ,KZ=FZ;var Po=function(){return Po=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Po.apply(this,arguments)};function $N(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function qZ(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var vh="right-scroll-bar-position",yh="width-before-scroll-bar",GZ="with-scroll-bars-hidden",YZ="--removed-body-scroll-bar-size";function gy(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function XZ(e,t){var n=p.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var jC=new WeakMap;function ZZ(e,t){var n=XZ(t||null,function(r){return e.forEach(function(o){return gy(o,r)})});return p.useLayoutEffect(function(){var r=jC.get(n);if(r){var o=new Set(r),i=new Set(e),s=n.current;o.forEach(function(a){i.has(a)||gy(a,null)}),i.forEach(function(a){o.has(a)||gy(a,s)})}jC.set(n,e)},[e]),n}function JZ(e){return e}function QZ(e,t){t===void 0&&(t=JZ);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var s=t(i,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(i){for(r=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(a){return i(a)},filter:function(){return n}}},assignMedium:function(i){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(i),s=n}var l=function(){var u=s;s=[],u.forEach(i)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(u){s.push(u),c()},filter:function(u){return s=s.filter(u),n}}}};return o}function eJ(e){e===void 0&&(e={});var t=QZ(null);return t.options=Po({async:!0,ssr:!1},e),t}var DN=function(e){var t=e.sideCar,n=$N(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return p.createElement(r,Po({},n))};DN.isSideCarExport=!0;function tJ(e,t){return e.useMedium(t),DN}var AN=eJ(),vy=function(){},qg=p.forwardRef(function(e,t){var n=p.useRef(null),r=p.useState({onScrollCapture:vy,onWheelCapture:vy,onTouchMoveCapture:vy}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,h=e.noIsolation,m=e.inert,g=e.allowPinchZoom,b=e.as,y=b===void 0?"div":b,v=$N(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),w=f,S=ZZ([n,t]),k=Po(Po({},v),o);return p.createElement(p.Fragment,null,u&&p.createElement(w,{sideCar:AN,removeScrollBar:c,shards:d,noIsolation:h,inert:m,setCallbacks:i,allowPinchZoom:!!g,lockRef:n}),s?p.cloneElement(p.Children.only(a),Po(Po({},k),{ref:S})):p.createElement(y,Po({},k,{className:l,ref:S}),a))});qg.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};qg.classNames={fullWidth:yh,zeroRight:vh};var nJ=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function rJ(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=nJ();return t&&e.setAttribute("nonce",t),e}function oJ(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function iJ(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var sJ=function(){var e=0,t=null;return{add:function(n){e==0&&(t=rJ())&&(oJ(t,n),iJ(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},aJ=function(){var e=sJ();return function(t,n){p.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},IN=function(){var e=aJ(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},lJ={left:0,top:0,right:0,gap:0},yy=function(e){return parseInt(e||"",10)||0},cJ=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[yy(n),yy(r),yy(o)]},uJ=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return lJ;var t=cJ(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},dJ=IN(),fJ=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
372
- .`.concat(GZ,` {
373
- overflow: hidden `).concat(r,`;
374
- padding-right: `).concat(a,"px ").concat(r,`;
375
- }
376
- body {
377
- overflow: hidden `).concat(r,`;
378
- overscroll-behavior: contain;
379
- `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
380
- padding-left: `.concat(o,`px;
381
- padding-top: `).concat(i,`px;
382
- padding-right: `).concat(s,`px;
383
- margin-left:0;
384
- margin-top:0;
385
- margin-right: `).concat(a,"px ").concat(r,`;
386
- `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
387
- }
388
-
389
- .`).concat(vh,` {
390
- right: `).concat(a,"px ").concat(r,`;
391
- }
392
-
393
- .`).concat(yh,` {
394
- margin-right: `).concat(a,"px ").concat(r,`;
395
- }
396
-
397
- .`).concat(vh," .").concat(vh,` {
398
- right: 0 `).concat(r,`;
399
- }
400
-
401
- .`).concat(yh," .").concat(yh,` {
402
- margin-right: 0 `).concat(r,`;
403
- }
404
-
405
- body {
406
- `).concat(YZ,": ").concat(a,`px;
407
- }
408
- `)},pJ=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,i=p.useMemo(function(){return uJ(o)},[o]);return p.createElement(dJ,{styles:fJ(i,!t,o,n?"":"!important")})},Rx=!1;if(typeof window<"u")try{var $p=Object.defineProperty({},"passive",{get:function(){return Rx=!0,!0}});window.addEventListener("test",$p,$p),window.removeEventListener("test",$p,$p)}catch{Rx=!1}var yl=Rx?{passive:!1}:!1,hJ=function(e){return e.tagName==="TEXTAREA"},LN=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!hJ(e)&&n[t]==="visible")},mJ=function(e){return LN(e,"overflowY")},gJ=function(e){return LN(e,"overflowX")},zC=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=jN(e,n);if(r){var o=zN(e,n),i=o[1],s=o[2];if(i>s)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},vJ=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},yJ=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},jN=function(e,t){return e==="v"?mJ(t):gJ(t)},zN=function(e,t){return e==="v"?vJ(t):yJ(t)},xJ=function(e,t){return e==="h"&&t==="rtl"?-1:1},bJ=function(e,t,n,r,o){var i=xJ(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),c=!1,u=s>0,d=0,f=0;do{var h=zN(e,a),m=h[0],g=h[1],b=h[2],y=g-b-i*m;(m||y)&&jN(e,a)&&(d+=y,f+=m),a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&(o&&d===0||!o&&s>d)||!u&&(o&&f===0||!o&&-s>f))&&(c=!0),c},Dp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},FC=function(e){return[e.deltaX,e.deltaY]},BC=function(e){return e&&"current"in e?e.current:e},wJ=function(e,t){return e[0]===t[0]&&e[1]===t[1]},SJ=function(e){return`
409
- .block-interactivity-`.concat(e,` {pointer-events: none;}
410
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
411
- `)},kJ=0,xl=[];function EJ(e){var t=p.useRef([]),n=p.useRef([0,0]),r=p.useRef(),o=p.useState(kJ++)[0],i=p.useState(function(){return IN()})[0],s=p.useRef(e);p.useEffect(function(){s.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var g=qZ([e.lockRef.current],(e.shards||[]).map(BC),!0).filter(Boolean);return g.forEach(function(b){return b.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),g.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=p.useCallback(function(g,b){if("touches"in g&&g.touches.length===2)return!s.current.allowPinchZoom;var y=Dp(g),v=n.current,w="deltaX"in g?g.deltaX:v[0]-y[0],S="deltaY"in g?g.deltaY:v[1]-y[1],k,C=g.target,E=Math.abs(w)>Math.abs(S)?"h":"v";if("touches"in g&&E==="h"&&C.type==="range")return!1;var T=zC(E,C);if(!T)return!0;if(T?k=E:(k=E==="v"?"h":"v",T=zC(E,C)),!T)return!1;if(!r.current&&"changedTouches"in g&&(w||S)&&(r.current=k),!k)return!0;var R=r.current||k;return bJ(R,b,g,R==="h"?w:S,!0)},[]),l=p.useCallback(function(g){var b=g;if(!(!xl.length||xl[xl.length-1]!==i)){var y="deltaY"in b?FC(b):Dp(b),v=t.current.filter(function(k){return k.name===b.type&&k.target===b.target&&wJ(k.delta,y)})[0];if(v&&v.should){b.cancelable&&b.preventDefault();return}if(!v){var w=(s.current.shards||[]).map(BC).filter(Boolean).filter(function(k){return k.contains(b.target)}),S=w.length>0?a(b,w[0]):!s.current.noIsolation;S&&b.cancelable&&b.preventDefault()}}},[]),c=p.useCallback(function(g,b,y,v){var w={name:g,delta:b,target:y,should:v};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(S){return S!==w})},1)},[]),u=p.useCallback(function(g){n.current=Dp(g),r.current=void 0},[]),d=p.useCallback(function(g){c(g.type,FC(g),g.target,a(g,e.lockRef.current))},[]),f=p.useCallback(function(g){c(g.type,Dp(g),g.target,a(g,e.lockRef.current))},[]);p.useEffect(function(){return xl.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,yl),document.addEventListener("touchmove",l,yl),document.addEventListener("touchstart",u,yl),function(){xl=xl.filter(function(g){return g!==i}),document.removeEventListener("wheel",l,yl),document.removeEventListener("touchmove",l,yl),document.removeEventListener("touchstart",u,yl)}},[]);var h=e.removeScrollBar,m=e.inert;return p.createElement(p.Fragment,null,m?p.createElement(i,{styles:SJ(o)}):null,h?p.createElement(pJ,{gapMode:"margin"}):null)}const CJ=tJ(AN,EJ);var FN=p.forwardRef(function(e,t){return p.createElement(qg,Po({},e,{ref:t,sideCar:CJ}))});FN.classNames=qg.classNames;const Gg=FN,Px=["Enter"," "],_J=["ArrowDown","PageUp","Home"],BN=["ArrowUp","PageDown","End"],OJ=[..._J,...BN],TJ={ltr:[...Px,"ArrowRight"],rtl:[...Px,"ArrowLeft"]},MJ={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Yg="Menu",[hf,RJ,PJ]=Vg(Yg),[rl,VN]=vr(Yg,[PJ,Uc,PN]),X1=Uc(),UN=PN(),[NJ,ol]=rl(Yg),[$J,Wf]=rl(Yg),DJ=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=e,a=X1(t),[l,c]=p.useState(null),u=p.useRef(!1),d=qt(i),f=$f(o);return p.useEffect(()=>{const h=()=>{u.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},m=()=>u.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),p.createElement(K1,a,p.createElement(NJ,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:c},p.createElement($J,{scope:t,onClose:p.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:s},r)))},HN=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=X1(n);return p.createElement(q1,D({},o,r,{ref:t}))}),WN="MenuPortal",[AJ,KN]=rl(WN,{forceMount:void 0}),IJ=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=ol(WN,t);return p.createElement(AJ,{scope:t,forceMount:n},p.createElement(yn,{present:n||i.open},p.createElement(Kg,{asChild:!0,container:o},r)))},po="MenuContent",[LJ,Z1]=rl(po),jJ=p.forwardRef((e,t)=>{const n=KN(po,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=ol(po,e.__scopeMenu),s=Wf(po,e.__scopeMenu);return p.createElement(hf.Provider,{scope:e.__scopeMenu},p.createElement(yn,{present:r||i.open},p.createElement(hf.Slot,{scope:e.__scopeMenu},s.modal?p.createElement(zJ,D({},o,{ref:t})):p.createElement(FJ,D({},o,{ref:t})))))}),zJ=p.forwardRef((e,t)=>{const n=ol(po,e.__scopeMenu),r=p.useRef(null),o=Le(t,r);return p.useEffect(()=>{const i=r.current;if(i)return Bg(i)},[]),p.createElement(J1,D({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:re(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),FJ=p.forwardRef((e,t)=>{const n=ol(po,e.__scopeMenu);return p.createElement(J1,D({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),J1=p.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h,disableOutsideScroll:m,...g}=e,b=ol(po,n),y=Wf(po,n),v=X1(n),w=UN(n),S=RJ(n),[k,C]=p.useState(null),E=p.useRef(null),T=Le(t,E,b.onContentChange),R=p.useRef(0),$=p.useRef(""),j=p.useRef(0),z=p.useRef(null),ee=p.useRef("right"),V=p.useRef(0),U=m?Gg:p.Fragment,O=m?{as:ki,allowPinchZoom:!0}:void 0,M=P=>{var N,I;const B=$.current+P,de=S().filter(Pe=>!Pe.disabled),ue=document.activeElement,Ae=(N=de.find(Pe=>Pe.ref.current===ue))===null||N===void 0?void 0:N.textValue,me=de.map(Pe=>Pe.textValue),X=rQ(me,B,Ae),Ne=(I=de.find(Pe=>Pe.textValue===X))===null||I===void 0?void 0:I.ref.current;(function Pe(se){$.current=se,window.clearTimeout(R.current),se!==""&&(R.current=window.setTimeout(()=>Pe(""),1e3))})(B),Ne&&setTimeout(()=>Ne.focus())};p.useEffect(()=>()=>window.clearTimeout(R.current),[]),Hg();const _=p.useCallback(P=>{var N,I;return ee.current===((N=z.current)===null||N===void 0?void 0:N.side)&&iQ(P,(I=z.current)===null||I===void 0?void 0:I.area)},[]);return p.createElement(LJ,{scope:n,searchRef:$,onItemEnter:p.useCallback(P=>{_(P)&&P.preventDefault()},[_]),onItemLeave:p.useCallback(P=>{var N;_(P)||((N=E.current)===null||N===void 0||N.focus(),C(null))},[_]),onTriggerLeave:p.useCallback(P=>{_(P)&&P.preventDefault()},[_]),pointerGraceTimerRef:j,onPointerGraceIntentChange:p.useCallback(P=>{z.current=P},[])},p.createElement(U,O,p.createElement(Wg,{asChild:!0,trapped:o,onMountAutoFocus:re(i,P=>{var N;P.preventDefault(),(N=E.current)===null||N===void 0||N.focus()}),onUnmountAutoFocus:s},p.createElement(Ug,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h},p.createElement(WZ,D({asChild:!0},w,{dir:y.dir,orientation:"vertical",loop:r,currentTabStopId:k,onCurrentTabStopIdChange:C,onEntryFocus:re(l,P=>{y.isUsingKeyboardRef.current||P.preventDefault()})}),p.createElement(G1,D({role:"menu","aria-orientation":"vertical","data-state":ZN(b.open),"data-radix-menu-content":"",dir:y.dir},v,g,{ref:T,style:{outline:"none",...g.style},onKeyDown:re(g.onKeyDown,P=>{const I=P.target.closest("[data-radix-menu-content]")===P.currentTarget,B=P.ctrlKey||P.altKey||P.metaKey,de=P.key.length===1;I&&(P.key==="Tab"&&P.preventDefault(),!B&&de&&M(P.key));const ue=E.current;if(P.target!==ue||!OJ.includes(P.key))return;P.preventDefault();const me=S().filter(X=>!X.disabled).map(X=>X.ref.current);BN.includes(P.key)&&me.reverse(),tQ(me)}),onBlur:re(e.onBlur,P=>{P.currentTarget.contains(P.target)||(window.clearTimeout(R.current),$.current="")}),onPointerMove:re(e.onPointerMove,mf(P=>{const N=P.target,I=V.current!==P.clientX;if(P.currentTarget.contains(N)&&I){const B=P.clientX>V.current?"right":"left";ee.current=B,V.current=P.clientX}}))})))))))}),BJ=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.createElement(we.div,D({role:"group"},r,{ref:t}))}),VJ=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.createElement(we.div,D({},r,{ref:t}))}),Nx="MenuItem",VC="menu.itemSelect",Q1=p.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=p.useRef(null),s=Wf(Nx,e.__scopeMenu),a=Z1(Nx,e.__scopeMenu),l=Le(t,i),c=p.useRef(!1),u=()=>{const d=i.current;if(!n&&d){const f=new CustomEvent(VC,{bubbles:!0,cancelable:!0});d.addEventListener(VC,h=>r==null?void 0:r(h),{once:!0}),m2(d,f),f.defaultPrevented?c.current=!1:s.onClose()}};return p.createElement(qN,D({},o,{ref:l,disabled:n,onClick:re(e.onClick,u),onPointerDown:d=>{var f;(f=e.onPointerDown)===null||f===void 0||f.call(e,d),c.current=!0},onPointerUp:re(e.onPointerUp,d=>{var f;c.current||(f=d.currentTarget)===null||f===void 0||f.click()}),onKeyDown:re(e.onKeyDown,d=>{const f=a.searchRef.current!=="";n||f&&d.key===" "||Px.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})}))}),qN=p.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,s=Z1(Nx,n),a=UN(n),l=p.useRef(null),c=Le(t,l),[u,d]=p.useState(!1),[f,h]=p.useState("");return p.useEffect(()=>{const m=l.current;if(m){var g;h(((g=m.textContent)!==null&&g!==void 0?g:"").trim())}},[i.children]),p.createElement(hf.ItemSlot,{scope:n,disabled:r,textValue:o??f},p.createElement(KZ,D({asChild:!0},a,{focusable:!r}),p.createElement(we.div,D({role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},i,{ref:c,onPointerMove:re(e.onPointerMove,mf(m=>{r?s.onItemLeave(m):(s.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus())})),onPointerLeave:re(e.onPointerLeave,mf(m=>s.onItemLeave(m))),onFocus:re(e.onFocus,()=>d(!0)),onBlur:re(e.onBlur,()=>d(!1))}))))}),UJ=p.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return p.createElement(YN,{scope:e.__scopeMenu,checked:n},p.createElement(Q1,D({role:"menuitemcheckbox","aria-checked":Am(n)?"mixed":n},o,{ref:t,"data-state":ew(n),onSelect:re(o.onSelect,()=>r==null?void 0:r(Am(n)?!0:!n),{checkForDefaultPrevented:!1})})))}),HJ="MenuRadioGroup",[Yle,WJ]=rl(HJ,{value:void 0,onValueChange:()=>{}}),KJ="MenuRadioItem",qJ=p.forwardRef((e,t)=>{const{value:n,...r}=e,o=WJ(KJ,e.__scopeMenu),i=n===o.value;return p.createElement(YN,{scope:e.__scopeMenu,checked:i},p.createElement(Q1,D({role:"menuitemradio","aria-checked":i},r,{ref:t,"data-state":ew(i),onSelect:re(r.onSelect,()=>{var s;return(s=o.onValueChange)===null||s===void 0?void 0:s.call(o,n)},{checkForDefaultPrevented:!1})})))}),GN="MenuItemIndicator",[YN,GJ]=rl(GN,{checked:!1}),YJ=p.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=GJ(GN,n);return p.createElement(yn,{present:r||Am(i.checked)||i.checked===!0},p.createElement(we.span,D({},o,{ref:t,"data-state":ew(i.checked)})))}),XJ=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.createElement(we.div,D({role:"separator","aria-orientation":"horizontal"},r,{ref:t}))}),ZJ="MenuSub",[Xle,XN]=rl(ZJ),Ap="MenuSubTrigger",JJ=p.forwardRef((e,t)=>{const n=ol(Ap,e.__scopeMenu),r=Wf(Ap,e.__scopeMenu),o=XN(Ap,e.__scopeMenu),i=Z1(Ap,e.__scopeMenu),s=p.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=i,c={__scopeMenu:e.__scopeMenu},u=p.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return p.useEffect(()=>u,[u]),p.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),l(null)}},[a,l]),p.createElement(HN,D({asChild:!0},c),p.createElement(qN,D({id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":ZN(n.open)},e,{ref:dg(t,o.onTriggerChange),onClick:d=>{var f;(f=e.onClick)===null||f===void 0||f.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:re(e.onPointerMove,mf(d=>{i.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:re(e.onPointerLeave,mf(d=>{var f;u();const h=(f=n.content)===null||f===void 0?void 0:f.getBoundingClientRect();if(h){var m;const g=(m=n.content)===null||m===void 0?void 0:m.dataset.side,b=g==="right",y=b?-5:5,v=h[b?"left":"right"],w=h[b?"right":"left"];i.onPointerGraceIntentChange({area:[{x:d.clientX+y,y:d.clientY},{x:v,y:h.top},{x:w,y:h.top},{x:w,y:h.bottom},{x:v,y:h.bottom}],side:g}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(d),d.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:re(e.onKeyDown,d=>{const f=i.searchRef.current!=="";if(!(e.disabled||f&&d.key===" ")&&TJ[r.dir].includes(d.key)){var h;n.onOpenChange(!0),(h=n.content)===null||h===void 0||h.focus(),d.preventDefault()}})})))}),QJ="MenuSubContent",eQ=p.forwardRef((e,t)=>{const n=KN(po,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=ol(po,e.__scopeMenu),s=Wf(po,e.__scopeMenu),a=XN(QJ,e.__scopeMenu),l=p.useRef(null),c=Le(t,l);return p.createElement(hf.Provider,{scope:e.__scopeMenu},p.createElement(yn,{present:r||i.open},p.createElement(hf.Slot,{scope:e.__scopeMenu},p.createElement(J1,D({id:a.contentId,"aria-labelledby":a.triggerId},o,{ref:c,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var d;s.isUsingKeyboardRef.current&&((d=l.current)===null||d===void 0||d.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:re(e.onFocusOutside,u=>{u.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:re(e.onEscapeKeyDown,u=>{s.onClose(),u.preventDefault()}),onKeyDown:re(e.onKeyDown,u=>{const d=u.currentTarget.contains(u.target),f=MJ[s.dir].includes(u.key);if(d&&f){var h;i.onOpenChange(!1),(h=a.trigger)===null||h===void 0||h.focus(),u.preventDefault()}})})))))});function ZN(e){return e?"open":"closed"}function Am(e){return e==="indeterminate"}function ew(e){return Am(e)?"indeterminate":e?"checked":"unchecked"}function tQ(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function nQ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function rQ(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=nQ(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function oQ(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i].x,l=t[i].y,c=t[s].x,u=t[s].y;l>r!=u>r&&n<(c-a)*(r-l)/(u-l)+a&&(o=!o)}return o}function iQ(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return oQ(n,t)}function mf(e){return t=>t.pointerType==="mouse"?e(t):void 0}const sQ=DJ,aQ=HN,lQ=IJ,cQ=jJ,uQ=BJ,dQ=VJ,fQ=Q1,pQ=UJ,hQ=qJ,mQ=YJ,gQ=XJ,vQ=JJ,yQ=eQ,JN="DropdownMenu",[xQ,Zle]=vr(JN,[VN]),xr=VN(),[bQ,QN]=xQ(JN),e$=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,l=xr(t),c=p.useRef(null),[u=!1,d]=xo({prop:o,defaultProp:i,onChange:s});return p.createElement(bQ,{scope:t,triggerId:Pr(),triggerRef:c,contentId:Pr(),open:u,onOpenChange:d,onOpenToggle:p.useCallback(()=>d(f=>!f),[d]),modal:a},p.createElement(sQ,D({},l,{open:u,onOpenChange:d,dir:r,modal:a}),n))},wQ="DropdownMenuTrigger",t$=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=QN(wQ,n),s=xr(n);return p.createElement(aQ,D({asChild:!0},s),p.createElement(we.button,D({type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r},o,{ref:dg(t,i.triggerRef),onPointerDown:re(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:re(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})))}),SQ=e=>{const{__scopeDropdownMenu:t,...n}=e,r=xr(t);return p.createElement(lQ,D({},r,n))},kQ="DropdownMenuContent",EQ=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=QN(kQ,n),i=xr(n),s=p.useRef(!1);return p.createElement(cQ,D({id:o.contentId,"aria-labelledby":o.triggerId},i,r,{ref:t,onCloseAutoFocus:re(e.onCloseAutoFocus,a=>{var l;s.current||(l=o.triggerRef.current)===null||l===void 0||l.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:re(e.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;(!o.modal||u)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),CQ=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=xr(n);return p.createElement(uQ,D({},o,r,{ref:t}))}),_Q=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=xr(n);return p.createElement(dQ,D({},o,r,{ref:t}))}),OQ=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=xr(n);return p.createElement(fQ,D({},o,r,{ref:t}))}),TQ=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=xr(n);return p.createElement(pQ,D({},o,r,{ref:t}))}),MQ=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=xr(n);return p.createElement(hQ,D({},o,r,{ref:t}))}),RQ=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=xr(n);return p.createElement(mQ,D({},o,r,{ref:t}))}),PQ=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=xr(n);return p.createElement(gQ,D({},o,r,{ref:t}))}),NQ=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=xr(n);return p.createElement(vQ,D({},o,r,{ref:t}))}),$Q=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=xr(n);return p.createElement(yQ,D({},o,r,{ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),DQ=e$,AQ=t$,IQ=SQ,n$=EQ,LQ=CQ,r$=_Q,o$=OQ,i$=TQ,s$=MQ,a$=RQ,l$=PQ,c$=NQ,u$=$Q,jQ=DQ,zQ=AQ,FQ=LQ,BQ=p.forwardRef(({className:e,inset:t,children:n,...r},o)=>x.jsxs(c$,{ref:o,className:je("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[n,x.jsx(R4,{className:"w-4 h-4 ml-auto"})]}));BQ.displayName=c$.displayName;const VQ=p.forwardRef(({className:e,...t},n)=>x.jsx(u$,{ref:n,className:je("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));VQ.displayName=u$.displayName;const tw=p.forwardRef(({className:e,sideOffset:t=4,container:n,...r},o)=>x.jsx(IQ,{container:n,children:x.jsx(n$,{ref:o,sideOffset:t,className:je("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));tw.displayName=n$.displayName;const si=p.forwardRef(({className:e,inset:t,...n},r)=>x.jsx(o$,{ref:r,className:je("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));si.displayName=o$.displayName;const UQ=p.forwardRef(({className:e,children:t,checked:n,...r},o)=>x.jsxs(i$,{ref:o,className:je("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[x.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:x.jsx(a$,{children:x.jsx(Df,{className:"w-4 h-4"})})}),t]}));UQ.displayName=i$.displayName;const HQ=p.forwardRef(({className:e,children:t,...n},r)=>x.jsxs(s$,{ref:r,className:je("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[x.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:x.jsx(a$,{children:x.jsx(N4,{className:"w-2 h-2 fill-current"})})}),t]}));HQ.displayName=s$.displayName;const WQ=p.forwardRef(({className:e,inset:t,...n},r)=>x.jsx(r$,{ref:r,className:je("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));WQ.displayName=r$.displayName;const KQ=p.forwardRef(({className:e,...t},n)=>x.jsx(l$,{ref:n,className:je("-mx-1 my-1 h-px bg-muted",e),...t}));KQ.displayName=l$.displayName;function Im(e){"@babel/helpers - typeof";return Im=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Im(e)}function Ga(e){if(e===null||e===!0||e===!1)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function Zt(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function br(e){Zt(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||Im(e)==="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):((typeof e=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function qQ(e,t){Zt(2,arguments);var n=br(e).getTime(),r=Ga(t);return new Date(n+r)}var GQ={};function Xg(){return GQ}function YQ(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}function UC(e){Zt(1,arguments);var t=br(e);return t.setHours(0,0,0,0),t}function XQ(e){return Zt(1,arguments),e instanceof Date||Im(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function ZQ(e){if(Zt(1,arguments),!XQ(e)&&typeof e!="number")return!1;var t=br(e);return!isNaN(Number(t))}function JQ(e){Zt(1,arguments);var t=br(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function QQ(e){Zt(1,arguments);var t=br(e);return t.setDate(1),t.setHours(0,0,0,0),t}function eee(e,t){Zt(2,arguments);var n=Ga(t);return qQ(e,-n)}var tee=864e5;function nee(e){Zt(1,arguments);var t=br(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=t.getTime(),o=n-r;return Math.floor(o/tee)+1}function Lm(e){Zt(1,arguments);var t=1,n=br(e),r=n.getUTCDay(),o=(r<t?7:0)+r-t;return n.setUTCDate(n.getUTCDate()-o),n.setUTCHours(0,0,0,0),n}function d$(e){Zt(1,arguments);var t=br(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var o=Lm(r),i=new Date(0);i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0);var s=Lm(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function ree(e){Zt(1,arguments);var t=d$(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var r=Lm(n);return r}var oee=6048e5;function iee(e){Zt(1,arguments);var t=br(e),n=Lm(t).getTime()-ree(t).getTime();return Math.round(n/oee)+1}function jm(e,t){var n,r,o,i,s,a,l,c;Zt(1,arguments);var u=Xg(),d=Ga((n=(r=(o=(i=t==null?void 0:t.weekStartsOn)!==null&&i!==void 0?i:t==null||(s=t.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.weekStartsOn)!==null&&o!==void 0?o:u.weekStartsOn)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&n!==void 0?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=br(e),h=f.getUTCDay(),m=(h<d?7:0)+h-d;return f.setUTCDate(f.getUTCDate()-m),f.setUTCHours(0,0,0,0),f}function f$(e,t){var n,r,o,i,s,a,l,c;Zt(1,arguments);var u=br(e),d=u.getUTCFullYear(),f=Xg(),h=Ga((n=(r=(o=(i=t==null?void 0:t.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(s=t.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.firstWeekContainsDate)!==null&&o!==void 0?o:f.firstWeekContainsDate)!==null&&r!==void 0?r:(l=f.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&n!==void 0?n:1);if(!(h>=1&&h<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var m=new Date(0);m.setUTCFullYear(d+1,0,h),m.setUTCHours(0,0,0,0);var g=jm(m,t),b=new Date(0);b.setUTCFullYear(d,0,h),b.setUTCHours(0,0,0,0);var y=jm(b,t);return u.getTime()>=g.getTime()?d+1:u.getTime()>=y.getTime()?d:d-1}function see(e,t){var n,r,o,i,s,a,l,c;Zt(1,arguments);var u=Xg(),d=Ga((n=(r=(o=(i=t==null?void 0:t.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(s=t.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.firstWeekContainsDate)!==null&&o!==void 0?o:u.firstWeekContainsDate)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&n!==void 0?n:1),f=f$(e,t),h=new Date(0);h.setUTCFullYear(f,0,d),h.setUTCHours(0,0,0,0);var m=jm(h,t);return m}var aee=6048e5;function lee(e,t){Zt(1,arguments);var n=br(e),r=jm(n,t).getTime()-see(n,t).getTime();return Math.round(r/aee)+1}function Xe(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}var cee={y:function(t,n){var r=t.getUTCFullYear(),o=r>0?r:1-r;return Xe(n==="yy"?o%100:o,n.length)},M:function(t,n){var r=t.getUTCMonth();return n==="M"?String(r+1):Xe(r+1,2)},d:function(t,n){return Xe(t.getUTCDate(),n.length)},a:function(t,n){var r=t.getUTCHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h:function(t,n){return Xe(t.getUTCHours()%12||12,n.length)},H:function(t,n){return Xe(t.getUTCHours(),n.length)},m:function(t,n){return Xe(t.getUTCMinutes(),n.length)},s:function(t,n){return Xe(t.getUTCSeconds(),n.length)},S:function(t,n){var r=n.length,o=t.getUTCMilliseconds(),i=Math.floor(o*Math.pow(10,r-3));return Xe(i,n.length)}};const qi=cee;var bl={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},uee={G:function(t,n,r){var o=t.getUTCFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return r.era(o,{width:"abbreviated"});case"GGGGG":return r.era(o,{width:"narrow"});case"GGGG":default:return r.era(o,{width:"wide"})}},y:function(t,n,r){if(n==="yo"){var o=t.getUTCFullYear(),i=o>0?o:1-o;return r.ordinalNumber(i,{unit:"year"})}return qi.y(t,n)},Y:function(t,n,r,o){var i=f$(t,o),s=i>0?i:1-i;if(n==="YY"){var a=s%100;return Xe(a,2)}return n==="Yo"?r.ordinalNumber(s,{unit:"year"}):Xe(s,n.length)},R:function(t,n){var r=d$(t);return Xe(r,n.length)},u:function(t,n){var r=t.getUTCFullYear();return Xe(r,n.length)},Q:function(t,n,r){var o=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"Q":return String(o);case"QQ":return Xe(o,2);case"Qo":return r.ordinalNumber(o,{unit:"quarter"});case"QQQ":return r.quarter(o,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(o,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(o,{width:"wide",context:"formatting"})}},q:function(t,n,r){var o=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"q":return String(o);case"qq":return Xe(o,2);case"qo":return r.ordinalNumber(o,{unit:"quarter"});case"qqq":return r.quarter(o,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(o,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(o,{width:"wide",context:"standalone"})}},M:function(t,n,r){var o=t.getUTCMonth();switch(n){case"M":case"MM":return qi.M(t,n);case"Mo":return r.ordinalNumber(o+1,{unit:"month"});case"MMM":return r.month(o,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(o,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(o,{width:"wide",context:"formatting"})}},L:function(t,n,r){var o=t.getUTCMonth();switch(n){case"L":return String(o+1);case"LL":return Xe(o+1,2);case"Lo":return r.ordinalNumber(o+1,{unit:"month"});case"LLL":return r.month(o,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(o,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(o,{width:"wide",context:"standalone"})}},w:function(t,n,r,o){var i=lee(t,o);return n==="wo"?r.ordinalNumber(i,{unit:"week"}):Xe(i,n.length)},I:function(t,n,r){var o=iee(t);return n==="Io"?r.ordinalNumber(o,{unit:"week"}):Xe(o,n.length)},d:function(t,n,r){return n==="do"?r.ordinalNumber(t.getUTCDate(),{unit:"date"}):qi.d(t,n)},D:function(t,n,r){var o=nee(t);return n==="Do"?r.ordinalNumber(o,{unit:"dayOfYear"}):Xe(o,n.length)},E:function(t,n,r){var o=t.getUTCDay();switch(n){case"E":case"EE":case"EEE":return r.day(o,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(o,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(o,{width:"short",context:"formatting"});case"EEEE":default:return r.day(o,{width:"wide",context:"formatting"})}},e:function(t,n,r,o){var i=t.getUTCDay(),s=(i-o.weekStartsOn+8)%7||7;switch(n){case"e":return String(s);case"ee":return Xe(s,2);case"eo":return r.ordinalNumber(s,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});case"eeee":default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(t,n,r,o){var i=t.getUTCDay(),s=(i-o.weekStartsOn+8)%7||7;switch(n){case"c":return String(s);case"cc":return Xe(s,n.length);case"co":return r.ordinalNumber(s,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});case"cccc":default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(t,n,r){var o=t.getUTCDay(),i=o===0?7:o;switch(n){case"i":return String(i);case"ii":return Xe(i,n.length);case"io":return r.ordinalNumber(i,{unit:"day"});case"iii":return r.day(o,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(o,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(o,{width:"short",context:"formatting"});case"iiii":default:return r.day(o,{width:"wide",context:"formatting"})}},a:function(t,n,r){var o=t.getUTCHours(),i=o/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,n,r){var o=t.getUTCHours(),i;switch(o===12?i=bl.noon:o===0?i=bl.midnight:i=o/12>=1?"pm":"am",n){case"b":case"bb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(t,n,r){var o=t.getUTCHours(),i;switch(o>=17?i=bl.evening:o>=12?i=bl.afternoon:o>=4?i=bl.morning:i=bl.night,n){case"B":case"BB":case"BBB":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(t,n,r){if(n==="ho"){var o=t.getUTCHours()%12;return o===0&&(o=12),r.ordinalNumber(o,{unit:"hour"})}return qi.h(t,n)},H:function(t,n,r){return n==="Ho"?r.ordinalNumber(t.getUTCHours(),{unit:"hour"}):qi.H(t,n)},K:function(t,n,r){var o=t.getUTCHours()%12;return n==="Ko"?r.ordinalNumber(o,{unit:"hour"}):Xe(o,n.length)},k:function(t,n,r){var o=t.getUTCHours();return o===0&&(o=24),n==="ko"?r.ordinalNumber(o,{unit:"hour"}):Xe(o,n.length)},m:function(t,n,r){return n==="mo"?r.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):qi.m(t,n)},s:function(t,n,r){return n==="so"?r.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):qi.s(t,n)},S:function(t,n){return qi.S(t,n)},X:function(t,n,r,o){var i=o._originalDate||t,s=i.getTimezoneOffset();if(s===0)return"Z";switch(n){case"X":return WC(s);case"XXXX":case"XX":return aa(s);case"XXXXX":case"XXX":default:return aa(s,":")}},x:function(t,n,r,o){var i=o._originalDate||t,s=i.getTimezoneOffset();switch(n){case"x":return WC(s);case"xxxx":case"xx":return aa(s);case"xxxxx":case"xxx":default:return aa(s,":")}},O:function(t,n,r,o){var i=o._originalDate||t,s=i.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+HC(s,":");case"OOOO":default:return"GMT"+aa(s,":")}},z:function(t,n,r,o){var i=o._originalDate||t,s=i.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+HC(s,":");case"zzzz":default:return"GMT"+aa(s,":")}},t:function(t,n,r,o){var i=o._originalDate||t,s=Math.floor(i.getTime()/1e3);return Xe(s,n.length)},T:function(t,n,r,o){var i=o._originalDate||t,s=i.getTime();return Xe(s,n.length)}};function HC(e,t){var n=e>0?"-":"+",r=Math.abs(e),o=Math.floor(r/60),i=r%60;if(i===0)return n+String(o);var s=t||"";return n+String(o)+s+Xe(i,2)}function WC(e,t){if(e%60===0){var n=e>0?"-":"+";return n+Xe(Math.abs(e)/60,2)}return aa(e,t)}function aa(e,t){var n=t||"",r=e>0?"-":"+",o=Math.abs(e),i=Xe(Math.floor(o/60),2),s=Xe(o%60,2);return r+i+n+s}var KC=function(t,n){switch(t){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},p$=function(t,n){switch(t){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},dee=function(t,n){var r=t.match(/(P+)(p+)?/)||[],o=r[1],i=r[2];if(!i)return KC(t,n);var s;switch(o){case"P":s=n.dateTime({width:"short"});break;case"PP":s=n.dateTime({width:"medium"});break;case"PPP":s=n.dateTime({width:"long"});break;case"PPPP":default:s=n.dateTime({width:"full"});break}return s.replace("{{date}}",KC(o,n)).replace("{{time}}",p$(i,n))},fee={p:p$,P:dee},pee=["D","DD"],hee=["YY","YYYY"];function mee(e){return pee.indexOf(e)!==-1}function gee(e){return hee.indexOf(e)!==-1}function qC(e,t,n){if(e==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var vee={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},yee=function(t,n,r){var o,i=vee[t];return typeof i=="string"?o=i:n===1?o=i.one:o=i.other.replace("{{count}}",n.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+o:o+" ago":o};const xee=yee;function xy(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth,r=e.formats[n]||e.formats[e.defaultWidth];return r}}var bee={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},wee={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},See={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},kee={date:xy({formats:bee,defaultWidth:"full"}),time:xy({formats:wee,defaultWidth:"full"}),dateTime:xy({formats:See,defaultWidth:"full"})};const Eee=kee;var Cee={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},_ee=function(t,n,r,o){return Cee[t]};const Oee=_ee;function mu(e){return function(t,n){var r=n!=null&&n.context?String(n.context):"standalone",o;if(r==="formatting"&&e.formattingValues){var i=e.defaultFormattingWidth||e.defaultWidth,s=n!=null&&n.width?String(n.width):i;o=e.formattingValues[s]||e.formattingValues[i]}else{var a=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;o=e.values[l]||e.values[a]}var c=e.argumentCallback?e.argumentCallback(t):t;return o[c]}}var Tee={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Mee={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Ree={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Pee={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Nee={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},$ee={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Dee=function(t,n){var r=Number(t),o=r%100;if(o>20||o<10)switch(o%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},Aee={ordinalNumber:Dee,era:mu({values:Tee,defaultWidth:"wide"}),quarter:mu({values:Mee,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:mu({values:Ree,defaultWidth:"wide"}),day:mu({values:Pee,defaultWidth:"wide"}),dayPeriod:mu({values:Nee,defaultWidth:"wide",formattingValues:$ee,defaultFormattingWidth:"wide"})};const Iee=Aee;function gu(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;var s=i[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?jee(a,function(d){return d.test(s)}):Lee(a,function(d){return d.test(s)}),c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;var u=t.slice(s.length);return{value:c,rest:u}}}function Lee(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function jee(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}function zee(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.match(e.matchPattern);if(!r)return null;var o=r[0],i=t.match(e.parsePattern);if(!i)return null;var s=e.valueCallback?e.valueCallback(i[0]):i[0];s=n.valueCallback?n.valueCallback(s):s;var a=t.slice(o.length);return{value:s,rest:a}}}var Fee=/^(\d+)(th|st|nd|rd)?/i,Bee=/\d+/i,Vee={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Uee={any:[/^b/i,/^(a|c)/i]},Hee={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Wee={any:[/1/i,/2/i,/3/i,/4/i]},Kee={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},qee={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Gee={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Yee={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Xee={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Zee={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Jee={ordinalNumber:zee({matchPattern:Fee,parsePattern:Bee,valueCallback:function(t){return parseInt(t,10)}}),era:gu({matchPatterns:Vee,defaultMatchWidth:"wide",parsePatterns:Uee,defaultParseWidth:"any"}),quarter:gu({matchPatterns:Hee,defaultMatchWidth:"wide",parsePatterns:Wee,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:gu({matchPatterns:Kee,defaultMatchWidth:"wide",parsePatterns:qee,defaultParseWidth:"any"}),day:gu({matchPatterns:Gee,defaultMatchWidth:"wide",parsePatterns:Yee,defaultParseWidth:"any"}),dayPeriod:gu({matchPatterns:Xee,defaultMatchWidth:"any",parsePatterns:Zee,defaultParseWidth:"any"})};const Qee=Jee;var ete={code:"en-US",formatDistance:xee,formatLong:Eee,formatRelative:Oee,localize:Iee,match:Qee,options:{weekStartsOn:0,firstWeekContainsDate:1}};const h$=ete;var tte=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,nte=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,rte=/^'([^]*?)'?$/,ote=/''/g,ite=/[a-zA-Z]/;function il(e,t,n){var r,o,i,s,a,l,c,u,d,f,h,m,g,b,y,v,w,S;Zt(2,arguments);var k=String(t),C=Xg(),E=(r=(o=n==null?void 0:n.locale)!==null&&o!==void 0?o:C.locale)!==null&&r!==void 0?r:h$,T=Ga((i=(s=(a=(l=n==null?void 0:n.firstWeekContainsDate)!==null&&l!==void 0?l:n==null||(c=n.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&a!==void 0?a:C.firstWeekContainsDate)!==null&&s!==void 0?s:(d=C.locale)===null||d===void 0||(f=d.options)===null||f===void 0?void 0:f.firstWeekContainsDate)!==null&&i!==void 0?i:1);if(!(T>=1&&T<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var R=Ga((h=(m=(g=(b=n==null?void 0:n.weekStartsOn)!==null&&b!==void 0?b:n==null||(y=n.locale)===null||y===void 0||(v=y.options)===null||v===void 0?void 0:v.weekStartsOn)!==null&&g!==void 0?g:C.weekStartsOn)!==null&&m!==void 0?m:(w=C.locale)===null||w===void 0||(S=w.options)===null||S===void 0?void 0:S.weekStartsOn)!==null&&h!==void 0?h:0);if(!(R>=0&&R<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!E.localize)throw new RangeError("locale must contain localize property");if(!E.formatLong)throw new RangeError("locale must contain formatLong property");var $=br(e);if(!ZQ($))throw new RangeError("Invalid time value");var j=YQ($),z=eee($,j),ee={firstWeekContainsDate:T,weekStartsOn:R,locale:E,_originalDate:$},V=k.match(nte).map(function(U){var O=U[0];if(O==="p"||O==="P"){var M=fee[O];return M(U,E.formatLong)}return U}).join("").match(tte).map(function(U){if(U==="''")return"'";var O=U[0];if(O==="'")return ste(U);var M=uee[O];if(M)return!(n!=null&&n.useAdditionalWeekYearTokens)&&gee(U)&&qC(U,t,String(e)),!(n!=null&&n.useAdditionalDayOfYearTokens)&&mee(U)&&qC(U,t,String(e)),M(z,U,E.localize,ee);if(O.match(ite))throw new RangeError("Format string contains an unescaped latin alphabet character `"+O+"`");return U}).join("");return V}function ste(e){var t=e.match(rte);return t?t[1].replace(ote,"'"):e}var Et=function(){return Et=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Et.apply(this,arguments)};var m$={exports:{}},vu={};/**
412
- * @license React
413
- * react-jsx-runtime.production.min.js
414
- *
415
- * Copyright (c) Facebook, Inc. and its affiliates.
416
- *
417
- * This source code is licensed under the MIT license found in the
418
- * LICENSE file in the root directory of this source tree.
419
- */var GC;function ate(){if(GC)return vu;GC=1;var e=H,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function s(a,l,c){var u,d={},f=null,h=null;c!==void 0&&(f=""+c),l.key!==void 0&&(f=""+l.key),l.ref!==void 0&&(h=l.ref);for(u in l)r.call(l,u)&&!i.hasOwnProperty(u)&&(d[u]=l[u]);if(a&&a.defaultProps)for(u in l=a.defaultProps,l)d[u]===void 0&&(d[u]=l[u]);return{$$typeof:t,type:a,key:f,ref:h,props:d,_owner:o.current}}return vu.Fragment=n,vu.jsx=s,vu.jsxs=s,vu}m$.exports=ate();var g$=m$.exports;function lte(e){return e.mode==="multiple"}function cte(e){return e.mode==="range"}function ute(e){return e.mode==="single"}var dte={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};function fte(e,t){return il(e,"LLLL y",t)}function pte(e,t){return il(e,"d",t)}function hte(e,t){return il(e,"LLLL",t)}function mte(e){return"".concat(e)}function gte(e,t){return il(e,"cccccc",t)}function vte(e,t){return il(e,"yyyy",t)}var yte=Object.freeze({__proto__:null,formatCaption:fte,formatDay:pte,formatMonthCaption:hte,formatWeekNumber:mte,formatWeekdayName:gte,formatYearCaption:vte}),xte=function(e,t,n){return il(e,"do MMMM (EEEE)",n)},bte=function(){return"Month: "},wte=function(){return"Go to next month"},Ste=function(){return"Go to previous month"},kte=function(e,t){return il(e,"cccc",t)},Ete=function(e){return"Week n. ".concat(e)},Cte=function(){return"Year: "},_te=Object.freeze({__proto__:null,labelDay:xte,labelMonthDropdown:bte,labelNext:wte,labelPrevious:Ste,labelWeekNumber:Ete,labelWeekday:kte,labelYearDropdown:Cte});function Ote(){var e="buttons",t=dte,n=h$,r={},o={},i=1,s={},a=new Date;return{captionLayout:e,classNames:t,formatters:yte,labels:_te,locale:n,modifiersClassNames:r,modifiers:o,numberOfMonths:i,styles:s,today:a,mode:"default"}}function Tte(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,o=e.toMonth,i=e.fromDate,s=e.toDate;return r?i=QQ(r):t&&(i=new Date(t,0,1)),o?s=JQ(o):n&&(s=new Date(n,11,31)),{fromDate:i?UC(i):void 0,toDate:s?UC(s):void 0}}var v$=p.createContext(void 0);function Mte(e){var t,n=e.initialProps,r=Ote(),o=Tte(n),i=o.fromDate,s=o.toDate,a=(t=n.captionLayout)!==null&&t!==void 0?t:r.captionLayout;a!=="buttons"&&(!i||!s)&&(a="buttons");var l;(ute(n)||lte(n)||cte(n))&&(l=n.onSelect);var c=Et(Et(Et({},r),n),{captionLayout:a,classNames:Et(Et({},r.classNames),n.classNames),components:Et({},n.components),formatters:Et(Et({},r.formatters),n.formatters),fromDate:i,labels:Et(Et({},r.labels),n.labels),mode:n.mode||r.mode,modifiers:Et(Et({},r.modifiers),n.modifiers),modifiersClassNames:Et(Et({},r.modifiersClassNames),n.modifiersClassNames),onSelect:l,styles:Et(Et({},r.styles),n.styles),toDate:s});return g$.jsx(v$.Provider,{value:c,children:e.children})}function Rte(){var e=p.useContext(v$);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}p.createContext(void 0);p.forwardRef(function(e,t){var n=Rte(),r=n.classNames,o=n.styles,i=[r.button_reset,r.button];e.className&&i.push(e.className);var s=i.join(" "),a=Et(Et({},o.button_reset),o.button);return e.style&&Object.assign(a,e.style),g$.jsx("button",Et({},e,{ref:t,type:"button",className:s,style:a}))});p.createContext(void 0);p.createContext(void 0);var Wo;(function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"})(Wo||(Wo={}));Wo.Selected;Wo.Disabled;Wo.Hidden;Wo.Today;Wo.RangeEnd;Wo.RangeMiddle;Wo.RangeStart;Wo.Outside;p.createContext(void 0);p.createContext(void 0);p.createContext(void 0);var Pte=Object.defineProperty,Nte=Object.getOwnPropertyDescriptor,Kf=(e,t,n,r)=>{for(var o=r>1?void 0:r?Nte(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&Pte(t,n,o),o},$te={icon:"bold",label:({t:e})=>e(rE.LABEL),description:({t:e})=>e(rE.DESCRIPTION)},Ya=class extends Vf{get name(){return"bold"}createTags(){return[Me.FormattingMark,Me.FontStyle]}createMarkSpec(e,t){return{...t,attrs:e.defaults(),parseDOM:[{tag:"strong",getAttrs:e.parse},{tag:"b",getAttrs:n=>Vo(n)&&n.style.fontWeight!=="normal"?e.parse(n):!1},{style:"font-weight",getAttrs:n=>xe(n)&&/^(bold(er)?|[5-9]\d{2,})$/.test(n)?null:!1},...t.parseDOM??[]],toDOM:n=>{const{weight:r}=this.options;return r?["strong",{"font-weight":r.toString()},0]:["strong",e.dom(n),0]}}}createInputRules(){return[Sm({regexp:/(?:\*\*|__)([^*_]+)(?:\*\*|__)$/,type:this.type,ignoreWhitespace:!0})]}toggleBold(e){return rf({type:this.type,selection:e})}setBold(e){return({tr:t,dispatch:n})=>{const{from:r,to:o}=Dr(e??t.selection,t.doc);return n==null||n(t.addMark(r,o,this.type.create())),!0}}removeBold(e){return({tr:t,dispatch:n})=>{const{from:r,to:o}=Dr(e??t.selection,t.doc);return t.doc.rangeHasMark(r,o,this.type)?(n==null||n(t.removeMark(r,o,this.type)),!0):!1}}shortcut(e){return this.toggleBold()(e)}};Kf([ie($te)],Ya.prototype,"toggleBold",1);Kf([ie()],Ya.prototype,"setBold",1);Kf([ie()],Ya.prototype,"removeBold",1);Kf([yr({shortcut:q.Bold,command:"toggleBold"})],Ya.prototype,"shortcut",1);Ya=Kf([He({defaultOptions:{weight:void 0},staticKeys:["weight"]})],Ya);var Dte=Object.defineProperty,Ate=Object.getOwnPropertyDescriptor,nw=(e,t,n,r)=>{for(var o=r>1?void 0:r?Ate(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&Dte(t,n,o),o},Ite={icon:"italic",label:({t:e})=>e(oE.LABEL),description:({t:e})=>e(oE.DESCRIPTION)},gf=class extends Vf{get name(){return"italic"}createTags(){return[Me.FontStyle,Me.FormattingMark]}createMarkSpec(e,t){return{...t,attrs:e.defaults(),parseDOM:[{tag:"i",getAttrs:e.parse},{tag:"em",getAttrs:e.parse},{style:"font-style=italic"},...t.parseDOM??[]],toDOM:n=>["em",e.dom(n),0]}}createKeymap(){return{"Mod-i":rf({type:this.type})}}createInputRules(){return[Sm({regexp:/(?:^|[^*])\*([^*]+)\*$/,type:this.type,ignoreWhitespace:!0,updateCaptured:({fullMatch:e,start:t})=>e.startsWith("*")?{}:{fullMatch:e.slice(1),start:t+1}}),Sm({regexp:/(?:^|\W)_([^_]+)_$/,type:this.type,ignoreWhitespace:!0,updateCaptured:({fullMatch:e,start:t})=>e.startsWith("_")?{}:{fullMatch:e.slice(1),start:t+1}})]}createPasteRules(){return[{type:"mark",markType:this.type,regexp:/(?:^|\W)_([^_]+)_/g},{type:"mark",markType:this.type,regexp:/\*([^*]+)\*/g}]}toggleItalic(e){return rf({type:this.type,selection:e})}shortcut(e){return this.toggleItalic()(e)}};nw([ie(Ite)],gf.prototype,"toggleItalic",1);nw([yr({shortcut:q.Italic,command:"toggleItalic"})],gf.prototype,"shortcut",1);gf=nw([He({})],gf);var Lte=Object.defineProperty,jte=Object.getOwnPropertyDescriptor,rw=(e,t,n,r)=>{for(var o=r>1?void 0:r?jte(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&Lte(t,n,o),o},zte={icon:"strikethrough",label:({t:e})=>e(iE.LABEL),description:({t:e})=>e(iE.DESCRIPTION)},vf=class extends Vf{get name(){return"strike"}createTags(){return[Me.FontStyle,Me.FormattingMark]}createMarkSpec(e,t){return{...t,attrs:e.defaults(),parseDOM:[{tag:"s",getAttrs:e.parse},{tag:"del",getAttrs:e.parse},{tag:"strike",getAttrs:e.parse},{style:"text-decoration",getAttrs:n=>n==="line-through"?{}:!1},...t.parseDOM??[]],toDOM:n=>["s",e.dom(n),0]}}toggleStrike(){return rf({type:this.type})}shortcut(e){return this.toggleStrike()(e)}createInputRules(){return[Sm({regexp:/~([^~]+)~$/,type:this.type,ignoreWhitespace:!0})]}createPasteRules(){return[{regexp:/~([^~]+)~/g,type:"mark",markType:this.type}]}};rw([ie(zte)],vf.prototype,"toggleStrike",1);rw([yr({shortcut:q.Strike,command:"toggleStrike"})],vf.prototype,"shortcut",1);vf=rw([He({})],vf);var y$=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},We=(e,t,n)=>(y$(e,t,"read from private field"),n?n.call(e):t.get(e)),Pl=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},ns=(e,t,n,r)=>(y$(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Fte='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="22" height="22" fill="rgba(0, 0, 0, 0.65)" stroke="rgba(255, 255, 255, 0.5)" transform="rotate(90)" xmlns:v="https://vecta.io/nano"><path fill-rule="evenodd" d="M14 0a2 2 0 0 0-2 2v10H2a2 2 0 1 0 0 4h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z"/></svg>',Bte='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="22" height="22" fill="rgba(0, 0, 0, 0.65)" stroke="rgba(255, 255, 255, 0.5)" transform="matrix(0 1 1 0 0 0)" xmlns:v="https://vecta.io/nano"><path fill-rule="evenodd" d="M14 0a2 2 0 0 0-2 2v10H2a2 2 0 1 0 0 4h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z"/></svg>',Vte=encodeURIComponent(Fte),Ute=encodeURIComponent(Bte),An,Hte=class{constructor(e){Pl(this,An,void 0);const t=document.createElement("div"),n=document.createElement("div");this.dom=t,ns(this,An,n),this.type=e,this.createHandle(e)}createHandle(e){switch(fn(this.dom,{position:"absolute",pointerEvents:"auto",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"100"}),fn(We(this,An),{opacity:"0",transition:"opacity 300ms ease-in 0s"}),We(this,An).dataset.dragging="",e){case 0:fn(this.dom,{right:"0px",top:"0px",height:"100%",width:"15px",cursor:"col-resize"}),fn(We(this,An),{width:" 4px",height:"36px",maxHeight:"50%",boxSizing:"content-box",background:"rgba(0, 0, 0, 0.65)",border:"1px solid rgba(255, 255, 255, 0.5)",borderRadius:"6px"});break;case 1:fn(this.dom,{left:"0px",top:"0px",height:"100%",width:"15px",cursor:"col-resize"}),fn(We(this,An),{width:" 4px",height:"36px",maxHeight:"50%",boxSizing:"content-box",background:"rgba(0, 0, 0, 0.65)",border:"1px solid rgba(255, 255, 255, 0.5)",borderRadius:"6px"});break;case 2:fn(this.dom,{bottom:"0px",width:"100%",height:"14px",cursor:"row-resize"}),fn(We(this,An),{width:" 42px",height:"4px",boxSizing:"content-box",maxWidth:"50%",background:"rgba(0, 0, 0, 0.65)",border:"1px solid rgba(255, 255, 255, 0.5)",borderRadius:"6px"});break;case 3:fn(this.dom,{right:"-1px",bottom:"-2px",width:"30px",height:"30px",cursor:"nwse-resize",zIndex:"101"}),fn(We(this,An),{height:"22px",width:"22px",backgroundRepeat:"no-repeat",backgroundImage:`url("data:image/svg+xml,${Ute}") `});break;case 4:fn(this.dom,{left:"-1px",bottom:"-2px",width:"30px",height:"30px",cursor:"nesw-resize",zIndex:"101"}),fn(We(this,An),{height:"22px",width:"22px",backgroundRepeat:"no-repeat",backgroundImage:`url("data:image/svg+xml,${Vte}") `});break}this.dom.append(We(this,An))}setHandleVisibility(e){const t=e||!!We(this,An).dataset.dragging;We(this,An).style.opacity=t?"1":"0"}dataSetDragging(e){We(this,An).dataset.dragging=e?"true":""}};An=new WeakMap;var Ip=50,x$=(e=>(e[e.Fixed=0]="Fixed",e[e.Flexible=1]="Flexible",e))(x$||{}),la,ca,ua,ri,da,Wte=class{constructor({node:e,view:t,getPos:n,aspectRatio:r=0,options:o,initialSize:i}){Pl(this,la,void 0),Pl(this,ca,void 0),Pl(this,ua,[]),Pl(this,ri,void 0),Pl(this,da,void 0);const s=this.createWrapper(e,i),a=this.createElement({node:e,view:t,getPos:n,options:o}),c=(r===1?[0,1,2,3,4]:[0,1]).map(f=>new Hte(f));for(const f of c){const h=m=>{this.startResizing(m,t,n,f)};f.dom.addEventListener("mousedown",h),We(this,ua).push(()=>f.dom.removeEventListener("mousedown",h)),s.append(f.dom)}const u=()=>{c.forEach(f=>f.setHandleVisibility(!0))},d=()=>{c.forEach(f=>f.setHandleVisibility(!1))};s.addEventListener("mouseover",u),s.addEventListener("mouseout",d),We(this,ua).push(()=>s.removeEventListener("mouseover",u),()=>s.removeEventListener("mouseout",d)),s.append(a),this.dom=s,ns(this,ca,e),ns(this,la,a),this.aspectRatio=r}createWrapper(e,t){const n=document.createElement("div");return n.classList.add("remirror-resizable-view"),n.style.position="relative",t?fn(n,{width:YC(t.width),aspectRatio:`${t.width} / ${t.height}`}):fn(n,{width:YC(e.attrs.width),aspectRatio:`${e.attrs.width} / ${e.attrs.height}`}),fn(n,{maxWidth:"100%",minWidth:`${Ip}px`,verticalAlign:"bottom",display:"inline-block",lineHeight:"0",transition:"width 0.15s ease-out, height 0.15s ease-out"}),n}startResizing(e,t,n,r){var o,i;e.preventDefault(),r.dataSetDragging(!0),We(this,la).style.pointerEvents="none";const s=e.pageX,a=e.pageY,l=((o=We(this,la))==null?void 0:o.getBoundingClientRect().width)||0,c=((i=We(this,la))==null?void 0:i.getBoundingClientRect().height)||0,u=K0(100,!1,f=>{const h=f.pageX,m=f.pageY,g=h-s,b=m-a;let y=null,v=null;if(this.aspectRatio===0&&l&&c)switch(r.type){case 0:case 3:y=l+g,v=c/l*y;break;case 1:case 4:y=l-g,v=c/l*y;break;case 2:v=c+b,y=l/c*v;break}else if(this.aspectRatio===1)switch(r.type){case 0:y=l+g;break;case 1:y=l-g;break;case 2:v=c+b;break;case 3:y=l+g,v=c+b;break;case 4:y=l-g,v=c+b;break}typeof y=="number"&&y<Ip&&(this.aspectRatio===0&&l&&c?(y=Ip,v=c/l*y):this.aspectRatio===1&&(y=Ip)),y&&(ns(this,ri,Math.round(y)),this.dom.style.width=`${We(this,ri)}px`),v&&ns(this,da,Math.round(v)),(y||v)&&(this.dom.style.aspectRatio=`${We(this,ri)} / ${We(this,da)}`)}),d=f=>{f.preventDefault(),r.dataSetDragging(!1),r.setHandleVisibility(!1),We(this,la).style.pointerEvents="auto",document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",d);const h=n(),m=t.state.tr.setNodeMarkup(h,void 0,{...We(this,ca).attrs,width:We(this,ri),height:We(this,da)});t.dispatch(m)};document.addEventListener("mousemove",u),document.addEventListener("mouseup",d),We(this,ua).push(()=>document.removeEventListener("mousemove",u)),We(this,ua).push(()=>document.removeEventListener("mouseup",d))}update(e){return e.type!==We(this,ca).type||this.aspectRatio===0&&e.attrs.width&&e.attrs.width!==We(this,ri)||this.aspectRatio===1&&e.attrs.width&&e.attrs.height&&e.attrs.width!==We(this,ri)&&e.attrs.height!==We(this,da)||!Kte(We(this,ca),e,["width","height"])?!1:(ns(this,ca,e),ns(this,ri,e.attrs.width),ns(this,da,e.attrs.height),!0)}destroy(){We(this,ua).forEach(e=>e())}};la=new WeakMap;ca=new WeakMap;ua=new WeakMap;ri=new WeakMap;da=new WeakMap;function Kte(e,t,n){return e===t||qte(e,t,n)&&e.content.eq(t.content)}function qte(e,t,n){const r=e.attrs,o=t.attrs,i={};for(const a of n)i[a]=null;e.attrs={...r,...i},t.attrs={...o,...i};const s=e.sameMarkup(t);return e.attrs=r,t.attrs=o,s}function YC(e){return typeof e=="number"?`${e}px`:e||void 0}var Gte=Object.defineProperty,Yte=Object.getOwnPropertyDescriptor,ow=(e,t,n,r)=>{for(var o=r>1?void 0:r?Yte(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&Gte(t,n,o),o},Xte=class extends Wte{constructor(e,t,n){super({node:e,view:t,getPos:n,aspectRatio:x$.Fixed})}createElement({node:e}){const t=document.createElement("img");return t.setAttribute("src",e.attrs.src),fn(t,{width:"100%",minWidth:"50px",objectFit:"contain"}),t}},yf=class extends zr{get name(){return"image"}createTags(){return[Me.InlineNode,Me.Media]}createNodeSpec(e,t){const{preferPastedTextContent:n}=this.options;return{inline:!0,draggable:!0,selectable:!1,...t,attrs:{...e.defaults(),alt:{default:""},crop:{default:null},height:{default:null},width:{default:null},rotate:{default:null},src:{default:null},title:{default:""},fileName:{default:null},resizable:{default:!1}},parseDOM:[{tag:"img[src]",getAttrs:r=>{var o;if(Vo(r)){const i=Jte({element:r,parse:e.parse});return n&&((o=i.src)!=null&&o.startsWith("file:///"))?!1:i}return{}}},...t.parseDOM??[]],toDOM:r=>{const o=dP(r.attrs,e);return["img",{...e.dom(r),...o}]}}}insertImage(e,t){return({tr:n,dispatch:r})=>{const{from:o,to:i}=Dr(t??n.selection,n.doc),s=this.type.create(e);return r==null||r(n.replaceRangeWith(o,i,s)),!0}}uploadImage(e,t){const{updatePlaceholder:n,destroyPlaceholder:r,createPlaceholder:o}=this.options;return i=>{const{tr:s}=i;let a=s.selection.from;return this.store.createPlaceholderCommand({promise:e,placeholder:{type:"widget",get pos(){return a},createElement:(l,c)=>{const u=o(l,c);return t==null||t(u),u},onUpdate:(l,c,u,d)=>{n(l,c,u,d)},onDestroy:(l,c)=>{r(l,c)}},onSuccess:(l,c,u)=>this.insertImage(l,c)(u)}).validate(({tr:l,dispatch:c})=>{const u=iR(l.doc,a,this.type);return u==null?!1:(a=u,l.selection.empty||c==null||c(l.deleteSelection()),!0)},"unshift").generateCommand()(i)}}fileUploadFileHandler(e,t,n){var r;const{preferPastedTextContent:o,uploadHandler:i}=this.options;if(o&&tne(t)&&((r=t.clipboardData)!=null&&r.getData("text/plain")))return!1;const{commands:s,chain:a}=this.store,l=e.map((u,d)=>({file:u,progress:f=>{s.updatePlaceholder(c[d],f)}})),c=i(l);dr(n)&&a.selectText(n);for(const u of c)a.uploadImage(u);return a.run(),!0}createPasteRules(){return[{type:"file",regexp:/image/i,fileHandler:e=>{const t=e.type==="drop"?e.pos:void 0;return this.fileUploadFileHandler(e.files,e.event,t)}}]}createNodeViews(){return this.options.enableResizing?(e,t,n)=>new Xte(e,t,n):{}}};ow([ie()],yf.prototype,"insertImage",1);ow([ie()],yf.prototype,"uploadImage",1);yf=ow([He({defaultOptions:{createPlaceholder:Qte,updatePlaceholder:()=>{},destroyPlaceholder:()=>{},uploadHandler:ene,enableResizing:!1,preferPastedTextContent:!0}})],yf);function Zte(e){let{width:t,height:n}=e.style;return t=t||e.getAttribute("width")||"",n=n||e.getAttribute("height")||"",{width:t,height:n}}function Jte({element:e,parse:t}){const{width:n,height:r}=Zte(e);return{...t(e),alt:e.getAttribute("alt")??"",height:Number.parseInt(r||"0",10)||null,src:e.getAttribute("src")??null,title:e.getAttribute("title")??"",width:Number.parseInt(n||"0",10)||null,fileName:e.getAttribute("data-file-name")??null}}function Qte(e,t){const n=document.createElement("div");return n.classList.add(MG.IMAGE_LOADER),n}function ene(e){he(e.length>0,{code:K.EXTENSION,message:"The upload handler was applied for the image extension without any valid files"});let t=0;const n=[];for(const{file:r,progress:o}of e)n.push(()=>new Promise(i=>{const s=new FileReader;s.addEventListener("load",a=>{var l;t+=1,o(t/e.length),i({src:(l=a.target)==null?void 0:l.result,fileName:r.name})},{once:!0}),s.readAsDataURL(r)}));return n}function tne(e){return e.clipboardData!==void 0}function nne(e={}){return new $i({view(t){return new rne(t,e)}})}class rne{constructor(t,n){var r;this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(o=>{let i=s=>{this[o](s)};return t.dom.addEventListener(o,i),{name:o,handler:i}})}destroy(){this.handlers.forEach(({name:t,handler:n})=>this.editorView.dom.removeEventListener(t,n))}update(t,n){this.cursorPos!=null&&n.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(t){t!=this.cursorPos&&(this.cursorPos=t,t==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let t=this.editorView.state.doc.resolve(this.cursorPos),n=!t.parent.inlineContent,r;if(n){let a=t.nodeBefore,l=t.nodeAfter;if(a||l){let c=this.editorView.nodeDOM(this.cursorPos-(a?a.nodeSize:0));if(c){let u=c.getBoundingClientRect(),d=a?u.bottom:u.top;a&&l&&(d=(d+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:u.left,right:u.right,top:d-this.width/2,bottom:d+this.width/2}}}}if(!r){let a=this.editorView.coordsAtPos(this.cursorPos);r={left:a.left-this.width/2,right:a.left+this.width/2,top:a.top,bottom:a.bottom}}let o=this.editorView.dom.offsetParent;this.element||(this.element=o.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let i,s;if(!o||o==document.body&&getComputedStyle(o).position=="static")i=-pageXOffset,s=-pageYOffset;else{let a=o.getBoundingClientRect();i=a.left-o.scrollLeft,s=a.top-o.scrollTop}this.element.style.left=r.left-i+"px",this.element.style.top=r.top-s+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(t){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),t)}dragover(t){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),o=r&&r.type.spec.disableDropCursor,i=typeof o=="function"?o(this.editorView,n,t):o;if(n&&!i){let s=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=sR(this.editorView.state.doc,s,this.editorView.dragging.slice);a!=null&&(s=a)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(t){(t.target==this.editorView.dom||!this.editorView.dom.contains(t.relatedTarget))&&this.setCursor(null)}}var one=Object.defineProperty,ine=Object.getOwnPropertyDescriptor,sne=(e,t,n,r)=>{for(var o=r>1?void 0:r?ine(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&one(t,n,o),o},$x=class extends ft{get name(){return"dropCursor"}createExternalPlugins(){const{color:e,width:t}=this.options;return[nne({color:e,width:t})]}};$x=sne([He({defaultOptions:{color:"black",width:1}})],$x);var ane=Object.defineProperty,lne=Object.getOwnPropertyDescriptor,b$=(e,t,n,r)=>{for(var o=r>1?void 0:r?lne(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&ane(t,n,o),o},{LABEL:cne}=_8,une={icon:({attrs:e})=>`h${(e==null?void 0:e.level)??"1"}`,label:({t:e,attrs:t})=>e({...cne,values:{level:t==null?void 0:t.level}})},dne=[q.H1,q.H2,q.H3,q.H4,q.H5,q.H6],zm=class extends zr{get name(){return"heading"}createTags(){return[Me.Block,Me.TextBlock,Me.FormattingNode]}createNodeSpec(e,t){return{content:"inline*",defining:!0,draggable:!1,...t,attrs:{...e.defaults(),level:{default:this.options.defaultLevel}},parseDOM:[...this.options.levels.map(n=>({tag:`h${n}`,getAttrs:r=>({...e.parse(r),level:n})})),...t.parseDOM??[]],toDOM:n=>this.options.levels.includes(n.attrs.level)?[`h${n.attrs.level}`,e.dom(n),0]:[`h${this.options.defaultLevel}`,e.dom(n),0]}}toggleHeading(e={}){return hP({type:this.type,toggleType:"paragraph",attrs:e})}createKeymap(e){const t=this.store.getExtension(De),n=ce(),r=[];for(const o of this.options.levels){const i=dne[o-1]??q.H1;n[i]=wm(this.type,{level:o}),r.push({attrs:{level:o},shortcut:e(i)[0]})}return t.updateDecorated("toggleHeading",{shortcut:r}),n}createInputRules(){return this.options.levels.map(e=>K8(new RegExp(`^(#{1,${e}})\\s$`),this.type,()=>({level:e})))}createPasteRules(){return this.options.levels.map(e=>({type:"node",nodeType:this.type,regexp:new RegExp(`^#{${e}}\\s([\\s\\w]+)$`),getAttributes:()=>({level:e}),startOfTextBlock:!0}))}};b$([ie(une)],zm.prototype,"toggleHeading",1);zm=b$([He({defaultOptions:{levels:[1,2,3,4,5,6],defaultLevel:1},staticKeys:["defaultLevel","levels"]})],zm);var w$={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(typeof self<"u"?self:_A,function(){return function(n){function r(i){if(o[i])return o[i].exports;var s=o[i]={i,l:!1,exports:{}};return n[i].call(s.exports,s,s.exports,r),s.l=!0,s.exports}var o={};return r.m=n,r.c=o,r.d=function(i,s,a){r.o(i,s)||Object.defineProperty(i,s,{configurable:!1,enumerable:!0,get:a})},r.n=function(i){var s=i&&i.__esModule?function(){return i.default}:function(){return i};return r.d(s,"a",s),s},r.o=function(i,s){return Object.prototype.hasOwnProperty.call(i,s)},r.p="",r(r.s=0)}([function(n,r,o){function i(){throw new TypeError("The given URL is not a string. Please verify your string|array.")}function s(c){typeof c!="string"&&i();for(var u=0,d=0,f=0,h=c.length,m=0;h--&&++m&&!(u&&-1<a.indexOf(c[m]));)c[m]==="."&&(++u,d=m);for(u=m,m=d;m--;)if(l.indexOf(c[m])!==-1){f=m+1;break}return 2>f?"":c.slice(f,u)}var a=["/",":","?","#"],l=[".","/","@"];n.exports=function(c){if(typeof c=="string")return s(c);if(Array.isArray(c)){var u=[],d,f=0;for(d=c.length;f<d;f++)u.push(s(c[f]));return u}i()}}])})})(w$);var fne=w$.exports;const pne=Ri(fne);var hne=Object.defineProperty,mne=Object.getOwnPropertyDescriptor,qf=(e,t,n,r)=>{for(var o=r>1?void 0:r?mne(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&hne(t,n,o),o},gne=["com","de","net","org","uk","cn","ga","nl","cf","ml","tk","ru","br","gq","xyz","fr","eu","info","co","au","ca","it","in","ch","pl","es","online","us","top","be","jp","biz","se","at","dk","cz","za","me","ir","icu","shop","kr","site","mx","hu","io","cc","club","no","cyou"],XC="updateLink",vne=/(?:(?:(?:https?|ftp):)?\/\/)?(?:\S+(?::\S*)?@)?(?:(?:[\da-z\u00A1-\uFFFF][\w\u00A1-\uFFFF-]{0,62})?[\da-z\u00A1-\uFFFF]\.)*(?:(?:\d(?!\.)|[a-z\u00A1-\uFFFF])(?:[\da-z\u00A1-\uFFFF][\w\u00A1-\uFFFF-]{0,62})?[\da-z\u00A1-\uFFFF]\.)+[a-z\u00A1-\uFFFF]{2,}(?::\d{2,5})?(?:[#/?]\S*)?/gi,Xa=class extends Vf{constructor(){super(...arguments),this._autoLinkRegexNonGlobal=void 0}get name(){return"link"}createTags(){return[Me.Link,Me.ExcludeInputRules]}createMarkSpec(e,t){const n="data-link-auto",r=o=>{const{defaultTarget:i,supportedTargets:s}=this.options,a=i?[...s,i]:s;return o&&go(a,o)?{target:o}:void 0};return{inclusive:!1,excludes:"_",...t,attrs:{...e.defaults(),href:{},target:{default:this.options.defaultTarget},auto:{default:!1}},parseDOM:[{tag:"a[href]",getAttrs:o=>{if(!Vo(o))return!1;const i=o.getAttribute("href"),s=o.textContent,a=this.options.autoLink&&(o.hasAttribute(n)||i===s||(i==null?void 0:i.replace(`${this.options.defaultProtocol}//`,""))===s);return{...e.parse(o),href:i,auto:a,...r(o.getAttribute("target"))}}},...t.parseDOM??[]],toDOM:o=>{const{auto:i,target:s,...a}=dP(o.attrs,e),l=o.attrs.auto?{[n]:""}:{};return["a",{...e.dom(o),...a,rel:"noopener noreferrer nofollow",...l,...r(o.attrs.target)},0]}}}onCreate(){const{autoLinkRegex:e}=this.options;this._autoLinkRegexNonGlobal=new RegExp(`^${e.source}$`,e.flags.replace("g",""))}shortcut({tr:e}){let t="",{from:n,to:r,empty:o,$from:i}=e.selection,s=!1;const a=_i(i,this.type);if(o){const l=a??lP(e);if(!l)return!1;({text:t,from:n,to:r}=l),s=!0}return n===r?!1:(s||(t=e.doc.textBetween(n,r)),this.options.onActivateLink(t),this.options.onShortcut({activeLink:a?{attrs:a.mark.attrs,from:a.from,to:a.to}:void 0,selectedText:t,from:n,to:r}),!0)}updateLink(e,t){return n=>{const{tr:r}=n;return!(tl(r.selection)&&!b1(r.selection)||cF(r.selection)||bm({trState:r,type:this.type}))&&!t?!1:(r.setMeta(this.name,{command:XC,attrs:e,range:t}),MF({type:this.type,attrs:e,range:t})(n))}}selectLink(){return this.store.commands.selectMark.original(this.type)}removeLink(e){return t=>{const{tr:n}=t;return bm({trState:n,type:this.type,...e})?gP({type:this.type,expand:!0,range:e})(t):!1}}createPasteRules(){return[{type:"mark",regexp:this.options.autoLinkRegex,markType:this.type,getAttributes:(e,t)=>({href:this.buildHref(pd(e)),auto:!t}),transformMatch:e=>{const t=pd(e);return!t||!this.isValidUrl(t)?!1:t}}]}createEventHandlers(){return{clickMark:(e,t)=>{const n=t.getMark(this.type);if(!n)return;const r=n.mark.attrs,o={...r,...n};if(this.options.onClick(e,o))return!0;if(!this.store.view.editable)return;let i=!1;if(this.options.openLinkOnClick){i=!0;const s=r.href;window.open(s,"_blank")}return this.options.selectTextOnClick&&(i=!0,this.store.commands.selectText(n)),i}}}createPlugin(){return{appendTransaction:(e,t,n)=>{if(e.filter(h=>!!h.getMeta(this.name)).forEach(h=>{const m=h.getMeta(this.name);if(m.command===XC){const{range:g,attrs:b}=m,{selection:y,doc:v}=n,w={range:g,selection:y,doc:v,attrs:b},{from:S,to:k}=g??y;this.options.onUpdateLink(v.textBetween(S,k),w)}}),!this.options.autoLink||Sx(t)-Sx(n)===1||!e.some(h=>h.docChanged))return;const s=Xz(e,t),a=hF(s,[Ot,Kt]),{mapping:l}=s,{tr:c,doc:u}=n,{updateLink:d,removeLink:f}=this.store.chain(c);if(a.forEach(({prevFrom:h,prevTo:m,from:g,to:b})=>{const y=[],v=b-g===2,w=this.getLinkMarksInRange(t.doc,h,m,!0).filter(S=>S.mark.type===this.type).map(({from:S,to:k,text:C})=>({mappedFrom:l.map(S),mappedTo:l.map(k),text:C,from:S,to:k}));w.forEach(({mappedFrom:S,mappedTo:k,from:C,to:E},T)=>this.getLinkMarksInRange(u,S,k,!0).filter(R=>R.mark.type===this.type).forEach(R=>{const $=t.doc.textBetween(C,E,void 0," "),j=u.textBetween(R.from,R.to+1,void 0," ").trim(),z=this.isValidUrl($);this.isValidUrl(j)||(z&&(f({from:R.from,to:R.to}).tr(),w.splice(T,1)),!v&&g===b&&this.findAutoLinks(j).map(V=>this.addLinkProperties({...V,from:S+V.start,to:S+V.end})).forEach(({attrs:V,range:U,text:O})=>{d(V,U).tr(),y.push({attrs:V,range:U,text:O})}))})),this.findTextBlocksInRange(u,{from:g,to:b}).forEach(({text:S,positionStart:k})=>{this.findAutoLinks(S).map(C=>this.addLinkProperties({...C,from:k+C.start+1,to:k+C.end+1})).filter(({range:C})=>{const E=g>=C.from&&g<=C.to,T=b>=C.from&&b<=C.to;return E||T||v}).filter(({range:C})=>this.getLinkMarksInRange(c.doc,C.from,C.to,!1).length===0).filter(({range:{from:C},text:E})=>!w.some(({text:T,mappedFrom:R})=>R===C&&T===E)).forEach(({attrs:C,text:E,range:T})=>{d(C,T).tr(),y.push({attrs:C,range:T,text:E})})}),window.requestAnimationFrame(()=>{y.forEach(({attrs:S,range:k,text:C})=>{const{doc:E,selection:T}=c;this.options.onUpdateLink(C,{attrs:S,doc:E,range:k,selection:T})})})}),c.steps.length!==0)return c}}}buildHref(e){return this.options.extractHref({url:e,defaultProtocol:this.options.defaultProtocol})}getLinkMarksInRange(e,t,n,r){const o=[];if(t===n){const i=Math.max(t-1,0),s=e.resolve(i),a=_i(s,this.type);(a==null?void 0:a.mark.attrs.auto)===r&&o.push(a)}else e.nodesBetween(t,n,(i,s)=>{const l=(i.marks??[]).find(({type:c,attrs:u})=>c===this.type&&u.auto===r);l&&o.push({from:s,to:s+i.nodeSize,mark:l,text:i.textContent})});return o}findTextBlocksInRange(e,t){const n=[];return e.nodesBetween(t.from,t.to,(r,o)=>{!r.isTextblock||!r.type.allowsMarkType(this.type)||n.push({node:r,pos:o})}),n.map(r=>({text:e.textBetween(r.pos,r.pos+r.node.nodeSize,void 0," "),positionStart:r.pos}))}addLinkProperties({from:e,to:t,href:n,...r}){return{...r,range:{from:e,to:t},attrs:{href:n,auto:!0}}}findAutoLinks(e){if(this.options.findAutoLinks)return this.options.findAutoLinks(e,this.options.defaultProtocol);const t=[];for(const n of Sg(e,this.options.autoLinkRegex)){const r=pd(n);if(!r)continue;const o=this.buildHref(r);!this.isValidTLD(o)&&!o.startsWith("tel:")||t.push({text:r,href:o,start:n.index,end:n.index+r.length})}return t}isValidUrl(e){var t;return this.options.isValidUrl?this.options.isValidUrl(e,this.options.defaultProtocol):this.isValidTLD(this.buildHref(e))&&!!((t=this._autoLinkRegexNonGlobal)!=null&&t.test(e))}isValidTLD(e){const{autoLinkAllowedTLDs:t}=this.options;if(t.length===0)return!0;const n=pne(e);if(n==="")return!0;const r=h7(n.split("."));return t.includes(r)}};qf([yr({shortcut:q.InsertLink})],Xa.prototype,"shortcut",1);qf([ie()],Xa.prototype,"updateLink",1);qf([ie()],Xa.prototype,"selectLink",1);qf([ie()],Xa.prototype,"removeLink",1);Xa=qf([He({defaultOptions:{autoLink:!1,defaultProtocol:"",selectTextOnClick:!1,openLinkOnClick:!1,autoLinkRegex:vne,autoLinkAllowedTLDs:gne,findAutoLinks:void 0,isValidUrl:void 0,defaultTarget:null,supportedTargets:[],extractHref:yne},staticKeys:["autoLinkRegex"],handlerKeyOptions:{onClick:{earlyReturnValue:!0}},handlerKeys:["onActivateLink","onShortcut","onUpdateLink","onClick"],defaultPriority:Je.Medium})],Xa);function yne({url:e,defaultProtocol:t}){const n=/^((?:https?|ftp)?:)\/\//.test(e);return!n&&e.includes("@")?`mailto:${e}`:n?e:`${t}//${e}`}var xne=Object.defineProperty,bne=Object.getOwnPropertyDescriptor,S$=(e,t,n,r)=>{for(var o=r>1?void 0:r?bne(t,n):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(r?s(t,n,o):s(o))||o);return r&&o&&xne(t,n,o),o},Fm=class extends zr{get name(){return"hardBreak"}createTags(){return[Me.InlineNode]}createNodeSpec(e,t){return{inline:!0,selectable:!1,atom:!0,leafText:()=>`
420
- `,...t,attrs:e.defaults(),parseDOM:[{tag:"br",getAttrs:e.parse},...t.parseDOM??[]],toDOM:n=>["br",e.dom(n)]}}createKeymap(){const e=Yz(fd(wP),()=>(this.store.commands.insertHardBreak(),!0));return{"Mod-Enter":e,"Shift-Enter":e}}insertHardBreak(){return e=>{const{tr:t,dispatch:n}=e;return n==null||n(t.replaceSelectionWith(this.type.create()).scrollIntoView()),!0}}};S$([ie()],Fm.prototype,"insertHardBreak",1);Fm=S$([He({defaultPriority:Je.Low})],Fm);function Ii({submitStatus:e}){return e==="loading"||e==="waiting"?x.jsx(Y4,{className:"animate-spin"}):e==="patch-success"?x.jsx(P4,{className:"text-accent"}):null}function iw(e,t,n,r,o){const[i,s]=p.useState(!1),[a,l]=p.useState(!1),[c,u]=p.useState(null);return p.useEffect(()=>{if(n&&e){l(!0);const f=setTimeout(()=>{s(!0),n&&(o?(u(o),n(h=>r(o,h)).finally(()=>{s(!1),l(!1),setTimeout(()=>{u(null)},1e3)})):(u(t),n(h=>r(t,h)).finally(()=>{s(!1),l(!1),setTimeout(()=>{u(null)},1e3)})))},1e3);return()=>{clearTimeout(f)}}},[t,e]),c!==null&&c===(t??"")?"patch-success":i?"loading":a?"waiting":"idle"}const wne=()=>[new Ya({}),new gf,new vf,new yf({enableResizing:!1}),new $x({}),new zm({levels:[1,2,3,4,5,6],defaultLevel:1}),new ff({}),new pf,new Xa({autoLink:!0}),new Fm].slice();function Sne(e){const{manager:t,state:n}=IY({extensions:wne,content:e,selection:"start"});return{manager:t,state:n}}function kne({state:e,manager:t,options:n,onChange:r,debug:o,submitStatus:i}){const s=n&&Object.entries(n).some(([,u])=>u),[a,l]=p.useState(s),c=p.useMemo(()=>[on("p-4 border rounded-md outline-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 appearance-none border-input bg-background",{"pt-[54px] -translate-y-[50px]":a})],[a]);return x.jsx("div",{className:on("relative text-base val-rich-text-editor"),children:x.jsx(zY,{manager:t,initialContent:e,classNames:c,children:x.jsxs(Mte,{initialProps:{mode:"default"},children:[x.jsx(Ene,{hasOptions:s,options:n,debug:o,setShowToolbar:l,submitStatus:i}),x.jsx(Ex,{}),r&&x.jsx(LY,{onChange:r})]})})})}const Ene=({options:e,hasOptions:t,debug:n,submitStatus:r,setShowToolbar:o})=>{var c,u,d,f,h,m,g,b,y,v,w,S,k,C,E,T;const i=tN(),s=SY(),a=t||s.heading()||s.image()||s.link()||s.bulletList()||s.orderedList()||s.bold()||s.italic()||s.strike();p.useEffect(()=>{o(a)},[a]);const l=p.useRef(null);return x.jsxs("div",{children:[x.jsx("div",{className:"h-0",ref:l}),x.jsxs("div",{className:on("sticky top-0 flex flex-col py-2 z-[40] border divide-y rounded-md rounded-b-none border-t-0 rounded-t-none pt-[1px] border-input bg-background",{hidden:!a}),children:[x.jsxs("div",{className:"flex items-center justify-between",children:[x.jsxs("div",{className:"flex flex-row items-center justify-start px-4 py-1 gap-x-3",children:[(((c=e==null?void 0:e.block)==null?void 0:c.h1)||((u=e==null?void 0:e.block)==null?void 0:u.h2)||((d=e==null?void 0:e.block)==null?void 0:d.h3)||((f=e==null?void 0:e.block)==null?void 0:f.h4)||((h=e==null?void 0:e.block)==null?void 0:h.h5)||((m=e==null?void 0:e.block)==null?void 0:m.h6)||s.heading())&&x.jsxs(jQ,{children:[x.jsx(zQ,{asChild:!0,className:"pr-4",children:x.jsxs("button",{children:[s.heading({level:1})&&x.jsx(yk,{size:22}),s.heading({level:2})&&x.jsx(xk,{size:22}),s.heading({level:3})&&x.jsx(bk,{size:22}),s.heading({level:4})&&x.jsx(wk,{size:22}),s.heading({level:5})&&x.jsx(Sk,{size:22}),s.heading({level:6})&&x.jsx(kk,{size:22}),!s.heading()&&"Normal"]})}),x.jsxs(tw,{container:l.current,children:[x.jsx(si,{onClick:()=>{i.setBlockNodeType("paragraph").focus().run()},children:"Normal"}),((g=e==null?void 0:e.block)==null?void 0:g.h1)&&x.jsx(si,{onClick:()=>{i.setBlockNodeType("heading",{level:1}).focus().run()},children:x.jsx(yk,{size:16})}),((b=e==null?void 0:e.block)==null?void 0:b.h2)&&x.jsx(si,{onClick:()=>{i.setBlockNodeType("heading",{level:2}).focus().run()},children:x.jsx(xk,{size:16})}),((y=e==null?void 0:e.block)==null?void 0:y.h3)&&x.jsx(si,{onClick:()=>{i.setBlockNodeType("heading",{level:3}).focus().run()},children:x.jsx(bk,{size:16})}),((v=e==null?void 0:e.block)==null?void 0:v.h4)&&x.jsx(si,{onClick:()=>{i.setBlockNodeType("heading",{level:4}).focus().run()},children:x.jsx(wk,{size:16})}),((w=e==null?void 0:e.block)==null?void 0:w.h5)&&x.jsx(si,{onClick:()=>{i.setBlockNodeType("heading",{level:5}).focus().run()},children:x.jsx(Sk,{size:16})}),((S=e==null?void 0:e.block)==null?void 0:S.h6)&&x.jsx(si,{onClick:()=>{i.setBlockNodeType("heading",{level:6}).focus().run()},children:x.jsx(kk,{size:16})})]})]}),x.jsx(wl,{icon:x.jsx(T4,{size:18}),stroke:3,isOption:(k=e==null?void 0:e.style)==null?void 0:k.bold,isActive:s.bold(),onToggle:()=>i.toggleBold().focus().run()}),x.jsx(wl,{icon:x.jsx(Z4,{size:18}),stroke:3,isOption:(C=e==null?void 0:e.style)==null?void 0:C.lineThrough,isActive:s.strike(),onToggle:()=>i.toggleStrike().focus().run()}),x.jsx(wl,{icon:x.jsx(z4,{size:18}),stroke:3,isOption:(E=e==null?void 0:e.style)==null?void 0:E.italic,isActive:s.italic(),onToggle:()=>i.toggleItalic().focus().run()}),x.jsx(wl,{icon:x.jsx(V4,{size:18}),stroke:3,isActive:s.bulletList(),onToggle:()=>i.toggleBulletList().focus().run()}),x.jsx(wl,{icon:x.jsx(B4,{size:18}),stroke:3,isActive:s.orderedList(),onToggle:()=>i.toggleOrderedList().focus().run()}),x.jsx(wl,{icon:x.jsx(F4,{size:18}),stroke:3,isActive:s.link(),onToggle:()=>i.selectMark("link").updateLink({href:""}).focus().run()}),(((T=e==null?void 0:e.inline)==null?void 0:T.img)||s.image())&&x.jsxs("label",{className:"cursor-pointer",htmlFor:"val-toolbar-image-select",children:[x.jsx("input",{hidden:!0,id:"val-toolbar-image-select",accept:"image/*",type:"file",onChange:R=>{xM(R).then($=>{i.insertImage({src:$.src,width:$.width,height:$.height,fileName:bM($.src,$.filename??null,{width:$.width,height:$.height,sha256:$.sha256,mimeType:$.mimeType})??void 0}).focus().run()})}}),x.jsx(j4,{size:18,className:`${s.image()&&"stroke-[3px]"}`})]}),n&&x.jsx("button",{onMouseDown:R=>R.preventDefault(),onClick:()=>i.insertHardBreak().run(),children:"Br"})]}),x.jsx("div",{className:"pr-4",children:x.jsx(Ii,{submitStatus:r})})]}),x.jsx(Cne,{})]})]})};function Cne(){const e=tN(),[t,n]=p.useState(),r=kY().link();return p.useEffect(()=>{const i=typeof r=="object"&&"href"in r&&typeof r.href=="string"?r.href:void 0;n(i)},[r==null?void 0:r.href]),r!==void 0?x.jsxs("div",{className:"flex items-center justify-start px-4 pt-1 gap-x-2",children:[x.jsx("input",{className:"bg-transparent text-accent",onChange:i=>{n(i.target.value)},defaultValue:t,placeholder:"https://"}),x.jsx("button",{className:"p-2",title:"Update",disabled:t===void 0,onClick:()=>{t!==void 0&&e.selectMark("link").updateLink({href:t}).focus().run()},children:x.jsx(Df,{size:14})}),x.jsx("button",{className:"p-2",title:"Remove",onClick:()=>{e.removeLink().focus().run()},children:x.jsx(ej,{size:13})})]}):null}function wl({stroke:e,isActive:t,onToggle:n,icon:r}){return x.jsx("button",{className:on({"text-accent":t,"stroke-[2px]":t&&e===2,"stroke-[3px]":t&&e===3}),onClick:o=>{o.preventDefault(),n()},children:r})}function sw(e){const t=p.useRef({value:e,previous:e});return p.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}const _ne=p.forwardRef((e,t)=>p.createElement(we.span,D({},e,{ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}))),One=[" ","Enter","ArrowUp","ArrowDown"],Tne=[" ","Enter"],Zg="Select",[Jg,aw,Mne]=Vg(Zg),[Hc,Jle]=vr(Zg,[Mne,Uc]),lw=Uc(),[Rne,sl]=Hc(Zg),[Pne,Nne]=Hc(Zg),$ne=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:s,defaultValue:a,onValueChange:l,dir:c,name:u,autoComplete:d,disabled:f,required:h}=e,m=lw(t),[g,b]=p.useState(null),[y,v]=p.useState(null),[w,S]=p.useState(!1),k=$f(c),[C=!1,E]=xo({prop:r,defaultProp:o,onChange:i}),[T,R]=xo({prop:s,defaultProp:a,onChange:l}),$=p.useRef(null),j=g?!!g.closest("form"):!0,[z,ee]=p.useState(new Set),V=Array.from(z).map(U=>U.props.value).join(";");return p.createElement(K1,m,p.createElement(Rne,{required:h,scope:t,trigger:g,onTriggerChange:b,valueNode:y,onValueNodeChange:v,valueNodeHasChildren:w,onValueNodeHasChildrenChange:S,contentId:Pr(),value:T,onValueChange:R,open:C,onOpenChange:E,dir:k,triggerPointerDownPosRef:$,disabled:f},p.createElement(Jg.Provider,{scope:t},p.createElement(Pne,{scope:e.__scopeSelect,onNativeOptionAdd:p.useCallback(U=>{ee(O=>new Set(O).add(U))},[]),onNativeOptionRemove:p.useCallback(U=>{ee(O=>{const M=new Set(O);return M.delete(U),M})},[])},n)),j?p.createElement(_$,{key:V,"aria-hidden":!0,required:h,tabIndex:-1,name:u,autoComplete:d,value:T,onChange:U=>R(U.target.value),disabled:f},T===void 0?p.createElement("option",{value:""}):null,Array.from(z)):null))},Dne="SelectTrigger",Ane=p.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=lw(n),s=sl(Dne,n),a=s.disabled||r,l=Le(t,s.onTriggerChange),c=aw(n),[u,d,f]=O$(m=>{const g=c().filter(v=>!v.disabled),b=g.find(v=>v.value===s.value),y=T$(g,m,b);y!==void 0&&s.onValueChange(y.value)}),h=()=>{a||(s.onOpenChange(!0),f())};return p.createElement(q1,D({asChild:!0},i),p.createElement(we.button,D({type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":C$(s.value)?"":void 0},o,{ref:l,onClick:re(o.onClick,m=>{m.currentTarget.focus()}),onPointerDown:re(o.onPointerDown,m=>{const g=m.target;g.hasPointerCapture(m.pointerId)&&g.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&(h(),s.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)},m.preventDefault())}),onKeyDown:re(o.onKeyDown,m=>{const g=u.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&d(m.key),!(g&&m.key===" ")&&One.includes(m.key)&&(h(),m.preventDefault())})})))}),Ine="SelectValue",Lne=p.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:s="",...a}=e,l=sl(Ine,n),{onValueNodeHasChildrenChange:c}=l,u=i!==void 0,d=Le(t,l.onValueNodeChange);return ur(()=>{c(u)},[c,u]),p.createElement(we.span,D({},a,{ref:d,style:{pointerEvents:"none"}}),C$(l.value)?p.createElement(p.Fragment,null,s):i)}),jne=p.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return p.createElement(we.span,D({"aria-hidden":!0},o,{ref:t}),r||"▼")}),zne=e=>p.createElement(Kg,D({asChild:!0},e)),Mc="SelectContent",Fne=p.forwardRef((e,t)=>{const n=sl(Mc,e.__scopeSelect),[r,o]=p.useState();if(ur(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?At.createPortal(p.createElement(k$,{scope:e.__scopeSelect},p.createElement(Jg.Slot,{scope:e.__scopeSelect},p.createElement("div",null,e.children))),i):null}return p.createElement(Bne,D({},e,{ref:t}))}),ai=10,[k$,Qg]=Hc(Mc),Bne=p.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:h,sticky:m,hideWhenDetached:g,avoidCollisions:b,...y}=e,v=sl(Mc,n),[w,S]=p.useState(null),[k,C]=p.useState(null),E=Le(t,X=>S(X)),[T,R]=p.useState(null),[$,j]=p.useState(null),z=aw(n),[ee,V]=p.useState(!1),U=p.useRef(!1);p.useEffect(()=>{if(w)return Bg(w)},[w]),Hg();const O=p.useCallback(X=>{const[Ne,...Pe]=z().map(Te=>Te.ref.current),[se]=Pe.slice(-1),ze=document.activeElement;for(const Te of X)if(Te===ze||(Te==null||Te.scrollIntoView({block:"nearest"}),Te===Ne&&k&&(k.scrollTop=0),Te===se&&k&&(k.scrollTop=k.scrollHeight),Te==null||Te.focus(),document.activeElement!==ze))return},[z,k]),M=p.useCallback(()=>O([T,w]),[O,T,w]);p.useEffect(()=>{ee&&M()},[ee,M]);const{onOpenChange:_,triggerPointerDownPosRef:P}=v;p.useEffect(()=>{if(w){let X={x:0,y:0};const Ne=se=>{var ze,Te,Tt,pt;X={x:Math.abs(Math.round(se.pageX)-((ze=(Te=P.current)===null||Te===void 0?void 0:Te.x)!==null&&ze!==void 0?ze:0)),y:Math.abs(Math.round(se.pageY)-((Tt=(pt=P.current)===null||pt===void 0?void 0:pt.y)!==null&&Tt!==void 0?Tt:0))}},Pe=se=>{X.x<=10&&X.y<=10?se.preventDefault():w.contains(se.target)||_(!1),document.removeEventListener("pointermove",Ne),P.current=null};return P.current!==null&&(document.addEventListener("pointermove",Ne),document.addEventListener("pointerup",Pe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Ne),document.removeEventListener("pointerup",Pe,{capture:!0})}}},[w,_,P]),p.useEffect(()=>{const X=()=>_(!1);return window.addEventListener("blur",X),window.addEventListener("resize",X),()=>{window.removeEventListener("blur",X),window.removeEventListener("resize",X)}},[_]);const[N,I]=O$(X=>{const Ne=z().filter(ze=>!ze.disabled),Pe=Ne.find(ze=>ze.ref.current===document.activeElement),se=T$(Ne,X,Pe);se&&setTimeout(()=>se.ref.current.focus())}),B=p.useCallback((X,Ne,Pe)=>{const se=!U.current&&!Pe;(v.value!==void 0&&v.value===Ne||se)&&(R(X),se&&(U.current=!0))},[v.value]),de=p.useCallback(()=>w==null?void 0:w.focus(),[w]),ue=p.useCallback((X,Ne,Pe)=>{const se=!U.current&&!Pe;(v.value!==void 0&&v.value===Ne||se)&&j(X)},[v.value]),Ae=r==="popper"?ZC:Vne,me=Ae===ZC?{side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:h,sticky:m,hideWhenDetached:g,avoidCollisions:b}:{};return p.createElement(k$,{scope:n,content:w,viewport:k,onViewportChange:C,itemRefCallback:B,selectedItem:T,onItemLeave:de,itemTextRefCallback:ue,focusSelectedItem:M,selectedItemText:$,position:r,isPositioned:ee,searchRef:N},p.createElement(Gg,{as:ki,allowPinchZoom:!0},p.createElement(Wg,{asChild:!0,trapped:v.open,onMountAutoFocus:X=>{X.preventDefault()},onUnmountAutoFocus:re(o,X=>{var Ne;(Ne=v.trigger)===null||Ne===void 0||Ne.focus({preventScroll:!0}),X.preventDefault()})},p.createElement(Ug,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:X=>X.preventDefault(),onDismiss:()=>v.onOpenChange(!1)},p.createElement(Ae,D({role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:X=>X.preventDefault()},y,me,{onPlaced:()=>V(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:re(y.onKeyDown,X=>{const Ne=X.ctrlKey||X.altKey||X.metaKey;if(X.key==="Tab"&&X.preventDefault(),!Ne&&X.key.length===1&&I(X.key),["ArrowUp","ArrowDown","Home","End"].includes(X.key)){let se=z().filter(ze=>!ze.disabled).map(ze=>ze.ref.current);if(["ArrowUp","End"].includes(X.key)&&(se=se.slice().reverse()),["ArrowUp","ArrowDown"].includes(X.key)){const ze=X.target,Te=se.indexOf(ze);se=se.slice(Te+1)}setTimeout(()=>O(se)),X.preventDefault()}})}))))))}),Vne=p.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=sl(Mc,n),s=Qg(Mc,n),[a,l]=p.useState(null),[c,u]=p.useState(null),d=Le(t,E=>u(E)),f=aw(n),h=p.useRef(!1),m=p.useRef(!0),{viewport:g,selectedItem:b,selectedItemText:y,focusSelectedItem:v}=s,w=p.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&c&&g&&b&&y){const E=i.trigger.getBoundingClientRect(),T=c.getBoundingClientRect(),R=i.valueNode.getBoundingClientRect(),$=y.getBoundingClientRect();if(i.dir!=="rtl"){const ze=$.left-T.left,Te=R.left-ze,Tt=E.left-Te,pt=E.width+Tt,ln=Math.max(pt,T.width),qn=window.innerWidth-ai,Li=D0(Te,[ai,qn-ln]);a.style.minWidth=pt+"px",a.style.left=Li+"px"}else{const ze=T.right-$.right,Te=window.innerWidth-R.right-ze,Tt=window.innerWidth-E.right-Te,pt=E.width+Tt,ln=Math.max(pt,T.width),qn=window.innerWidth-ai,Li=D0(Te,[ai,qn-ln]);a.style.minWidth=pt+"px",a.style.right=Li+"px"}const j=f(),z=window.innerHeight-ai*2,ee=g.scrollHeight,V=window.getComputedStyle(c),U=parseInt(V.borderTopWidth,10),O=parseInt(V.paddingTop,10),M=parseInt(V.borderBottomWidth,10),_=parseInt(V.paddingBottom,10),P=U+O+ee+_+M,N=Math.min(b.offsetHeight*5,P),I=window.getComputedStyle(g),B=parseInt(I.paddingTop,10),de=parseInt(I.paddingBottom,10),ue=E.top+E.height/2-ai,Ae=z-ue,me=b.offsetHeight/2,X=b.offsetTop+me,Ne=U+O+X,Pe=P-Ne;if(Ne<=ue){const ze=b===j[j.length-1].ref.current;a.style.bottom="0px";const Te=c.clientHeight-g.offsetTop-g.offsetHeight,Tt=Math.max(Ae,me+(ze?de:0)+Te+M),pt=Ne+Tt;a.style.height=pt+"px"}else{const ze=b===j[0].ref.current;a.style.top="0px";const Tt=Math.max(ue,U+g.offsetTop+(ze?B:0)+me)+Pe;a.style.height=Tt+"px",g.scrollTop=Ne-ue+g.offsetTop}a.style.margin=`${ai}px 0`,a.style.minHeight=N+"px",a.style.maxHeight=z+"px",r==null||r(),requestAnimationFrame(()=>h.current=!0)}},[f,i.trigger,i.valueNode,a,c,g,b,y,i.dir,r]);ur(()=>w(),[w]);const[S,k]=p.useState();ur(()=>{c&&k(window.getComputedStyle(c).zIndex)},[c]);const C=p.useCallback(E=>{E&&m.current===!0&&(w(),v==null||v(),m.current=!1)},[w,v]);return p.createElement(Une,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:C},p.createElement("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S}},p.createElement(we.div,D({},o,{ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}}))))}),ZC=p.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=ai,...i}=e,s=lw(n);return p.createElement(G1,D({},s,i,{ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}))}),[Une,Hne]=Hc(Mc,{}),JC="SelectViewport",Wne=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Qg(JC,n),i=Hne(JC,n),s=Le(t,o.onViewportChange),a=p.useRef(0);return p.createElement(p.Fragment,null,p.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),p.createElement(Jg.Slot,{scope:n},p.createElement(we.div,D({"data-radix-select-viewport":"",role:"presentation"},r,{ref:s,style:{position:"relative",flex:1,overflow:"auto",...r.style},onScroll:re(r.onScroll,l=>{const c=l.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:d}=i;if(d!=null&&d.current&&u){const f=Math.abs(a.current-c.scrollTop);if(f>0){const h=window.innerHeight-ai*2,m=parseFloat(u.style.minHeight),g=parseFloat(u.style.height),b=Math.max(m,g);if(b<h){const y=b+f,v=Math.min(h,y),w=y-v;u.style.height=v+"px",u.style.bottom==="0px"&&(c.scrollTop=w>0?w:0,u.style.justifyContent="flex-end")}}}a.current=c.scrollTop})}))))}),Kne="SelectGroup",[qne,Gne]=Hc(Kne),Yne=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Pr();return p.createElement(qne,{scope:n,id:o},p.createElement(we.div,D({role:"group","aria-labelledby":o},r,{ref:t})))}),Xne="SelectLabel",Zne=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Gne(Xne,n);return p.createElement(we.div,D({id:o.id},r,{ref:t}))}),Dx="SelectItem",[Jne,E$]=Hc(Dx),Qne=p.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...s}=e,a=sl(Dx,n),l=Qg(Dx,n),c=a.value===r,[u,d]=p.useState(i??""),[f,h]=p.useState(!1),m=Le(t,y=>{var v;return(v=l.itemRefCallback)===null||v===void 0?void 0:v.call(l,y,r,o)}),g=Pr(),b=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return p.createElement(Jne,{scope:n,value:r,disabled:o,textId:g,isSelected:c,onItemTextChange:p.useCallback(y=>{d(v=>{var w;return v||((w=y==null?void 0:y.textContent)!==null&&w!==void 0?w:"").trim()})},[])},p.createElement(Jg.ItemSlot,{scope:n,value:r,disabled:o,textValue:u},p.createElement(we.div,D({role:"option","aria-labelledby":g,"data-highlighted":f?"":void 0,"aria-selected":c&&f,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1},s,{ref:m,onFocus:re(s.onFocus,()=>h(!0)),onBlur:re(s.onBlur,()=>h(!1)),onPointerUp:re(s.onPointerUp,b),onPointerMove:re(s.onPointerMove,y=>{if(o){var v;(v=l.onItemLeave)===null||v===void 0||v.call(l)}else y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:re(s.onPointerLeave,y=>{if(y.currentTarget===document.activeElement){var v;(v=l.onItemLeave)===null||v===void 0||v.call(l)}}),onKeyDown:re(s.onKeyDown,y=>{var v;((v=l.searchRef)===null||v===void 0?void 0:v.current)!==""&&y.key===" "||(Tne.includes(y.key)&&b(),y.key===" "&&y.preventDefault())})}))))}),Lp="SelectItemText",ere=p.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,s=sl(Lp,n),a=Qg(Lp,n),l=E$(Lp,n),c=Nne(Lp,n),[u,d]=p.useState(null),f=Le(t,y=>d(y),l.onItemTextChange,y=>{var v;return(v=a.itemTextRefCallback)===null||v===void 0?void 0:v.call(a,y,l.value,l.disabled)}),h=u==null?void 0:u.textContent,m=p.useMemo(()=>p.createElement("option",{key:l.value,value:l.value,disabled:l.disabled},h),[l.disabled,l.value,h]),{onNativeOptionAdd:g,onNativeOptionRemove:b}=c;return ur(()=>(g(m),()=>b(m)),[g,b,m]),p.createElement(p.Fragment,null,p.createElement(we.span,D({id:l.textId},i,{ref:f})),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?At.createPortal(i.children,s.valueNode):null)}),tre="SelectItemIndicator",nre=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return E$(tre,n).isSelected?p.createElement(we.span,D({"aria-hidden":!0},r,{ref:t})):null}),rre=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return p.createElement(we.div,D({"aria-hidden":!0},r,{ref:t}))});function C$(e){return e===""||e===void 0}const _$=p.forwardRef((e,t)=>{const{value:n,...r}=e,o=p.useRef(null),i=Le(t,o),s=sw(n);return p.useEffect(()=>{const a=o.current,l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==n&&u){const d=new Event("change",{bubbles:!0});u.call(a,n),a.dispatchEvent(d)}},[s,n]),p.createElement(_ne,{asChild:!0},p.createElement("select",D({},r,{ref:i,defaultValue:n})))});_$.displayName="BubbleSelect";function O$(e){const t=qt(e),n=p.useRef(""),r=p.useRef(0),o=p.useCallback(s=>{const a=n.current+s;t(a),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(a)},[t]),i=p.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return p.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function T$(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=ore(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function ore(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const ire=$ne,M$=Ane,sre=Lne,are=jne,lre=zne,R$=Fne,cre=Wne,ure=Yne,P$=Zne,N$=Qne,dre=ere,fre=nre,$$=rre,cw=ire,pre=ure,uw=sre,ev=p.forwardRef(({className:e,children:t,...n},r)=>x.jsxs(M$,{ref:r,className:je("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...n,children:[t,x.jsx(are,{asChild:!0,children:x.jsx(A2,{className:"w-4 h-4 opacity-50"})})]}));ev.displayName=M$.displayName;const tv=p.forwardRef(({className:e,children:t,position:n="popper",container:r,...o},i)=>x.jsx(lre,{container:r,children:x.jsx(R$,{ref:i,className:je("relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...o,children:x.jsx(cre,{className:je("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t})})}));tv.displayName=R$.displayName;const hre=p.forwardRef(({className:e,...t},n)=>x.jsx(P$,{ref:n,className:je("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));hre.displayName=P$.displayName;const nv=p.forwardRef(({className:e,children:t,...n},r)=>x.jsxs(N$,{ref:r,className:je("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[x.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:x.jsx(fre,{children:x.jsx(Df,{className:"w-4 h-4"})})}),x.jsx(dre,{children:t})]}));nv.displayName=N$.displayName;const mre=p.forwardRef(({className:e,...t},n)=>x.jsx($$,{ref:n,className:je("-mx-1 my-1 h-px bg-muted",e),...t}));mre.displayName=$$.displayName;function so(e){if(e.type==="object")return Object.fromEntries(Object.keys(e.items).map(n=>[n,so(e.items[n])]));if(e.type==="array")return[];if(e.type==="record")return{};if(e.opt)return null;if(e.type==="richtext")return[];if(e.type==="string")return"";if(e.type==="boolean")return!1;if(e.type==="number")return 0;if(e.type==="keyOf")return e.values==="number"?0:e.values==="string"?"":e.values[0];if(e.type==="file")return{_ref:"/public/",_type:"file",metadata:{sha256:""}};if(e.type==="image")return{_ref:"/public/",_type:"file",metadata:{height:0,width:0,mimeType:"application/octet-stream",sha256:""}};if(e.type==="literal")return e.value;if(e.type==="union")return so(e.items[0]);throw Error("Unexpected schema type: "+JSON.stringify(e))}const D$=H.createContext({get store(){throw Error("ValStoreContext not found. Ensure components are wrapped by ValStoreContext!")}});function gre(e,t){const[n,r]=p.useState({status:"idle"}),{store:o}=p.useContext(D$);return p.useEffect(()=>{r({status:"loading"}),o.getModule(e).then(async i=>{if(Ke.isOk(i)){const s=i.value,a=tt.resolvePath(t,s.source,s.schema);r({status:"success",source:a.source,schema:a.schema})}else r({status:"error",error:{message:i.error.message}})})},[e,t]),n}function A$({store:e,children:t}){return x.jsx(D$.Provider,{value:{store:e},children:t})}function mi(e){return Array.isArray(e)}function dw({source:e,schema:t}){return e===null?x.jsx(vre,{}):typeof e=="object"?mi(e)?x.jsx(yre,{source:e}):(t==null?void 0:t.type)==="richtext"?x.jsx(wre,{source:e}):(t==null?void 0:t.type)==="image"?x.jsx(I$,{source:e}):(t==null?void 0:t.type)==="file"||e[_n]==="file"?x.jsx(bre,{source:e}):(t==null?void 0:t.type)==="object"?x.jsx(QC,{source:e,schema:t}):(t==null?void 0:t.type)==="record"?x.jsx(xre,{source:e}):x.jsx(QC,{source:e}):x.jsx("span",{className:"min-h-6",children:e.toString()})}function vre(){return x.jsx("span",{className:"text-accent",children:"Empty"})}function QC({source:e,schema:t}){const n=t&&Object.keys(t==null?void 0:t.items)||Object.keys(e);return x.jsx("div",{className:"grid grid-cols-[min-content,auto] text-left",children:n.map(r=>x.jsxs("div",{className:"grid col-span-2 gap-1 grid-cols-subgrid",children:[x.jsxs("span",{className:"font-serif text-accent",children:[r,":"]}),x.jsx(dw,{source:e[r]??null,schema:t==null?void 0:t.items[r]})]},r))})}function yre({source:e}){return x.jsxs("span",{children:[e.length===0&&x.jsx("span",{children:"No"}),e.length>0&&x.jsx("span",{className:"text-accent",children:e.length}),x.jsx("span",{children:e.length===1?" item":" items"})]})}function xre({source:e}){const t=Object.keys(e);return x.jsxs("span",{children:[t.length===0&&x.jsx("span",{children:"No"}),t.length>0&&x.jsx("span",{className:"text-accent",children:t.length}),x.jsx("span",{children:e.length===1?" item":" items"})]})}function bre({source:e}){return it in e&&typeof e[it]=="string"?x.jsx("a",{href:tt.convertFileSource(e).url,children:e[it]}):x.jsx("span",{className:"text-destructive",children:"Invalid File"})}function I$(e){var s;const[t,n]=p.useState(null),r=(s=yD())==null?void 0:s.hoverElem;let o,i;if("source"in e){if(!(it in e.source&&typeof e.source[it]=="string"))return x.jsx("span",{className:"text-destructive",children:"Invalid Image"});o=tt.convertFileSource(e.source).url,i=e.source[it]}else o=e.src,i=e.alt||o;return x.jsxs("span",{onMouseOver:a=>{n({x:a.clientX,y:a.clientY})},onMouseLeave:()=>{n(null)},className:"relative flex items-center justify-start gap-1",children:[x.jsx("a",{href:o,className:"overflow-hidden underline truncate ",children:i}),t&&r&&At.createPortal(x.jsx("img",{className:"absolute z-[5] max-w-[10vw]",style:{left:t.x+10,top:t.y+10},src:o}),r)]})}function wre({source:e}){if(!("templateStrings"in e&&"exprs"in e)||e[_n]!=="richtext")return x.jsx("span",{className:"text-destructive",children:"Invalid RichText"});let t=[];Array.isArray(e)?t=e:console.warn("Invalid RichText source",e);function n(r,o){return typeof r=="string"?x.jsx("span",{children:r},o):r.tag==="p"?x.jsx("p",{children:r.children.map(n)},o):r.tag==="h1"||r.tag==="h2"||r.tag==="h3"||r.tag==="h4"||r.tag==="h5"||r.tag==="h6"?x.jsx("span",{className:"font-bold text-accent",children:r.children.map(n)},o):r.tag==="a"?x.jsx("span",{className:"underline text-accent",children:r.children.map(n)},o):r.tag==="img"?x.jsx(I$,{src:r.src[it]},o):r.tag==="br"?x.jsx("br",{},o):p.createElement(r.tag,{key:o,children:r.children.map(n)})}return x.jsx("span",{children:t.map((r,o)=>n(r,o))})}const L$="Checkbox",[Sre,Qle]=vr(L$),[kre,Ere]=Sre(L$),Cre=p.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:i,required:s,disabled:a,value:l="on",onCheckedChange:c,...u}=e,[d,f]=p.useState(null),h=Le(t,w=>f(w)),m=p.useRef(!1),g=d?!!d.closest("form"):!0,[b=!1,y]=xo({prop:o,defaultProp:i,onChange:c}),v=p.useRef(b);return p.useEffect(()=>{const w=d==null?void 0:d.form;if(w){const S=()=>y(v.current);return w.addEventListener("reset",S),()=>w.removeEventListener("reset",S)}},[d,y]),p.createElement(kre,{scope:n,state:b,disabled:a},p.createElement(we.button,D({type:"button",role:"checkbox","aria-checked":Ra(b)?"mixed":b,"aria-required":s,"data-state":j$(b),"data-disabled":a?"":void 0,disabled:a,value:l},u,{ref:h,onKeyDown:re(e.onKeyDown,w=>{w.key==="Enter"&&w.preventDefault()}),onClick:re(e.onClick,w=>{y(S=>Ra(S)?!0:!S),g&&(m.current=w.isPropagationStopped(),m.current||w.stopPropagation())})})),g&&p.createElement(Tre,{control:d,bubbles:!m.current,name:r,value:l,checked:b,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),_re="CheckboxIndicator",Ore=p.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,i=Ere(_re,n);return p.createElement(yn,{present:r||Ra(i.state)||i.state===!0},p.createElement(we.span,D({"data-state":j$(i.state),"data-disabled":i.disabled?"":void 0},o,{ref:t,style:{pointerEvents:"none",...e.style}})))}),Tre=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=p.useRef(null),s=sw(n),a=W1(t);return p.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&d){const f=new Event("click",{bubbles:r});l.indeterminate=Ra(n),d.call(l,Ra(n)?!1:n),l.dispatchEvent(f)}},[s,n,r]),p.createElement("input",D({type:"checkbox","aria-hidden":!0,defaultChecked:Ra(n)?!1:n},o,{tabIndex:-1,ref:i,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function Ra(e){return e==="indeterminate"}function j$(e){return Ra(e)?"indeterminate":e?"checked":"unchecked"}const z$=Cre,Mre=Ore,fw=p.forwardRef(({className:e,...t},n)=>x.jsx(z$,{ref:n,className:je("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:x.jsx(Mre,{className:je("flex items-center justify-center text-current"),children:x.jsx(Df,{className:"w-4 h-4"})})}));fw.displayName=z$.displayName;function F$({path:e,source:t,schema:n,initOnSubmit:r}){const o=r(e);if((typeof t=="string"||t===null)&&(n==null?void 0:n.type)==="string")return x.jsx(r_,{path:e,defaultValue:t,schema:n,onSubmit:o,type:"text",validate:(i,s)=>new d2(n.options?{...n.options,regexp:n.options.regexp?new RegExp(n.options.regexp.source,n.options.regexp.flags):void 0}:void 0).validate(i,s)});if((typeof t=="number"||t===null)&&(n==null?void 0:n.type)==="number")return x.jsx(r_,{path:e,defaultValue:t==null?void 0:t.toString(),schema:n,onSubmit:o,type:"number",validate:(i,s)=>new u2(n.options).validate(i,Number(s))});if((typeof t=="boolean"||t===null)&&(n==null?void 0:n.type)==="boolean")return x.jsx(Rre,{path:e,defaultValue:t,schema:n,onSubmit:o});if((typeof t=="number"||typeof t=="string"||t===null)&&(n==null?void 0:n.type)==="keyOf")return x.jsx(t_,{defaultValue:t,onSubmit:o,selector:n.path});if((typeof t=="number"||typeof t=="string"||t===null)&&(n==null?void 0:n.type)==="keyOf")return x.jsx(t_,{defaultValue:t,onSubmit:o,selector:n.path});if((typeof t=="object"||t===null)&&(n==null?void 0:n.type)==="richtext")return x.jsx(jre,{schema:n,onSubmit:o,defaultValue:t});if((typeof t=="object"||t===null)&&(n==null?void 0:n.type)==="image")return x.jsx(Ire,{path:e,onSubmit:o,defaultValue:t});if((typeof t=="object"||t===null)&&(n==null?void 0:n.type)==="file")return x.jsx(Are,{path:e,onSubmit:o,defaultValue:t});if((typeof t=="string"||t===null)&&(n==null?void 0:n.type)==="union"&&typeof n.key!="string")if(n.key.type!=="literal")console.error("Val: found union with non-literal key type. Check schema corresponding to path:",e);else return x.jsx(Pre,{path:e,options:n.items.flatMap(i=>i.type==="literal"?[i.value]:[]),onSubmit:o,defaultValue:t});return console.warn(`Unsupported schema: ${n.type} (source type: ${typeof t}) source:`,t),x.jsx(Gc,{path:e,schema:n,source:so(n),initOnSubmit:r})}function Rre({defaultValue:e,onSubmit:t}){const[n,r]=p.useState(e??null),[o,i]=p.useState(!1);return x.jsx(So,{children:x.jsxs("div",{className:"flex items-center justify-between",children:[x.jsx(fw,{checked:n||!1,onCheckedChange:s=>{const a=typeof s=="boolean"?s:null;r(a),t&&(i(!0),t(l=>Promise.resolve([{op:"replace",path:l,value:a}])).finally(()=>{i(!1)}))}}),x.jsx(Ii,{submitStatus:o?"loading":"idle"})]})})}function Pre({onSubmit:e,options:t,defaultValue:n}){const[r,o]=p.useState();p.useEffect(()=>{n!=null&&o(n)},[n]);const[i,s]=p.useState(!1);return x.jsx(So,{children:x.jsxs("div",{className:"flex items-center justify-between",children:[x.jsxs(cw,{value:r,onValueChange:a=>{o(a),e&&(s(!0),e(l=>Promise.resolve(Nre(l,a))).finally(()=>{s(!1)}))},children:[x.jsx(ev,{className:"w-[180px]",children:x.jsx(uw,{placeholder:"Select"})}),x.jsx(tv,{children:x.jsx(pre,{children:t.map(a=>x.jsx(nv,{value:a,children:a},a))})})]}),x.jsx(Ii,{submitStatus:i?"loading":"idle"})]})})}function Nre(e,t){return[{value:t,op:"replace",path:e}]}function B$(e,t,n,r){const o=bM(t,n,r);return!o||!r?[]:[{value:{[it]:`/public/${o}`,[_n]:"file",metadata:r},op:"replace",path:e},{value:t,op:"file",path:e,filePath:`/public/${o}`}]}function e_(e,t){const n=e.concat("metadata");return[{value:t,op:"replace",path:n}]}const $re=new TextEncoder;function Dre(e){return new Promise((t,n)=>{var i;const r=(i=e.currentTarget.files)==null?void 0:i[0],o=new FileReader;o.addEventListener("load",()=>{const s=o.result;if(typeof s=="string"){const a=tt.getSHA256Hash($re.encode(s)),l=mg(s);t({src:s,filename:r==null?void 0:r.name,sha256:a,mimeType:l,fileExt:l&&gg(l)})}else n(s?{message:"Unexpected file result type",result:s}:{message:"Empty result"})}),r&&o.readAsDataURL(r)})}function Are({path:e,defaultValue:t,onSubmit:n}){const[r,o]=p.useState(null),[i,s]=p.useState(!1),[a,l]=p.useState();return p.useEffect(()=>{const c=t&&tt.convertFileSource(t).url;l(c)},[t]),x.jsx(So,{children:x.jsxs("div",{className:"w-fit",children:[x.jsx("div",{className:"flex flex-col justify-start p-2 border border-b-0 rounded-sm rounded-b-none gap-y-4 bg-background text-foreground border-input",children:r||a?x.jsxs("div",{className:"relative flex flex-col justify-center items-center min-h-[100px] min-w-[200px]",children:[x.jsx("div",{children:x.jsx(I4,{})}),x.jsx("div",{children:r==null?void 0:r.filename})]}):x.jsx("div",{children:"Select file below"})},e),x.jsxs("div",{className:"p-4 border border-t-0 rounded-b-sm bg-background border-input",children:[x.jsx("label",{htmlFor:`img_input:${e}`,className:"block px-1 py-2 text-sm text-center rounded-md cursor-pointer bg-primary text-background",children:"Update"}),x.jsx("div",{className:"absolute top-6 right-6 text-background",children:x.jsx(Ii,{submitStatus:i?"loading":"idle"})}),x.jsx("input",{hidden:!0,disabled:i,id:`img_input:${e}`,type:"file",onChange:c=>{n&&Dre(c).then(u=>{const d={src:u.src,filename:u.filename};o(d);let f;u.mimeType&&(f={sha256:u.sha256,mimeType:u.mimeType}),s(!0),n(h=>Promise.resolve(B$(h,d.src,d.filename??null,f))).finally(()=>{s(!1)})}).catch(u=>{console.error(u.message),o(null)})}})]})]})})}function Ire({path:e,defaultValue:t,onSubmit:n}){const[r,o]=p.useState(),[i,s]=p.useState(),[a,l]=p.useState(!1),[c,u]=p.useState(),[d,f]=p.useState();return p.useEffect(()=>{var h;f(t&&"/api/val/files/public"+tt.convertFileSource(t).url),u((h=t==null?void 0:t.metadata)==null?void 0:h.hotspot)},[t]),x.jsx(So,{children:x.jsxs("div",{className:"pr-6 w-fit",children:[x.jsx("div",{className:"flex flex-col justify-start p-2 border border-b-0 rounded-sm rounded-b-none gap-y-4 bg-background text-foreground border-input",children:r||d?x.jsxs("div",{className:"relative",children:[c&&x.jsx("div",{className:"rounded-full h-[12px] w-[12px] bg-background mix-blend-difference border-accent border-2 absolute pointer-events-none",style:{top:`${c.y*100}%`,left:`${c.x*100}%`}}),x.jsx("img",{src:r||d,draggable:!1,className:"object-contain w-full max-h-[500px]",style:{cursor:"crosshair"},onClick:h=>{const{width:m,height:g,left:b,top:y}=h.currentTarget.getBoundingClientRect(),v=(h.clientX-6-b)/m,w=(h.clientY-6-y)/g;u({x:v,y:w,width:1,height:1}),n&&(l(!0),n(async S=>{if(i)return e_(S,{...i,hotspot:{x:v,y:w,width:1,height:1}});if(t)return e_(S,{...t.metadata,hotspot:{x:v,y:w,width:1,height:1}});throw new Error("No metadata to update")}).finally(()=>{l(!1)}))}})]}):x.jsx("div",{children:"Select image below"})},e),x.jsxs("div",{className:"relative p-4 border border-t-0 rounded-b-sm bg-background border-input",children:[x.jsx("label",{htmlFor:`img_input:${e}`,className:"block px-1 py-2 text-sm text-center rounded-md cursor-pointer bg-primary text-background",children:"Update"}),x.jsx("div",{className:"absolute top-6 right-6 text-background",children:x.jsx(Ii,{submitStatus:a?"loading":"idle"})}),x.jsx("input",{hidden:!0,disabled:a,id:`img_input:${e}`,type:"file",accept:"image/*",onChange:h=>{n&&xM(h).then(m=>{const g={src:m.src,filename:m.filename};o(m.src),u(void 0);let b;m.width&&m.height&&m.mimeType&&(b={sha256:m.sha256,width:m.width,height:m.height,mimeType:m.mimeType},s(b)),l(!0),n(y=>Promise.resolve(B$(y,g.src,g.filename??null,b))).finally(()=>{l(!1)})}).catch(m=>{console.error(m.message)})}})]})]})})}function Lre(e,t){console.log("content",t);const{blocks:n,files:r}=t?c6(t):{blocks:[],files:{}};return console.log("blocks",n),[{op:"replace",path:e,value:n},...Object.entries(r).flatMap(([o,{value:i,patchPaths:s}])=>s.map(a=>({op:"file",path:e,filePath:o,value:i,nestedFilePath:a})))]}function jre({defaultValue:e,schema:t,onSubmit:n}){const[r,o]=p.useState(!1),[i,s]=p.useState();p.useEffect(()=>{o(!1),s(void 0)},[e]);const{state:a,manager:l}=Sne(e&&b6(e)),c=iw(r,i,n,async(u,d)=>{if(!u)return[];const f=m6.safeParse(i);return f.success?Lre(d,f.data):[]});return x.jsx(So,{children:x.jsx(kne,{options:t.options,onChange:u=>{o(!0),s(u)},state:a,manager:l,submitStatus:c})})}function t_({defaultValue:e,onSubmit:t,selector:n}){const[r,o]=tt.splitModuleFilePathAndModulePath(n),i=gre(r,o),[s,a]=p.useState(),[l,c]=p.useState(!1),[u,d]=p.useState(e);if(p.useEffect(()=>{d(e)},[e]),p.useEffect(()=>{if(i.status==="success"&&u!==null){const{source:m,schema:g}=i;if(typeof m!="object"){console.error("Invalid selector source",m);return}if(m===null||u===void 0)return;let b;mi(m)?b=m[Number(u)]:b=m[u],g.type==="object"?a({source:b,schema:g.items[u]}):g.type==="array"||g.type==="record"?a({source:b,schema:g.item}):console.error("Invalid selector schema",g)}},[i,u]),i.status==="loading"||i.status==="idle")return x.jsx("span",{children:"Loading..."});if(i.status==="error")return x.jsxs("span",{children:["Error: ",i.error.message]});const{source:f,schema:h}=i;return h.type==="array"||h.type==="record"||h.type==="object"?f===null?x.jsx("span",{children:"Module not found"}):typeof f!="object"?x.jsx("span",{children:"Invalid module source"}):x.jsx(So,{children:x.jsxs(cw,{disabled:l,onValueChange:m=>{t&&(c(!0),t(g=>(d(m),Promise.resolve([{op:"replace",path:g,value:i.schema.type==="array"?Number(m):m}]))).finally(()=>{c(!1)}))},children:[x.jsx(ev,{className:"h-[8ch]",children:s&&s.source!==void 0?x.jsx(n_,{source:s.source,schema:s.schema}):x.jsx(uw,{className:"h-[8ch]"})}),x.jsx(tv,{children:x.jsxs("div",{className:"relative pr-6",children:[Object.keys(f).map(m=>x.jsx(nv,{className:"h-[8ch]",value:m,children:x.jsx(n_,{source:mi(f)?f[Number(m)]:f[m],schema:h.type==="object"?h.items[m]:h.item})},m)),x.jsx("div",{className:"absolute top-2 -right-4",children:x.jsx(Ii,{submitStatus:l?"loading":"idle"})})]})})]})}):x.jsxs("span",{children:["Contact developer. Cannot use key of on: ",h.type]})}function n_({source:e,schema:t}){return x.jsx("div",{className:"h-[5ch] overflow-y-hidden ",children:x.jsx(dw,{source:e,schema:t})})}function r_({defaultValue:e,path:t,onSubmit:n,type:r,validate:o}){var f;const[i,s]=p.useState(e||""),a=p.useRef(null),[l,c]=p.useState(!1);p.useEffect(()=>{c(!1)},[t]);const u=o(t,i),d=iw(l,i,n,async(h,m)=>[{op:"replace",path:m,value:r==="number"?Number(h):h}],((f=a.current)==null?void 0:f.value)??null);return x.jsxs(So,{children:[x.jsxs("div",{className:"relative flex gap-2 pr-6",children:[x.jsx(yg,{ref:a,defaultValue:i??"",onChange:h=>{c(!0),s(h.target.value)},type:r}),x.jsx("div",{className:"absolute top-2 -right-4",children:x.jsx(Ii,{submitStatus:d})})]}),u&&u[t]?x.jsx(zre,{errors:u&&u[t]||[]}):x.jsx("span",{})]})}function zre({errors:e}){return x.jsx("div",{className:"flex flex-col p-2 text-sm rounded-md gap-y-1 text-destructive-foreground bg-destructive",children:e.map((t,n)=>x.jsx("div",{children:t.message},n))})}function So({children:e,className:t}){return x.jsx("div",{className:on("pl-4 pt-4",t),children:e})}const V$=p.forwardRef(({className:e,...t},n)=>x.jsx("div",{ref:n,className:je("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));V$.displayName="Card";const Fre=p.forwardRef(({className:e,...t},n)=>x.jsx("div",{ref:n,className:je("flex flex-col space-y-1.5 p-6",e),...t}));Fre.displayName="CardHeader";const Bre=p.forwardRef(({className:e,...t},n)=>x.jsx("h3",{ref:n,className:je("text-2xl font-semibold leading-none tracking-tight",e),...t}));Bre.displayName="CardTitle";const Vre=p.forwardRef(({className:e,...t},n)=>x.jsx("p",{ref:n,className:je("text-sm text-muted-foreground",e),...t}));Vre.displayName="CardDescription";const Ure=p.forwardRef(({className:e,...t},n)=>x.jsx("div",{ref:n,className:je("p-6 pt-0",e),...t}));Ure.displayName="CardContent";const Hre=p.forwardRef(({className:e,...t},n)=>x.jsx("div",{ref:n,className:je("flex items-center p-6 pt-0",e),...t}));Hre.displayName="CardFooter";const pw=H.createContext({hardLink:!1,useNavigate:()=>()=>{},basePath:"",sourcePath:"",moduleFilePath:"",modulePath:""});function by(e){return e?`/${decodeURIComponent(e)}`:""}function hw({children:e,overlay:t}){const[n,r]=H.useState(""),[o,i]=H.useState(by(n));p.useEffect(()=>{if(!t){const l=qre();l&&i(by(l)),window.onpopstate=()=>{const c=window.location.pathname.split("/"),u=gw(c),d=(u===-1?c:c.slice(u+1)).join("/");i(by(d)),r(d)}}},[]);const[s,a]=tt.splitModuleFilePathAndModulePath(o);return x.jsx(pw.Provider,{value:{hardLink:!!t,useNavigate:()=>l=>{t?window.location.href=`/val${l}`:(i(l),Wre(l),r(l))},basePath:n,moduleFilePath:s,modulePath:a,sourcePath:o},children:e})}function Wre(e){const t=window.location.pathname.split("/"),n=gw(t),r=`${t.slice(0,n+1).concat(...e.split("/").slice(1)).join("/")}`;window.history.pushState(null,"",r)}function mw(){return p.useContext(pw).useNavigate()}function Kre(){const e=p.useContext(pw);return{basePath:e.basePath,sourcePath:e.sourcePath,moduleFilePath:e.moduleFilePath,modulePath:e.modulePath}}function qre(){const e=window.location.pathname.split("/"),t=gw(e);return(t===-1?e:e.slice(t+1)).join("/")}function gw(e){const t=e.indexOf("static"),n=t===-1?e.indexOf("val"):t;return n===-1&&console.error("Router error",e,n),n}function Gre(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return p.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const rv=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Wc(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function vw(e){return"nodeType"in e}function Kn(e){var t,n;return e?Wc(e)?e:vw(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function yw(e){const{Document:t}=Kn(e);return e instanceof t}function Gf(e){return Wc(e)?!1:e instanceof Kn(e).HTMLElement}function U$(e){return e instanceof Kn(e).SVGElement}function Kc(e){return e?Wc(e)?e.document:vw(e)?yw(e)?e:Gf(e)||U$(e)?e.ownerDocument:document:document:document}const bo=rv?p.useLayoutEffect:p.useEffect;function xw(e){const t=p.useRef(e);return bo(()=>{t.current=e}),p.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function Yre(){const e=p.useRef(null),t=p.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=p.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function xf(e,t){t===void 0&&(t=[e]);const n=p.useRef(e);return bo(()=>{n.current!==e&&(n.current=e)},t),n}function Yf(e,t){const n=p.useRef();return p.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Bm(e){const t=xw(e),n=p.useRef(null),r=p.useCallback(o=>{o!==n.current&&(t==null||t(o,n.current)),n.current=o},[]);return[n,r]}function Ax(e){const t=p.useRef();return p.useEffect(()=>{t.current=e},[e]),t.current}let wy={};function Xf(e,t){return p.useMemo(()=>{if(t)return t;const n=wy[e]==null?0:wy[e]+1;return wy[e]=n,e+"-"+n},[e,t])}function H$(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((i,s)=>{const a=Object.entries(s);for(const[l,c]of a){const u=i[l];u!=null&&(i[l]=u+e*c)}return i},{...t})}}const sc=H$(1),bf=H$(-1);function Xre(e){return"clientX"in e&&"clientY"in e}function bw(e){if(!e)return!1;const{KeyboardEvent:t}=Kn(e.target);return t&&e instanceof t}function Zre(e){if(!e)return!1;const{TouchEvent:t}=Kn(e.target);return t&&e instanceof t}function Ix(e){if(Zre(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return Xre(e)?{x:e.clientX,y:e.clientY}:null}const wf=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[wf.Translate.toString(e),wf.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),o_="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Jre(e){return e.matches(o_)?e:e.querySelector(o_)}const Qre={display:"none"};function eoe(e){let{id:t,value:n}=e;return H.createElement("div",{id:t,style:Qre},n)}function toe(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return H.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function noe(){const[e,t]=p.useState("");return{announce:p.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const W$=p.createContext(null);function roe(e){const t=p.useContext(W$);p.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function ooe(){const[e]=p.useState(()=>new Set),t=p.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[p.useCallback(r=>{let{type:o,event:i}=r;e.forEach(s=>{var a;return(a=s[o])==null?void 0:a.call(s,i)})},[e]),t]}const ioe={draggable:`
421
- To pick up a draggable item, press the space bar.
422
- While dragging, use the arrow keys to move the item.
423
- Press space again to drop the item in its new position, or press escape to cancel.
424
- `},soe={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function aoe(e){let{announcements:t=soe,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=ioe}=e;const{announce:i,announcement:s}=noe(),a=Xf("DndLiveRegion"),[l,c]=p.useState(!1);if(p.useEffect(()=>{c(!0)},[]),roe(p.useMemo(()=>({onDragStart(d){let{active:f}=d;i(t.onDragStart({active:f}))},onDragMove(d){let{active:f,over:h}=d;t.onDragMove&&i(t.onDragMove({active:f,over:h}))},onDragOver(d){let{active:f,over:h}=d;i(t.onDragOver({active:f,over:h}))},onDragEnd(d){let{active:f,over:h}=d;i(t.onDragEnd({active:f,over:h}))},onDragCancel(d){let{active:f,over:h}=d;i(t.onDragCancel({active:f,over:h}))}}),[i,t])),!l)return null;const u=H.createElement(H.Fragment,null,H.createElement(eoe,{id:r,value:o.draggable}),H.createElement(toe,{id:a,announcement:s}));return n?At.createPortal(u,n):u}var Dt;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Dt||(Dt={}));function Vm(){}function i_(e,t){return p.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function loe(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return p.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const wo=Object.freeze({x:0,y:0});function K$(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function q$(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function coe(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function s_(e){let{left:t,top:n,height:r,width:o}=e;return[{x:t,y:n},{x:t+o,y:n},{x:t,y:n+r},{x:t+o,y:n+r}]}function G$(e,t){if(!e||e.length===0)return null;const[n]=e;return t?n[t]:n}function a_(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const uoe=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=a_(t,t.left,t.top),i=[];for(const s of r){const{id:a}=s,l=n.get(a);if(l){const c=K$(a_(l),o);i.push({id:a,data:{droppableContainer:s,value:c}})}}return i.sort(q$)},doe=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=s_(t),i=[];for(const s of r){const{id:a}=s,l=n.get(a);if(l){const c=s_(l),u=o.reduce((f,h,m)=>f+K$(c[m],h),0),d=Number((u/4).toFixed(4));i.push({id:a,data:{droppableContainer:s,value:d}})}}return i.sort(q$)};function foe(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),s=o-r,a=i-n;if(r<o&&n<i){const l=t.width*t.height,c=e.width*e.height,u=s*a,d=u/(l+c-u);return Number(d.toFixed(4))}return 0}const poe=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const i of r){const{id:s}=i,a=n.get(s);if(a){const l=foe(a,t);l>0&&o.push({id:s,data:{droppableContainer:i,value:l}})}}return o.sort(coe)};function hoe(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function Y$(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:wo}function moe(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return o.reduce((s,a)=>({...s,top:s.top+e*a.y,bottom:s.bottom+e*a.y,left:s.left+e*a.x,right:s.right+e*a.x}),{...n})}}const goe=moe(1);function voe(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function yoe(e,t,n){const r=voe(t);if(!r)return e;const{scaleX:o,scaleY:i,x:s,y:a}=r,l=e.left-s-(1-o)*parseFloat(n),c=e.top-a-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),u=o?e.width/o:e.width,d=i?e.height/i:e.height;return{width:u,height:d,top:c,right:l+u,bottom:c+d,left:l}}const xoe={ignoreTransform:!1};function qc(e,t){t===void 0&&(t=xoe);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:c,transformOrigin:u}=Kn(e).getComputedStyle(e);c&&(n=yoe(n,c,u))}const{top:r,left:o,width:i,height:s,bottom:a,right:l}=n;return{top:r,left:o,width:i,height:s,bottom:a,right:l}}function l_(e){return qc(e,{ignoreTransform:!0})}function boe(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function woe(e,t){return t===void 0&&(t=Kn(e).getComputedStyle(e)),t.position==="fixed"}function Soe(e,t){t===void 0&&(t=Kn(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const i=t[o];return typeof i=="string"?n.test(i):!1})}function ov(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(yw(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Gf(o)||U$(o)||n.includes(o))return n;const i=Kn(e).getComputedStyle(o);return o!==e&&Soe(o,i)&&n.push(o),woe(o,i)?n:r(o.parentNode)}return e?r(e):n}function X$(e){const[t]=ov(e,1);return t??null}function Sy(e){return!rv||!e?null:Wc(e)?e:vw(e)?yw(e)||e===Kc(e).scrollingElement?window:Gf(e)?e:null:null}function Z$(e){return Wc(e)?e.scrollX:e.scrollLeft}function J$(e){return Wc(e)?e.scrollY:e.scrollTop}function Lx(e){return{x:Z$(e),y:J$(e)}}var Wt;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Wt||(Wt={}));function Q$(e){return!rv||!e?!1:e===document.scrollingElement}function eD(e){const t={x:0,y:0},n=Q$(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,s=e.scrollTop>=r.y,a=e.scrollLeft>=r.x;return{isTop:o,isLeft:i,isBottom:s,isRight:a,maxScroll:r,minScroll:t}}const koe={x:.2,y:.2};function Eoe(e,t,n,r,o){let{top:i,left:s,right:a,bottom:l}=n;r===void 0&&(r=10),o===void 0&&(o=koe);const{isTop:c,isBottom:u,isLeft:d,isRight:f}=eD(e),h={x:0,y:0},m={x:0,y:0},g={height:t.height*o.y,width:t.width*o.x};return!c&&i<=t.top+g.height?(h.y=Wt.Backward,m.y=r*Math.abs((t.top+g.height-i)/g.height)):!u&&l>=t.bottom-g.height&&(h.y=Wt.Forward,m.y=r*Math.abs((t.bottom-g.height-l)/g.height)),!f&&a>=t.right-g.width?(h.x=Wt.Forward,m.x=r*Math.abs((t.right-g.width-a)/g.width)):!d&&s<=t.left+g.width&&(h.x=Wt.Backward,m.x=r*Math.abs((t.left+g.width-s)/g.width)),{direction:h,speed:m}}function Coe(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:s}=window;return{top:0,left:0,right:i,bottom:s,width:i,height:s}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function tD(e){return e.reduce((t,n)=>sc(t,Lx(n)),wo)}function _oe(e){return e.reduce((t,n)=>t+Z$(n),0)}function Ooe(e){return e.reduce((t,n)=>t+J$(n),0)}function Toe(e,t){if(t===void 0&&(t=qc),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);X$(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Moe=[["x",["left","right"],_oe],["y",["top","bottom"],Ooe]];class ww{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=ov(n),o=tD(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,s,a]of Moe)for(const l of s)Object.defineProperty(this,l,{get:()=>{const c=a(r),u=o[i]-c;return this.rect[l]+u},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class hd{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var o;(o=this.target)==null||o.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function Roe(e){const{EventTarget:t}=Kn(e);return e instanceof t?e:Kc(e)}function ky(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var kr;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(kr||(kr={}));function c_(e){e.preventDefault()}function Poe(e){e.stopPropagation()}var Fe;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"})(Fe||(Fe={}));const nD={start:[Fe.Space,Fe.Enter],cancel:[Fe.Esc],end:[Fe.Space,Fe.Enter]},Noe=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Fe.Right:return{...n,x:n.x+25};case Fe.Left:return{...n,x:n.x-25};case Fe.Down:return{...n,y:n.y+25};case Fe.Up:return{...n,y:n.y-25}}};class Sw{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new hd(Kc(n)),this.windowListeners=new hd(Kn(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(kr.Resize,this.handleCancel),this.windowListeners.add(kr.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(kr.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&Toe(r),n(wo)}handleKeyDown(t){if(bw(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:i=nD,coordinateGetter:s=Noe,scrollBehavior:a="smooth"}=o,{code:l}=t;if(i.end.includes(l)){this.handleEnd(t);return}if(i.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:c}=r.current,u=c?{x:c.left,y:c.top}:wo;this.referenceCoordinates||(this.referenceCoordinates=u);const d=s(t,{active:n,context:r.current,currentCoordinates:u});if(d){const f=bf(d,u),h={x:0,y:0},{scrollableAncestors:m}=r.current;for(const g of m){const b=t.code,{isTop:y,isRight:v,isLeft:w,isBottom:S,maxScroll:k,minScroll:C}=eD(g),E=Coe(g),T={x:Math.min(b===Fe.Right?E.right-E.width/2:E.right,Math.max(b===Fe.Right?E.left:E.left+E.width/2,d.x)),y:Math.min(b===Fe.Down?E.bottom-E.height/2:E.bottom,Math.max(b===Fe.Down?E.top:E.top+E.height/2,d.y))},R=b===Fe.Right&&!v||b===Fe.Left&&!w,$=b===Fe.Down&&!S||b===Fe.Up&&!y;if(R&&T.x!==d.x){const j=g.scrollLeft+f.x,z=b===Fe.Right&&j<=k.x||b===Fe.Left&&j>=C.x;if(z&&!f.y){g.scrollTo({left:j,behavior:a});return}z?h.x=g.scrollLeft-j:h.x=b===Fe.Right?g.scrollLeft-k.x:g.scrollLeft-C.x,h.x&&g.scrollBy({left:-h.x,behavior:a});break}else if($&&T.y!==d.y){const j=g.scrollTop+f.y,z=b===Fe.Down&&j<=k.y||b===Fe.Up&&j>=C.y;if(z&&!f.x){g.scrollTo({top:j,behavior:a});return}z?h.y=g.scrollTop-j:h.y=b===Fe.Down?g.scrollTop-k.y:g.scrollTop-C.y,h.y&&g.scrollBy({top:-h.y,behavior:a});break}}this.handleMove(t,sc(bf(d,this.referenceCoordinates),h))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Sw.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=nD,onActivation:o}=t,{active:i}=n;const{code:s}=e.nativeEvent;if(r.start.includes(s)){const a=i.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),o==null||o({event:e.nativeEvent}),!0)}return!1}}];function u_(e){return!!(e&&"distance"in e)}function d_(e){return!!(e&&"delay"in e)}class kw{constructor(t,n,r){var o;r===void 0&&(r=Roe(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:i}=t,{target:s}=i;this.props=t,this.events=n,this.document=Kc(s),this.documentListeners=new hd(this.document),this.listeners=new hd(r),this.windowListeners=new hd(Kn(s)),this.initialCoordinates=(o=Ix(i))!=null?o:wo,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),this.windowListeners.add(kr.Resize,this.handleCancel),this.windowListeners.add(kr.DragStart,c_),this.windowListeners.add(kr.VisibilityChange,this.handleCancel),this.windowListeners.add(kr.ContextMenu,c_),this.documentListeners.add(kr.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(d_(n)){this.timeoutId=setTimeout(this.handleStart,n.delay);return}if(u_(n))return}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(kr.Click,Poe,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(kr.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:o,props:i}=this,{onMove:s,options:{activationConstraint:a}}=i;if(!o)return;const l=(n=Ix(t))!=null?n:wo,c=bf(o,l);if(!r&&a){if(u_(a)){if(a.tolerance!=null&&ky(c,a.tolerance))return this.handleCancel();if(ky(c,a.distance))return this.handleStart()}return d_(a)&&ky(c,a.tolerance)?this.handleCancel():void 0}t.cancelable&&t.preventDefault(),s(l)}handleEnd(){const{onEnd:t}=this.props;this.detach(),t()}handleCancel(){const{onCancel:t}=this.props;this.detach(),t()}handleKeydown(t){t.code===Fe.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const $oe={move:{name:"pointermove"},end:{name:"pointerup"}};class Ew extends kw{constructor(t){const{event:n}=t,r=Kc(n.target);super(t,$oe,r)}}Ew.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const Doe={move:{name:"mousemove"},end:{name:"mouseup"}};var jx;(function(e){e[e.RightClick=2]="RightClick"})(jx||(jx={}));class Aoe extends kw{constructor(t){super(t,Doe,Kc(t.event.target))}}Aoe.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===jx.RightClick?!1:(r==null||r({event:n}),!0)}}];const Ey={move:{name:"touchmove"},end:{name:"touchend"}};class Ioe extends kw{constructor(t){super(t,Ey)}static setup(){return window.addEventListener(Ey.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Ey.move.name,t)};function t(){}}}Ioe.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return o.length>1?!1:(r==null||r({event:n}),!0)}}];var md;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(md||(md={}));var Um;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Um||(Um={}));function Loe(e){let{acceleration:t,activator:n=md.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:s=5,order:a=Um.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:u,delta:d,threshold:f}=e;const h=zoe({delta:d,disabled:!i}),[m,g]=Yre(),b=p.useRef({x:0,y:0}),y=p.useRef({x:0,y:0}),v=p.useMemo(()=>{switch(n){case md.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case md.DraggableRect:return o}},[n,o,l]),w=p.useRef(null),S=p.useCallback(()=>{const C=w.current;if(!C)return;const E=b.current.x*y.current.x,T=b.current.y*y.current.y;C.scrollBy(E,T)},[]),k=p.useMemo(()=>a===Um.TreeOrder?[...c].reverse():c,[a,c]);p.useEffect(()=>{if(!i||!c.length||!v){g();return}for(const C of k){if((r==null?void 0:r(C))===!1)continue;const E=c.indexOf(C),T=u[E];if(!T)continue;const{direction:R,speed:$}=Eoe(C,T,v,t,f);for(const j of["x","y"])h[j][R[j]]||($[j]=0,R[j]=0);if($.x>0||$.y>0){g(),w.current=C,m(S,s),b.current=$,y.current=R;return}}b.current={x:0,y:0},y.current={x:0,y:0},g()},[t,S,r,g,i,s,JSON.stringify(v),JSON.stringify(h),m,c,k,u,JSON.stringify(f)])}const joe={x:{[Wt.Backward]:!1,[Wt.Forward]:!1},y:{[Wt.Backward]:!1,[Wt.Forward]:!1}};function zoe(e){let{delta:t,disabled:n}=e;const r=Ax(t);return Yf(o=>{if(n||!r||!o)return joe;const i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Wt.Backward]:o.x[Wt.Backward]||i.x===-1,[Wt.Forward]:o.x[Wt.Forward]||i.x===1},y:{[Wt.Backward]:o.y[Wt.Backward]||i.y===-1,[Wt.Forward]:o.y[Wt.Forward]||i.y===1}}},[n,t,r])}function Foe(e,t){const n=t!==null?e.get(t):void 0,r=n?n.node.current:null;return Yf(o=>{var i;return t===null?null:(i=r??o)!=null?i:null},[r,t])}function Boe(e,t){return p.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,i=o.activators.map(s=>({eventName:s.eventName,handler:t(s.handler,r)}));return[...n,...i]},[]),[e,t])}var Sf;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Sf||(Sf={}));var zx;(function(e){e.Optimized="optimized"})(zx||(zx={}));const f_=new Map;function Voe(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,s]=p.useState(null),{frequency:a,measure:l,strategy:c}=o,u=p.useRef(e),d=b(),f=xf(d),h=p.useCallback(function(y){y===void 0&&(y=[]),!f.current&&s(v=>v===null?y:v.concat(y.filter(w=>!v.includes(w))))},[f]),m=p.useRef(null),g=Yf(y=>{if(d&&!n)return f_;if(!y||y===f_||u.current!==e||i!=null){const v=new Map;for(let w of e){if(!w)continue;if(i&&i.length>0&&!i.includes(w.id)&&w.rect.current){v.set(w.id,w.rect.current);continue}const S=w.node.current,k=S?new ww(l(S),S):null;w.rect.current=k,k&&v.set(w.id,k)}return v}return y},[e,i,n,d,l]);return p.useEffect(()=>{u.current=e},[e]),p.useEffect(()=>{d||h()},[n,d]),p.useEffect(()=>{i&&i.length>0&&s(null)},[JSON.stringify(i)]),p.useEffect(()=>{d||typeof a!="number"||m.current!==null||(m.current=setTimeout(()=>{h(),m.current=null},a))},[a,d,h,...r]),{droppableRects:g,measureDroppableContainers:h,measuringScheduled:i!=null};function b(){switch(c){case Sf.Always:return!1;case Sf.BeforeDragging:return n;default:return!n}}}function rD(e,t){return Yf(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Uoe(e,t){return rD(e,t)}function Hoe(e){let{callback:t,disabled:n}=e;const r=xw(t),o=p.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return p.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function iv(e){let{callback:t,disabled:n}=e;const r=xw(t),o=p.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return p.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function Woe(e){return new ww(qc(e),e)}function p_(e,t,n){t===void 0&&(t=Woe);const[r,o]=p.useReducer(a,null),i=Hoe({callback(l){if(e)for(const c of l){const{type:u,target:d}=c;if(u==="childList"&&d instanceof HTMLElement&&d.contains(e)){o();break}}}}),s=iv({callback:o});return bo(()=>{o(),e?(s==null||s.observe(e),i==null||i.observe(document.body,{childList:!0,subtree:!0})):(s==null||s.disconnect(),i==null||i.disconnect())},[e]),r;function a(l){if(!e)return null;if(e.isConnected===!1){var c;return(c=l??n)!=null?c:null}const u=t(e);return JSON.stringify(l)===JSON.stringify(u)?l:u}}function Koe(e){const t=rD(e);return Y$(e,t)}const h_=[];function qoe(e){const t=p.useRef(e),n=Yf(r=>e?r&&r!==h_&&e&&t.current&&e.parentNode===t.current.parentNode?r:ov(e):h_,[e]);return p.useEffect(()=>{t.current=e},[e]),n}function Goe(e){const[t,n]=p.useState(null),r=p.useRef(e),o=p.useCallback(i=>{const s=Sy(i.target);s&&n(a=>a?(a.set(s,Lx(s)),new Map(a)):null)},[]);return p.useEffect(()=>{const i=r.current;if(e!==i){s(i);const a=e.map(l=>{const c=Sy(l);return c?(c.addEventListener("scroll",o,{passive:!0}),[c,Lx(c)]):null}).filter(l=>l!=null);n(a.length?new Map(a):null),r.current=e}return()=>{s(e),s(i)};function s(a){a.forEach(l=>{const c=Sy(l);c==null||c.removeEventListener("scroll",o)})}},[o,e]),p.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,s)=>sc(i,s),wo):tD(e):wo,[e,t])}function m_(e,t){t===void 0&&(t=[]);const n=p.useRef(null);return p.useEffect(()=>{n.current=null},t),p.useEffect(()=>{const r=e!==wo;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?bf(e,n.current):wo}function Yoe(e){p.useEffect(()=>{if(!rv)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function Xoe(e,t){return p.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:i}=r;return n[o]=s=>{i(s,t)},n},{}),[e,t])}function oD(e){return p.useMemo(()=>e?boe(e):null,[e])}const Cy=[];function Zoe(e,t){t===void 0&&(t=qc);const[n]=e,r=oD(n?Kn(n):null),[o,i]=p.useReducer(a,Cy),s=iv({callback:i});return e.length>0&&o===Cy&&i(),bo(()=>{e.length?e.forEach(l=>s==null?void 0:s.observe(l)):(s==null||s.disconnect(),i())},[e]),o;function a(){return e.length?e.map(l=>Q$(l)?r:new ww(t(l),l)):Cy}}function Joe(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Gf(t)?t:e}function Qoe(e){let{measure:t}=e;const[n,r]=p.useState(null),o=p.useCallback(c=>{for(const{target:u}of c)if(Gf(u)){r(d=>{const f=t(u);return d?{...d,width:f.width,height:f.height}:f});break}},[t]),i=iv({callback:o}),s=p.useCallback(c=>{const u=Joe(c);i==null||i.disconnect(),u&&(i==null||i.observe(u)),r(u?t(u):null)},[t,i]),[a,l]=Bm(s);return p.useMemo(()=>({nodeRef:a,rect:n,setRef:l}),[n,a,l])}const eie=[{sensor:Ew,options:{}},{sensor:Sw,options:{}}],tie={current:{}},xh={draggable:{measure:l_},droppable:{measure:l_,strategy:Sf.WhileDragging,frequency:zx.Optimized},dragOverlay:{measure:qc}};class gd extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const nie={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new gd,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Vm},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:xh,measureDroppableContainers:Vm,windowRect:null,measuringScheduled:!1},rie={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Vm,draggableNodes:new Map,over:null,measureDroppableContainers:Vm},sv=p.createContext(rie),iD=p.createContext(nie);function oie(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new gd}}}function iie(e,t){switch(t.type){case Dt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Dt.DragMove:return e.draggable.active?{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}}:e;case Dt.DragEnd:case Dt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Dt.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new gd(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case Dt.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const s=new gd(e.droppable.containers);return s.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:s}}}case Dt.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new gd(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function sie(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=p.useContext(sv),i=Ax(r),s=Ax(n==null?void 0:n.id);return p.useEffect(()=>{if(!t&&!r&&i&&s!=null){if(!bw(i)||document.activeElement===i.target)return;const a=o.get(s);if(!a)return;const{activatorNode:l,node:c}=a;if(!l.current&&!c.current)return;requestAnimationFrame(()=>{for(const u of[l.current,c.current]){if(!u)continue;const d=Jre(u);if(d){d.focus();break}}})}},[r,t,o,s,i]),null}function aie(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,i)=>i({transform:o,...r}),n):n}function lie(e){return p.useMemo(()=>({draggable:{...xh.draggable,...e==null?void 0:e.draggable},droppable:{...xh.droppable,...e==null?void 0:e.droppable},dragOverlay:{...xh.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function cie(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=p.useRef(!1),{x:s,y:a}=typeof o=="boolean"?{x:o,y:o}:o;bo(()=>{if(!s&&!a||!t){i.current=!1;return}if(i.current||!r)return;const c=t==null?void 0:t.node.current;if(!c||c.isConnected===!1)return;const u=n(c),d=Y$(u,r);if(s||(d.x=0),a||(d.y=0),i.current=!0,Math.abs(d.x)>0||Math.abs(d.y)>0){const f=X$(c);f&&f.scrollBy({top:d.y,left:d.x})}},[t,s,a,r,n])}const sD=p.createContext({...wo,scaleX:1,scaleY:1});var ls;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(ls||(ls={}));const uie=p.memo(function(t){var n,r,o,i;let{id:s,accessibility:a,autoScroll:l=!0,children:c,sensors:u=eie,collisionDetection:d=poe,measuring:f,modifiers:h,...m}=t;const g=p.useReducer(iie,void 0,oie),[b,y]=g,[v,w]=ooe(),[S,k]=p.useState(ls.Uninitialized),C=S===ls.Initialized,{draggable:{active:E,nodes:T,translate:R},droppable:{containers:$}}=b,j=E?T.get(E):null,z=p.useRef({initial:null,translated:null}),ee=p.useMemo(()=>{var Jt;return E!=null?{id:E,data:(Jt=j==null?void 0:j.data)!=null?Jt:tie,rect:z}:null},[E,j]),V=p.useRef(null),[U,O]=p.useState(null),[M,_]=p.useState(null),P=xf(m,Object.values(m)),N=Xf("DndDescribedBy",s),I=p.useMemo(()=>$.getEnabled(),[$]),B=lie(f),{droppableRects:de,measureDroppableContainers:ue,measuringScheduled:Ae}=Voe(I,{dragging:C,dependencies:[R.x,R.y],config:B.droppable}),me=Foe(T,E),X=p.useMemo(()=>M?Ix(M):null,[M]),Ne=wA(),Pe=Uoe(me,B.draggable.measure);cie({activeNode:E?T.get(E):null,config:Ne.layoutShiftCompensation,initialRect:Pe,measure:B.draggable.measure});const se=p_(me,B.draggable.measure,Pe),ze=p_(me?me.parentElement:null),Te=p.useRef({activatorEvent:null,active:null,activeNode:me,collisionRect:null,collisions:null,droppableRects:de,draggableNodes:T,draggingNode:null,draggingNodeRect:null,droppableContainers:$,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Tt=$.getNodeFor((n=Te.current.over)==null?void 0:n.id),pt=Qoe({measure:B.dragOverlay.measure}),ln=(r=pt.nodeRef.current)!=null?r:me,qn=C?(o=pt.rect)!=null?o:se:null,Li=!!(pt.nodeRef.current&&pt.rect),Qf=Koe(Li?null:se),Xc=oD(ln?Kn(ln):null),ko=qoe(C?Tt??me:null),Yo=Zoe(ko),ep=aie(h,{transform:{x:R.x-Qf.x,y:R.y-Qf.y,scaleX:1,scaleY:1},activatorEvent:M,active:ee,activeNodeRect:se,containerNodeRect:ze,draggingNodeRect:qn,over:Te.current.over,overlayNodeRect:pt.rect,scrollableAncestors:ko,scrollableAncestorRects:Yo,windowRect:Xc}),Vw=X?sc(X,R):null,Uw=Goe(ko),hA=m_(Uw),mA=m_(Uw,[se]),ll=sc(ep,hA),cl=qn?goe(qn,ep):null,Zc=ee&&cl?d({active:ee,collisionRect:cl,droppableRects:de,droppableContainers:I,pointerCoordinates:Vw}):null,Hw=G$(Zc,"id"),[ji,Ww]=p.useState(null),gA=Li?ep:sc(ep,mA),vA=hoe(gA,(i=ji==null?void 0:ji.rect)!=null?i:null,se),Kw=p.useCallback((Jt,Gn)=>{let{sensor:Yn,options:zi}=Gn;if(V.current==null)return;const wr=T.get(V.current);if(!wr)return;const Br=Jt.nativeEvent,Eo=new Yn({active:V.current,activeNode:wr,event:Br,options:zi,context:Te,onStart(Vr){const Jc=V.current;if(Jc==null)return;const Qc=T.get(Jc);if(!Qc)return;const{onDragStart:tp}=P.current,np={active:{id:Jc,data:Qc.data,rect:z}};At.unstable_batchedUpdates(()=>{tp==null||tp(np),k(ls.Initializing),y({type:Dt.DragStart,initialCoordinates:Vr,active:Jc}),v({type:"onDragStart",event:np})})},onMove(Vr){y({type:Dt.DragMove,coordinates:Vr})},onEnd:ul(Dt.DragEnd),onCancel:ul(Dt.DragCancel)});At.unstable_batchedUpdates(()=>{O(Eo),_(Jt.nativeEvent)});function ul(Vr){return async function(){const{active:Qc,collisions:tp,over:np,scrollAdjustedTranslate:Gw}=Te.current;let eu=null;if(Qc&&Gw){const{cancelDrop:tu}=P.current;eu={activatorEvent:Br,active:Qc,collisions:tp,delta:Gw,over:np},Vr===Dt.DragEnd&&typeof tu=="function"&&await Promise.resolve(tu(eu))&&(Vr=Dt.DragCancel)}V.current=null,At.unstable_batchedUpdates(()=>{y({type:Vr}),k(ls.Uninitialized),Ww(null),O(null),_(null);const tu=Vr===Dt.DragEnd?"onDragEnd":"onDragCancel";if(eu){const hv=P.current[tu];hv==null||hv(eu),v({type:tu,event:eu})}})}}},[T]),yA=p.useCallback((Jt,Gn)=>(Yn,zi)=>{const wr=Yn.nativeEvent,Br=T.get(zi);if(V.current!==null||!Br||wr.dndKit||wr.defaultPrevented)return;const Eo={active:Br};Jt(Yn,Gn.options,Eo)===!0&&(wr.dndKit={capturedBy:Gn.sensor},V.current=zi,Kw(Yn,Gn))},[T,Kw]),qw=Boe(u,yA);Yoe(u),bo(()=>{se&&S===ls.Initializing&&k(ls.Initialized)},[se,S]),p.useEffect(()=>{const{onDragMove:Jt}=P.current,{active:Gn,activatorEvent:Yn,collisions:zi,over:wr}=Te.current;if(!Gn||!Yn)return;const Br={active:Gn,activatorEvent:Yn,collisions:zi,delta:{x:ll.x,y:ll.y},over:wr};At.unstable_batchedUpdates(()=>{Jt==null||Jt(Br),v({type:"onDragMove",event:Br})})},[ll.x,ll.y]),p.useEffect(()=>{const{active:Jt,activatorEvent:Gn,collisions:Yn,droppableContainers:zi,scrollAdjustedTranslate:wr}=Te.current;if(!Jt||V.current==null||!Gn||!wr)return;const{onDragOver:Br}=P.current,Eo=zi.get(Hw),ul=Eo&&Eo.rect.current?{id:Eo.id,rect:Eo.rect.current,data:Eo.data,disabled:Eo.disabled}:null,Vr={active:Jt,activatorEvent:Gn,collisions:Yn,delta:{x:wr.x,y:wr.y},over:ul};At.unstable_batchedUpdates(()=>{Ww(ul),Br==null||Br(Vr),v({type:"onDragOver",event:Vr})})},[Hw]),bo(()=>{Te.current={activatorEvent:M,active:ee,activeNode:me,collisionRect:cl,collisions:Zc,droppableRects:de,draggableNodes:T,draggingNode:ln,draggingNodeRect:qn,droppableContainers:$,over:ji,scrollableAncestors:ko,scrollAdjustedTranslate:ll},z.current={initial:qn,translated:cl}},[ee,me,Zc,cl,T,ln,qn,de,$,ji,ko,ll]),Loe({...Ne,delta:R,draggingRect:cl,pointerCoordinates:Vw,scrollableAncestors:ko,scrollableAncestorRects:Yo});const xA=p.useMemo(()=>({active:ee,activeNode:me,activeNodeRect:se,activatorEvent:M,collisions:Zc,containerNodeRect:ze,dragOverlay:pt,draggableNodes:T,droppableContainers:$,droppableRects:de,over:ji,measureDroppableContainers:ue,scrollableAncestors:ko,scrollableAncestorRects:Yo,measuringConfiguration:B,measuringScheduled:Ae,windowRect:Xc}),[ee,me,se,M,Zc,ze,pt,T,$,de,ji,ue,ko,Yo,B,Ae,Xc]),bA=p.useMemo(()=>({activatorEvent:M,activators:qw,active:ee,activeNodeRect:se,ariaDescribedById:{draggable:N},dispatch:y,draggableNodes:T,over:ji,measureDroppableContainers:ue}),[M,qw,ee,se,y,N,T,ji,ue]);return H.createElement(W$.Provider,{value:w},H.createElement(sv.Provider,{value:bA},H.createElement(iD.Provider,{value:xA},H.createElement(sD.Provider,{value:vA},c)),H.createElement(sie,{disabled:(a==null?void 0:a.restoreFocus)===!1})),H.createElement(aoe,{...a,hiddenTextDescribedById:N}));function wA(){const Jt=(U==null?void 0:U.autoScrollEnabled)===!1,Gn=typeof l=="object"?l.enabled===!1:l===!1,Yn=C&&!Jt&&!Gn;return typeof l=="object"?{...l,enabled:Yn}:{enabled:Yn}}}),die=p.createContext(null),g_="button",fie="Droppable";function pie(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=Xf(fie),{activators:s,activatorEvent:a,active:l,activeNodeRect:c,ariaDescribedById:u,draggableNodes:d,over:f}=p.useContext(sv),{role:h=g_,roleDescription:m="draggable",tabIndex:g=0}=o??{},b=(l==null?void 0:l.id)===t,y=p.useContext(b?sD:die),[v,w]=Bm(),[S,k]=Bm(),C=Xoe(s,t),E=xf(n);bo(()=>(d.set(t,{id:t,key:i,node:v,activatorNode:S,data:E}),()=>{const R=d.get(t);R&&R.key===i&&d.delete(t)}),[d,t]);const T=p.useMemo(()=>({role:h,tabIndex:g,"aria-disabled":r,"aria-pressed":b&&h===g_?!0:void 0,"aria-roledescription":m,"aria-describedby":u.draggable}),[r,h,g,b,m,u.draggable]);return{active:l,activatorEvent:a,activeNodeRect:c,attributes:T,isDragging:b,listeners:r?void 0:C,node:v,over:f,setNodeRef:w,setActivatorNodeRef:k,transform:y}}function hie(){return p.useContext(iD)}const mie="Droppable",gie={timeout:25};function vie(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=Xf(mie),{active:s,dispatch:a,over:l,measureDroppableContainers:c}=p.useContext(sv),u=p.useRef({disabled:n}),d=p.useRef(!1),f=p.useRef(null),h=p.useRef(null),{disabled:m,updateMeasurementsFor:g,timeout:b}={...gie,...o},y=xf(g??r),v=p.useCallback(()=>{if(!d.current){d.current=!0;return}h.current!=null&&clearTimeout(h.current),h.current=setTimeout(()=>{c(Array.isArray(y.current)?y.current:[y.current]),h.current=null},b)},[b]),w=iv({callback:v,disabled:m||!s}),S=p.useCallback((T,R)=>{w&&(R&&(w.unobserve(R),d.current=!1),T&&w.observe(T))},[w]),[k,C]=Bm(S),E=xf(t);return p.useEffect(()=>{!w||!k.current||(w.disconnect(),d.current=!1,w.observe(k.current))},[k,w]),bo(()=>(a({type:Dt.RegisterDroppable,element:{id:r,key:i,disabled:n,node:k,rect:f,data:E}}),()=>a({type:Dt.UnregisterDroppable,key:i,id:r})),[r]),p.useEffect(()=>{n!==u.current.disabled&&(a({type:Dt.SetDroppableDisabled,id:r,key:i,disabled:n}),u.current.disabled=n)},[r,i,n,a]),{active:s,rect:f,isOver:(l==null?void 0:l.id)===r,node:k,over:l,setNodeRef:C}}function Cw(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function yie(e,t){return e.reduce((n,r,o)=>{const i=t.get(r);return i&&(n[o]=i),n},Array(e.length))}function jp(e){return e!==null&&e>=0}function xie(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]!==t[n])return!1;return!0}function bie(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const aD=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const i=Cw(t,r,n),s=t[o],a=i[o];return!a||!s?null:{x:a.left-s.left,y:a.top-s.top,scaleX:a.width/s.width,scaleY:a.height/s.height}},zp={scaleX:1,scaleY:1},wie=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:i,overIndex:s}=e;const a=(t=i[n])!=null?t:r;if(!a)return null;if(o===n){const c=i[s];return c?{x:0,y:n<s?c.top+c.height-(a.top+a.height):c.top-a.top,...zp}:null}const l=Sie(i,o,n);return o>n&&o<=s?{x:0,y:-a.height-l,...zp}:o<n&&o>=s?{x:0,y:a.height+l,...zp}:{x:0,y:0,...zp}};function Sie(e,t,n){const r=e[t],o=e[t-1],i=e[t+1];return r?n<t?o?r.top-(o.top+o.height):i?i.top-(r.top+r.height):0:i?i.top-(r.top+r.height):o?r.top-(o.top+o.height):0:0}const lD="Sortable",cD=H.createContext({activeIndex:-1,containerId:lD,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:aD,disabled:{draggable:!1,droppable:!1}});function kie(e){let{children:t,id:n,items:r,strategy:o=aD,disabled:i=!1}=e;const{active:s,dragOverlay:a,droppableRects:l,over:c,measureDroppableContainers:u}=hie(),d=Xf(lD,n),f=a.rect!==null,h=p.useMemo(()=>r.map(C=>typeof C=="object"&&"id"in C?C.id:C),[r]),m=s!=null,g=s?h.indexOf(s.id):-1,b=c?h.indexOf(c.id):-1,y=p.useRef(h),v=!xie(h,y.current),w=b!==-1&&g===-1||v,S=bie(i);bo(()=>{v&&m&&u(h)},[v,h,m,u]),p.useEffect(()=>{y.current=h},[h]);const k=p.useMemo(()=>({activeIndex:g,containerId:d,disabled:S,disableTransforms:w,items:h,overIndex:b,useDragOverlay:f,sortedRects:yie(h,l),strategy:o}),[g,d,S.draggable,S.droppable,w,h,b,l,f,o]);return H.createElement(cD.Provider,{value:k},t)}const Eie=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return Cw(n,r,o).indexOf(t)},Cie=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:i,newIndex:s,previousItems:a,previousContainerId:l,transition:c}=e;return!c||!r||a!==i&&o===s?!1:n?!0:s!==o&&t===l},_ie={duration:200,easing:"ease"},uD="transform",Oie=wf.Transition.toString({property:uD,duration:0,easing:"linear"}),Tie={roleDescription:"sortable"};function Mie(e){let{disabled:t,index:n,node:r,rect:o}=e;const[i,s]=p.useState(null),a=p.useRef(n);return bo(()=>{if(!t&&n!==a.current&&r.current){const l=o.current;if(l){const c=qc(r.current,{ignoreTransform:!0}),u={x:l.left-c.left,y:l.top-c.top,scaleX:l.width/c.width,scaleY:l.height/c.height};(u.x||u.y)&&s(u)}}n!==a.current&&(a.current=n)},[t,n,r,o]),p.useEffect(()=>{i&&s(null)},[i]),i}function Rie(e){let{animateLayoutChanges:t=Cie,attributes:n,disabled:r,data:o,getNewIndex:i=Eie,id:s,strategy:a,resizeObserverConfig:l,transition:c=_ie}=e;const{items:u,containerId:d,activeIndex:f,disabled:h,disableTransforms:m,sortedRects:g,overIndex:b,useDragOverlay:y,strategy:v}=p.useContext(cD),w=Pie(r,h),S=u.indexOf(s),k=p.useMemo(()=>({sortable:{containerId:d,index:S,items:u},...o}),[d,o,S,u]),C=p.useMemo(()=>u.slice(u.indexOf(s)),[u,s]),{rect:E,node:T,isOver:R,setNodeRef:$}=vie({id:s,data:k,disabled:w.droppable,resizeObserverConfig:{updateMeasurementsFor:C,...l}}),{active:j,activatorEvent:z,activeNodeRect:ee,attributes:V,setNodeRef:U,listeners:O,isDragging:M,over:_,setActivatorNodeRef:P,transform:N}=pie({id:s,data:k,attributes:{...Tie,...n},disabled:w.draggable}),I=Gre($,U),B=!!j,de=B&&!m&&jp(f)&&jp(b),ue=!y&&M,Ae=ue&&de?N:null,X=de?Ae??(a??v)({rects:g,activeNodeRect:ee,activeIndex:f,overIndex:b,index:S}):null,Ne=jp(f)&&jp(b)?i({id:s,items:u,activeIndex:f,overIndex:b}):S,Pe=j==null?void 0:j.id,se=p.useRef({activeId:Pe,items:u,newIndex:Ne,containerId:d}),ze=u!==se.current.items,Te=t({active:j,containerId:d,isDragging:M,isSorting:B,id:s,index:S,items:u,newIndex:se.current.newIndex,previousItems:se.current.items,previousContainerId:se.current.containerId,transition:c,wasDragging:se.current.activeId!=null}),Tt=Mie({disabled:!Te,index:S,node:T,rect:E});return p.useEffect(()=>{B&&se.current.newIndex!==Ne&&(se.current.newIndex=Ne),d!==se.current.containerId&&(se.current.containerId=d),u!==se.current.items&&(se.current.items=u)},[B,Ne,d,u]),p.useEffect(()=>{if(Pe===se.current.activeId)return;if(Pe&&!se.current.activeId){se.current.activeId=Pe;return}const ln=setTimeout(()=>{se.current.activeId=Pe},50);return()=>clearTimeout(ln)},[Pe]),{active:j,activeIndex:f,attributes:V,data:k,rect:E,index:S,newIndex:Ne,items:u,isOver:R,isSorting:B,isDragging:M,listeners:O,node:T,overIndex:b,over:_,setNodeRef:I,setActivatorNodeRef:P,setDroppableNodeRef:$,setDraggableNodeRef:U,transform:Tt??X,transition:pt()};function pt(){if(Tt||ze&&se.current.newIndex===S)return Oie;if(!(ue&&!bw(z)||!c)&&(B||Te))return wf.Transition.toString({...c,property:uD})}}function Pie(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}function Hm(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const Nie=[Fe.Down,Fe.Right,Fe.Up,Fe.Left],$ie=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:o,droppableContainers:i,over:s,scrollableAncestors:a}}=t;if(Nie.includes(e.code)){if(e.preventDefault(),!n||!r)return;const l=[];i.getEnabled().forEach(d=>{if(!d||d!=null&&d.disabled)return;const f=o.get(d.id);if(f)switch(e.code){case Fe.Down:r.top<f.top&&l.push(d);break;case Fe.Up:r.top>f.top&&l.push(d);break;case Fe.Left:r.left>f.left&&l.push(d);break;case Fe.Right:r.left<f.left&&l.push(d);break}});const c=doe({active:n,collisionRect:r,droppableRects:o,droppableContainers:l,pointerCoordinates:null});let u=G$(c,"id");if(u===(s==null?void 0:s.id)&&c.length>1&&(u=c[1].id),u!=null){const d=i.get(n.id),f=i.get(u),h=f?o.get(f.id):null,m=f==null?void 0:f.node.current;if(m&&h&&d&&f){const b=ov(m).some((C,E)=>a[E]!==C),y=dD(d,f),v=Die(d,f),w=b||!y?{x:0,y:0}:{x:v?r.width-h.width:0,y:v?r.height-h.height:0},S={x:h.left,y:h.top};return w.x&&w.y?S:bf(S,w)}}}};function dD(e,t){return!Hm(e)||!Hm(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function Die(e,t){return!Hm(e)||!Hm(t)||!dD(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function Aie({source:e,path:t,schema:n,loading:r,onClick:o,onMove:i,onDelete:s}){const[a,l]=p.useState(!1),[c,u]=p.useState([]);p.useEffect(()=>{const h=[];let m=1;for(const g of e){const b=tt.createValPathOfItem(t,m-1);if(!b){console.error("Val: could not determine path of item",t,m),m++;continue}h.push({source:g,path:b,id:m}),m++}u(h)},[e,t]);const d=loe(i_(Ew),i_(Sw,{coordinateGetter:$ie}));return x.jsx(uie,{sensors:d,collisionDetection:uoe,onDragEnd:f,children:x.jsx(kie,{items:c,strategy:wie,children:x.jsx("div",{className:"grid grid-cols-[min-content,min-content,1fr,min-content] gap-4",children:c.map(({source:h,path:m,id:g})=>x.jsx(Iie,{id:g,source:h,schema:n.item,path:m,disabled:r||a,onClick:o,onDelete:b=>{l(!0),s(b-1).then(()=>{u(y=>y.filter(v=>v.id!==b))}).finally(()=>{l(!1)})}},g))})})});function f(h){const{active:m,over:g}=h;if((m==null?void 0:m.id)!==(g==null?void 0:g.id)){l(!0);const b=c.findIndex(w=>w.id===Number(m==null?void 0:m.id)),y=c.findIndex(w=>w.id===Number(g==null?void 0:g.id)),v=c.slice();u(w=>Cw(w,b,y)),i(b,y).catch(()=>{u(v)}).then(()=>{u(w=>w.map((S,k)=>{const C=tt.createValPathOfItem(t,k);if(!C)throw Error("Val: could not determine path of item: "+t+" i:"+k);return{...S,path:C,id:k+1}}))}).finally(()=>{l(!1)})}}}const v_=170;function Iie({id:e,path:t,source:n,schema:r,disabled:o,onClick:i,onDelete:s}){const a=p.useRef(null),[l,c]=p.useState(!1);p.useEffect(()=>{a.current&&(a.current.getBoundingClientRect().height>=v_?c(!0):c(!1))},[e,n]);const{attributes:u,listeners:d,setNodeRef:f,transform:h,transition:m}=Rie({id:e,disabled:o}),g={transform:wf.Transform.toString(h),transition:m};return x.jsxs("div",{ref:f,style:g,className:"grid items-start col-span-4 gap-4 grid-cols-subgrid disabled:opacity-55",children:[x.jsx("button",{...u,...d,className:on("pt-4",{"opacity-30":o}),disabled:o,onClick:()=>{i(t)},children:x.jsx(L4,{})}),x.jsx("button",{className:"pt-4 font-serif text-accent",disabled:o,onClick:()=>{i(t)},children:Lie(e)}),x.jsxs("button",{className:"relative grid p-4 overflow-hidden border rounded border-border bg-card gap-y-2 grid-cols-subgrid cols-span-1",style:{maxHeight:v_},ref:a,disabled:o,onClick:()=>{i(t)},children:[x.jsx(dw,{source:n,schema:r}),l&&x.jsx("div",{className:"absolute bottom-0 left-0 w-full bg-gradient-to-b via-50% from-transparent via-card/90 to-card",style:{height:40}})]}),x.jsx("button",{className:"pt-4",children:x.jsxs(e$,{children:[x.jsx(t$,{asChild:!0,children:x.jsx($4,{})}),x.jsx(tw,{className:"w-32",children:x.jsx(FQ,{children:x.jsxs(si,{onClick:()=>{s(e)},children:[x.jsx(Q4,{className:"w-4 h-4 mr-2"}),x.jsx("span",{children:"Delete"})]})})})]})})]})}function Lie(e){return e.toString().padStart(2,"0")}function Gc({path:e,source:t,schema:n,field:r,initOnSubmit:o,top:i}){if(n.opt)return x.jsx(Vie,{path:e,source:t,schema:n,field:r,initOnSubmit:o});if(t===null)return x.jsx(gD,{source:t,schema:n,path:e,initOnSubmit:o});if(n.type==="object")return typeof t!="object"||mi(t)?x.jsxs("div",{children:["ERROR: expected object, but found ",typeof t]}):x.jsxs("div",{children:[r&&x.jsx("div",{className:"text-left",children:r}),x.jsx(fD,{source:t,path:e,schema:n,initOnSubmit:o,top:i})]});if(n.type==="array")return typeof t!="object"||!mi(t)?x.jsxs("div",{children:["ERROR: expected array, but found ",typeof t]}):x.jsxs("div",{className:"w-full",children:[r&&x.jsx("div",{className:"text-left",children:r}),x.jsx(pD,{source:t,path:e,schema:n,initOnSubmit:o})]});if(n.type==="record")return typeof t!="object"?x.jsxs("div",{children:["ERROR: expected object for ",n.type,", but found ",typeof t]}):mi(t)?x.jsxs("div",{children:["ERROR: did not expect array for ",n.type]}):x.jsxs("div",{children:[r&&x.jsx("div",{className:"text-left",children:r}),x.jsx(Fie,{source:t,path:e,schema:n,initOnSubmit:o})]});if((n==null?void 0:n.type)==="union"){if(typeof n.key=="string"&&typeof t=="object"&&!mi(t))return x.jsx(jie,{field:r,source:t,path:e,schema:n,initOnSubmit:o,top:i})}else if((n==null?void 0:n.type)==="literal")return x.jsx(x.Fragment,{});return x.jsxs("div",{className:"py-2 gap-y-4",children:[r&&x.jsx("div",{className:"text-left",children:r}),x.jsx(F$,{path:e,source:t,schema:n,initOnSubmit:o})]})}function jie({field:e,path:t,source:n,schema:r,initOnSubmit:o,top:i}){const s=zie(r),[a,l]=p.useState(null),[c,u]=p.useState(null);p.useEffect(()=>{const m=n[r.key];if(typeof m!="string"){console.error("Expected key to be a string, but got",m);return}l(m);for(const g of r.items)if(g.type==="object"&&g.items[r.key]){const b=g.items[r.key];b.type==="literal"&&b.value===m&&u({schema:g,source:n})}},[r,n]);const[d,f]=p.useState(!1),h=o(t);return x.jsxs(So,{className:on("flex flex-col gap-y-4",{"border-l-2 border-border pl-6":!i}),children:[(e||r.key)&&x.jsx("div",{className:"text-left",children:e||r.key}),x.jsx(cw,{value:a??void 0,disabled:d,onValueChange:m=>{l(m);for(const g of r.items)if(g.type==="object"&&g.items[r.key]){const b=g.items[r.key];if(b.type==="literal"&&b.value===m){const y={...Object.fromEntries(Object.keys(g.items).map(v=>[v,so(g.items[v])])),[r.key]:m};u({schema:g,source:y}),f(!0),h(async v=>[{op:"replace",path:v,value:y}]).finally(()=>{f(!1)});return}}console.error("Could not find key",m)},children:x.jsxs("div",{className:"relative pr-6",children:[x.jsx(ev,{children:x.jsx(uw,{placeholder:"Select type"})}),x.jsx(tv,{children:s.map(m=>x.jsx(nv,{value:m.toString(),children:m.toString()},m))}),x.jsx("div",{className:"absolute top-2 -right-4",children:x.jsx(Ii,{submitStatus:d?"loading":"idle"})})]})}),c&&x.jsx(Gc,{path:t,source:c.source,schema:c.schema,initOnSubmit:o,top:i},JSON.stringify(c.schema))]},t)}function zie(e){const t=[];for(const n of e.items)if(n.type==="object"&&n.items[e.key]){const r=n.items[e.key];r.type==="literal"&&t.push(r.value)}return t}function fD({path:e,source:t,schema:n,initOnSubmit:r,top:o}){return x.jsx("div",{className:on("flex flex-col gap-y-1",{"border-l-2 border-border pl-6 mt-4":!o}),children:Object.entries(n.items).map(([i,s])=>{const a=Wm(e,i);return x.jsx(Gc,{path:a,source:(t==null?void 0:t[i])??null,schema:s,field:i,initOnSubmit:r},a)})},e)}function Fie({path:e,source:t,schema:n,initOnSubmit:r}){const o=r(e),[i,s]=p.useState(!1),[a,l]=p.useState(!1),c=Object.keys(t);return x.jsxs(So,{className:"flex flex-col",children:[i?x.jsxs("form",{className:"flex gap-2",onSubmit:u=>{u.preventDefault(),!(!i.key||c.includes(i.key))&&(l(!0),o(async d=>[{op:"add",path:d.concat(i.key),value:so(n.item)}]).then(()=>{s(!1)}).finally(()=>{l(!1)}))},title:c.includes(i.key)?"Key already exists":"",children:[x.jsx(yg,{value:i.key,onChange:u=>s({key:u.target.value})}),x.jsx(Kd,{disabled:a||c.includes(i.key),children:x.jsx(Df,{})})]}):x.jsx("button",{className:"self-end p-2",disabled:a,onClick:()=>{s({key:""})},children:x.jsx(L0,{})}),x.jsx("div",{className:"flex flex-col gap-4 p-2",children:Object.entries(t).sort(([u],[d])=>u.localeCompare(d)).map(([u,d])=>{const f=Wm(e,u),h=r(f);return x.jsxs("div",{className:"grid grid-cols-[auto,min-content] items-start gap-2",children:[x.jsx(Bie,{allKeys:c,recordKey:u,path:f,source:d,schema:n.item,initOnSubmit:r}),x.jsx("button",{onClick:()=>{l(!0),h(async m=>[{op:"remove",path:m}]).catch(m=>{console.error("Could not delete item",m)}).finally(()=>{l(!1)})},children:x.jsx(Af,{})})]},u)})},e)]})}const y_=170;function Bie({recordKey:e,allKeys:t,path:n,source:r,schema:o,initOnSubmit:i}){const s=H.useRef(null),[a,l]=p.useState(!1);p.useEffect(()=>{s.current&&s.current.getBoundingClientRect().height>=y_&&l(!0)},[]);const c=mw(),u=i(n),[d,f]=p.useState(e);p.useEffect(()=>{f(e)},[e]);const h=t.includes(d),m=iw(!h,d,u,async(y,v)=>[{op:"move",from:v,path:v.slice(0,-1).concat(y)}]),[g,b]=p.useState(null);return x.jsxs(V$,{ref:s,className:"relative px-4 pt-2 pb-4 overflow-hidden border gap-y-2",style:{maxHeight:y_},children:[x.jsxs("div",{className:"relative flex gap-2 pr-6",children:[x.jsx(yg,{disabled:m==="loading",className:"font-serif text-left text-accent",value:d,onChange:y=>{const v=y.target.value;v!==e&&(t.includes(v)?b("Key already exists"):f(y.target.value))}}),x.jsx("div",{className:"absolute top-2 -right-4",children:g?x.jsx("div",{className:"text-destructive",title:g,children:x.jsx(Af,{})}):x.jsx(Ii,{submitStatus:m})})]}),x.jsx("button",{className:"text-xs",onClick:()=>{c(n)},children:x.jsx(hD,{path:n,source:r,schema:o})},n),a&&x.jsx("div",{className:"absolute bottom-0 left-0 w-full h-[20px] bg-gradient-to-b from-transparent to-background"})]})}function pD({path:e,source:t,schema:n,initOnSubmit:r}){const o=mw(),i=r(e),[s,a]=p.useState(!1),[l,c]=p.useState(t);return p.useEffect(()=>{c(t)},[t]),x.jsxs(So,{className:"flex flex-col items center",children:[x.jsx("button",{className:"self-end px-2",onClick:()=>{a(!0),i(async u=>[{op:"add",path:u.concat("0"),value:so(n.item)}]).then(async()=>{c(u=>[so(n.item)].concat(...u))}).finally(()=>{a(!1)})},children:x.jsx(L0,{})}),x.jsx("div",{className:"flex flex-col gap-4 p-2",children:x.jsx(Aie,{path:e,source:l,schema:n,loading:s,onDelete:async u=>(a(!0),i(async d=>[{op:"remove",path:d.concat(u.toString())}]).catch(d=>{console.error("Could not delete item",d)}).finally(()=>{a(!1)})),onMove:async(u,d)=>i(async f=>{const h=f.concat(u.toString()),m=f.concat(d.toString());return[{op:"move",from:h,path:m}]}).catch(f=>{console.error("Could not move item",f)}).finally(()=>{a(!1)}),onClick:u=>{s||o(u)}})}),l.length>0&&x.jsx("button",{className:"self-end px-2",onClick:()=>{a(!0),i(async u=>[{op:"add",path:u.concat("-"),value:so(n.item)}]).then(()=>{c(u=>u.concat(so(n.item)))}).finally(()=>{a(!1)})},children:x.jsx(L0,{})})]},e)}function Wm(e,t){const n=tt.createValPathOfItem(e,t);if(!n)throw Error(`Could not create val path: ${e} of ${t==null?void 0:t.toString()}`);return n}function hD({path:e,source:t,schema:n}){return n.type==="object"?x.jsx("div",{className:"grid grid-cols-[min-content_1fr] gap-2 text-left",children:Object.entries(n.items).map(([r])=>x.jsxs(p.Fragment,{children:[x.jsxs("span",{className:"text-muted",children:[r,":"]}),x.jsx("span",{children:x.jsx(hD,{source:(t==null?void 0:t[r])??null,schema:n.items[r],path:Wm(e,r)})})]},Wm(e,r)))},e):n.type==="array"?t===null?x.jsx("span",{className:"text-accent",children:"Empty"},e):Array.isArray(t)?x.jsxs("span",{children:[x.jsx("span",{className:"text-accent",children:t.length}),x.jsx("span",{children:t.length===1?" item":" items"})]},e):x.jsx("span",{className:"px-2 bg-destructive text-destructive-foreground",children:"Unknown length"},e):n.type==="richtext"?t===null?x.jsx("span",{className:"text-accent",children:"Empty"},e):typeof t!="object"?x.jsxs("div",{className:"p-4 text-destructive-foreground bg-destructive",children:["ERROR: ",typeof t," not an object"]},e):Array.isArray(t)?x.jsx(Wie,{children:{children:t}},e):x.jsx("div",{className:"p-4 text-destructive-foreground bg-destructive",children:"ERROR: object is not richtext"},e):n.type==="string"?t===null?x.jsx("span",{className:"text-accent",children:"Empty"},e):x.jsx("span",{children:t}):n.type==="image"?t===null?x.jsx("span",{className:"text-accent",children:"Empty"},e):typeof t!="object"?x.jsx("div",{className:"p-4 text-destructive-foreground bg-destructive",children:"ERROR: not an object"},e):!(it in t)||typeof t[it]!="string"?x.jsx("div",{className:"p-4 text-destructive-foreground bg-destructive",children:"ERROR: object is not an image"},e):x.jsx(mD,{source:t},e):n.type==="boolean"?t===null?x.jsx("span",{className:"text-accent",children:"Empty"},e):x.jsx("span",{className:"text-accent",children:t?"true":"false"},e):n.type==="number"?t===null?x.jsx("span",{className:"text-accent",children:"Empty"},e):x.jsx("span",{className:"text-accent",children:t.toString()}):n.type==="keyOf"?t===null?x.jsx("span",{className:"text-accent",children:"Empty"},e):x.jsx("span",{className:"text-accent",children:t.toString()},e):x.jsxs("div",{children:["TODO: ",n.type]},e)}function mD({source:e}){var s;const[t,n]=p.useState(null),r=(s=yD())==null?void 0:s.hoverElem,o=e;if(e[it]===void 0||typeof e[it]!="string")return console.warn("Invalid image source (cannot display preview)",e),null;const i=tt.convertFileSource(o).url;return typeof i!="string"||!i.startsWith("/")?(console.warn("Invalid image url (cannot display preview)",i),null):x.jsxs("span",{onMouseOver:a=>{n({x:a.clientX,y:a.clientY})},onMouseLeave:()=>{n(null)},className:"relative flex items-center justify-start gap-1",children:[x.jsx("a",{href:i,className:"overflow-hidden underline truncate ",children:o[it]}),t&&r&&At.createPortal(x.jsx("img",{className:"absolute z-[5] max-w-[10vw]",style:{left:t.x+10,top:t.y+10},src:i}),r)]})}function Vie({path:e,source:t,schema:n,initOnSubmit:r,field:o}){const[i,s]=p.useState(t!==null),a=r(e),[l,c]=p.useState(!1);return p.useEffect(()=>{s(t!==null)},[t]),x.jsxs(So,{className:"flex flex-col",children:[x.jsxs("div",{className:"relative flex items-center justify-between w-full gap-4 pr-3",children:[x.jsx("div",{className:"truncate max-w-[300px] text-left",title:e,dir:"rtl",children:o||x.jsx(Xb,{children:e})}),x.jsx(fw,{disabled:l,checked:i,onCheckedChange:u=>{typeof u=="boolean"?(c(!0),a(async d=>[{op:"replace",path:d,value:u?t===null?so(n):t:null}]).then(()=>{s(u)}).finally(()=>{c(!1)})):console.error("Expected boolean, but got",u)}})]}),i&&t===null&&x.jsx(gD,{source:so(n),schema:n,path:e,initOnSubmit:r}),i&&t!==null&&x.jsx(Gc,{path:e,source:t,schema:{...n,opt:!1},initOnSubmit:r})]},e)}function gD({source:e,path:t,schema:n,initOnSubmit:r}){if(n.type==="array"){if(typeof e=="object"&&(e===null||mi(e)))return x.jsx(pD,{initOnSubmit:r,source:e===null?[]:e,path:t,schema:n})}else if(n.type==="object"){if(typeof e=="object"&&(e===null||!mi(e)))return x.jsx(fD,{source:e,path:t,schema:n,initOnSubmit:r})}else if(n.type==="richtext"||n.type==="string"||n.type==="image"||n.type==="number"||n.type==="keyOf"||n.type==="boolean"||n.type==="literal"||n.type==="union")return x.jsx(F$,{path:t,source:e,schema:n,initOnSubmit:r},t);return x.jsxs("div",{className:"p-4 bg-destructive text-destructive-foreground",children:["ERROR: unexpected source type ",typeof e," for schema type"," ",n.type]})}function Uie(e){const t={};return e.forEach(n=>{const r=n.split("/").filter(o=>o!=="");if(r.length===1)t[""]||(t[""]=[]),t[""].push(r[0]);else if(r.length>1){const o=r.slice(0,r.length-1).join("/"),i=r.slice(-1)[0];t[o]||(t[o]=[]),t[o].push(i)}}),t}function Hie({selectedPath:e,paths:t}){const n=Uie(t),r=e&&tt.splitModuleFilePathAndModulePath(e)[0],o=mw();return x.jsx("div",{className:"flex flex-col w-full py-2 text-xs",children:Object.entries(n).map(([i,s])=>x.jsxs("div",{className:"px-4 py-2",children:[i&&x.jsx("div",{className:"font-bold truncate max-w-[300px] text-left",title:i,children:x.jsx(Xb,{children:i})}),x.jsx("div",{className:on({"flex flex-col py-2 justify-start items-start":!!i}),children:s.map(a=>{const l=`/${i}/${a}`;return x.jsx("button",{className:on("block px-2 py-1 rounded-full",{"bg-accent text-accent-foreground":r===l}),onClick:()=>{o(l)},children:a},l)})})]},`/${i}`))})}const x_={tags:{h1:"font-bold",h2:"font-bold",h3:"font-bold",h4:"font-bold",h5:"font-bold",h6:"font-bold",p:""},classes:{bold:"font-bold",italic:"italic",lineThrough:"line-through"}};function Wie({children:e}){function t(o,i){const s=x_.tags[o];return s&&i?[i,s].join(" "):s||i}function n(o,i){const s=x_.classes[o];return s&&i?[i,s].join(" "):s||i}function r(o,i){var l,c;if(typeof o=="string")return o;if(_n in o)return x.jsx("img",{});if(o.tag==="p")return x.jsx("p",{className:t("p"),children:o.children.map((u,d)=>r(u,d))},i);if(o.tag==="ul")return x.jsx("ul",{className:t("ul"),children:o.children.map((u,d)=>r(u,d))},i);if(o.tag==="ol")return x.jsx("ol",{className:t("ol"),children:o.children.map((u,d)=>r(u,d))},i);if(o.tag==="li")return x.jsx("li",{className:t("li"),children:o.children.map((u,d)=>r(u,d))},i);if(o.tag==="span")return x.jsx("span",{className:o.styles.map(u=>{switch(u){case"bold":return n("bold");case"line-through":return n("lineThrough");case"italic":return n("italic")}}).join(" "),children:o.children.map((u,d)=>r(u,d))},i);if(o.tag==="h1")return x.jsx("h1",{className:t("h1"),children:o.children.map((u,d)=>r(u,d))},i);if(o.tag==="h2")return x.jsx("h2",{className:t("h2"),children:o.children.map((u,d)=>r(u,d))},i);if(o.tag==="h3")return x.jsx("h3",{className:t("h3"),children:o.children.map((u,d)=>r(u,d))},i);if(o.tag==="h4")return x.jsx("h4",{className:t("h4"),children:o.children.map((u,d)=>r(u,d))},i);if(o.tag==="h5")return x.jsx("h5",{className:t("h5"),children:o.children.map((u,d)=>r(u,d))},i);if(o.tag==="h6")return x.jsx("h6",{className:t("h6"),children:o.children.map((u,d)=>r(u,d))},i);if(o.tag==="br")return x.jsx("br",{},i);if(o.tag==="a")return x.jsx("a",{href:o.href,children:o.children.map((u,d)=>r(u,d))},i);if(o.tag==="img")return x.jsx(mD,{source:o.src});const s=o;console.error("Unexpected RichText node: "+JSON.stringify(s));const a=s;return a!=null&&a.tag?H.createElement(a.tag,{key:i,className:(l=a.class)==null?void 0:l.join(" "),children:(c=a.children)==null?void 0:c.map(r)}):null}return x.jsx("span",{children:e.children.map((o,i)=>r(o,i))})}const vD=H.createContext({hoverElem:null}),yD=()=>H.useContext(vD),xD="Dialog",[bD,ece]=vr(xD),[Kie,Ko]=bD(xD),qie=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,a=p.useRef(null),l=p.useRef(null),[c=!1,u]=xo({prop:r,defaultProp:o,onChange:i});return p.createElement(Kie,{scope:t,triggerRef:a,contentRef:l,contentId:Pr(),titleId:Pr(),descriptionId:Pr(),open:c,onOpenChange:u,onOpenToggle:p.useCallback(()=>u(d=>!d),[u]),modal:s},n)},wD="DialogPortal",[Gie,SD]=bD(wD,{forceMount:void 0}),Yie=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=Ko(wD,t);return p.createElement(Gie,{scope:t,forceMount:n},p.Children.map(r,s=>p.createElement(yn,{present:n||i.open},p.createElement(Kg,{asChild:!0,container:o},s))))},Fx="DialogOverlay",Xie=p.forwardRef((e,t)=>{const n=SD(Fx,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Ko(Fx,e.__scopeDialog);return i.modal?p.createElement(yn,{present:r||i.open},p.createElement(Zie,D({},o,{ref:t}))):null}),Zie=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ko(Fx,n);return p.createElement(Gg,{as:ki,allowPinchZoom:!0,shards:[o.contentRef]},p.createElement(we.div,D({"data-state":ED(o.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),kf="DialogContent",Jie=p.forwardRef((e,t)=>{const n=SD(kf,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Ko(kf,e.__scopeDialog);return p.createElement(yn,{present:r||i.open},i.modal?p.createElement(Qie,D({},o,{ref:t})):p.createElement(ese,D({},o,{ref:t})))}),Qie=p.forwardRef((e,t)=>{const n=Ko(kf,e.__scopeDialog),r=p.useRef(null),o=Le(t,n.contentRef,r);return p.useEffect(()=>{const i=r.current;if(i)return Bg(i)},[]),p.createElement(kD,D({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:re(e.onCloseAutoFocus,i=>{var s;i.preventDefault(),(s=n.triggerRef.current)===null||s===void 0||s.focus()}),onPointerDownOutside:re(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&i.preventDefault()}),onFocusOutside:re(e.onFocusOutside,i=>i.preventDefault())}))}),ese=p.forwardRef((e,t)=>{const n=Ko(kf,e.__scopeDialog),r=p.useRef(!1),o=p.useRef(!1);return p.createElement(kD,D({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s;if((s=e.onCloseAutoFocus)===null||s===void 0||s.call(e,i),!i.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),i.preventDefault()}r.current=!1,o.current=!1},onInteractOutside:i=>{var s,a;(s=e.onInteractOutside)===null||s===void 0||s.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const l=i.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}}))}),kD=p.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,a=Ko(kf,n),l=p.useRef(null),c=Le(t,l);return Hg(),p.createElement(p.Fragment,null,p.createElement(Wg,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},p.createElement(Ug,D({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":ED(a.open)},s,{ref:c,onDismiss:()=>a.onOpenChange(!1)}))),!1)}),tse="DialogTitle",nse=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ko(tse,n);return p.createElement(we.h2,D({id:o.titleId},r,{ref:t}))}),rse="DialogDescription",ose=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ko(rse,n);return p.createElement(we.p,D({id:o.descriptionId},r,{ref:t}))}),ise="DialogClose",sse=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ko(ise,n);return p.createElement(we.button,D({type:"button"},r,{ref:t,onClick:re(e.onClick,()=>o.onOpenChange(!1))}))});function ED(e){return e?"open":"closed"}const ase=qie,lse=Yie,CD=Xie,_D=Jie,OD=nse,TD=ose,cse=sse,use=ase,dse=lse,MD=p.forwardRef(({className:e,...t},n)=>x.jsx(CD,{ref:n,className:je("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));MD.displayName=CD.displayName;const RD=p.forwardRef(({className:e,children:t,container:n,hideClose:r,...o},i)=>x.jsxs(dse,{container:n,children:[x.jsx(MD,{}),x.jsxs(_D,{ref:i,className:je("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",e),...o,children:[t,r?null:x.jsxs(cse,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[x.jsx(Af,{className:"w-4 h-4"}),x.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));RD.displayName=_D.displayName;const fse=p.forwardRef(({className:e,...t},n)=>x.jsx(OD,{ref:n,className:je("text-lg font-semibold leading-none tracking-tight",e),...t}));fse.displayName=OD.displayName;const pse=p.forwardRef(({className:e,...t},n)=>x.jsx(TD,{ref:n,className:je("text-sm text-muted-foreground",e),...t}));pse.displayName=TD.displayName;const PD=({api:e,store:t})=>{const[n,r]=p.useState(null),i=Kre().sourcePath||"",[s,a]=p.useState(),[l,c]=p.useState("not-asked");p.useEffect(()=>{l==="not-asked"&&(c("running"),t.initialize().then(R=>{Ke.isOk(R)?(a(R.value),c("complete")):(r(R.error.message),c("failed"))}))},[l]);const u=q2(e),[d,f]=j2(),h=H.useRef(null),[m,g]=p.useState([]),b=p.useCallback(R=>async $=>{const[j,z]=tt.splitModuleFilePathAndModulePath(R),ee=await $(tt.createPatchPath(z)),V=await t.applyPatch(j,m,ee);if(Ke.isOk(V)){const U=[];for(const O of Object.values(V.value))U.push(...O.patchIds);g(U)}},[m]),[y,v]=p.useState(!1),[w,S]=p.useState(),[k,C]=p.useState(null),[E]=i?tt.splitModuleFilePathAndModulePath(i):[void 0,void 0];p.useEffect(()=>{C(null),S(void 0),E&&v(!0)},[E]),p.useEffect(()=>{let R=!1;return E?t.reset().then(async()=>{const $=await t.getModule(E);R||u.status==="success"&&u.data.enabled&&(Ke.isOk($)?C($.value):S($.error.message))}).finally(()=>{R||v(!1)}):C(null),()=>{R=!0}},[E,i,u,m]),p.useEffect(()=>{e.getPatches().then(R=>{if(Ke.isOk(R)){const $=[];for(const j of Object.values(R.value).flat())j.applied_at_base_sha||$.push(j.patch_id);g($)}else console.error("Could not get patches",R.error)})},[]);const T=p.useRef(null);return x.jsx(A$,{store:t,children:x.jsx(Yb.Provider,{value:{theme:d,setTheme:f,editMode:"full",session:u,setEditMode:()=>{},setWindowSize:()=>{}},children:x.jsxs("div",{id:"val-fullscreen-container",className:"relative w-full h-[100] overflow-hidden font-serif antialiased bg-background text-primary","data-mode":d,children:[x.jsx("div",{ref:T}),x.jsx("div",{id:"val-fullscreen-hover",ref:h}),x.jsx(vD.Provider,{value:{hoverElem:h==null?void 0:h.current},children:x.jsx("div",{className:"text-primary",children:x.jsxs(ad,{children:[x.jsx("div",{className:"px-4 h-[50px] flex items-center justify-center",children:x.jsx(I2,{})}),x.jsx(Jl,{className:"px-4",children:s?x.jsx(Hie,{selectedPath:i,paths:s}):!n&&x.jsx("div",{className:"py-4",children:"Loading..."})}),x.jsxs("div",{className:"flex items-center justify-between h-[50px] w-full px-4",children:[x.jsxs("div",{className:"flex items-center justify-start gap-2 font-serif text-xs",children:[x.jsx("button",{onClick:()=>{history.back()},children:x.jsx(M4,{})}),x.jsx("div",{className:"truncate max-w-[300px] text-left",dir:"rtl",title:i,children:x.jsx(Xb,{children:i||"/"})})]}),x.jsxs("div",{className:"flex gap-2",children:[x.jsx(Kd,{onClick:()=>{window.location.href="/"},children:"Preview"}),x.jsxs(Kd,{disabled:!(u.status==="success"&&u.data.enabled)||m.length===0,onClick:()=>{e.postSave({patchIds:m}).then(async R=>{if(Ke.isOk(R)){const $=await e.deletePatches(m);Ke.isOk($)?(g([]),alert("Success")):r("Could not clean up")}else r("Could not publish")})},children:["Publish ",m.length>0&&`(${m.length})`]})]})]}),x.jsxs("div",{className:"max-w-xl p-4",children:[x.jsx(hse,{session:u,portal:T.current,api:e}),w&&x.jsxs("div",{className:"p-4 text-lg bg-destructive text-destructive-foreground",children:["ERROR: ",w]}),y&&x.jsx("div",{className:"flex place-content-center",children:"Loading..."}),k&&i&&x.jsx(mse,{path:i,source:k.source,schema:k.schema,initOnSubmit:b})]})]})})})]})})})};function hse({api:e,session:t,portal:n}){var i,s;const r=t.status==="success"&&t.data.mode==="unauthorized",o=t.status==="success"&&!t.data.enabled;return x.jsx(use,{open:r||o,children:x.jsx(RD,{container:n,className:"flex items-center justify-center p-0 border-t-0",hideClose:!0,children:x.jsxs("div",{className:"flex flex-col items-center justify-center w-full gap-4 pb-4",children:[x.jsx("h1",{className:"w-full py-2 text-lg font-bold text-center border-t rounded-t bg-accent text-primary",children:r?"Login required":"Enable Val"}),x.jsx("p",{children:r?"You need to login to continue":"You must enable Val to continue"}),x.jsx(Kd,{asChild:!0,children:x.jsx("a",{href:r?e.getLoginUrl(((i=window==null?void 0:window.location)==null?void 0:i.href)||"/val"):e.getEnableUrl(((s=window==null?void 0:window.location)==null?void 0:s.href)||"/val"),children:r?"Login":"Enable Val"})})]})})})}function mse({path:e,source:t,schema:n,initOnSubmit:r}){const[,o]=tt.splitModuleFilePathAndModulePath(e),i=tt.resolvePath(o,t,n);if(!i)throw console.error("Could not resolve module: "+e,{modulePath:o,moduleSource:t,moduleSchema:n}),Error("Could not resolve module: "+e);return x.jsx(Gc,{path:e,source:i.source,schema:i.schema,initOnSubmit:r,top:!0})}const gse=p.createContext(null),_y={didCatch:!1,error:null};class _w extends p.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=_y}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var n,r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];(n=(r=this.props).onReset)===null||n===void 0||n.call(r,{args:i,reason:"imperative-api"}),this.setState(_y)}}componentDidCatch(t,n){var r,o;(r=(o=this.props).onError)===null||r===void 0||r.call(o,t,n)}componentDidUpdate(t,n){const{didCatch:r}=this.state,{resetKeys:o}=this.props;if(r&&n.error!==null&&vse(t.resetKeys,o)){var i,s;(i=(s=this.props).onReset)===null||i===void 0||i.call(s,{next:o,prev:t.resetKeys,reason:"keys"}),this.setState(_y)}}render(){const{children:t,fallbackRender:n,FallbackComponent:r,fallback:o}=this.props,{didCatch:i,error:s}=this.state;let a=t;if(i){const l={error:s,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")a=n(l);else if(r)a=p.createElement(r,l);else if(o===null||p.isValidElement(o))a=o;else throw s}return p.createElement(gse.Provider,{value:{didCatch:i,error:s,resetErrorBoundary:this.resetErrorBoundary}},a)}}function vse(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((n,r)=>!Object.is(n,t[r]))}const ND="Collapsible",[yse,$D]=vr(ND),[xse,Ow]=yse(ND),bse=p.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:i,onOpenChange:s,...a}=e,[l=!1,c]=xo({prop:r,defaultProp:o,onChange:s});return p.createElement(xse,{scope:n,disabled:i,contentId:Pr(),open:l,onOpenToggle:p.useCallback(()=>c(u=>!u),[c])},p.createElement(we.div,D({"data-state":Tw(l),"data-disabled":i?"":void 0},a,{ref:t})))}),wse="CollapsibleTrigger",Sse=p.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=Ow(wse,n);return p.createElement(we.button,D({type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":Tw(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled},r,{ref:t,onClick:re(e.onClick,o.onOpenToggle)}))}),DD="CollapsibleContent",kse=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Ow(DD,e.__scopeCollapsible);return p.createElement(yn,{present:n||o.open},({present:i})=>p.createElement(Ese,D({},r,{ref:t,present:i})))}),Ese=p.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=e,s=Ow(DD,n),[a,l]=p.useState(r),c=p.useRef(null),u=Le(t,c),d=p.useRef(0),f=d.current,h=p.useRef(0),m=h.current,g=s.open||a,b=p.useRef(g),y=p.useRef();return p.useEffect(()=>{const v=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(v)},[]),ur(()=>{const v=c.current;if(v){y.current=y.current||{transitionDuration:v.style.transitionDuration,animationName:v.style.animationName},v.style.transitionDuration="0s",v.style.animationName="none";const w=v.getBoundingClientRect();d.current=w.height,h.current=w.width,b.current||(v.style.transitionDuration=y.current.transitionDuration,v.style.animationName=y.current.animationName),l(r)}},[s.open,r]),p.createElement(we.div,D({"data-state":Tw(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!g},i,{ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style}}),g&&o)});function Tw(e){return e?"open":"closed"}const Cse=bse,_se=Sse,Ose=kse,Js="Accordion",Tse=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Mw,Mse,Rse]=Vg(Js),[av,tce]=vr(Js,[Rse,$D]),Rw=$D(),AD=H.forwardRef((e,t)=>{const{type:n,...r}=e,o=r,i=r;return H.createElement(Mw.Provider,{scope:e.__scopeAccordion},n==="multiple"?H.createElement(Dse,D({},i,{ref:t})):H.createElement($se,D({},o,{ref:t})))});AD.propTypes={type(e){const t=e.value||e.defaultValue;return e.type&&!["single","multiple"].includes(e.type)?new Error("Invalid prop `type` supplied to `Accordion`. Expected one of `single | multiple`."):e.type==="multiple"&&typeof t=="string"?new Error("Invalid prop `type` supplied to `Accordion`. Expected `single` when `defaultValue` or `value` is type `string`."):e.type==="single"&&Array.isArray(t)?new Error("Invalid prop `type` supplied to `Accordion`. Expected `multiple` when `defaultValue` or `value` is type `string[]`."):null}};const[ID,Pse]=av(Js),[LD,Nse]=av(Js,{collapsible:!1}),$se=H.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},collapsible:i=!1,...s}=e,[a,l]=xo({prop:n,defaultProp:r,onChange:o});return H.createElement(ID,{scope:e.__scopeAccordion,value:a?[a]:[],onItemOpen:l,onItemClose:H.useCallback(()=>i&&l(""),[i,l])},H.createElement(LD,{scope:e.__scopeAccordion,collapsible:i},H.createElement(jD,D({},s,{ref:t}))))}),Dse=H.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=e,[s=[],a]=xo({prop:n,defaultProp:r,onChange:o}),l=H.useCallback(u=>a((d=[])=>[...d,u]),[a]),c=H.useCallback(u=>a((d=[])=>d.filter(f=>f!==u)),[a]);return H.createElement(ID,{scope:e.__scopeAccordion,value:s,onItemOpen:l,onItemClose:c},H.createElement(LD,{scope:e.__scopeAccordion,collapsible:!0},H.createElement(jD,D({},i,{ref:t}))))}),[Ase,lv]=av(Js),jD=H.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:o,orientation:i="vertical",...s}=e,a=H.useRef(null),l=Le(a,t),c=Mse(n),d=$f(o)==="ltr",f=re(e.onKeyDown,h=>{var m;if(!Tse.includes(h.key))return;const g=h.target,b=c().filter(R=>{var $;return!(($=R.ref.current)!==null&&$!==void 0&&$.disabled)}),y=b.findIndex(R=>R.ref.current===g),v=b.length;if(y===-1)return;h.preventDefault();let w=y;const S=0,k=v-1,C=()=>{w=y+1,w>k&&(w=S)},E=()=>{w=y-1,w<S&&(w=k)};switch(h.key){case"Home":w=S;break;case"End":w=k;break;case"ArrowRight":i==="horizontal"&&(d?C():E());break;case"ArrowDown":i==="vertical"&&C();break;case"ArrowLeft":i==="horizontal"&&(d?E():C());break;case"ArrowUp":i==="vertical"&&E();break}const T=w%v;(m=b[T].ref.current)===null||m===void 0||m.focus()});return H.createElement(Ase,{scope:n,disabled:r,direction:o,orientation:i},H.createElement(Mw.Slot,{scope:n},H.createElement(we.div,D({},s,{"data-orientation":i,ref:l,onKeyDown:r?void 0:f}))))}),Bx="AccordionItem",[Ise,Pw]=av(Bx),Lse=H.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...o}=e,i=lv(Bx,n),s=Pse(Bx,n),a=Rw(n),l=Pr(),c=r&&s.value.includes(r)||!1,u=i.disabled||e.disabled;return H.createElement(Ise,{scope:n,open:c,disabled:u,triggerId:l},H.createElement(Cse,D({"data-orientation":i.orientation,"data-state":zD(c)},a,o,{ref:t,disabled:u,open:c,onOpenChange:d=>{d?s.onItemOpen(r):s.onItemClose(r)}})))}),jse="AccordionHeader",zse=H.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=lv(Js,n),i=Pw(jse,n);return H.createElement(we.h3,D({"data-orientation":o.orientation,"data-state":zD(i.open),"data-disabled":i.disabled?"":void 0},r,{ref:t}))}),b_="AccordionTrigger",Fse=H.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=lv(Js,n),i=Pw(b_,n),s=Nse(b_,n),a=Rw(n);return H.createElement(Mw.ItemSlot,{scope:n},H.createElement(_se,D({"aria-disabled":i.open&&!s.collapsible||void 0,"data-orientation":o.orientation,id:i.triggerId},a,r,{ref:t})))}),Bse="AccordionContent",Vse=H.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=lv(Js,n),i=Pw(Bse,n),s=Rw(n);return H.createElement(Ose,D({role:"region","aria-labelledby":i.triggerId,"data-orientation":o.orientation},s,r,{ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}}))});function zD(e){return e?"open":"closed"}const Use=AD,Hse=Lse,Wse=zse,FD=Fse,BD=Vse,Kse=Use,VD=p.forwardRef(({className:e,...t},n)=>x.jsx(Hse,{ref:n,className:je("border-b",e),...t}));VD.displayName="AccordionItem";const UD=p.forwardRef(({className:e,children:t,...n},r)=>x.jsx(Wse,{className:"flex",children:x.jsxs(FD,{ref:r,className:je("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...n,children:[t,x.jsx(A2,{className:"w-4 h-4 transition-transform duration-200 shrink-0"})]})}));UD.displayName=FD.displayName;const HD=p.forwardRef(({className:e,children:t,...n},r)=>x.jsx(BD,{ref:r,className:je("overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",e),...n,children:x.jsx("div",{className:"pt-0 pb-4",children:t})}));HD.displayName=BD.displayName;function Nw({error:e,resetErrorBoundary:t}){return console.error(e),x.jsx("div",{className:"absolute top-0 left-0 flex items-center justify-center w-screen h-screen bg-card-foreground",children:x.jsx("div",{className:"w-full h-full p-10",children:x.jsxs("div",{className:"w-full h-full p-10 overflow-scroll bg-card text-primary",children:[x.jsxs("div",{className:"flex items-center justify-between",children:[x.jsxs("div",{className:"flex items-center gap-[0.5em] text-lg font-bold text-center py-2",children:[x.jsx(I2,{})," encountered an error"]}),x.jsx("button",{onClick:t,children:x.jsx(Af,{})})]}),x.jsx("div",{className:"text-4xl font-normal ",children:"Message:"}),x.jsx("pre",{children:e.message}),e.stack&&x.jsx(Kse,{type:"single",className:"font-serif",collapsible:!0,defaultValue:"error",children:x.jsxs(VD,{value:"error",children:[x.jsx(UD,{children:"Stack trace:"}),x.jsx(HD,{className:"p-4 bg-popover text-popover-foreground",children:e.stack&&x.jsx("pre",{children:e.stack})})]})})]})})})}function qse(){const{api:e,store:t}=p.useMemo(()=>{const n=new Kb("/api/val"),r=new Qb(n);return{api:n,store:r}},[]);return x.jsx(_w,{fallbackRender:Nw,children:x.jsx(hw,{children:x.jsx(PD,{api:e,store:t})})})}function Gse(){const e=new Kb("/api/val"),t=new Qb(e);return x.jsx(_w,{fallbackRender:Nw,children:x.jsx(hw,{children:x.jsx(PD,{api:e,store:t})})})}function Yse({root:e,children:t}){return At.createPortal(t,e)}const Xse=({children:e,style:t})=>{const n=p.useRef(null),[r,o]=p.useState(null);return p.useLayoutEffect(()=>{if(n.current)if(n.current.shadowRoot)o(n.current.shadowRoot);else{const i=n.current.attachShadow({mode:"open"});o(i)}},[]),x.jsx("div",{ref:n,style:t,id:"val-shadow-root",children:r&&x.jsx(Yse,{root:r,children:e})})},Zse="/spa/index.css",Jse="val-app",Qse="val-overlay",WD="Switch",[eae,nce]=vr(WD),[tae,nae]=eae(WD),rae=p.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:i,required:s,disabled:a,value:l="on",onCheckedChange:c,...u}=e,[d,f]=p.useState(null),h=Le(t,v=>f(v)),m=p.useRef(!1),g=d?!!d.closest("form"):!0,[b=!1,y]=xo({prop:o,defaultProp:i,onChange:c});return p.createElement(tae,{scope:n,checked:b,disabled:a},p.createElement(we.button,D({type:"button",role:"switch","aria-checked":b,"aria-required":s,"data-state":KD(b),"data-disabled":a?"":void 0,disabled:a,value:l},u,{ref:h,onClick:re(e.onClick,v=>{y(w=>!w),g&&(m.current=v.isPropagationStopped(),m.current||v.stopPropagation())})})),g&&p.createElement(sae,{control:d,bubbles:!m.current,name:r,value:l,checked:b,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),oae="SwitchThumb",iae=p.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=nae(oae,n);return p.createElement(we.span,D({"data-state":KD(o.checked),"data-disabled":o.disabled?"":void 0},r,{ref:t}))}),sae=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=p.useRef(null),s=sw(n),a=W1(t);return p.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&d){const f=new Event("click",{bubbles:r});d.call(l,n),l.dispatchEvent(f)}},[s,n,r]),p.createElement("input",D({type:"checkbox","aria-hidden":!0,defaultChecked:n},o,{tabIndex:-1,ref:i,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function KD(e){return e?"checked":"unchecked"}const aae=rae,qD="Popover",[GD,rce]=vr(qD,[Uc]),$w=Uc(),[lae,Yc]=GD(qD),cae=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,a=$w(t),l=p.useRef(null),[c,u]=p.useState(!1),[d=!1,f]=xo({prop:r,defaultProp:o,onChange:i});return p.createElement(K1,a,p.createElement(lae,{scope:t,contentId:Pr(),triggerRef:l,open:d,onOpenChange:f,onOpenToggle:p.useCallback(()=>f(h=>!h),[f]),hasCustomAnchor:c,onCustomAnchorAdd:p.useCallback(()=>u(!0),[]),onCustomAnchorRemove:p.useCallback(()=>u(!1),[]),modal:s},n))},uae="PopoverTrigger",dae=p.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Yc(uae,n),i=$w(n),s=Le(t,o.triggerRef),a=p.createElement(we.button,D({type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":ZD(o.open)},r,{ref:s,onClick:re(e.onClick,o.onOpenToggle)}));return o.hasCustomAnchor?a:p.createElement(q1,D({asChild:!0},i),a)}),YD="PopoverPortal",[fae,pae]=GD(YD,{forceMount:void 0}),hae=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=Yc(YD,t);return p.createElement(fae,{scope:t,forceMount:n},p.createElement(yn,{present:n||i.open},p.createElement(Kg,{asChild:!0,container:o},r)))},Ef="PopoverContent",mae=p.forwardRef((e,t)=>{const n=pae(Ef,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=Yc(Ef,e.__scopePopover);return p.createElement(yn,{present:r||i.open},i.modal?p.createElement(gae,D({},o,{ref:t})):p.createElement(vae,D({},o,{ref:t})))}),gae=p.forwardRef((e,t)=>{const n=Yc(Ef,e.__scopePopover),r=p.useRef(null),o=Le(t,r),i=p.useRef(!1);return p.useEffect(()=>{const s=r.current;if(s)return Bg(s)},[]),p.createElement(Gg,{as:ki,allowPinchZoom:!0},p.createElement(XD,D({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:re(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),i.current||(a=n.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:re(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;i.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:re(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})))}),vae=p.forwardRef((e,t)=>{const n=Yc(Ef,e.__scopePopover),r=p.useRef(!1),o=p.useRef(!1);return p.createElement(XD,D({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s;if((s=e.onCloseAutoFocus)===null||s===void 0||s.call(e,i),!i.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),i.preventDefault()}r.current=!1,o.current=!1},onInteractOutside:i=>{var s,a;(s=e.onInteractOutside)===null||s===void 0||s.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const l=i.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}}))}),XD=p.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...d}=e,f=Yc(Ef,n),h=$w(n);return Hg(),p.createElement(Wg,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},p.createElement(Ug,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>f.onOpenChange(!1)},p.createElement(G1,D({"data-state":ZD(f.open),role:"dialog",id:f.contentId},h,d,{ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}}))))});function ZD(e){return e?"open":"closed"}const yae=cae,xae=dae,JD=hae,Dw=mae,bae=yae,wae=xae,Sae=p.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>x.jsx(JD,{children:x.jsx(Dw,{ref:o,align:t,sideOffset:n,className:je("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));Sae.displayName=Dw.displayName;const Aw="p-1 border rounded-full shadow border-accent",w_="valbuild:urlBeforeNavigation";function kae({api:e,patches:t,direction:n,onClickPatches:r}){const{theme:o,setTheme:i,editMode:s,setEditMode:a,session:l}=L2();if(l.status==="success"&&l.data.mode==="unauthorized")return x.jsxs(S_,{direction:n,href:e.getLoginUrl(window.location.href),children:[x.jsx("span",{children:"Login"}),x.jsx(Ek,{size:18})]});if(l.status==="success"&&!l.data.enabled)return x.jsxs(S_,{direction:n,href:e.getEnableUrl(window.location.href),children:[x.jsx("span",{children:"Enable"}),x.jsx(Ek,{size:18})]});const[c,u]=p.useState();return p.useEffect(()=>{u(t.length)},[t]),x.jsxs(QD,{direction:n,children:[x.jsx(Oy,{active:s==="hover"||s==="window",onClick:()=>{a(d=>d==="hover"||s==="window"?"off":"hover")},children:x.jsx("div",{className:"h-[24px] w-[24px] flex justify-center items-center",children:s==="hover"||s==="window"?x.jsx(q4,{size:18}):x.jsx(G4,{size:18})})}),x.jsx(Oy,{active:s==="full",onClick:()=>{if(s!=="full")localStorage.setItem(w_,window.location.href),window.location.href=e.getEditUrl();else if(s==="full"){const d=localStorage.getItem(w_);window.location.href=d||"/"}},children:x.jsx("div",{className:"h-[24px] w-[24px] flex justify-center items-center",children:s==="full"?x.jsx(W4,{size:15}):x.jsx(U4,{size:15})})}),c!==void 0&&x.jsx(Oy,{onClick:()=>{c>0&&r()},children:x.jsxs("div",{className:"relative h-[24px] w-[24px] flex justify-center items-center",children:[x.jsx("div",{className:"absolute -right-[10px] -top-[10px] border border-border rounded-full px-1 font-sans text-xs bg-card text-accent",children:c}),x.jsx(X4,{size:18})]})}),x.jsx(wae,{className:Aw,children:x.jsx("div",{className:"h-[24px] w-[24px] flex justify-center items-center",children:x.jsx(D4,{size:18})})}),x.jsx(Dw,{align:"start",sideOffset:12,side:"right",className:"z-50 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",children:x.jsxs("div",{className:"flex flex-col items-start justify-center p-4 gap-x-4",children:[x.jsx("div",{className:"flex items-end justify-end w-full",children:x.jsx("div",{className:"h-[34px] w-[34px] flex justify-center items-center",children:x.jsxs(aae,{className:"relative peer inline-flex h-[24px] w-[34px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-slate-800 data-[state=unchecked]:bg-slate-800",defaultChecked:o==="light",onClick:()=>{i(o==="dark"?"light":"dark")},children:[o==="dark"&&x.jsx(K4,{size:13,className:"absolute top-[4px] left-[17px] text-white"}),x.jsx(iae,{className:"pointer-events-none block h-[16px] w-[16px] rounded-full bg-white shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-[15px] data-[state=unchecked]:translate-x-0"}),o==="light"&&x.jsx(J4,{size:13,className:"absolute top-[4px] left-[1px] text-white"})]})})}),x.jsx("div",{children:x.jsxs("a",{className:"flex items-center justify-center font-bold h-[34px] gap-x-1",href:e.getDisableUrl(window.location.href),children:[x.jsx("span",{children:"Disable"}),x.jsx(A4,{size:18})]})})]})})]})}function S_({href:e,direction:t,children:n}){return x.jsx(QD,{direction:t,border:!1,children:x.jsx("a",{className:Aw,href:e,children:x.jsx("div",{className:"flex items-center justify-center px-2 gap-y-2",children:n})})})}function QD({children:e,direction:t,border:n=!0}){return x.jsx("div",{className:on("flex justify-center w-full h-full px-2 py-2 font-sans rounded-full gap-3 text-primary border-fill bg-gradient-to-br from-background/90 from-40% to-background backdrop-blur-lg drop-shadow-2xl",{"flex-col items-start":t==="vertical","flex-row items-center":t==="horizontal"},{border:n}),children:e})}function Oy({active:e,onClick:t,children:n}){return x.jsx("button",{className:on(Aw,{"bg-accent text-accent-foreground drop-shadow-[0px_0px_12px_hsl(var(--accent))]":e}),onClick:t,children:n})}var Iw={exports:{}},Zf={},cv={exports:{}},eA={};function tA(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=tA(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function k_(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=tA(e))&&(r&&(r+=" "),r+=t);return r}const Eae=Object.freeze(Object.defineProperty({__proto__:null,clsx:k_,default:k_},Symbol.toStringTag,{value:"Module"})),Cae=OA(Eae);var kt={},qo={};Object.defineProperty(qo,"__esModule",{value:!0});qo.dontSetMe=Rae;qo.findInArray=_ae;qo.int=Mae;qo.isFunction=Oae;qo.isNum=Tae;function _ae(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function Oae(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function Tae(e){return typeof e=="number"&&!isNaN(e)}function Mae(e){return parseInt(e,10)}function Rae(e,t,n){if(e[t])return new Error("Invalid prop ".concat(t," passed to ").concat(n," - do not set this, set it on the child."))}var al={};Object.defineProperty(al,"__esModule",{value:!0});al.browserPrefixToKey=rA;al.browserPrefixToStyle=Pae;al.default=void 0;al.getPrefix=nA;const Ty=["Moz","Webkit","O","ms"];function nA(){var e;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const n=(e=window.document)===null||e===void 0||(e=e.documentElement)===null||e===void 0?void 0:e.style;if(!n||t in n)return"";for(let r=0;r<Ty.length;r++)if(rA(t,Ty[r])in n)return Ty[r];return""}function rA(e,t){return t?"".concat(t).concat(Nae(e)):e}function Pae(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function Nae(e){let t="",n=!0;for(let r=0;r<e.length;r++)n?(t+=e[r].toUpperCase(),n=!1):e[r]==="-"?n=!0:t+=e[r];return t}al.default=nA();Object.defineProperty(kt,"__esModule",{value:!0});kt.addClassName=sA;kt.addEvent=Aae;kt.addUserSelectStyles=Kae;kt.createCSSTransform=Vae;kt.createSVGTransform=Uae;kt.getTouch=Hae;kt.getTouchIdentifier=Wae;kt.getTranslation=Lw;kt.innerHeight=zae;kt.innerWidth=Fae;kt.matchesSelector=iA;kt.matchesSelectorAndParentsTo=Dae;kt.offsetXYFromParent=Bae;kt.outerHeight=Lae;kt.outerWidth=jae;kt.removeClassName=aA;kt.removeEvent=Iae;kt.removeUserSelectStyles=qae;var lr=qo,E_=$ae(al);function oA(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(oA=function(r){return r?n:t})(e)}function $ae(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=oA(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}let Fp="";function iA(e,t){return Fp||(Fp=(0,lr.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,lr.isFunction)(e[n])})),(0,lr.isFunction)(e[Fp])?e[Fp](t):!1}function Dae(e,t,n){let r=e;do{if(iA(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function Aae(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.addEventListener?e.addEventListener(t,n,o):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n}function Iae(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.removeEventListener?e.removeEventListener(t,n,o):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null}function Lae(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,lr.int)(n.borderTopWidth),t+=(0,lr.int)(n.borderBottomWidth),t}function jae(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,lr.int)(n.borderLeftWidth),t+=(0,lr.int)(n.borderRightWidth),t}function zae(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,lr.int)(n.paddingTop),t-=(0,lr.int)(n.paddingBottom),t}function Fae(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,lr.int)(n.paddingLeft),t-=(0,lr.int)(n.paddingRight),t}function Bae(e,t,n){const o=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),i=(e.clientX+t.scrollLeft-o.left)/n,s=(e.clientY+t.scrollTop-o.top)/n;return{x:i,y:s}}function Vae(e,t){const n=Lw(e,t,"px");return{[(0,E_.browserPrefixToKey)("transform",E_.default)]:n}}function Uae(e,t){return Lw(e,t,"")}function Lw(e,t,n){let{x:r,y:o}=e,i="translate(".concat(r).concat(n,",").concat(o).concat(n,")");if(t){const s="".concat(typeof t.x=="string"?t.x:t.x+n),a="".concat(typeof t.y=="string"?t.y:t.y+n);i="translate(".concat(s,", ").concat(a,")")+i}return i}function Hae(e,t){return e.targetTouches&&(0,lr.findInArray)(e.targetTouches,n=>t===n.identifier)||e.changedTouches&&(0,lr.findInArray)(e.changedTouches,n=>t===n.identifier)}function Wae(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function Kae(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
425
- `,t.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
426
- `,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&sA(e.body,"react-draggable-transparent-selection")}function qae(e){if(e)try{if(e.body&&aA(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&t.type!=="Caret"&&t.removeAllRanges()}}catch{}}function sA(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function aA(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var Go={};Object.defineProperty(Go,"__esModule",{value:!0});Go.canDragX=Xae;Go.canDragY=Zae;Go.createCoreData=Qae;Go.createDraggableData=ele;Go.getBoundPosition=Gae;Go.getControlPosition=Jae;Go.snapToGrid=Yae;var Qn=qo,Wl=kt;function Gae(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:tle(r);const o=jw(e);if(typeof r=="string"){const{ownerDocument:i}=o,s=i.defaultView;let a;if(r==="parent"?a=o.parentNode:a=i.querySelector(r),!(a instanceof s.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const l=a,c=s.getComputedStyle(o),u=s.getComputedStyle(l);r={left:-o.offsetLeft+(0,Qn.int)(u.paddingLeft)+(0,Qn.int)(c.marginLeft),top:-o.offsetTop+(0,Qn.int)(u.paddingTop)+(0,Qn.int)(c.marginTop),right:(0,Wl.innerWidth)(l)-(0,Wl.outerWidth)(o)-o.offsetLeft+(0,Qn.int)(u.paddingRight)-(0,Qn.int)(c.marginRight),bottom:(0,Wl.innerHeight)(l)-(0,Wl.outerHeight)(o)-o.offsetTop+(0,Qn.int)(u.paddingBottom)-(0,Qn.int)(c.marginBottom)}}return(0,Qn.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,Qn.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,Qn.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,Qn.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function Yae(e,t,n){const r=Math.round(t/e[0])*e[0],o=Math.round(n/e[1])*e[1];return[r,o]}function Xae(e){return e.props.axis==="both"||e.props.axis==="x"}function Zae(e){return e.props.axis==="both"||e.props.axis==="y"}function Jae(e,t,n){const r=typeof t=="number"?(0,Wl.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const o=jw(n),i=n.props.offsetParent||o.offsetParent||o.ownerDocument.body;return(0,Wl.offsetXYFromParent)(r||e,i,n.props.scale)}function Qae(e,t,n){const r=!(0,Qn.isNum)(e.lastX),o=jw(e);return r?{node:o,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:o,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function ele(e,t){const n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function tle(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function jw(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var uv={},dv={};Object.defineProperty(dv,"__esModule",{value:!0});dv.default=nle;function nle(){}Object.defineProperty(uv,"__esModule",{value:!0});uv.default=void 0;var My=ole(p),Dn=zw(jg),rle=zw(At),dn=kt,Gi=Go,Ry=qo,yu=zw(dv);function zw(e){return e&&e.__esModule?e:{default:e}}function lA(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(lA=function(r){return r?n:t})(e)}function ole(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=lA(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function wn(e,t,n){return t=ile(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ile(e){var t=sle(e,"string");return typeof t=="symbol"?t:String(t)}function sle(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const Gr={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let Yi=Gr.mouse,fv=class extends My.Component{constructor(){super(...arguments),wn(this,"dragging",!1),wn(this,"lastX",NaN),wn(this,"lastY",NaN),wn(this,"touchIdentifier",null),wn(this,"mounted",!1),wn(this,"handleDragStart",t=>{if(this.props.onMouseDown(t),!this.props.allowAnyClick&&typeof t.button=="number"&&t.button!==0)return!1;const n=this.findDOMNode();if(!n||!n.ownerDocument||!n.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:r}=n;if(this.props.disabled||!(t.target instanceof r.defaultView.Node)||this.props.handle&&!(0,dn.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,dn.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const o=(0,dn.getTouchIdentifier)(t);this.touchIdentifier=o;const i=(0,Gi.getControlPosition)(t,o,this);if(i==null)return;const{x:s,y:a}=i,l=(0,Gi.createCoreData)(this,s,a);(0,yu.default)("DraggableCore: handleDragStart: %j",l),(0,yu.default)("calling",this.props.onStart),!(this.props.onStart(t,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,dn.addUserSelectStyles)(r),this.dragging=!0,this.lastX=s,this.lastY=a,(0,dn.addEvent)(r,Yi.move,this.handleDrag),(0,dn.addEvent)(r,Yi.stop,this.handleDragStop))}),wn(this,"handleDrag",t=>{const n=(0,Gi.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let a=r-this.lastX,l=o-this.lastY;if([a,l]=(0,Gi.snapToGrid)(this.props.grid,a,l),!a&&!l)return;r=this.lastX+a,o=this.lastY+l}const i=(0,Gi.createCoreData)(this,r,o);if((0,yu.default)("DraggableCore: handleDrag: %j",i),this.props.onDrag(t,i)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const l=document.createEvent("MouseEvents");l.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(l)}return}this.lastX=r,this.lastY=o}),wn(this,"handleDragStop",t=>{if(!this.dragging)return;const n=(0,Gi.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let l=r-this.lastX||0,c=o-this.lastY||0;[l,c]=(0,Gi.snapToGrid)(this.props.grid,l,c),r=this.lastX+l,o=this.lastY+c}const i=(0,Gi.createCoreData)(this,r,o);if(this.props.onStop(t,i)===!1||this.mounted===!1)return!1;const a=this.findDOMNode();a&&this.props.enableUserSelectHack&&(0,dn.removeUserSelectStyles)(a.ownerDocument),(0,yu.default)("DraggableCore: handleDragStop: %j",i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&((0,yu.default)("DraggableCore: Removing handlers"),(0,dn.removeEvent)(a.ownerDocument,Yi.move,this.handleDrag),(0,dn.removeEvent)(a.ownerDocument,Yi.stop,this.handleDragStop))}),wn(this,"onMouseDown",t=>(Yi=Gr.mouse,this.handleDragStart(t))),wn(this,"onMouseUp",t=>(Yi=Gr.mouse,this.handleDragStop(t))),wn(this,"onTouchStart",t=>(Yi=Gr.touch,this.handleDragStart(t))),wn(this,"onTouchEnd",t=>(Yi=Gr.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,dn.addEvent)(t,Gr.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,dn.removeEvent)(n,Gr.mouse.move,this.handleDrag),(0,dn.removeEvent)(n,Gr.touch.move,this.handleDrag),(0,dn.removeEvent)(n,Gr.mouse.stop,this.handleDragStop),(0,dn.removeEvent)(n,Gr.touch.stop,this.handleDragStop),(0,dn.removeEvent)(t,Gr.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,dn.removeUserSelectStyles)(n)}}findDOMNode(){var t,n;return(t=this.props)!==null&&t!==void 0&&t.nodeRef?(n=this.props)===null||n===void 0||(n=n.nodeRef)===null||n===void 0?void 0:n.current:rle.default.findDOMNode(this)}render(){return My.cloneElement(My.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};uv.default=fv;wn(fv,"displayName","DraggableCore");wn(fv,"propTypes",{allowAnyClick:Dn.default.bool,children:Dn.default.node.isRequired,disabled:Dn.default.bool,enableUserSelectHack:Dn.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:Dn.default.arrayOf(Dn.default.number),handle:Dn.default.string,cancel:Dn.default.string,nodeRef:Dn.default.object,onStart:Dn.default.func,onDrag:Dn.default.func,onStop:Dn.default.func,onMouseDown:Dn.default.func,scale:Dn.default.number,className:Ry.dontSetMe,style:Ry.dontSetMe,transform:Ry.dontSetMe});wn(fv,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1});(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return l.default}}),e.default=void 0;var t=f(p),n=u(jg),r=u(At),o=u(Cae),i=kt,s=Go,a=qo,l=u(uv),c=u(dv);function u(v){return v&&v.__esModule?v:{default:v}}function d(v){if(typeof WeakMap!="function")return null;var w=new WeakMap,S=new WeakMap;return(d=function(k){return k?S:w})(v)}function f(v,w){if(!w&&v&&v.__esModule)return v;if(v===null||typeof v!="object"&&typeof v!="function")return{default:v};var S=d(w);if(S&&S.has(v))return S.get(v);var k={},C=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var E in v)if(E!=="default"&&Object.prototype.hasOwnProperty.call(v,E)){var T=C?Object.getOwnPropertyDescriptor(v,E):null;T&&(T.get||T.set)?Object.defineProperty(k,E,T):k[E]=v[E]}return k.default=v,S&&S.set(v,k),k}function h(){return h=Object.assign?Object.assign.bind():function(v){for(var w=1;w<arguments.length;w++){var S=arguments[w];for(var k in S)Object.prototype.hasOwnProperty.call(S,k)&&(v[k]=S[k])}return v},h.apply(this,arguments)}function m(v,w,S){return w=g(w),w in v?Object.defineProperty(v,w,{value:S,enumerable:!0,configurable:!0,writable:!0}):v[w]=S,v}function g(v){var w=b(v,"string");return typeof w=="symbol"?w:String(w)}function b(v,w){if(typeof v!="object"||v===null)return v;var S=v[Symbol.toPrimitive];if(S!==void 0){var k=S.call(v,w||"default");if(typeof k!="object")return k;throw new TypeError("@@toPrimitive must return a primitive value.")}return(w==="string"?String:Number)(v)}class y extends t.Component{static getDerivedStateFromProps(w,S){let{position:k}=w,{prevPropsPosition:C}=S;return k&&(!C||k.x!==C.x||k.y!==C.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:k,prevPropsPosition:C}),{x:k.x,y:k.y,prevPropsPosition:{...k}}):null}constructor(w){super(w),m(this,"onDragStart",(S,k)=>{if((0,c.default)("Draggable: onDragStart: %j",k),this.props.onStart(S,(0,s.createDraggableData)(this,k))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),m(this,"onDrag",(S,k)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",k);const C=(0,s.createDraggableData)(this,k),E={x:C.x,y:C.y,slackX:0,slackY:0};if(this.props.bounds){const{x:R,y:$}=E;E.x+=this.state.slackX,E.y+=this.state.slackY;const[j,z]=(0,s.getBoundPosition)(this,E.x,E.y);E.x=j,E.y=z,E.slackX=this.state.slackX+(R-E.x),E.slackY=this.state.slackY+($-E.y),C.x=E.x,C.y=E.y,C.deltaX=E.x-this.state.x,C.deltaY=E.y-this.state.y}if(this.props.onDrag(S,C)===!1)return!1;this.setState(E)}),m(this,"onDragStop",(S,k)=>{if(!this.state.dragging||this.props.onStop(S,(0,s.createDraggableData)(this,k))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",k);const E={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:R,y:$}=this.props.position;E.x=R,E.y=$}this.setState(E)}),this.state={dragging:!1,dragged:!1,x:w.position?w.position.x:w.defaultPosition.x,y:w.position?w.position.y:w.defaultPosition.y,prevPropsPosition:{...w.position},slackX:0,slackY:0,isElementSVG:!1},w.position&&!(w.onDrag||w.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var w,S;return(w=(S=this.props)===null||S===void 0||(S=S.nodeRef)===null||S===void 0?void 0:S.current)!==null&&w!==void 0?w:r.default.findDOMNode(this)}render(){const{axis:w,bounds:S,children:k,defaultPosition:C,defaultClassName:E,defaultClassNameDragging:T,defaultClassNameDragged:R,position:$,positionOffset:j,scale:z,...ee}=this.props;let V={},U=null;const M=!!!$||this.state.dragging,_=$||C,P={x:(0,s.canDragX)(this)&&M?this.state.x:_.x,y:(0,s.canDragY)(this)&&M?this.state.y:_.y};this.state.isElementSVG?U=(0,i.createSVGTransform)(P,j):V=(0,i.createCSSTransform)(P,j);const N=(0,o.default)(k.props.className||"",E,{[T]:this.state.dragging,[R]:this.state.dragged});return t.createElement(l.default,h({},ee,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(k),{className:N,style:{...k.props.style,...V},transform:U}))}}e.default=y,m(y,"displayName","Draggable"),m(y,"propTypes",{...l.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:a.dontSetMe,style:a.dontSetMe,transform:a.dontSetMe}),m(y,"defaultProps",{...l.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(eA);const{default:cA,DraggableCore:ale}=eA;cv.exports=cA;cv.exports.default=cA;cv.exports.DraggableCore=ale;var lle=cv.exports,Fw={};Fw.__esModule=!0;Fw.cloneElement=hle;var cle=ule(p);function ule(e){return e&&e.__esModule?e:{default:e}}function C_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function __(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?C_(Object(n),!0).forEach(function(r){dle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dle(e,t,n){return t=fle(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fle(e){var t=ple(e,"string");return typeof t=="symbol"?t:String(t)}function ple(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function hle(e,t){return t.style&&e.props.style&&(t.style=__(__({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),cle.default.cloneElement(e,t)}var Jf={};Jf.__esModule=!0;Jf.resizableProps=void 0;var Ce=mle(jg);function mle(e){return e&&e.__esModule?e:{default:e}}var gle={axis:Ce.default.oneOf(["both","x","y","none"]),className:Ce.default.string,children:Ce.default.element.isRequired,draggableOpts:Ce.default.shape({allowAnyClick:Ce.default.bool,cancel:Ce.default.string,children:Ce.default.node,disabled:Ce.default.bool,enableUserSelectHack:Ce.default.bool,offsetParent:Ce.default.node,grid:Ce.default.arrayOf(Ce.default.number),handle:Ce.default.string,nodeRef:Ce.default.object,onStart:Ce.default.func,onDrag:Ce.default.func,onStop:Ce.default.func,onMouseDown:Ce.default.func,scale:Ce.default.number}),height:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0];if(o.axis==="both"||o.axis==="y"){var i;return(i=Ce.default.number).isRequired.apply(i,n)}return Ce.default.number.apply(Ce.default,n)},handle:Ce.default.oneOfType([Ce.default.node,Ce.default.func]),handleSize:Ce.default.arrayOf(Ce.default.number),lockAspectRatio:Ce.default.bool,maxConstraints:Ce.default.arrayOf(Ce.default.number),minConstraints:Ce.default.arrayOf(Ce.default.number),onResizeStop:Ce.default.func,onResizeStart:Ce.default.func,onResize:Ce.default.func,resizeHandles:Ce.default.arrayOf(Ce.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:Ce.default.number,width:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0];if(o.axis==="both"||o.axis==="x"){var i;return(i=Ce.default.number).isRequired.apply(i,n)}return Ce.default.number.apply(Ce.default,n)}};Jf.resizableProps=gle;Zf.__esModule=!0;Zf.default=void 0;var xu=wle(p),vle=lle,yle=Fw,xle=Jf,ble=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function uA(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(uA=function(o){return o?n:t})(e)}function wle(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=uA(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Vx(){return Vx=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},Vx.apply(this,arguments)}function Sle(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function O_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Py(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?O_(Object(n),!0).forEach(function(r){kle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kle(e,t,n){return t=Ele(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ele(e){var t=Cle(e,"string");return typeof t=="symbol"?t:String(t)}function Cle(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _le(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Ux(e,t)}function Ux(e,t){return Ux=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},Ux(e,t)}var Bw=function(e){_le(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r=e.call.apply(e,[this].concat(i))||this,r.handleRefs={},r.lastHandleRect=null,r.slack=null,r}var n=t.prototype;return n.componentWillUnmount=function(){this.resetData()},n.resetData=function(){this.lastHandleRect=this.slack=null},n.runConstraints=function(o,i){var s=this.props,a=s.minConstraints,l=s.maxConstraints,c=s.lockAspectRatio;if(!a&&!l&&!c)return[o,i];if(c){var u=this.props.width/this.props.height,d=o-this.props.width,f=i-this.props.height;Math.abs(d)>Math.abs(f*u)?i=o/u:o=i*u}var h=o,m=i,g=this.slack||[0,0],b=g[0],y=g[1];return o+=b,i+=y,a&&(o=Math.max(a[0],o),i=Math.max(a[1],i)),l&&(o=Math.min(l[0],o),i=Math.min(l[1],i)),this.slack=[b+(h-o),y+(m-i)],[o,i]},n.resizeHandler=function(o,i){var s=this;return function(a,l){var c=l.node,u=l.deltaX,d=l.deltaY;o==="onResizeStart"&&s.resetData();var f=(s.props.axis==="both"||s.props.axis==="x")&&i!=="n"&&i!=="s",h=(s.props.axis==="both"||s.props.axis==="y")&&i!=="e"&&i!=="w";if(!(!f&&!h)){var m=i[0],g=i[i.length-1],b=c.getBoundingClientRect();if(s.lastHandleRect!=null){if(g==="w"){var y=b.left-s.lastHandleRect.left;u+=y}if(m==="n"){var v=b.top-s.lastHandleRect.top;d+=v}}s.lastHandleRect=b,g==="w"&&(u=-u),m==="n"&&(d=-d);var w=s.props.width+(f?u/s.props.transformScale:0),S=s.props.height+(h?d/s.props.transformScale:0),k=s.runConstraints(w,S);w=k[0],S=k[1];var C=w!==s.props.width||S!==s.props.height,E=typeof s.props[o]=="function"?s.props[o]:null,T=o==="onResize"&&!C;E&&!T&&(a.persist==null||a.persist(),E(a,{node:c,size:{width:w,height:S},handle:i})),o==="onResizeStop"&&s.resetData()}}},n.renderResizeHandle=function(o,i){var s=this.props.handle;if(!s)return xu.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+o,ref:i});if(typeof s=="function")return s(o,i);var a=typeof s.type=="string",l=Py({ref:i},a?{}:{handleAxis:o});return xu.cloneElement(s,l)},n.render=function(){var o=this,i=this.props,s=i.children,a=i.className,l=i.draggableOpts;i.width,i.height,i.handle,i.handleSize,i.lockAspectRatio,i.axis,i.minConstraints,i.maxConstraints,i.onResize,i.onResizeStop,i.onResizeStart;var c=i.resizeHandles;i.transformScale;var u=Sle(i,ble);return(0,yle.cloneElement)(s,Py(Py({},u),{},{className:(a?a+" ":"")+"react-resizable",children:[].concat(s.props.children,c.map(function(d){var f,h=(f=o.handleRefs[d])!=null?f:o.handleRefs[d]=xu.createRef();return xu.createElement(vle.DraggableCore,Vx({},l,{nodeRef:h,key:"resizableHandle-"+d,onStop:o.resizeHandler("onResizeStop",d),onStart:o.resizeHandler("onResizeStart",d),onDrag:o.resizeHandler("onResize",d)}),o.renderResizeHandle(d,h))}))}))},t}(xu.Component);Zf.default=Bw;Bw.propTypes=xle.resizableProps;Bw.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var pv={};pv.__esModule=!0;pv.default=void 0;var Ny=Ple(p),Ole=dA(jg),Tle=dA(Zf),Mle=Jf,Rle=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function dA(e){return e&&e.__esModule?e:{default:e}}function fA(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(fA=function(o){return o?n:t})(e)}function Ple(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=fA(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Hx(){return Hx=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},Hx.apply(this,arguments)}function T_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Km(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?T_(Object(n),!0).forEach(function(r){Nle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Nle(e,t,n){return t=$le(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $le(e){var t=Dle(e,"string");return typeof t=="symbol"?t:String(t)}function Dle(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ale(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function Ile(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Wx(e,t)}function Wx(e,t){return Wx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},Wx(e,t)}var pA=function(e){Ile(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r=e.call.apply(e,[this].concat(i))||this,r.state={width:r.props.width,height:r.props.height,propsWidth:r.props.width,propsHeight:r.props.height},r.onResize=function(a,l){var c=l.size;r.props.onResize?(a.persist==null||a.persist(),r.setState(c,function(){return r.props.onResize&&r.props.onResize(a,l)})):r.setState(c)},r}t.getDerivedStateFromProps=function(o,i){return i.propsWidth!==o.width||i.propsHeight!==o.height?{width:o.width,height:o.height,propsWidth:o.width,propsHeight:o.height}:null};var n=t.prototype;return n.render=function(){var o=this.props,i=o.handle,s=o.handleSize;o.onResize;var a=o.onResizeStart,l=o.onResizeStop,c=o.draggableOpts,u=o.minConstraints,d=o.maxConstraints,f=o.lockAspectRatio,h=o.axis;o.width,o.height;var m=o.resizeHandles,g=o.style,b=o.transformScale,y=Ale(o,Rle);return Ny.createElement(Tle.default,{axis:h,draggableOpts:c,handle:i,handleSize:s,height:this.state.height,lockAspectRatio:f,maxConstraints:d,minConstraints:u,onResizeStart:a,onResize:this.onResize,onResizeStop:l,resizeHandles:m,transformScale:b,width:this.state.width},Ny.createElement("div",Hx({},y,{style:Km(Km({},g),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(Ny.Component);pv.default=pA;pA.propTypes=Km(Km({},Mle.resizableProps),{},{children:Ole.default.element});Iw.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};var Lle=Iw.exports.Resizable=Zf.default;Iw.exports.ResizableBox=pv.default;const Nl=400,$y=250;function jle({position:e,onClose:t,children:n}){const[r,o]=p.useState({height:window.innerHeight,width:window.innerWidth});p.useEffect(()=>{const g=()=>{window.visualViewport?o({height:window.visualViewport.height,width:window.visualViewport.width}):o({height:window.innerHeight,width:window.innerWidth})};return window.addEventListener("resize",g),window.addEventListener("orientationchange",g),()=>{window.removeEventListener("resize",g),window.removeEventListener("orientationchange",g)}},[]);const[i,s,a,l,c]=zle({position:e,globalSize:r});p.useEffect(()=>{c({left:r.width-Nl-74,top:16})},[r]),p.useEffect(()=>{const g=b=>{b.key==="Escape"&&t()};return document.addEventListener("keyup",g),()=>{document.removeEventListener("keyup",g)}},[]);const{windowSize:u,setWindowSize:d}=L2(),f=r.width<=600||r.height<=600;p.useEffect(()=>{var g,b;d({height:window.innerHeight-30,width:Nl,innerHeight:window.innerHeight-30-(64+(((b=(g=h.current)==null?void 0:g.getBoundingClientRect())==null?void 0:b.height)||0))})},[]);const h=p.useRef(null);p.useEffect(()=>{if(f){c({top:0,left:0}),d({height:window.innerHeight,width:window.innerWidth,innerHeight:window.innerHeight-64});const g=document.ownerDocument||document,b=g.body.style.overflow;return g.body.style.overflow="hidden",()=>{g.body.style.overflow=b}}},[f,r]);const m=p.useRef();return x.jsx(Lle,{minConstraints:f?void 0:[Nl,$y],width:(u==null?void 0:u.width)||Nl,height:(u==null?void 0:u.height)||$y,onResize:(g,{size:b})=>{var y,v;return!f&&d({...b,innerHeight:b.height-(64+(((v=(y=h.current)==null?void 0:y.getBoundingClientRect())==null?void 0:v.height)||0))})},handle:f?null:x.jsx("div",{className:"fixed bottom-0 right-0 cursor-se-resize",children:x.jsx("svg",{height:"18",viewBox:"0 0 18 18",width:"18",xmlns:"http://www.w3.org/2000/svg",children:x.jsx("path",{d:"m14.228 16.227a1 1 0 0 1 -.707-1.707l1-1a1 1 0 0 1 1.416 1.414l-1 1a1 1 0 0 1 -.707.293zm-5.638 0a1 1 0 0 1 -.707-1.707l6.638-6.638a1 1 0 0 1 1.416 1.414l-6.638 6.638a1 1 0 0 1 -.707.293zm-5.84 0a1 1 0 0 1 -.707-1.707l12.477-12.477a1 1 0 1 1 1.415 1.414l-12.478 12.477a1 1 0 0 1 -.707.293z",fill:"currentColor"})})}),className:on("absolute inset-0 tablet:w-auto tablet:h-auto tablet:min-h-fit max-h-svh bg-gradient-to-br from-background/90 from-40% to-background backdrop-blur-lg text-primary drop-shadow-2xl min-w-[320px]",{"opacity-0":!s,"opacity-100":s,"rounded-lg":!f}),children:x.jsxs("div",{style:{width:(u==null?void 0:u.width)||Nl,height:(u==null?void 0:u.height)||$y,left:i.left,top:i.top,right:i.right,bottom:i.bottom},children:[x.jsxs("div",{ref:a,className:"relative flex items-center justify-center px-2 py-2 text-primary",onTouchStart:g=>{var y;const b=(y=g.changedTouches)==null?void 0:y[0];b&&(m.current={time:Date.now(),y:b.clientY})},onTouchEnd:g=>{var y;const b=(y=g.changedTouches)==null?void 0:y[0];b&&m.current&&b.clientY-m.current.y>20&&b.clientY-m.current.y<100&&Date.now()-m.current.time<150&&(g.preventDefault(),t())},children:[f?x.jsx("div",{className:"py-6",children:x.jsx("div",{className:"absolute left-1/2 -translate-x-1/2 h-[8px] w-[80px] top-4 bg-primary rounded-lg"})}):x.jsx(O4,{size:16,className:"block w-full cursor-grab",onMouseDown:g=>{f||(g.preventDefault(),g.stopPropagation(),l())}}),x.jsx("button",{className:"absolute top-0 right-0 px-4 py-2 focus:outline-none focus-visible:outline-accent",onClick:t,children:x.jsx(Af,{size:f?32:16})})]}),x.jsxs("div",{children:[Array.isArray(n)&&n.slice(0,1),x.jsx(Jl,{className:"relative",style:{height:u==null?void 0:u.innerHeight},children:Array.isArray(n)?n.slice(1,-1):n}),x.jsx("div",{ref:h,className:"w-full px-4 pb-0",children:Array.isArray(n)&&n.slice(-1)})]})]})})}function zle({position:e,globalSize:t}){var c,u;const[n,r]=p.useState({left:t.width-Nl-74,top:16});p.useEffect(()=>{e&&r(e)},[e]);const[o,i]=p.useState(!1),s=p.useRef(null);p.useEffect(()=>{const d=()=>{i(!1)},f=h=>{var m,g,b,y;if(o){h.preventDefault(),h.stopPropagation();const v=-((((g=(m=s==null?void 0:s.current)==null?void 0:m.getBoundingClientRect())==null?void 0:g.width)||0)/2)+h.clientX,w=-((((y=(b=s==null?void 0:s.current)==null?void 0:b.getBoundingClientRect())==null?void 0:y.height)||0)/2)+ +h.clientY;r({left:v<0?0:v,top:w<0?0:w})}};return document.addEventListener("mouseup",d),document.addEventListener("mousemove",f),()=>{document.removeEventListener("mouseup",d),document.removeEventListener("mousemove",f)}},[o]);const a=()=>i(!0),l=!!((u=(c=s==null?void 0:s.current)==null?void 0:c.getBoundingClientRect())!=null&&u.width);return[n,l,s,a,r]}function Fle({defaultTheme:e,api:t,store:n,onSubmit:r}){const[o,i]=j2(e),s=q2(t),[a,l]=Ule(),[c,u]=Vle(a),[d,f]=p.useState(null),h=d!=null&&d.path?d.path.split(","):[];p.useEffect(()=>{n.reset()},[n]);const[m,g]=p.useState(Object.fromEntries(h.map(E=>[E,{status:"not-asked"}])));p.useEffect(()=>{g(Object.fromEntries(h.map(T=>[T,{status:"loading"}])));async function E(){const T=await Promise.all(h.map(async R=>{const[$,j]=tt.splitModuleFilePathAndModulePath(R),z=await n.getModule($,!1);if(Ke.isErr(z))return[$,{status:"error",error:z.error.message}];{const{source:ee,schema:V}=z.value;if(!ee||!V)return[$,{status:"error",error:"Val could load this content. Please try again."}];{const U=tt.resolvePath(j,ee,V);return!U.source||!U.schema?[$,{status:"error",error:"Val could not internally resolve this content. This is possibly due to a misconfiguration or a bug in Val."}]:[R,{status:"success",data:{source:U.source,schema:U.schema}}]}}}));g(Object.fromEntries(T))}E()},[h.join(";")]);const[b,y]=p.useState(),[v,w]=p.useState([]),[S,k]=p.useState(0);p.useEffect(()=>{t.getPatches().then(E=>{if(Ke.isErr(E)){console.error(E.error);return}w(Object.values(E.value).flatMap(T=>T.map(R=>R.patch_id)))})},[S]);const C=p.useCallback(E=>async T=>{const[R,$]=tt.splitModuleFilePathAndModulePath(E),j=await T(tt.createPatchPath($)),z=await n.applyPatch(R,v,j);if(Ke.isOk(z)){const ee=[];for(const V of Object.values(z.value))ee.push(...V.patchIds);w(ee)}k(ee=>ee+1),r(!0)},[]);return x.jsx(A$,{store:n,children:x.jsx(Yb.Provider,{value:{theme:o,session:s,editMode:a,setEditMode:l,setTheme:i,windowSize:b,setWindowSize:y},children:x.jsxs("div",{id:"val-overlay-container","data-mode":o,className:"font-serif antialiased",style:{position:"fixed",top:0,left:0,zIndex:8999},children:[x.jsxs(bae,{children:[x.jsx(JD,{}),x.jsx("div",{className:"fixed -translate-y-1/2 right-4 top-1/2 z-overlay",children:x.jsx(kae,{direction:"vertical",api:t,patches:v,onClickPatches:()=>{t.postSave({patchIds:v}).then(async E=>{if(Ke.isOk(E)){const T=await t.deletePatches(v);Ke.isOk(T)?(w([]),await n.reset()):alert("Could not clean up")}else alert("Could not publish")})}})})]}),s.status==="success"&&s.data.enabled&&(a==="hover"||a==="window")&&c.path&&x.jsx(Ble,{hoverTarget:c,setHoverTarget:u,setEditMode:l,setWindowTarget:f}),a==="window"&&d&&x.jsx(jle,{onClose:()=>{f(null),l("hover")},children:x.jsx("div",{className:"p-4",style:{maxHeight:b==null?void 0:b.innerHeight,maxWidth:b==null?void 0:b.width},children:Object.entries(m).map(([E,T])=>{if(T.status!=="success")return x.jsxs("div",{children:[x.jsxs("span",{children:[E,T.status!=="error"&&x.jsxs("span",{children:[": ",T.status]})]}),T.status==="error"&&x.jsx("pre",{className:"text-red-600 whitespace-pre-wrap",children:T.error})]},E);const{source:R,schema:$}=T.data;return!R||!$?x.jsxs("div",{children:["Module: ",E," is missing source or schema"]}):x.jsx(Gc,{initOnSubmit:C,path:E,schema:$,source:R,top:!0},E)})})})]})})})}function Ble({hoverTarget:e,setEditMode:t,setWindowTarget:n,setHoverTarget:r}){var i;const o=(i=e.element)==null?void 0:i.getBoundingClientRect();return p.useEffect(()=>{if(e.path){const s=a=>{a.target&&a.target instanceof HTMLElement&&a.target.id!=="val-shadow-root"&&n({...e,path:e.path,mouse:{x:a.pageX,y:a.pageY}}),t("window"),r(null),a.stopPropagation()};return document.body.addEventListener("click",s),()=>{document.body.removeEventListener("click",s)}}},[e]),x.jsx("div",{id:"val-hover",className:"fixed border-2 cursor-pointer z-overlay-hover border-accent",style:{pointerEvents:"none",top:o==null?void 0:o.top,left:o==null?void 0:o.left,width:o==null?void 0:o.width,height:o==null?void 0:o.height},children:x.jsx("div",{className:"flex items-center justify-end w-full text-xs",children:x.jsx("div",{className:"flex items-center justify-center px-3 py-1 border-b-2 border-l-2 text-accent-foreground bg-accent border-accent",style:{maxHeight:(o==null?void 0:o.height)&&o.height-4,fontSize:o!=null&&o.height&&o.height<=16?o.height-4:void 0},children:"Edit"})})})}function Vle(e){const[t,n]=p.useState(),[r,o]=p.useState(),[i,s]=p.useState();function a(l){if(l){const c=[];l.dataset.valPath&&c.push(l.dataset.valPath);for(const u of Array.from(l.querySelectorAll("*")))if(u instanceof HTMLElement){const d=u.dataset.valPath;d&&c.push(d)}c.length>0&&(n(l),o(c.join(",")),s(l.getBoundingClientRect()))}}return p.useEffect(()=>{if(e==="hover"||e==="window"){const l=c=>{a(c.target)};return document.addEventListener("mouseover",l),()=>{n(void 0),o(void 0),document.removeEventListener("mouseover",l)}}},[e]),p.useEffect(()=>{const l=()=>{t&&s(t.getBoundingClientRect())},c=new ResizeObserver(()=>{t&&s(t.getBoundingClientRect())}),u=document.getElementById("val-shadow-root");return t&&u&&c.observe(u),document.addEventListener("scroll",l,{passive:!0}),()=>{document.removeEventListener("scroll",l),c.disconnect()}},[t]),[{path:r,element:t,rect:i},l=>{var c;n(l==null?void 0:l.element),o(l==null?void 0:l.path),s((c=l==null?void 0:l.element)==null?void 0:c.getBoundingClientRect())}]}const Bp="val-edit-mode";function Ule(){const[e,t]=p.useState("off");p.useEffect(()=>{try{const r=localStorage.getItem(Bp);r==="off"||r==="hover"||r==="window"||r==="full"?t(r==="window"?"hover":r):(localStorage.removeItem(Bp),t("off"))}catch{t("off")}},[]);const n=p.useCallback(r=>{typeof r=="function"?t(o=>{const i=r(o);return localStorage.setItem(Bp,i),i}):(localStorage.setItem(Bp,r),t(r))},[]);return[e,n]}function Hle(){const e="/api/val",t=new Kb(e),n=new Qb(t);return x.jsxs(Xse,{children:[x.jsx("link",{rel:"preconnect",href:"https://fonts.googleapis.com"}),x.jsx("link",{rel:"preconnect",href:"https://fonts.gstatic.com",crossOrigin:"anonymous"}),x.jsx("link",{href:"https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap",rel:"stylesheet"}),x.jsx("link",{href:"https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;1,100;1,300;1,400;1,500;1,700&family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap",rel:"stylesheet"}),x.jsx("style",{children:`
427
- #val-overlay-container {
428
- visibility: hidden;
429
- }
430
- `}),x.jsx("link",{rel:"stylesheet",href:`${e}/static${Zse}`}),x.jsx(_w,{fallbackRender:Nw,children:x.jsx(hw,{overlay:!0,children:x.jsx(Fle,{api:t,store:n,onSubmit:()=>{const r=new CustomEvent("val-event",{detail:{type:"overlay-submit",refreshRequired:!0}});window.dispatchEvent(r)}})})})]})}const M_=document.getElementById(Jse),R_=document.getElementById(Qse),P_=document.getElementById("val-app-static");M_?Yu.createRoot(M_).render(H.createElement(H.StrictMode,null,H.createElement(qse,null))):P_?Yu.createRoot(P_).render(H.createElement(H.StrictMode,null,H.createElement(Gse,null))):R_?Yu.createRoot(R_).render(H.createElement(H.StrictMode,null,H.createElement(Hle,null))):console.error("Val: could not mount Val element. Check your configuration.");