From 015e630503a1d00a59473589abcc6843985de9c1 Mon Sep 17 00:00:00 2001 From: Cesar Augusto Date: Mon, 19 Aug 2024 15:28:36 +0200 Subject: [PATCH] Updates --- .../{index-B0lybPZt.js => index-7ABYw9tI.js} | 132 +++++++++--------- index.html | 2 +- 2 files changed, 67 insertions(+), 67 deletions(-) rename assets/{index-B0lybPZt.js => index-7ABYw9tI.js} (72%) diff --git a/assets/index-B0lybPZt.js b/assets/index-7ABYw9tI.js similarity index 72% rename from assets/index-B0lybPZt.js rename to assets/index-7ABYw9tI.js index 79eb74d..99a8f47 100644 --- a/assets/index-B0lybPZt.js +++ b/assets/index-7ABYw9tI.js @@ -6,7 +6,7 @@ var pF=Object.defineProperty;var mF=(t,e,n)=>e in t?pF(t,e,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var ch=Symbol.for("react.element"),yF=Symbol.for("react.portal"),bF=Symbol.for("react.fragment"),vF=Symbol.for("react.strict_mode"),wF=Symbol.for("react.profiler"),kF=Symbol.for("react.provider"),xF=Symbol.for("react.context"),EF=Symbol.for("react.forward_ref"),SF=Symbol.for("react.suspense"),CF=Symbol.for("react.memo"),_F=Symbol.for("react.lazy"),XE=Symbol.iterator;function AF(t){return t===null||typeof t!="object"?null:(t=XE&&t[XE]||t["@@iterator"],typeof t=="function"?t:null)}var c5={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},f5=Object.assign,d5={};function Mc(t,e,n){this.props=t,this.context=e,this.refs=d5,this.updater=n||c5}Mc.prototype.isReactComponent={};Mc.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};Mc.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function h5(){}h5.prototype=Mc.prototype;function Tk(t,e,n){this.props=t,this.context=e,this.refs=d5,this.updater=n||c5}var Mk=Tk.prototype=new h5;Mk.constructor=Tk;f5(Mk,Mc.prototype);Mk.isPureReactComponent=!0;var eS=Array.isArray,p5=Object.prototype.hasOwnProperty,Ok={current:null},m5={key:!0,ref:!0,__self:!0,__source:!0};function g5(t,e,n){var r,i={},o=null,s=null;if(e!=null)for(r in e.ref!==void 0&&(s=e.ref),e.key!==void 0&&(o=""+e.key),e)p5.call(e,r)&&!m5.hasOwnProperty(r)&&(i[r]=e[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1e in t?pF(t,e,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var PF=ee,qr=BF;function ne(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),L2=Object.prototype.hasOwnProperty,zF=/^[: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]*$/,nS={},rS={};function jF(t){return L2.call(rS,t)?!0:L2.call(nS,t)?!1:zF.test(t)?rS[t]=!0:(nS[t]=!0,!1)}function qF(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function VF(t,e,n,r){if(e===null||typeof e>"u"||qF(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function cr(t,e,n,r,i,o,s){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=o,this.removeEmptyString=s}var Dn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Dn[t]=new cr(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Dn[e]=new cr(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Dn[t]=new cr(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Dn[t]=new cr(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){Dn[t]=new cr(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Dn[t]=new cr(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Dn[t]=new cr(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Dn[t]=new cr(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Dn[t]=new cr(t,5,!1,t.toLowerCase(),null,!1,!1)});var Nk=/[\-:]([a-z])/g;function $k(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(Nk,$k);Dn[e]=new cr(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(Nk,$k);Dn[e]=new cr(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(Nk,$k);Dn[e]=new cr(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Dn[t]=new cr(t,1,!1,t.toLowerCase(),null,!1,!1)});Dn.xlinkHref=new cr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Dn[t]=new cr(t,1,!1,t.toLowerCase(),null,!0,!0)});function Ik(t,e,n,r){var i=Dn.hasOwnProperty(e)?Dn[e]:null;(i!==null?i.type!==0:r||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),L2=Object.prototype.hasOwnProperty,zF=/^[: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]*$/,nS={},rS={};function jF(t){return L2.call(rS,t)?!0:L2.call(nS,t)?!1:zF.test(t)?rS[t]=!0:(nS[t]=!0,!1)}function qF(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function UF(t,e,n,r){if(e===null||typeof e>"u"||qF(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function cr(t,e,n,r,i,o,s){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=o,this.removeEmptyString=s}var Dn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Dn[t]=new cr(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Dn[e]=new cr(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Dn[t]=new cr(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Dn[t]=new cr(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){Dn[t]=new cr(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Dn[t]=new cr(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Dn[t]=new cr(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Dn[t]=new cr(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Dn[t]=new cr(t,5,!1,t.toLowerCase(),null,!1,!1)});var Nk=/[\-:]([a-z])/g;function $k(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(Nk,$k);Dn[e]=new cr(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(Nk,$k);Dn[e]=new cr(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(Nk,$k);Dn[e]=new cr(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Dn[t]=new cr(t,1,!1,t.toLowerCase(),null,!1,!1)});Dn.xlinkHref=new cr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Dn[t]=new cr(t,1,!1,t.toLowerCase(),null,!0,!0)});function Ik(t,e,n,r){var i=Dn.hasOwnProperty(e)?Dn[e]:null;(i!==null?i.type!==0:r||!(2a||i[s]!==o[a]){var l=` -`+i[s].replace(" at new "," at ");return t.displayName&&l.includes("")&&(l=l.replace("",t.displayName)),l}while(1<=s&&0<=a);break}}}finally{py=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?yf(t):""}function UF(t){switch(t.tag){case 5:return yf(t.type);case 16:return yf("Lazy");case 13:return yf("Suspense");case 19:return yf("SuspenseList");case 0:case 2:case 15:return t=my(t.type,!1),t;case 11:return t=my(t.type.render,!1),t;case 1:return t=my(t.type,!0),t;default:return""}}function j2(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case mu:return"Fragment";case pu:return"Portal";case B2:return"Profiler";case Rk:return"StrictMode";case P2:return"Suspense";case z2:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case S5:return(t.displayName||"Context")+".Consumer";case E5:return(t._context.displayName||"Context")+".Provider";case Fk:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Lk:return e=t.displayName||null,e!==null?e:j2(t.type)||"Memo";case As:e=t._payload,t=t._init;try{return j2(t(e))}catch{}}return null}function HF(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return j2(e);case 8:return e===Rk?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function ca(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function _5(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function WF(t){var e=_5(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Hh(t){t._valueTracker||(t._valueTracker=WF(t))}function A5(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=_5(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function A0(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function q2(t,e){var n=e.checked;return Dt({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function oS(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=ca(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function T5(t,e){e=e.checked,e!=null&&Ik(t,"checked",e,!1)}function V2(t,e){T5(t,e);var n=ca(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?U2(t,e.type,n):e.hasOwnProperty("defaultValue")&&U2(t,e.type,ca(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function sS(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function U2(t,e,n){(e!=="number"||A0(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var bf=Array.isArray;function Du(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=Wh.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function gd(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var qf={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},JF=["Webkit","ms","Moz","O"];Object.keys(qf).forEach(function(t){JF.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),qf[e]=qf[t]})});function N5(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||qf.hasOwnProperty(t)&&qf[t]?(""+e).trim():e+"px"}function $5(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=N5(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var KF=Dt({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 J2(t,e){if(e){if(KF[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(ne(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(ne(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(ne(61))}if(e.style!=null&&typeof e.style!="object")throw Error(ne(62))}}function K2(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var G2=null;function Bk(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Z2=null,Nu=null,$u=null;function uS(t){if(t=hh(t)){if(typeof Z2!="function")throw Error(ne(280));var e=t.stateNode;e&&(e=L1(e),Z2(t.stateNode,t.type,e))}}function I5(t){Nu?$u?$u.push(t):$u=[t]:Nu=t}function R5(){if(Nu){var t=Nu,e=$u;if($u=Nu=null,uS(t),e)for(t=0;t>>=0,t===0?32:31-(oL(t)/sL|0)|0}var Jh=64,Kh=4194304;function vf(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function D0(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,o=t.pingedLanes,s=n&268435455;if(s!==0){var a=s&~i;a!==0?r=vf(a):(o&=s,o!==0&&(r=vf(o)))}else s=n&~i,s!==0?r=vf(s):o!==0&&(r=vf(o));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,o=e&-e,i>=o||i===16&&(o&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0n;n++)e.push(t);return e}function fh(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Mi(e),t[e]=n}function cL(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0=Uf),bS=" ",vS=!1;function t8(t,e){switch(t){case"keyup":return BL.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function n8(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var gu=!1;function zL(t,e){switch(t){case"compositionend":return n8(e);case"keypress":return e.which!==32?null:(vS=!0,bS);case"textInput":return t=e.data,t===bS&&vS?null:t;default:return null}}function jL(t,e){if(gu)return t==="compositionend"||!Wk&&t8(t,e)?(t=X5(),Gp=Vk=qs=null,gu=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=ES(n)}}function s8(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?s8(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function a8(){for(var t=window,e=A0();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=A0(t.document)}return e}function Jk(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function ZL(t){var e=a8(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&s8(n.ownerDocument.documentElement,n)){if(r!==null&&Jk(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!t.extend&&o>r&&(i=r,r=o,o=i),i=SS(n,o);var s=SS(n,r);i&&s&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==s.node||t.focusOffset!==s.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),o>r?(t.addRange(e),t.extend(s.node,s.offset)):(e.setEnd(s.node,s.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,yu=null,nv=null,Wf=null,rv=!1;function CS(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;rv||yu==null||yu!==A0(r)||(r=yu,"selectionStart"in r&&Jk(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}),Wf&&xd(Wf,r)||(Wf=r,r=I0(nv,"onSelect"),0wu||(t.current=uv[wu],uv[wu]=null,wu--)}function vt(t,e){wu++,uv[wu]=t.current,t.current=e}var fa={},Un=va(fa),yr=va(!1),xl=fa;function Gu(t,e){var n=t.type.contextTypes;if(!n)return fa;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=e[o];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function br(t){return t=t.childContextTypes,t!=null}function F0(){Et(yr),Et(Un)}function NS(t,e,n){if(Un.current!==fa)throw Error(ne(168));vt(Un,e),vt(yr,n)}function g8(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(ne(108,HF(t)||"Unknown",i));return Dt({},n,r)}function L0(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||fa,xl=Un.current,vt(Un,t),vt(yr,yr.current),!0}function $S(t,e,n){var r=t.stateNode;if(!r)throw Error(ne(169));n?(t=g8(t,e,xl),r.__reactInternalMemoizedMergedChildContext=t,Et(yr),Et(Un),vt(Un,t)):Et(yr),vt(yr,n)}var Fo=null,B1=!1,My=!1;function y8(t){Fo===null?Fo=[t]:Fo.push(t)}function lB(t){B1=!0,y8(t)}function wa(){if(!My&&Fo!==null){My=!0;var t=0,e=st;try{var n=Fo;for(st=1;t>=s,i-=s,zo=1<<32-Mi(e)+i|n<D?(O=E,E=null):O=E.sibling;var N=d(y,E,w[D],g);if(N===null){E===null&&(E=O);break}t&&E&&N.alternate===null&&e(y,E),v=o(N,v,D),k===null?x=N:k.sibling=N,k=N,E=O}if(D===w.length)return n(y,E),Ct&&Fa(y,D),x;if(E===null){for(;DD?(O=E,E=null):O=E.sibling;var C=d(y,E,N.value,g);if(C===null){E===null&&(E=O);break}t&&E&&C.alternate===null&&e(y,E),v=o(C,v,D),k===null?x=C:k.sibling=C,k=C,E=O}if(N.done)return n(y,E),Ct&&Fa(y,D),x;if(E===null){for(;!N.done;D++,N=w.next())N=f(y,N.value,g),N!==null&&(v=o(N,v,D),k===null?x=N:k.sibling=N,k=N);return Ct&&Fa(y,D),x}for(E=r(y,E);!N.done;D++,N=w.next())N=h(E,y,D,N.value,g),N!==null&&(t&&N.alternate!==null&&E.delete(N.key===null?D:N.key),v=o(N,v,D),k===null?x=N:k.sibling=N,k=N);return t&&E.forEach(function(R){return e(y,R)}),Ct&&Fa(y,D),x}function b(y,v,w,g){if(typeof w=="object"&&w!==null&&w.type===mu&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Uh:e:{for(var x=w.key,k=v;k!==null;){if(k.key===x){if(x=w.type,x===mu){if(k.tag===7){n(y,k.sibling),v=i(k,w.props.children),v.return=y,y=v;break e}}else if(k.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===As&&FS(x)===k.type){n(y,k.sibling),v=i(k,w.props),v.ref=rf(y,k,w),v.return=y,y=v;break e}n(y,k);break}else e(y,k);k=k.sibling}w.type===mu?(v=ll(w.props.children,y.mode,g,w.key),v.return=y,y=v):(g=r0(w.type,w.key,w.props,null,y.mode,g),g.ref=rf(y,v,w),g.return=y,y=g)}return s(y);case pu:e:{for(k=w.key;v!==null;){if(v.key===k)if(v.tag===4&&v.stateNode.containerInfo===w.containerInfo&&v.stateNode.implementation===w.implementation){n(y,v.sibling),v=i(v,w.children||[]),v.return=y,y=v;break e}else{n(y,v);break}else e(y,v);v=v.sibling}v=Ly(w,y.mode,g),v.return=y,y=v}return s(y);case As:return k=w._init,b(y,v,k(w._payload),g)}if(bf(w))return p(y,v,w,g);if(Qc(w))return m(y,v,w,g);tp(y,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,v!==null&&v.tag===6?(n(y,v.sibling),v=i(v,w),v.return=y,y=v):(n(y,v),v=Fy(w,y.mode,g),v.return=y,y=v),s(y)):n(y,v)}return b}var Yu=k8(!0),x8=k8(!1),z0=va(null),j0=null,Eu=null,Yk=null;function Qk(){Yk=Eu=j0=null}function Xk(t){var e=z0.current;Et(z0),t._currentValue=e}function dv(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function Ru(t,e){j0=t,Yk=Eu=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(gr=!0),t.firstContext=null)}function di(t){var e=t._currentValue;if(Yk!==t)if(t={context:t,memoizedValue:e,next:null},Eu===null){if(j0===null)throw Error(ne(308));Eu=t,j0.dependencies={lanes:0,firstContext:t}}else Eu=Eu.next=t;return e}var Ja=null;function ex(t){Ja===null?Ja=[t]:Ja.push(t)}function E8(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,ex(e)):(n.next=i.next,i.next=n),e.interleaved=n,Go(t,r)}function Go(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var Ts=!1;function tx(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function S8(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Uo(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function ea(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,Ke&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,Go(t,n)}return i=r.interleaved,i===null?(e.next=e,ex(r)):(e.next=i.next,i.next=e),r.interleaved=e,Go(t,n)}function Yp(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,zk(t,n)}}function LS(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=s:o=o.next=s,n=n.next}while(n!==null);o===null?i=o=e:o=o.next=e}else i=o=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function q0(t,e,n,r){var i=t.updateQueue;Ts=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,u=l.next;l.next=null,s===null?o=u:s.next=u,s=l;var c=t.alternate;c!==null&&(c=c.updateQueue,a=c.lastBaseUpdate,a!==s&&(a===null?c.firstBaseUpdate=u:a.next=u,c.lastBaseUpdate=l))}if(o!==null){var f=i.baseState;s=0,c=u=l=null,a=o;do{var d=a.lane,h=a.eventTime;if((r&d)===d){c!==null&&(c=c.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var p=t,m=a;switch(d=e,h=n,m.tag){case 1:if(p=m.payload,typeof p=="function"){f=p.call(h,f,d);break e}f=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=m.payload,d=typeof p=="function"?p.call(h,f,d):p,d==null)break e;f=Dt({},f,d);break e;case 2:Ts=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,d=i.effects,d===null?i.effects=[a]:d.push(a))}else h={eventTime:h,lane:d,tag:a.tag,payload:a.payload,callback:a.callback,next:null},c===null?(u=c=h,l=f):c=c.next=h,s|=d;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;d=a,a=d.next,d.next=null,i.lastBaseUpdate=d,i.shared.pending=null}}while(!0);if(c===null&&(l=f),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,e=i.shared.interleaved,e!==null){i=e;do s|=i.lane,i=i.next;while(i!==e)}else o===null&&(i.shared.lanes=0);Cl|=s,t.lanes=s,t.memoizedState=f}}function BS(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;en?n:4,t(!0);var r=Dy.transition;Dy.transition={};try{t(!1),e()}finally{st=n,Dy.transition=r}}function j8(){return hi().memoizedState}function dB(t,e,n){var r=na(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},q8(t))V8(e,n);else if(n=E8(t,e,n,r),n!==null){var i=or();Oi(n,t,r,i),U8(n,e,r)}}function hB(t,e,n){var r=na(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(q8(t))V8(e,i);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var s=e.lastRenderedState,a=o(s,n);if(i.hasEagerState=!0,i.eagerState=a,Di(a,s)){var l=e.interleaved;l===null?(i.next=i,ex(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}n=E8(t,e,i,r),n!==null&&(i=or(),Oi(n,t,r,i),U8(n,e,r))}}function q8(t){var e=t.alternate;return t===Ot||e!==null&&e===Ot}function V8(t,e){Jf=U0=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function U8(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,zk(t,n)}}var H0={readContext:di,useCallback:Rn,useContext:Rn,useEffect:Rn,useImperativeHandle:Rn,useInsertionEffect:Rn,useLayoutEffect:Rn,useMemo:Rn,useReducer:Rn,useRef:Rn,useState:Rn,useDebugValue:Rn,useDeferredValue:Rn,useTransition:Rn,useMutableSource:Rn,useSyncExternalStore:Rn,useId:Rn,unstable_isNewReconciler:!1},pB={readContext:di,useCallback:function(t,e){return Wi().memoizedState=[t,e===void 0?null:e],t},useContext:di,useEffect:zS,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,Xp(4194308,4,F8.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Xp(4194308,4,t,e)},useInsertionEffect:function(t,e){return Xp(4,2,t,e)},useMemo:function(t,e){var n=Wi();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=Wi();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=dB.bind(null,Ot,t),[r.memoizedState,t]},useRef:function(t){var e=Wi();return t={current:t},e.memoizedState=t},useState:PS,useDebugValue:ux,useDeferredValue:function(t){return Wi().memoizedState=t},useTransition:function(){var t=PS(!1),e=t[0];return t=fB.bind(null,t[1]),Wi().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=Ot,i=Wi();if(Ct){if(n===void 0)throw Error(ne(407));n=n()}else{if(n=e(),pn===null)throw Error(ne(349));Sl&30||T8(r,e,n)}i.memoizedState=n;var o={value:n,getSnapshot:e};return i.queue=o,zS(O8.bind(null,r,o,t),[t]),r.flags|=2048,Od(9,M8.bind(null,r,o,n,e),void 0,null),n},useId:function(){var t=Wi(),e=pn.identifierPrefix;if(Ct){var n=jo,r=zo;n=(r&~(1<<32-Mi(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=Td++,0")&&(l=l.replace("",t.displayName)),l}while(1<=s&&0<=a);break}}}finally{py=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?yf(t):""}function VF(t){switch(t.tag){case 5:return yf(t.type);case 16:return yf("Lazy");case 13:return yf("Suspense");case 19:return yf("SuspenseList");case 0:case 2:case 15:return t=my(t.type,!1),t;case 11:return t=my(t.type.render,!1),t;case 1:return t=my(t.type,!0),t;default:return""}}function j2(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case mu:return"Fragment";case pu:return"Portal";case B2:return"Profiler";case Rk:return"StrictMode";case P2:return"Suspense";case z2:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case S5:return(t.displayName||"Context")+".Consumer";case E5:return(t._context.displayName||"Context")+".Provider";case Fk:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Lk:return e=t.displayName||null,e!==null?e:j2(t.type)||"Memo";case As:e=t._payload,t=t._init;try{return j2(t(e))}catch{}}return null}function HF(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return j2(e);case 8:return e===Rk?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function ca(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function _5(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function WF(t){var e=_5(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Wh(t){t._valueTracker||(t._valueTracker=WF(t))}function A5(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=_5(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function T0(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function q2(t,e){var n=e.checked;return Dt({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function oS(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=ca(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function T5(t,e){e=e.checked,e!=null&&Ik(t,"checked",e,!1)}function U2(t,e){T5(t,e);var n=ca(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?V2(t,e.type,n):e.hasOwnProperty("defaultValue")&&V2(t,e.type,ca(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function sS(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function V2(t,e,n){(e!=="number"||T0(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var bf=Array.isArray;function Du(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=Jh.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function gd(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var qf={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},JF=["Webkit","ms","Moz","O"];Object.keys(qf).forEach(function(t){JF.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),qf[e]=qf[t]})});function N5(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||qf.hasOwnProperty(t)&&qf[t]?(""+e).trim():e+"px"}function $5(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=N5(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var KF=Dt({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 J2(t,e){if(e){if(KF[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(ne(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(ne(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(ne(61))}if(e.style!=null&&typeof e.style!="object")throw Error(ne(62))}}function K2(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var G2=null;function Bk(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Z2=null,Nu=null,$u=null;function uS(t){if(t=ph(t)){if(typeof Z2!="function")throw Error(ne(280));var e=t.stateNode;e&&(e=L1(e),Z2(t.stateNode,t.type,e))}}function I5(t){Nu?$u?$u.push(t):$u=[t]:Nu=t}function R5(){if(Nu){var t=Nu,e=$u;if($u=Nu=null,uS(t),e)for(t=0;t>>=0,t===0?32:31-(oL(t)/sL|0)|0}var Kh=64,Gh=4194304;function vf(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function N0(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,o=t.pingedLanes,s=n&268435455;if(s!==0){var a=s&~i;a!==0?r=vf(a):(o&=s,o!==0&&(r=vf(o)))}else s=n&~i,s!==0?r=vf(s):o!==0&&(r=vf(o));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,o=e&-e,i>=o||i===16&&(o&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0n;n++)e.push(t);return e}function dh(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Mi(e),t[e]=n}function cL(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0=Vf),bS=" ",vS=!1;function t8(t,e){switch(t){case"keyup":return BL.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function n8(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var gu=!1;function zL(t,e){switch(t){case"compositionend":return n8(e);case"keypress":return e.which!==32?null:(vS=!0,bS);case"textInput":return t=e.data,t===bS&&vS?null:t;default:return null}}function jL(t,e){if(gu)return t==="compositionend"||!Wk&&t8(t,e)?(t=X5(),Zp=Uk=qs=null,gu=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=ES(n)}}function s8(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?s8(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function a8(){for(var t=window,e=T0();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=T0(t.document)}return e}function Jk(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function ZL(t){var e=a8(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&s8(n.ownerDocument.documentElement,n)){if(r!==null&&Jk(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!t.extend&&o>r&&(i=r,r=o,o=i),i=SS(n,o);var s=SS(n,r);i&&s&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==s.node||t.focusOffset!==s.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),o>r?(t.addRange(e),t.extend(s.node,s.offset)):(e.setEnd(s.node,s.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,yu=null,nv=null,Wf=null,rv=!1;function CS(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;rv||yu==null||yu!==T0(r)||(r=yu,"selectionStart"in r&&Jk(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}),Wf&&xd(Wf,r)||(Wf=r,r=R0(nv,"onSelect"),0wu||(t.current=uv[wu],uv[wu]=null,wu--)}function vt(t,e){wu++,uv[wu]=t.current,t.current=e}var fa={},Hn=va(fa),yr=va(!1),xl=fa;function Gu(t,e){var n=t.type.contextTypes;if(!n)return fa;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=e[o];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function br(t){return t=t.childContextTypes,t!=null}function L0(){Et(yr),Et(Hn)}function NS(t,e,n){if(Hn.current!==fa)throw Error(ne(168));vt(Hn,e),vt(yr,n)}function g8(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(ne(108,HF(t)||"Unknown",i));return Dt({},n,r)}function B0(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||fa,xl=Hn.current,vt(Hn,t),vt(yr,yr.current),!0}function $S(t,e,n){var r=t.stateNode;if(!r)throw Error(ne(169));n?(t=g8(t,e,xl),r.__reactInternalMemoizedMergedChildContext=t,Et(yr),Et(Hn),vt(Hn,t)):Et(yr),vt(yr,n)}var Fo=null,B1=!1,My=!1;function y8(t){Fo===null?Fo=[t]:Fo.push(t)}function lB(t){B1=!0,y8(t)}function wa(){if(!My&&Fo!==null){My=!0;var t=0,e=st;try{var n=Fo;for(st=1;t>=s,i-=s,zo=1<<32-Mi(e)+i|n<D?(O=E,E=null):O=E.sibling;var N=d(y,E,w[D],g);if(N===null){E===null&&(E=O);break}t&&E&&N.alternate===null&&e(y,E),v=o(N,v,D),k===null?x=N:k.sibling=N,k=N,E=O}if(D===w.length)return n(y,E),Ct&&Fa(y,D),x;if(E===null){for(;DD?(O=E,E=null):O=E.sibling;var C=d(y,E,N.value,g);if(C===null){E===null&&(E=O);break}t&&E&&C.alternate===null&&e(y,E),v=o(C,v,D),k===null?x=C:k.sibling=C,k=C,E=O}if(N.done)return n(y,E),Ct&&Fa(y,D),x;if(E===null){for(;!N.done;D++,N=w.next())N=f(y,N.value,g),N!==null&&(v=o(N,v,D),k===null?x=N:k.sibling=N,k=N);return Ct&&Fa(y,D),x}for(E=r(y,E);!N.done;D++,N=w.next())N=h(E,y,D,N.value,g),N!==null&&(t&&N.alternate!==null&&E.delete(N.key===null?D:N.key),v=o(N,v,D),k===null?x=N:k.sibling=N,k=N);return t&&E.forEach(function(R){return e(y,R)}),Ct&&Fa(y,D),x}function b(y,v,w,g){if(typeof w=="object"&&w!==null&&w.type===mu&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Hh:e:{for(var x=w.key,k=v;k!==null;){if(k.key===x){if(x=w.type,x===mu){if(k.tag===7){n(y,k.sibling),v=i(k,w.props.children),v.return=y,y=v;break e}}else if(k.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===As&&FS(x)===k.type){n(y,k.sibling),v=i(k,w.props),v.ref=rf(y,k,w),v.return=y,y=v;break e}n(y,k);break}else e(y,k);k=k.sibling}w.type===mu?(v=ll(w.props.children,y.mode,g,w.key),v.return=y,y=v):(g=i0(w.type,w.key,w.props,null,y.mode,g),g.ref=rf(y,v,w),g.return=y,y=g)}return s(y);case pu:e:{for(k=w.key;v!==null;){if(v.key===k)if(v.tag===4&&v.stateNode.containerInfo===w.containerInfo&&v.stateNode.implementation===w.implementation){n(y,v.sibling),v=i(v,w.children||[]),v.return=y,y=v;break e}else{n(y,v);break}else e(y,v);v=v.sibling}v=Ly(w,y.mode,g),v.return=y,y=v}return s(y);case As:return k=w._init,b(y,v,k(w._payload),g)}if(bf(w))return p(y,v,w,g);if(Qc(w))return m(y,v,w,g);np(y,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,v!==null&&v.tag===6?(n(y,v.sibling),v=i(v,w),v.return=y,y=v):(n(y,v),v=Fy(w,y.mode,g),v.return=y,y=v),s(y)):n(y,v)}return b}var Yu=k8(!0),x8=k8(!1),j0=va(null),q0=null,Eu=null,Yk=null;function Qk(){Yk=Eu=q0=null}function Xk(t){var e=j0.current;Et(j0),t._currentValue=e}function dv(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function Ru(t,e){q0=t,Yk=Eu=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(gr=!0),t.firstContext=null)}function di(t){var e=t._currentValue;if(Yk!==t)if(t={context:t,memoizedValue:e,next:null},Eu===null){if(q0===null)throw Error(ne(308));Eu=t,q0.dependencies={lanes:0,firstContext:t}}else Eu=Eu.next=t;return e}var Ja=null;function ex(t){Ja===null?Ja=[t]:Ja.push(t)}function E8(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,ex(e)):(n.next=i.next,i.next=n),e.interleaved=n,Go(t,r)}function Go(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var Ts=!1;function tx(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function S8(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Vo(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function ea(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,Ke&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,Go(t,n)}return i=r.interleaved,i===null?(e.next=e,ex(r)):(e.next=i.next,i.next=e),r.interleaved=e,Go(t,n)}function Qp(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,zk(t,n)}}function LS(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=s:o=o.next=s,n=n.next}while(n!==null);o===null?i=o=e:o=o.next=e}else i=o=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function U0(t,e,n,r){var i=t.updateQueue;Ts=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,u=l.next;l.next=null,s===null?o=u:s.next=u,s=l;var c=t.alternate;c!==null&&(c=c.updateQueue,a=c.lastBaseUpdate,a!==s&&(a===null?c.firstBaseUpdate=u:a.next=u,c.lastBaseUpdate=l))}if(o!==null){var f=i.baseState;s=0,c=u=l=null,a=o;do{var d=a.lane,h=a.eventTime;if((r&d)===d){c!==null&&(c=c.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var p=t,m=a;switch(d=e,h=n,m.tag){case 1:if(p=m.payload,typeof p=="function"){f=p.call(h,f,d);break e}f=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=m.payload,d=typeof p=="function"?p.call(h,f,d):p,d==null)break e;f=Dt({},f,d);break e;case 2:Ts=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,d=i.effects,d===null?i.effects=[a]:d.push(a))}else h={eventTime:h,lane:d,tag:a.tag,payload:a.payload,callback:a.callback,next:null},c===null?(u=c=h,l=f):c=c.next=h,s|=d;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;d=a,a=d.next,d.next=null,i.lastBaseUpdate=d,i.shared.pending=null}}while(!0);if(c===null&&(l=f),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,e=i.shared.interleaved,e!==null){i=e;do s|=i.lane,i=i.next;while(i!==e)}else o===null&&(i.shared.lanes=0);Cl|=s,t.lanes=s,t.memoizedState=f}}function BS(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;en?n:4,t(!0);var r=Dy.transition;Dy.transition={};try{t(!1),e()}finally{st=n,Dy.transition=r}}function j8(){return hi().memoizedState}function dB(t,e,n){var r=na(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},q8(t))U8(e,n);else if(n=E8(t,e,n,r),n!==null){var i=or();Oi(n,t,r,i),V8(n,e,r)}}function hB(t,e,n){var r=na(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(q8(t))U8(e,i);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var s=e.lastRenderedState,a=o(s,n);if(i.hasEagerState=!0,i.eagerState=a,Di(a,s)){var l=e.interleaved;l===null?(i.next=i,ex(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}n=E8(t,e,i,r),n!==null&&(i=or(),Oi(n,t,r,i),V8(n,e,r))}}function q8(t){var e=t.alternate;return t===Ot||e!==null&&e===Ot}function U8(t,e){Jf=H0=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function V8(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,zk(t,n)}}var W0={readContext:di,useCallback:Rn,useContext:Rn,useEffect:Rn,useImperativeHandle:Rn,useInsertionEffect:Rn,useLayoutEffect:Rn,useMemo:Rn,useReducer:Rn,useRef:Rn,useState:Rn,useDebugValue:Rn,useDeferredValue:Rn,useTransition:Rn,useMutableSource:Rn,useSyncExternalStore:Rn,useId:Rn,unstable_isNewReconciler:!1},pB={readContext:di,useCallback:function(t,e){return Wi().memoizedState=[t,e===void 0?null:e],t},useContext:di,useEffect:zS,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,e0(4194308,4,F8.bind(null,e,t),n)},useLayoutEffect:function(t,e){return e0(4194308,4,t,e)},useInsertionEffect:function(t,e){return e0(4,2,t,e)},useMemo:function(t,e){var n=Wi();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=Wi();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=dB.bind(null,Ot,t),[r.memoizedState,t]},useRef:function(t){var e=Wi();return t={current:t},e.memoizedState=t},useState:PS,useDebugValue:ux,useDeferredValue:function(t){return Wi().memoizedState=t},useTransition:function(){var t=PS(!1),e=t[0];return t=fB.bind(null,t[1]),Wi().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=Ot,i=Wi();if(Ct){if(n===void 0)throw Error(ne(407));n=n()}else{if(n=e(),pn===null)throw Error(ne(349));Sl&30||T8(r,e,n)}i.memoizedState=n;var o={value:n,getSnapshot:e};return i.queue=o,zS(O8.bind(null,r,o,t),[t]),r.flags|=2048,Od(9,M8.bind(null,r,o,n,e),void 0,null),n},useId:function(){var t=Wi(),e=pn.identifierPrefix;if(Ct){var n=jo,r=zo;n=(r&~(1<<32-Mi(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=Td++,0<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=s.createElement(n,{is:r.is}):(t=s.createElement(n),n==="select"&&(s=t,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):t=s.createElementNS(t,n),t[Qi]=e,t[Cd]=r,eT(t,e,!1,!1),e.stateNode=t;e:{switch(s=K2(n,r),n){case"dialog":xt("cancel",t),xt("close",t),i=r;break;case"iframe":case"object":case"embed":xt("load",t),i=r;break;case"video":case"audio":for(i=0;iec&&(e.flags|=128,r=!0,of(o,!1),e.lanes=4194304)}else{if(!r)if(t=V0(s),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),of(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!Ct)return Fn(e),null}else 2*jt()-o.renderingStartTime>ec&&n!==1073741824&&(e.flags|=128,r=!0,of(o,!1),e.lanes=4194304);o.isBackwards?(s.sibling=e.child,e.child=s):(n=o.last,n!==null?n.sibling=s:e.child=s,o.last=s)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=jt(),e.sibling=null,n=Tt.current,vt(Tt,r?n&1|2:n&1),e):(Fn(e),null);case 22:case 23:return mx(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?Ir&1073741824&&(Fn(e),e.subtreeFlags&6&&(e.flags|=8192)):Fn(e),null;case 24:return null;case 25:return null}throw Error(ne(156,e.tag))}function xB(t,e){switch(Gk(e),e.tag){case 1:return br(e.type)&&F0(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Qu(),Et(yr),Et(Un),ix(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return rx(e),null;case 13:if(Et(Tt),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(ne(340));Zu()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Et(Tt),null;case 4:return Qu(),null;case 10:return Xk(e.type._context),null;case 22:case 23:return mx(),null;case 24:return null;default:return null}}var rp=!1,zn=!1,EB=typeof WeakSet=="function"?WeakSet:Set,de=null;function Su(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){It(t,e,r)}else n.current=null}function kv(t,e,n){try{n()}catch(r){It(t,e,r)}}var YS=!1;function SB(t,e){if(iv=N0,t=a8(),Jk(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,u=0,c=0,f=t,d=null;t:for(;;){for(var h;f!==n||i!==0&&f.nodeType!==3||(a=s+i),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(h=f.firstChild)!==null;)d=f,f=h;for(;;){if(f===t)break t;if(d===n&&++u===i&&(a=s),d===o&&++c===r&&(l=s),(h=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(ov={focusedElem:t,selectionRange:n},N0=!1,de=e;de!==null;)if(e=de,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,de=t;else for(;de!==null;){e=de;try{var p=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var m=p.memoizedProps,b=p.memoizedState,y=e.stateNode,v=y.getSnapshotBeforeUpdate(e.elementType===e.type?m:ki(e.type,m),b);y.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var w=e.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(ne(163))}}catch(g){It(e,e.return,g)}if(t=e.sibling,t!==null){t.return=e.return,de=t;break}de=e.return}return p=YS,YS=!1,p}function Kf(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var o=i.destroy;i.destroy=void 0,o!==void 0&&kv(e,n,o)}i=i.next}while(i!==r)}}function j1(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function xv(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function rT(t){var e=t.alternate;e!==null&&(t.alternate=null,rT(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Qi],delete e[Cd],delete e[lv],delete e[sB],delete e[aB])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function iT(t){return t.tag===5||t.tag===3||t.tag===4}function QS(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||iT(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Ev(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=R0));else if(r!==4&&(t=t.child,t!==null))for(Ev(t,e,n),t=t.sibling;t!==null;)Ev(t,e,n),t=t.sibling}function Sv(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(Sv(t,e,n),t=t.sibling;t!==null;)Sv(t,e,n),t=t.sibling}var xn=null,xi=!1;function ds(t,e,n){for(n=n.child;n!==null;)oT(t,e,n),n=n.sibling}function oT(t,e,n){if(po&&typeof po.onCommitFiberUnmount=="function")try{po.onCommitFiberUnmount($1,n)}catch{}switch(n.tag){case 5:zn||Su(n,e);case 6:var r=xn,i=xi;xn=null,ds(t,e,n),xn=r,xi=i,xn!==null&&(xi?(t=xn,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):xn.removeChild(n.stateNode));break;case 18:xn!==null&&(xi?(t=xn,n=n.stateNode,t.nodeType===8?Ty(t.parentNode,n):t.nodeType===1&&Ty(t,n),wd(t)):Ty(xn,n.stateNode));break;case 4:r=xn,i=xi,xn=n.stateNode.containerInfo,xi=!0,ds(t,e,n),xn=r,xi=i;break;case 0:case 11:case 14:case 15:if(!zn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&kv(n,e,s),i=i.next}while(i!==r)}ds(t,e,n);break;case 1:if(!zn&&(Su(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){It(n,e,a)}ds(t,e,n);break;case 21:ds(t,e,n);break;case 22:n.mode&1?(zn=(r=zn)||n.memoizedState!==null,ds(t,e,n),zn=r):ds(t,e,n);break;default:ds(t,e,n)}}function XS(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new EB),e.forEach(function(r){var i=$B.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function bi(t,e){var n=e.deletions;if(n!==null)for(var r=0;ri&&(i=s),r&=~o}if(r=i,r=jt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*_B(r/1960))-r,10t?16:t,Vs===null)var r=!1;else{if(t=Vs,Vs=null,K0=0,Ke&6)throw Error(ne(331));var i=Ke;for(Ke|=4,de=t.current;de!==null;){var o=de,s=o.child;if(de.flags&16){var a=o.deletions;if(a!==null){for(var l=0;ljt()-hx?al(t,0):dx|=n),vr(t,e)}function hT(t,e){e===0&&(t.mode&1?(e=Kh,Kh<<=1,!(Kh&130023424)&&(Kh=4194304)):e=1);var n=or();t=Go(t,e),t!==null&&(fh(t,e,n),vr(t,n))}function NB(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),hT(t,n)}function $B(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(ne(314))}r!==null&&r.delete(e),hT(t,n)}var pT;pT=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||yr.current)gr=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return gr=!1,wB(t,e,n);gr=!!(t.flags&131072)}else gr=!1,Ct&&e.flags&1048576&&b8(e,P0,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;e0(t,e),t=e.pendingProps;var i=Gu(e,Un.current);Ru(e,n),i=sx(null,e,r,t,i,n);var o=ax();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,br(r)?(o=!0,L0(e)):o=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,tx(e),i.updater=z1,e.stateNode=i,i._reactInternals=e,pv(e,r,t,n),e=yv(null,e,r,!0,o,n)):(e.tag=0,Ct&&o&&Kk(e),Yn(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(e0(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=RB(r),t=ki(r,t),i){case 0:e=gv(null,e,r,t,n);break e;case 1:e=KS(null,e,r,t,n);break e;case 11:e=WS(null,e,r,t,n);break e;case 14:e=JS(null,e,r,ki(r.type,t),n);break e}throw Error(ne(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:ki(r,i),gv(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:ki(r,i),KS(t,e,r,i,n);case 3:e:{if(Y8(e),t===null)throw Error(ne(387));r=e.pendingProps,o=e.memoizedState,i=o.element,S8(t,e),q0(e,r,null,n);var s=e.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){i=Xu(Error(ne(423)),e),e=GS(t,e,r,n,i);break e}else if(r!==i){i=Xu(Error(ne(424)),e),e=GS(t,e,r,n,i);break e}else for(Lr=Xs(e.stateNode.containerInfo.firstChild),zr=e,Ct=!0,Ei=null,n=x8(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Zu(),r===i){e=Zo(t,e,n);break e}Yn(t,e,r,n)}e=e.child}return e;case 5:return C8(e),t===null&&fv(e),r=e.type,i=e.pendingProps,o=t!==null?t.memoizedProps:null,s=i.children,sv(r,i)?s=null:o!==null&&sv(r,o)&&(e.flags|=32),Z8(t,e),Yn(t,e,s,n),e.child;case 6:return t===null&&fv(e),null;case 13:return Q8(t,e,n);case 4:return nx(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Yu(e,null,r,n):Yn(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:ki(r,i),WS(t,e,r,i,n);case 7:return Yn(t,e,e.pendingProps,n),e.child;case 8:return Yn(t,e,e.pendingProps.children,n),e.child;case 12:return Yn(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,o=e.memoizedProps,s=i.value,vt(z0,r._currentValue),r._currentValue=s,o!==null)if(Di(o.value,s)){if(o.children===i.children&&!yr.current){e=Zo(t,e,n);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var a=o.dependencies;if(a!==null){s=o.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=Uo(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),dv(o.return,n,e),a.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===e.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(ne(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),dv(s,n,e),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===e){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}Yn(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,Ru(e,n),i=di(i),r=r(i),e.flags|=1,Yn(t,e,r,n),e.child;case 14:return r=e.type,i=ki(r,e.pendingProps),i=ki(r.type,i),JS(t,e,r,i,n);case 15:return K8(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:ki(r,i),e0(t,e),e.tag=1,br(r)?(t=!0,L0(e)):t=!1,Ru(e,n),H8(e,r,i),pv(e,r,i,n),yv(null,e,r,!0,t,n);case 19:return X8(t,e,n);case 22:return G8(t,e,n)}throw Error(ne(156,e.tag))};function mT(t,e){return q5(t,e)}function IB(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function si(t,e,n,r){return new IB(t,e,n,r)}function yx(t){return t=t.prototype,!(!t||!t.isReactComponent)}function RB(t){if(typeof t=="function")return yx(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Fk)return 11;if(t===Lk)return 14}return 2}function ra(t,e){var n=t.alternate;return n===null?(n=si(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function r0(t,e,n,r,i,o){var s=2;if(r=t,typeof t=="function")yx(t)&&(s=1);else if(typeof t=="string")s=5;else e:switch(t){case mu:return ll(n.children,i,o,e);case Rk:s=8,i|=8;break;case B2:return t=si(12,n,e,i|2),t.elementType=B2,t.lanes=o,t;case P2:return t=si(13,n,e,i),t.elementType=P2,t.lanes=o,t;case z2:return t=si(19,n,e,i),t.elementType=z2,t.lanes=o,t;case C5:return V1(n,i,o,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case E5:s=10;break e;case S5:s=9;break e;case Fk:s=11;break e;case Lk:s=14;break e;case As:s=16,r=null;break e}throw Error(ne(130,t==null?t:typeof t,""))}return e=si(s,n,e,i),e.elementType=t,e.type=r,e.lanes=o,e}function ll(t,e,n,r){return t=si(7,t,r,e),t.lanes=n,t}function V1(t,e,n,r){return t=si(22,t,r,e),t.elementType=C5,t.lanes=n,t.stateNode={isHidden:!1},t}function Fy(t,e,n){return t=si(6,t,null,e),t.lanes=n,t}function Ly(t,e,n){return e=si(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function FB(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=yy(0),this.expirationTimes=yy(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=yy(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function bx(t,e,n,r,i,o,s,a,l){return t=new FB(t,e,n,a,l),e===1?(e=1,o===!0&&(e|=8)):e=0,o=si(3,null,null,e),t.current=o,o.stateNode=t,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},tx(o),t}function LB(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(vT)}catch(t){console.error(t)}}vT(),v5.exports=Wr;var K1=v5.exports;const qB=D1(K1);var a6=K1;F2.createRoot=a6.createRoot,F2.hydrateRoot=a6.hydrateRoot;/** +`+o.stack}return{value:t,source:e,stack:i,digest:null}}function Iy(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function mv(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var yB=typeof WeakMap=="function"?WeakMap:Map;function W8(t,e,n){n=Vo(-1,n),n.tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){K0||(K0=!0,Cv=r),mv(t,e)},n}function J8(t,e,n){n=Vo(-1,n),n.tag=3;var r=t.type.getDerivedStateFromError;if(typeof r=="function"){var i=e.value;n.payload=function(){return r(i)},n.callback=function(){mv(t,e)}}var o=t.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){mv(t,e),typeof r!="function"&&(ta===null?ta=new Set([this]):ta.add(this));var s=e.stack;this.componentDidCatch(e.value,{componentStack:s!==null?s:""})}),n}function US(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new yB;var i=new Set;r.set(e,i)}else i=r.get(e),i===void 0&&(i=new Set,r.set(e,i));i.has(n)||(i.add(n),t=DB.bind(null,t,e,n),e.then(t,t))}function VS(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function HS(t,e,n,r,i){return t.mode&1?(t.flags|=65536,t.lanes=i,t):(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(e=Vo(-1,1),e.tag=2,ea(n,e,1))),n.lanes|=1),t)}var bB=ts.ReactCurrentOwner,gr=!1;function Qn(t,e,n,r){e.child=t===null?x8(e,null,n,r):Yu(e,t.child,n,r)}function WS(t,e,n,r,i){n=n.render;var o=e.ref;return Ru(e,i),r=sx(t,e,n,r,o,i),n=ax(),t!==null&&!gr?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,Zo(t,e,i)):(Ct&&n&&Kk(e),e.flags|=1,Qn(t,e,r,i),e.child)}function JS(t,e,n,r,i){if(t===null){var o=n.type;return typeof o=="function"&&!yx(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=o,K8(t,e,o,r,i)):(t=i0(n.type,null,r,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(o=t.child,!(t.lanes&i)){var s=o.memoizedProps;if(n=n.compare,n=n!==null?n:xd,n(s,r)&&t.ref===e.ref)return Zo(t,e,i)}return e.flags|=1,t=ra(o,r),t.ref=e.ref,t.return=e,e.child=t}function K8(t,e,n,r,i){if(t!==null){var o=t.memoizedProps;if(xd(o,r)&&t.ref===e.ref)if(gr=!1,e.pendingProps=r=o,(t.lanes&i)!==0)t.flags&131072&&(gr=!0);else return e.lanes=t.lanes,Zo(t,e,i)}return gv(t,e,n,r,i)}function G8(t,e,n){var r=e.pendingProps,i=r.children,o=t!==null?t.memoizedState:null;if(r.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},vt(Cu,Ir),Ir|=n;else{if(!(n&1073741824))return t=o!==null?o.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,vt(Cu,Ir),Ir|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,vt(Cu,Ir),Ir|=r}else o!==null?(r=o.baseLanes|n,e.memoizedState=null):r=n,vt(Cu,Ir),Ir|=r;return Qn(t,e,i,n),e.child}function Z8(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function gv(t,e,n,r,i){var o=br(n)?xl:Hn.current;return o=Gu(e,o),Ru(e,i),n=sx(t,e,n,r,o,i),r=ax(),t!==null&&!gr?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,Zo(t,e,i)):(Ct&&r&&Kk(e),e.flags|=1,Qn(t,e,n,i),e.child)}function KS(t,e,n,r,i){if(br(n)){var o=!0;B0(e)}else o=!1;if(Ru(e,i),e.stateNode===null)t0(t,e),H8(e,n,r),pv(e,n,r,i),r=!0;else if(t===null){var s=e.stateNode,a=e.memoizedProps;s.props=a;var l=s.context,u=n.contextType;typeof u=="object"&&u!==null?u=di(u):(u=br(n)?xl:Hn.current,u=Gu(e,u));var c=n.getDerivedStateFromProps,f=typeof c=="function"||typeof s.getSnapshotBeforeUpdate=="function";f||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==r||l!==u)&&qS(e,s,r,u),Ts=!1;var d=e.memoizedState;s.state=d,U0(e,r,s,i),l=e.memoizedState,a!==r||d!==l||yr.current||Ts?(typeof c=="function"&&(hv(e,n,c,r),l=e.memoizedState),(a=Ts||jS(e,n,a,r,d,l,u))?(f||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"&&(e.flags|=4194308)):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=l),s.props=r,s.state=l,s.context=u,r=a):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{s=e.stateNode,S8(t,e),a=e.memoizedProps,u=e.type===e.elementType?a:ki(e.type,a),s.props=u,f=e.pendingProps,d=s.context,l=n.contextType,typeof l=="object"&&l!==null?l=di(l):(l=br(n)?xl:Hn.current,l=Gu(e,l));var h=n.getDerivedStateFromProps;(c=typeof h=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==f||d!==l)&&qS(e,s,r,l),Ts=!1,d=e.memoizedState,s.state=d,U0(e,r,s,i);var p=e.memoizedState;a!==f||d!==p||yr.current||Ts?(typeof h=="function"&&(hv(e,n,h,r),p=e.memoizedState),(u=Ts||jS(e,n,u,r,d,p,l)||!1)?(c||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,p,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,p,l)),typeof s.componentDidUpdate=="function"&&(e.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===t.memoizedProps&&d===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&d===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=p),s.props=r,s.state=p,s.context=l,r=u):(typeof s.componentDidUpdate!="function"||a===t.memoizedProps&&d===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&d===t.memoizedState||(e.flags|=1024),r=!1)}return yv(t,e,n,r,o,i)}function yv(t,e,n,r,i,o){Z8(t,e);var s=(e.flags&128)!==0;if(!r&&!s)return i&&$S(e,n,!1),Zo(t,e,o);r=e.stateNode,bB.current=e;var a=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,t!==null&&s?(e.child=Yu(e,t.child,null,o),e.child=Yu(e,null,a,o)):Qn(t,e,a,o),e.memoizedState=r.state,i&&$S(e,n,!0),e.child}function Y8(t){var e=t.stateNode;e.pendingContext?NS(t,e.pendingContext,e.pendingContext!==e.context):e.context&&NS(t,e.context,!1),nx(t,e.containerInfo)}function GS(t,e,n,r,i){return Zu(),Zk(i),e.flags|=256,Qn(t,e,n,r),e.child}var bv={dehydrated:null,treeContext:null,retryLane:0};function vv(t){return{baseLanes:t,cachePool:null,transitions:null}}function Q8(t,e,n){var r=e.pendingProps,i=Tt.current,o=!1,s=(e.flags&128)!==0,a;if((a=s)||(a=t!==null&&t.memoizedState===null?!1:(i&2)!==0),a?(o=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(i|=1),vt(Tt,i&1),t===null)return fv(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(s=r.children,t=r.fallback,o?(r=e.mode,o=e.child,s={mode:"hidden",children:s},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=s):o=U1(s,r,0,null),t=ll(t,r,n,null),o.return=e,t.return=e,o.sibling=t,e.child=o,e.child.memoizedState=vv(n),e.memoizedState=bv,t):cx(e,s));if(i=t.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return vB(t,e,s,r,a,i,n);if(o){o=r.fallback,s=e.mode,i=t.child,a=i.sibling;var l={mode:"hidden",children:r.children};return!(s&1)&&e.child!==i?(r=e.child,r.childLanes=0,r.pendingProps=l,e.deletions=null):(r=ra(i,l),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?o=ra(a,o):(o=ll(o,s,n,null),o.flags|=2),o.return=e,r.return=e,r.sibling=o,e.child=r,r=o,o=e.child,s=t.child.memoizedState,s=s===null?vv(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},o.memoizedState=s,o.childLanes=t.childLanes&~n,e.memoizedState=bv,r}return o=t.child,t=o.sibling,r=ra(o,{mode:"visible",children:r.children}),!(e.mode&1)&&(r.lanes=n),r.return=e,r.sibling=null,t!==null&&(n=e.deletions,n===null?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=r,e.memoizedState=null,r}function cx(t,e){return e=U1({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function rp(t,e,n,r){return r!==null&&Zk(r),Yu(e,t.child,null,n),t=cx(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function vB(t,e,n,r,i,o,s){if(n)return e.flags&256?(e.flags&=-257,r=Iy(Error(ne(422))),rp(t,e,s,r)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(o=r.fallback,i=e.mode,r=U1({mode:"visible",children:r.children},i,0,null),o=ll(o,i,s,null),o.flags|=2,r.return=e,o.return=e,r.sibling=o,e.child=r,e.mode&1&&Yu(e,t.child,null,s),e.child.memoizedState=vv(s),e.memoizedState=bv,o);if(!(e.mode&1))return rp(t,e,s,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,o=Error(ne(419)),r=Iy(o,r,void 0),rp(t,e,s,r)}if(a=(s&t.childLanes)!==0,gr||a){if(r=pn,r!==null){switch(s&-s){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|s)?0:i,i!==0&&i!==o.retryLane&&(o.retryLane=i,Go(t,i),Oi(r,t,i,-1))}return gx(),r=Iy(Error(ne(421))),rp(t,e,s,r)}return i.data==="$?"?(e.flags|=128,e.child=t.child,e=NB.bind(null,t),i._reactRetry=e,null):(t=o.treeContext,Lr=Xs(i.nextSibling),zr=e,Ct=!0,Ei=null,t!==null&&(ii[oi++]=zo,ii[oi++]=jo,ii[oi++]=El,zo=t.id,jo=t.overflow,El=e),e=cx(e,r.children),e.flags|=4096,e)}function ZS(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),dv(t.return,e,n)}function Ry(t,e,n,r,i){var o=t.memoizedState;o===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=e,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function X8(t,e,n){var r=e.pendingProps,i=r.revealOrder,o=r.tail;if(Qn(t,e,r.children,n),r=Tt.current,r&2)r=r&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&ZS(t,n,e);else if(t.tag===19)ZS(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}r&=1}if(vt(Tt,r),!(e.mode&1))e.memoizedState=null;else switch(i){case"forwards":for(n=e.child,i=null;n!==null;)t=n.alternate,t!==null&&V0(t)===null&&(i=n),n=n.sibling;n=i,n===null?(i=e.child,e.child=null):(i=n.sibling,n.sibling=null),Ry(e,!1,i,n,o);break;case"backwards":for(n=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&V0(t)===null){e.child=i;break}t=i.sibling,i.sibling=n,n=i,i=t}Ry(e,!0,n,null,o);break;case"together":Ry(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function t0(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function Zo(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),Cl|=e.lanes,!(n&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(ne(153));if(e.child!==null){for(t=e.child,n=ra(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=ra(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function wB(t,e,n){switch(e.tag){case 3:Y8(e),Zu();break;case 5:C8(e);break;case 1:br(e.type)&&B0(e);break;case 4:nx(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,i=e.memoizedProps.value;vt(j0,r._currentValue),r._currentValue=i;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(vt(Tt,Tt.current&1),e.flags|=128,null):n&e.child.childLanes?Q8(t,e,n):(vt(Tt,Tt.current&1),t=Zo(t,e,n),t!==null?t.sibling:null);vt(Tt,Tt.current&1);break;case 19:if(r=(n&e.childLanes)!==0,t.flags&128){if(r)return X8(t,e,n);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),vt(Tt,Tt.current),r)break;return null;case 22:case 23:return e.lanes=0,G8(t,e,n)}return Zo(t,e,n)}var eT,wv,tT,nT;eT=function(t,e){for(var n=e.child;n!==null;){if(n.tag===5||n.tag===6)t.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};wv=function(){};tT=function(t,e,n,r){var i=t.memoizedProps;if(i!==r){t=e.stateNode,Ka(mo.current);var o=null;switch(n){case"input":i=q2(t,i),r=q2(t,r),o=[];break;case"select":i=Dt({},i,{value:void 0}),r=Dt({},r,{value:void 0}),o=[];break;case"textarea":i=H2(t,i),r=H2(t,r),o=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(t.onclick=F0)}J2(n,r);var s;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var a=i[u];for(s in a)a.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(md.hasOwnProperty(u)?o||(o=[]):(o=o||[]).push(u,null));for(u in r){var l=r[u];if(a=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&l!==a&&(l!=null||a!=null))if(u==="style")if(a){for(s in a)!a.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in l)l.hasOwnProperty(s)&&a[s]!==l[s]&&(n||(n={}),n[s]=l[s])}else n||(o||(o=[]),o.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(o=o||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(o=o||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(md.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&xt("scroll",t),o||a===l||(o=[])):(o=o||[]).push(u,l))}n&&(o=o||[]).push("style",n);var u=o;(e.updateQueue=u)&&(e.flags|=4)}};nT=function(t,e,n,r){n!==r&&(e.flags|=4)};function of(t,e){if(!Ct)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function Fn(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,r=0;if(e)for(var i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=t,i=i.sibling;else for(i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=r,t.childLanes=n,e}function kB(t,e,n){var r=e.pendingProps;switch(Gk(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Fn(e),null;case 1:return br(e.type)&&L0(),Fn(e),null;case 3:return r=e.stateNode,Qu(),Et(yr),Et(Hn),ix(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(tp(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,Ei!==null&&(Tv(Ei),Ei=null))),wv(t,e),Fn(e),null;case 5:rx(e);var i=Ka(Ad.current);if(n=e.type,t!==null&&e.stateNode!=null)tT(t,e,n,r,i),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(ne(166));return Fn(e),null}if(t=Ka(mo.current),tp(e)){r=e.stateNode,n=e.type;var o=e.memoizedProps;switch(r[Qi]=e,r[Cd]=o,t=(e.mode&1)!==0,n){case"dialog":xt("cancel",r),xt("close",r);break;case"iframe":case"object":case"embed":xt("load",r);break;case"video":case"audio":for(i=0;i<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=s.createElement(n,{is:r.is}):(t=s.createElement(n),n==="select"&&(s=t,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):t=s.createElementNS(t,n),t[Qi]=e,t[Cd]=r,eT(t,e,!1,!1),e.stateNode=t;e:{switch(s=K2(n,r),n){case"dialog":xt("cancel",t),xt("close",t),i=r;break;case"iframe":case"object":case"embed":xt("load",t),i=r;break;case"video":case"audio":for(i=0;iec&&(e.flags|=128,r=!0,of(o,!1),e.lanes=4194304)}else{if(!r)if(t=V0(s),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),of(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!Ct)return Fn(e),null}else 2*jt()-o.renderingStartTime>ec&&n!==1073741824&&(e.flags|=128,r=!0,of(o,!1),e.lanes=4194304);o.isBackwards?(s.sibling=e.child,e.child=s):(n=o.last,n!==null?n.sibling=s:e.child=s,o.last=s)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=jt(),e.sibling=null,n=Tt.current,vt(Tt,r?n&1|2:n&1),e):(Fn(e),null);case 22:case 23:return mx(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?Ir&1073741824&&(Fn(e),e.subtreeFlags&6&&(e.flags|=8192)):Fn(e),null;case 24:return null;case 25:return null}throw Error(ne(156,e.tag))}function xB(t,e){switch(Gk(e),e.tag){case 1:return br(e.type)&&L0(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Qu(),Et(yr),Et(Hn),ix(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return rx(e),null;case 13:if(Et(Tt),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(ne(340));Zu()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Et(Tt),null;case 4:return Qu(),null;case 10:return Xk(e.type._context),null;case 22:case 23:return mx(),null;case 24:return null;default:return null}}var ip=!1,zn=!1,EB=typeof WeakSet=="function"?WeakSet:Set,de=null;function Su(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){It(t,e,r)}else n.current=null}function kv(t,e,n){try{n()}catch(r){It(t,e,r)}}var YS=!1;function SB(t,e){if(iv=$0,t=a8(),Jk(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,u=0,c=0,f=t,d=null;t:for(;;){for(var h;f!==n||i!==0&&f.nodeType!==3||(a=s+i),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(h=f.firstChild)!==null;)d=f,f=h;for(;;){if(f===t)break t;if(d===n&&++u===i&&(a=s),d===o&&++c===r&&(l=s),(h=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(ov={focusedElem:t,selectionRange:n},$0=!1,de=e;de!==null;)if(e=de,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,de=t;else for(;de!==null;){e=de;try{var p=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var m=p.memoizedProps,b=p.memoizedState,y=e.stateNode,v=y.getSnapshotBeforeUpdate(e.elementType===e.type?m:ki(e.type,m),b);y.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var w=e.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(ne(163))}}catch(g){It(e,e.return,g)}if(t=e.sibling,t!==null){t.return=e.return,de=t;break}de=e.return}return p=YS,YS=!1,p}function Kf(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var o=i.destroy;i.destroy=void 0,o!==void 0&&kv(e,n,o)}i=i.next}while(i!==r)}}function j1(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function xv(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function rT(t){var e=t.alternate;e!==null&&(t.alternate=null,rT(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Qi],delete e[Cd],delete e[lv],delete e[sB],delete e[aB])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function iT(t){return t.tag===5||t.tag===3||t.tag===4}function QS(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||iT(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Ev(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=F0));else if(r!==4&&(t=t.child,t!==null))for(Ev(t,e,n),t=t.sibling;t!==null;)Ev(t,e,n),t=t.sibling}function Sv(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(Sv(t,e,n),t=t.sibling;t!==null;)Sv(t,e,n),t=t.sibling}var xn=null,xi=!1;function ds(t,e,n){for(n=n.child;n!==null;)oT(t,e,n),n=n.sibling}function oT(t,e,n){if(po&&typeof po.onCommitFiberUnmount=="function")try{po.onCommitFiberUnmount($1,n)}catch{}switch(n.tag){case 5:zn||Su(n,e);case 6:var r=xn,i=xi;xn=null,ds(t,e,n),xn=r,xi=i,xn!==null&&(xi?(t=xn,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):xn.removeChild(n.stateNode));break;case 18:xn!==null&&(xi?(t=xn,n=n.stateNode,t.nodeType===8?Ty(t.parentNode,n):t.nodeType===1&&Ty(t,n),wd(t)):Ty(xn,n.stateNode));break;case 4:r=xn,i=xi,xn=n.stateNode.containerInfo,xi=!0,ds(t,e,n),xn=r,xi=i;break;case 0:case 11:case 14:case 15:if(!zn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&kv(n,e,s),i=i.next}while(i!==r)}ds(t,e,n);break;case 1:if(!zn&&(Su(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){It(n,e,a)}ds(t,e,n);break;case 21:ds(t,e,n);break;case 22:n.mode&1?(zn=(r=zn)||n.memoizedState!==null,ds(t,e,n),zn=r):ds(t,e,n);break;default:ds(t,e,n)}}function XS(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new EB),e.forEach(function(r){var i=$B.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function bi(t,e){var n=e.deletions;if(n!==null)for(var r=0;ri&&(i=s),r&=~o}if(r=i,r=jt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*_B(r/1960))-r,10t?16:t,Us===null)var r=!1;else{if(t=Us,Us=null,G0=0,Ke&6)throw Error(ne(331));var i=Ke;for(Ke|=4,de=t.current;de!==null;){var o=de,s=o.child;if(de.flags&16){var a=o.deletions;if(a!==null){for(var l=0;ljt()-hx?al(t,0):dx|=n),vr(t,e)}function hT(t,e){e===0&&(t.mode&1?(e=Gh,Gh<<=1,!(Gh&130023424)&&(Gh=4194304)):e=1);var n=or();t=Go(t,e),t!==null&&(dh(t,e,n),vr(t,n))}function NB(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),hT(t,n)}function $B(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(ne(314))}r!==null&&r.delete(e),hT(t,n)}var pT;pT=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||yr.current)gr=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return gr=!1,wB(t,e,n);gr=!!(t.flags&131072)}else gr=!1,Ct&&e.flags&1048576&&b8(e,z0,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;t0(t,e),t=e.pendingProps;var i=Gu(e,Hn.current);Ru(e,n),i=sx(null,e,r,t,i,n);var o=ax();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,br(r)?(o=!0,B0(e)):o=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,tx(e),i.updater=z1,e.stateNode=i,i._reactInternals=e,pv(e,r,t,n),e=yv(null,e,r,!0,o,n)):(e.tag=0,Ct&&o&&Kk(e),Qn(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(t0(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=RB(r),t=ki(r,t),i){case 0:e=gv(null,e,r,t,n);break e;case 1:e=KS(null,e,r,t,n);break e;case 11:e=WS(null,e,r,t,n);break e;case 14:e=JS(null,e,r,ki(r.type,t),n);break e}throw Error(ne(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:ki(r,i),gv(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:ki(r,i),KS(t,e,r,i,n);case 3:e:{if(Y8(e),t===null)throw Error(ne(387));r=e.pendingProps,o=e.memoizedState,i=o.element,S8(t,e),U0(e,r,null,n);var s=e.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){i=Xu(Error(ne(423)),e),e=GS(t,e,r,n,i);break e}else if(r!==i){i=Xu(Error(ne(424)),e),e=GS(t,e,r,n,i);break e}else for(Lr=Xs(e.stateNode.containerInfo.firstChild),zr=e,Ct=!0,Ei=null,n=x8(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Zu(),r===i){e=Zo(t,e,n);break e}Qn(t,e,r,n)}e=e.child}return e;case 5:return C8(e),t===null&&fv(e),r=e.type,i=e.pendingProps,o=t!==null?t.memoizedProps:null,s=i.children,sv(r,i)?s=null:o!==null&&sv(r,o)&&(e.flags|=32),Z8(t,e),Qn(t,e,s,n),e.child;case 6:return t===null&&fv(e),null;case 13:return Q8(t,e,n);case 4:return nx(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Yu(e,null,r,n):Qn(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:ki(r,i),WS(t,e,r,i,n);case 7:return Qn(t,e,e.pendingProps,n),e.child;case 8:return Qn(t,e,e.pendingProps.children,n),e.child;case 12:return Qn(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,o=e.memoizedProps,s=i.value,vt(j0,r._currentValue),r._currentValue=s,o!==null)if(Di(o.value,s)){if(o.children===i.children&&!yr.current){e=Zo(t,e,n);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var a=o.dependencies;if(a!==null){s=o.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=Vo(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),dv(o.return,n,e),a.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===e.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(ne(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),dv(s,n,e),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===e){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}Qn(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,Ru(e,n),i=di(i),r=r(i),e.flags|=1,Qn(t,e,r,n),e.child;case 14:return r=e.type,i=ki(r,e.pendingProps),i=ki(r.type,i),JS(t,e,r,i,n);case 15:return K8(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:ki(r,i),t0(t,e),e.tag=1,br(r)?(t=!0,B0(e)):t=!1,Ru(e,n),H8(e,r,i),pv(e,r,i,n),yv(null,e,r,!0,t,n);case 19:return X8(t,e,n);case 22:return G8(t,e,n)}throw Error(ne(156,e.tag))};function mT(t,e){return q5(t,e)}function IB(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function si(t,e,n,r){return new IB(t,e,n,r)}function yx(t){return t=t.prototype,!(!t||!t.isReactComponent)}function RB(t){if(typeof t=="function")return yx(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Fk)return 11;if(t===Lk)return 14}return 2}function ra(t,e){var n=t.alternate;return n===null?(n=si(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function i0(t,e,n,r,i,o){var s=2;if(r=t,typeof t=="function")yx(t)&&(s=1);else if(typeof t=="string")s=5;else e:switch(t){case mu:return ll(n.children,i,o,e);case Rk:s=8,i|=8;break;case B2:return t=si(12,n,e,i|2),t.elementType=B2,t.lanes=o,t;case P2:return t=si(13,n,e,i),t.elementType=P2,t.lanes=o,t;case z2:return t=si(19,n,e,i),t.elementType=z2,t.lanes=o,t;case C5:return U1(n,i,o,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case E5:s=10;break e;case S5:s=9;break e;case Fk:s=11;break e;case Lk:s=14;break e;case As:s=16,r=null;break e}throw Error(ne(130,t==null?t:typeof t,""))}return e=si(s,n,e,i),e.elementType=t,e.type=r,e.lanes=o,e}function ll(t,e,n,r){return t=si(7,t,r,e),t.lanes=n,t}function U1(t,e,n,r){return t=si(22,t,r,e),t.elementType=C5,t.lanes=n,t.stateNode={isHidden:!1},t}function Fy(t,e,n){return t=si(6,t,null,e),t.lanes=n,t}function Ly(t,e,n){return e=si(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function FB(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=yy(0),this.expirationTimes=yy(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=yy(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function bx(t,e,n,r,i,o,s,a,l){return t=new FB(t,e,n,a,l),e===1?(e=1,o===!0&&(e|=8)):e=0,o=si(3,null,null,e),t.current=o,o.stateNode=t,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},tx(o),t}function LB(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(vT)}catch(t){console.error(t)}}vT(),v5.exports=Wr;var K1=v5.exports;const qB=D1(K1);var a6=K1;F2.createRoot=a6.createRoot,F2.hydrateRoot=a6.hydrateRoot;/** * @license @tabler/icons-react v3.11.0 - MIT * * This source code is licensed under the MIT license. * See the LICENSE file in the root directory of this source tree. - */var VB={outline:{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"},filled:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none"}};/** + */var UB={outline:{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"},filled:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none"}};/** * @license @tabler/icons-react v3.11.0 - MIT * * This source code is licensed under the MIT license. * See the LICENSE file in the root directory of this source tree. - */const ka=(t,e,n,r)=>{const i=ee.forwardRef(({color:o="currentColor",size:s=24,stroke:a=2,title:l,className:u,children:c,...f},d)=>ee.createElement("svg",{ref:d,...VB[t],width:s,height:s,className:["tabler-icon",`tabler-icon-${e}`,u].join(" "),...t==="filled"?{fill:o}:{strokeWidth:a,stroke:o},...f},[l&&ee.createElement("title",{key:"svg-title"},l),...r.map(([h,p])=>ee.createElement(h,p)),...Array.isArray(c)?c:[c]]));return i.displayName=`${n}`,i};/** + */const ka=(t,e,n,r)=>{const i=ee.forwardRef(({color:o="currentColor",size:s=24,stroke:a=2,title:l,className:u,children:c,...f},d)=>ee.createElement("svg",{ref:d,...UB[t],width:s,height:s,className:["tabler-icon",`tabler-icon-${e}`,u].join(" "),...t==="filled"?{fill:o}:{strokeWidth:a,stroke:o},...f},[l&&ee.createElement("title",{key:"svg-title"},l),...r.map(([h,p])=>ee.createElement(h,p)),...Array.isArray(c)?c:[c]]));return i.displayName=`${n}`,i};/** * @license @tabler/icons-react v3.11.0 - MIT * * This source code is licensed under the MIT license. * See the LICENSE file in the root directory of this source tree. - */var UB=ka("outline","bolt","IconBolt",[["path",{d:"M13 3l0 7l6 0l-8 11l0 -7l-6 0l8 -11",key:"svg-0"}]]);/** + */var VB=ka("outline","bolt","IconBolt",[["path",{d:"M13 3l0 7l6 0l-8 11l0 -7l-6 0l8 -11",key:"svg-0"}]]);/** * @license @tabler/icons-react v3.11.0 - MIT * * This source code is licensed under the MIT license. @@ -87,19 +87,19 @@ Error generating stack: `+o.message+` * * This source code is licensed under the MIT license. * See the LICENSE file in the root directory of this source tree. - */var JB=ka("filled","brand-github-filled","IconBrandGithubFilled",[["path",{d:"M5.315 2.1c.791 -.113 1.9 .145 3.333 .966l.272 .161l.16 .1l.397 -.083a13.3 13.3 0 0 1 4.59 -.08l.456 .08l.396 .083l.161 -.1c1.385 -.84 2.487 -1.17 3.322 -1.148l.164 .008l.147 .017l.076 .014l.05 .011l.144 .047a1 1 0 0 1 .53 .514a5.2 5.2 0 0 1 .397 2.91l-.047 .267l-.046 .196l.123 .163c.574 .795 .93 1.728 1.03 2.707l.023 .295l.007 .272c0 3.855 -1.659 5.883 -4.644 6.68l-.245 .061l-.132 .029l.014 .161l.008 .157l.004 .365l-.002 .213l-.003 3.834a1 1 0 0 1 -.883 .993l-.117 .007h-6a1 1 0 0 1 -.993 -.883l-.007 -.117v-.734c-1.818 .26 -3.03 -.424 -4.11 -1.878l-.535 -.766c-.28 -.396 -.455 -.579 -.589 -.644l-.048 -.019a1 1 0 0 1 .564 -1.918c.642 .188 1.074 .568 1.57 1.239l.538 .769c.76 1.079 1.36 1.459 2.609 1.191l.001 -.678l-.018 -.168a5.03 5.03 0 0 1 -.021 -.824l.017 -.185l.019 -.12l-.108 -.024c-2.976 -.71 -4.703 -2.573 -4.875 -6.139l-.01 -.31l-.004 -.292a5.6 5.6 0 0 1 .908 -3.051l.152 -.222l.122 -.163l-.045 -.196a5.2 5.2 0 0 1 .145 -2.642l.1 -.282l.106 -.253a1 1 0 0 1 .529 -.514l.144 -.047l.154 -.03z",key:"svg-0"}]]);function En(t){this.content=t}En.prototype={constructor:En,find:function(t){for(var e=0;e>1}};En.from=function(t){if(t instanceof En)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new En(e)};function ET(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),o=e.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)n++;return n}if(i.content.size||o.content.size){let s=ET(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function ST(t,e,n,r){for(let i=t.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let s=t.child(--i),a=e.child(--o),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 u=0,c=Math.min(s.text.length,a.text.length);for(;ue&&r(l,i+a,o||null,s)!==!1&&l.content.size){let c=a+1;l.nodesBetween(Math.max(0,e-c),Math.min(l.content.size,n-c),r,i+c)}a=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let o="",s=!0;return this.nodesBetween(e,n,(a,l)=>{let u=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&u||a.isTextblock)&&r&&(s?s=!1:o+=r),o+=u},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);oe)for(let o=0,s=0;se&&((sn)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,n-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,n-s-1))),r.push(a),i+=a.nodeSize),s=l}return new Gn(r,i)}cutByIndex(e,n){return e==n?Gn.empty:e==0&&n==this.content.length?this:new Gn(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new Gn(i,o)}addToStart(e){return new Gn([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Gn(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;nthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),s=i+o.nodeSize;if(s>=e)return s==e||n>0?sp(r+1,s):sp(r,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return Gn.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new Gn(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Gn.empty;let n,r=0;for(let i=0;ithis.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;nr.type.rank-i.type.rank),n}};ft.none=[];let Q0=class extends Error{},he=class iu{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=_T(this.content,e+this.openStart,n);return r&&new iu(r,this.openStart,this.openEnd)}removeBetween(e,n){return new iu(CT(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return iu.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new iu(oe.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new iu(e,r,i)}};he.empty=new he(oe.empty,0,0);function CT(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:s,offset:a}=t.findIndex(n);if(i==e||o.isText){if(a!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(CT(o.content,e-i-1,n-i-1)))}function _T(t,e,n,r){let{index:i,offset:o}=t.findIndex(e),s=t.maybeChild(i);if(o==e||s.isText)return t.cut(0,e).append(n).append(t.cut(e));let a=_T(s.content,e-o-1,n);return a&&t.replaceChild(i,s.copy(a))}function KB(t,e,n){if(n.openStart>t.depth)throw new Q0("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Q0("Inconsistent open depths");return AT(t,e,n,0)}function AT(t,e,n,r){let i=t.index(r),o=t.node(r);if(i==e.index(r)&&r=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Yf(t,e,n,r){let i=(e||t).node(n),o=0,s=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(ul(t.nodeAfter,r),o++));for(let a=o;ai&&Ov(t,e,i+1),s=r.depth>i&&Ov(n,r,i+1),a=[];return Yf(null,t,i,a),o&&s&&e.index(i)==n.index(i)?(TT(o,s),ul(cl(o,MT(t,e,n,r,i+1)),a)):(o&&ul(cl(o,X0(t,e,i+1)),a),Yf(e,n,i,a),s&&ul(cl(s,X0(n,r,i+1)),a)),Yf(r,null,i,a),new oe(a)}function X0(t,e,n){let r=[];if(Yf(null,t,n,r),t.depth>n){let i=Ov(t,e,n+1);ul(cl(i,X0(t,e,n+1)),r)}return Yf(e,null,n,r),new oe(r)}function GB(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)i=e.node(o).copy(oe.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}let l6=class Dv{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new em(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let s=e;;){let{index:a,offset:l}=s.content.findIndex(o),u=o-l;if(r.push(s,a,i+l),!u||(s=s.child(a),s.isText))break;o=u-1,i+=l+1}return new Dv(n,r,o)}static resolveCached(e,n){let r=u6.get(e);if(r)for(let o=0;oe&&this.nodesBetween(e,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),OT(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=oe.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),a=s&&s.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=i;ln.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=oe.fromJSON(e,n.content),o=e.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};fl.prototype.text=void 0;let XB=class $v extends fl{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):OT(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new $v(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new $v(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function OT(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}let Nd=class DT{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new eP(e,n);if(r.next==null)return DT.empty;let i=NT(r);r.next&&r.err("Unexpected trailing text");let o=aP(sP(i));return lP(o,r),o}matchType(e){for(let n=0;nu.createAndFill()));for(let u=0;u=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s"+e.indexOf(r.next[s].next);return o}).join(` -`)}};Nd.empty=new Nd(!0);let eP=class{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}};function NT(t){let e=[];do e.push(tP(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function tP(t){let e=[];do e.push(nP(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function nP(t){let e=oP(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=rP(t,e);else break;return e}function c6(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function rP(t,e){let n=c6(t),r=n;return t.eat(",")&&(t.next!="}"?r=c6(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function iP(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let o in n){let s=n[o];s.groups.indexOf(e)>-1&&i.push(s)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function oP(t){if(t.eat("(")){let e=NT(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=iP(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function sP(t){let e=[[]];return i(o(t,0),n()),e;function n(){return e.push([])-1}function r(s,a,l){let u={term:l,to:a};return e[s].push(u),u}function i(s,a){s.forEach(l=>l.to=a)}function o(s,a){if(s.type=="choice")return s.exprs.reduce((l,u)=>l.concat(o(u,a)),[]);if(s.type=="seq")for(let l=0;;l++){let u=o(s.exprs[l],a);if(l==s.exprs.length-1)return u;i(u,a=n())}else if(s.type=="star"){let l=n();return r(a,l),i(o(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=n();return i(o(s.expr,a),l),i(o(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(a)].concat(o(s.expr,a));if(s.type=="range"){let l=a;for(let u=0;u{t[s].forEach(({term:a,to:l})=>{if(!a)return;let u;for(let c=0;c{u||i.push([a,u=[]]),u.indexOf(c)==-1&&u.push(c)})})});let o=e[r.join(",")]=new Nd(r.indexOf(t.length-1)>-1);for(let s=0;s-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;nr[o]=new BT(o,n,s));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function uP(t){let e=t.split("|");return n=>{let r=n===null?"null":typeof n;if(e.indexOf(r)<0)throw new RangeError(`Expected value of type ${e}, got ${r}`)}}let cP=class{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default,this.validate=typeof e.validate=="string"?uP(e.validate):e.validate}get isRequired(){return!this.hasDefault}},PT=class zT{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=LT(i.attrs),this.excluded=null;let o=IT(this.attrs);this.instance=o?new ft(this,o):null}create(e=null){return!e&&this.instance?this.instance:new ft(this,RT(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new zT(o,i++,n,s)),r}removeFromSet(e){for(var n=0;n-1}},jT=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=En.from(e.nodes),n.marks=En.from(e.marks||{}),this.nodes=d6.compile(this.spec.nodes,this),this.marks=PT.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],s=o.spec.content||"",a=o.spec.marks;if(o.contentMatch=r[s]||(r[s]=Nd.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=a=="_"?null:a?h6(this,a.split(" ")):a==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:h6(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(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof d6){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,i)}text(e,n){let r=this.nodes.text;return new XB(r,r.defaultAttrs,e,ft.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return fl.fromJSON(this,e)}markFromJSON(e){return ft.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}};function h6(t,e){let n=[];for(let r=0;r-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function fP(t){return t.tag!=null}function dP(t){return t.style!=null}let xx=class Iv{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(fP(i))this.tags.push(i);else if(dP(i)){let o=/[^=]*/.exec(i.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let o=e.nodes[i.node];return o.contentMatch.matchType(o)})}parse(e,n={}){let r=new m6(this,n,!1);return r.addAll(e,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new m6(this,n,!0);return r.addAll(e,n.from,n.to),he.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;ie.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(s.getAttrs){let l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let n=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s{r(s=g6(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=g6(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Iv(e,Iv.schemaRules(e)))}};const qT={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},hP={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},VT={ol:!0,ul:!0},tm=1,nm=2,Qf=4;function p6(t,e,n){return e!=null?(e?tm:0)|(e==="full"?nm:0):t&&t.whitespace=="pre"?tm|nm:n&~Qf}let ap=class{constructor(e,n,r,i,o,s,a){this.type=e,this.attrs=n,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=a,this.content=[],this.activeMarks=ft.none,this.stashMarks=[],this.match=s||(a&Qf?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(oe.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&tm)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=oe.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(oe.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}popFromStashMark(e){for(let n=this.stashMarks.length-1;n>=0;n--)if(e.eq(this.stashMarks[n]))return this.stashMarks.splice(n,1)[0]}applyPending(e){for(let n=0,r=this.pendingMarks;nthis.addAll(e)),s&&this.sync(a),this.needsBlock=l}else this.withStyleRules(e,()=>{this.addElementByRule(e,o,o.consuming===!1?i:void 0)})}leafFallback(e){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(` -`))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let n=ft.none,r=ft.none;if(e.length)for(let i=0;i{l.clearMark(u)&&(r=u.addToSet(r))}):n=this.parser.schema.marks[l.mark].create(l.attrs).addToSet(n),l.consuming===!1)a=l;else break}}return[n,r]}addElementByRule(e,n,r){let i,o,s;n.node?(o=this.parser.schema.nodes[n.node],o.isLeaf?this.insertNode(o.create(n.attrs))||this.leafFallback(e):i=this.enter(o,n.attrs||null,n.preserveWhitespace)):(s=this.parser.schema.marks[n.mark].create(n.attrs),this.addPendingMark(s));let a=this.top;if(o&&o.isLeaf)this.findInside(e);else if(r)this.addElement(e,r);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l)}i&&this.sync(a)&&this.open--,s&&this.removePendingMark(s,a)}addAll(e,n,r){let i=n||0;for(let o=n?e.childNodes[n]:e.firstChild,s=r==null?null:e.childNodes[r];o!=s;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o);this.findAtPoint(e,i)}findPlace(e){let n,r;for(let i=this.open;i>=0;i--){let o=this.nodes[i],s=o.findWrapping(e);if(s&&(!n||n.length>s.length)&&(n=s,r=o,!s.length)||o.solid)break}if(!n)return!1;this.sync(r);for(let i=0;ithis.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let n=this.open;n>=0;n--)if(this.nodes[n]==e)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(a,l)=>{for(;a>=0;a--){let u=n[a];if(u==""){if(a==n.length-1||a==0)continue;for(;l>=o;l--)if(s(a-1,l))return!0;return!1}else{let c=l>0||l==0&&i?this.nodes[l].type:r&&l>=o?r.node(l-o).type:null;if(!c||c.name!=u&&c.groups.indexOf(u)==-1)return!1;l--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(e){let n=yP(e,this.top.pendingMarks);n&&this.top.stashMarks.push(n),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,n){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let s=i.popFromStashMark(e);s&&i.type&&i.type.allowsMarkType(s.type)&&(i.activeMarks=s.addToSet(i.activeMarks))}if(i==n)break}}};function pP(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&VT.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function mP(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function g6(t){let e={};for(let n in t)e[n]=t[n];return e}function gP(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],s=a=>{o.push(a);for(let l=0;l{if(o.length||s.marks.length){let a=0,l=0;for(;a=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&i0(Py(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null){return i0(e,n,r)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new UT(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=y6(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return y6(e.marks)}};function y6(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Py(t){return t.document||window.document}const b6=new WeakMap;function bP(t){let e=b6.get(t);return e===void 0&&b6.set(t,e=vP(t)),e}function vP(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=i.indexOf(" ");s>0&&(n=i.slice(0,s),i=i.slice(s+1));let a,l=n?t.createElementNS(n,i):t.createElement(i),u=e[1],c=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){c=2;for(let f in u)if(u[f]!=null){let d=f.indexOf(" ");d>0?l.setAttributeNS(f.slice(0,d),f.slice(d+1),u[f]):l.setAttribute(f,u[f])}}for(let f=c;fc)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:h,contentDOM:p}=i0(t,d,n,r);if(l.appendChild(h),p){if(a)throw new RangeError("Multiple content holes");a=p}}}return{dom:l,contentDOM:a}}const HT=65535,WT=Math.pow(2,16);function wP(t,e){return t+e*WT}function v6(t){return t&HT}function kP(t){return(t-(t&HT))/WT}const JT=1,KT=2,o0=4,GT=8;let Rv=class{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo>)>0}get deletedBefore(){return(this.delInfo&(JT|o0))>0}get deletedAfter(){return(this.delInfo&(KT|o0))>0}get deletedAcross(){return(this.delInfo&o0)>0}},Al=class ou{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&ou.empty)return ou.empty}recover(e){let n=0,r=v6(e);if(!this.inverted)for(let i=0;ie)break;let u=this.ranges[a+o],c=this.ranges[a+s],f=l+u;if(e<=f){let d=u?e==l?-1:e==f?1:n:n,h=l+i+(d<0?0:c);if(r)return h;let p=e==(n<0?l:f)?null:wP(a/3,e-l),m=e==l?KT:e==f?JT:o0;return(n<0?e!=l:e!=f)&&(m|=GT),new Rv(h,m,p)}i+=c-u}return r?e+i:new Rv(e+i,0,null)}touches(e,n){let r=0,i=v6(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;ae)break;let u=this.ranges[a+o],c=l+u;if(e<=c&&a==i*3)return!0;r+=this.ranges[a+s]-u}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i=0;n--){let i=e.getMirror(n);this.appendMap(e.maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new s0;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;ro&&l!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return Qn.fromReplace(e,this.from,this.to,o)}invert(){return new gh(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new xf(n.pos,r.pos,this.mark)}merge(e){return e instanceof xf&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new xf(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new xf(n.from,n.to,e.markFromJSON(n.mark))}};Wn.jsonID("addMark",Sx);let gh=class Ef extends Wn{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new he(Ex(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return Qn.fromReplace(e,this.from,this.to,r)}invert(){return new Sx(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Ef(n.pos,r.pos,this.mark)}merge(e){return e instanceof Ef&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ef(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Ef(n.from,n.to,e.markFromJSON(n.mark))}};Wn.jsonID("removeMark",gh);let Cx=class Sf extends Wn{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Qn.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Qn.fromReplace(e,this.pos,this.pos+1,new he(oe.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;ir.pos?null:new a0(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new a0(n.from,n.to,n.gapFrom,n.gapTo,he.fromJSON(e,n.slice),n.insert,!!n.structure)}};Wn.jsonID("replaceAround",_r);function Lv(t,e,n){let r=t.resolve(e),i=n-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function xP(t,e,n,r){let i=[],o=[],s,a;t.doc.nodesBetween(e,n,(l,u,c)=>{if(!l.isInline)return;let f=l.marks;if(!r.isInSet(f)&&c.type.allowsMarkType(r.type)){let d=Math.max(u,e),h=Math.min(u+l.nodeSize,n),p=r.addToSet(f);for(let m=0;mt.step(l)),o.forEach(l=>t.step(l))}function EP(t,e,n,r){let i=[],o=0;t.doc.nodesBetween(e,n,(s,a)=>{if(!s.isInline)return;o++;let l=null;if(r instanceof PT){let u=s.marks,c;for(;c=r.isInSet(u);)(l||(l=[])).push(c),u=c.removeFromSet(u)}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let u=Math.min(a+s.nodeSize,n);for(let c=0;ct.step(new gh(s.from,s.to,s.style)))}function YT(t,e,n,r=n.contentMatch,i=!0){let o=t.doc.nodeAt(e),s=[],a=e+1;for(let l=0;l=0;l--)t.step(s[l])}function SP(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Nc(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let i=t.$from.node(r),o=t.$from.index(r),s=t.$to.indexAfter(r);if(rn;p--)m||r.index(p)>0?(m=!0,c=oe.from(r.node(p).copy(c)),f++):l--;let d=oe.empty,h=0;for(let p=o,m=!1;p>n;p--)m||i.after(p+1)=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=oe.from(n[s].type.create(n[s].attrs,r))}let i=e.start,o=e.end;t.step(new _r(i,o,i,o,new he(r,0,0),n.length,!0))}function MP(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,n,(s,a)=>{if(s.isTextblock&&!s.hasMarkup(r,i)&&NP(t.doc,t.mapping.slice(o).map(a),r)){let l=null;if(r.schema.linebreakReplacement){let d=r.whitespace=="pre",h=!!r.contentMatch.matchType(r.schema.linebreakReplacement);d&&!h?l=!1:!d&&h&&(l=!0)}l===!1&&DP(t,s,a,o),YT(t,t.mapping.slice(o).map(a,1),r,void 0,l===null);let u=t.mapping.slice(o),c=u.map(a,1),f=u.map(a+s.nodeSize,1);return t.step(new _r(c,f,c+1,f-1,new he(oe.from(r.create(i,null,s.marks)),0,0),1,!0)),l===!0&&OP(t,s,a,o),!1}})}function OP(t,e,n,r){e.forEach((i,o)=>{if(i.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(i.text);){let l=t.mapping.slice(r).map(n+1+o+s.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function DP(t,e,n,r){e.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+o);t.replaceWith(s,s+1,e.type.schema.text(` -`))}})}function NP(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function $P(t,e,n,r,i){let o=t.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return t.replaceWith(e,e+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new _r(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new he(oe.from(s),0,0),1,!0))}function Lu(t,e,n=1,r){let i=t.resolve(e),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let u=i.depth-1,c=n-2;u>o;u--,c--){let f=i.node(u),d=i.index(u);if(f.type.spec.isolating)return!1;let h=f.content.cutByIndex(d,f.childCount),p=r&&r[c+1];p&&(h=h.replaceChild(0,p.type.create(p.attrs)));let m=r&&r[c]||f;if(!f.canReplace(d+1,f.childCount)||!m.type.validContent(h))return!1}let a=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type)}function IP(t,e,n=1,r){let i=t.doc.resolve(e),o=oe.empty,s=oe.empty;for(let a=i.depth,l=i.depth-n,u=n-1;a>l;a--,u--){o=oe.from(i.node(a).copy(o));let c=r&&r[u];s=oe.from(c?c.type.create(c.attrs,s):i.node(a).copy(s))}t.step(new Ni(e,e,new he(o.append(s),n,n),!0))}function xa(t,e){let n=t.resolve(e),r=n.index();return QT(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function QT(t,e){return!!(t&&e&&!t.isLeaf&&t.canAppend(e))}function Z1(t,e,n=-1){let r=t.resolve(e);for(let i=r.depth;;i--){let o,s,a=r.index(i);if(i==r.depth?(o=r.nodeBefore,s=r.nodeAfter):n>0?(o=r.node(i+1),a++,s=r.node(i).maybeChild(a)):(o=r.node(i).maybeChild(a-1),s=r.node(i+1)),o&&!o.isTextblock&&QT(o,s)&&r.node(i).canReplace(a,a+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}function RP(t,e,n){let r=new Ni(e-n,e+n,he.empty,!0);t.step(r)}function FP(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o=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),u=r.node(s),c=!1;if(o==1)c=u.canReplace(l,l,i);else{let f=u.contentMatchAt(l).findWrapping(i.firstChild.type);c=f&&u.canReplaceWith(l,l,f[0])}if(c)return a==0?r.pos:a<0?r.before(s+1):r.after(s+1)}return null}function Y1(t,e,n=e,r=he.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),o=t.resolve(n);return eM(i,o,r)?new Ni(e,n,r):new LP(i,o,r).fit()}function eM(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}let LP=class{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=oe.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=oe.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,a=i.depth;for(;s&&a&&o.childCount==1;)o=o.firstChild.content,s--,a--;let l=new he(o,s,a);return e>-1?new _r(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new Ni(r.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=jy(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:u}=this.frontier[a],c,f=null;if(n==1&&(s?u.matchType(s.type)||(f=u.fillBefore(oe.from(s),!1)):o&&l.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:a,parent:o,inject:f};if(n==2&&s&&(c=u.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:o,wrap:c};if(o&&u.matchType(o.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=jy(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new he(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=jy(e,n);if(i.childCount<=1&&n>0){let o=e.size-n<=n+i.size;this.unplaced=new he(Cf(e,n-1,1),n-1,o?n-1:r)}else this.unplaced=new he(Cf(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let m=0;m1||l==0||m.content.size)&&(f=b,c.push(tM(m.mark(d.allowedMarks(m.marks)),u==1?l:0,u==a.childCount?h:-1)))}let p=u==a.childCount;p||(h=-1),this.placed=_f(this.placed,n,oe.from(c)),this.frontier[n].match=f,p&&h<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,b=a;m1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n=0;a--){let{match:l,type:u}=this.frontier[a],c=qy(e,a,u,l,!0);if(!c||c.childCount)continue e}return{depth:n,fit:s,move:o?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=_f(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=_f(this.placed,this.depth,oe.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(oe.empty,!0);n.childCount&&(this.placed=_f(this.placed,this.frontier.length,n))}};function Cf(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Cf(t.firstChild.content,e-1,n)))}function _f(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(_f(t.lastChild.content,e-1,n)))}function jy(t,e){for(let n=0;n1&&(r=r.replaceChild(0,tM(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(oe.empty,!0)))),t.copy(r)}function qy(t,e,n,r,i){let o=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!BP(n,o.content,s)?a:null}function BP(t,e,n){for(let r=n;r0;d--,h--){let p=i.node(d).type.spec;if(p.defining||p.definingAsContext||p.isolating)break;s.indexOf(d)>-1?a=d:i.before(d)==h&&s.splice(1,0,-d)}let l=s.indexOf(a),u=[],c=r.openStart;for(let d=r.content,h=0;;h++){let p=d.firstChild;if(u.push(p),h==r.openStart)break;d=p.content}for(let d=c-1;d>=0;d--){let h=u[d],p=PP(h.type);if(p&&!h.sameMarkup(i.node(Math.abs(a)-1)))c=d;else if(p||!h.type.isTextblock)break}for(let d=r.openStart;d>=0;d--){let h=(d+c+1)%(r.openStart+1),p=u[h];if(p)for(let m=0;m=0&&(t.replace(e,n,r),!(t.steps.length>f));d--){let h=s[d];h<0||(e=i.before(h),n=o.after(h))}}function nM(t,e,n,r,i){if(er){let o=i.contentMatchAt(0),s=o.fillBefore(t).append(t);t=s.append(o.matchFragment(s).fillBefore(oe.empty,!0))}return t}function jP(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=FP(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new he(oe.from(r),0,0))}function qP(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),o=rM(r,i);for(let s=0;s0&&(l||r.node(a-1).canReplace(r.index(a-1),i.indexAfter(a-1))))return t.delete(r.before(a),i.after(a))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s)return t.delete(r.before(s),n);t.delete(e,n)}function rM(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let o=t.start(i);if(oe.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&n.push(i)}return n}let iM=class l0 extends Wn{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return Qn.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Qn.fromReplace(e,this.pos,this.pos+1,new he(oe.from(i),0,n.isLeaf?0:1))}getMap(){return Al.empty}invert(e){return new l0(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new l0(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new l0(n.pos,n.attr,n.value)}};Wn.jsonID("attr",iM);let oM=class Bv extends Wn{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return Qn.ok(r)}getMap(){return Al.empty}invert(e){return new Bv(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Bv(n.attr,n.value)}};Wn.jsonID("docAttr",oM);let tc=class extends Error{};tc=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};tc.prototype=Object.create(Error.prototype);tc.prototype.constructor=tc;tc.prototype.name="TransformError";let VP=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new ZT}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new tc(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=he.empty){let i=Y1(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new he(oe.from(r),0,0))}delete(e,n){return this.replace(e,n,he.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return zP(this,e,n,r),this}replaceRangeWith(e,n,r){return jP(this,e,n,r),this}deleteRange(e,n){return qP(this,e,n),this}lift(e,n){return CP(this,e,n),this}join(e,n=1){return RP(this,e,n),this}wrap(e,n){return TP(this,e,n),this}setBlockType(e,n=e,r,i=null){return MP(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return $P(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new iM(e,n,r)),this}setDocAttribute(e,n){return this.step(new oM(e,n)),this}addNodeMark(e,n){return this.step(new Cx(e,n)),this}removeNodeMark(e,n){if(!(n instanceof ft)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new _x(e,n)),this}split(e,n=1,r){return IP(this,e,n,r),this}addMark(e,n,r){return xP(this,e,n,r),this}removeMark(e,n,r){return EP(this,e,n,r),this}clearIncompatible(e,n,r){return YT(this,e,n,r),this}};const Vy=Object.create(null);let je=class{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new UP(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n=0;o--){let s=n<0?su(e.node(0),e.node(o),e.before(o+1),e.index(o),n,r):su(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,n,r);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new dl(e.node(0))}static atStart(e){return su(e,e,0,0,1)||new dl(e)}static atEnd(e){return su(e,e,e.content.size,e.childCount,-1)||new dl(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Vy[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Vy)throw new RangeError("Duplicate use of selection JSON ID "+e);return Vy[e]=n,n.prototype.jsonID=e,n}getBookmark(){return He.between(this.$anchor,this.$head).getBookmark()}};je.prototype.visible=!0;let UP=class{constructor(e,n){this.$from=e,this.$to=n}},k6=!1;function x6(t){!k6&&!t.parent.inlineContent&&(k6=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}let He=class Af extends je{constructor(e,n=e){x6(e),x6(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return je.near(r);let i=e.resolve(n.map(this.anchor));return new Af(i.parent.inlineContent?i:r,r)}replace(e,n=he.empty){if(super.replace(e,n),n==he.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof Af&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new sM(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Af(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=je.findFrom(n,r,!0)||je.findFrom(n,-r,!0);if(o)n=o.$head;else return je.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(je.findFrom(e,-r,!0)||je.findFrom(e,r,!0)).$anchor,e.pos0?0:1);i>0?s=0;s+=i){let a=e.child(s);if(a.isAtom){if(!o&&_e.isSelectable(a))return _e.create(t,n-(i<0?a.nodeSize:0))}else{let l=su(t,a,n+i,i<0?a.childCount:0,i,o);if(l)return l}n+=a.nodeSize*i}return null}function E6(t,e,n){let r=t.steps.length-1;if(r{s==null&&(s=c)}),t.setSelection(je.near(t.doc.resolve(s),n))}const S6=1,lp=2,C6=4;class JP extends VP{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(e){return this.storedMarks=e,this.updated|=lp,this}ensureMarks(e){return ft.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&lp)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~lp,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||ft.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(n);o=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(e,o)),this.selection.empty||this.setSelection(je.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=C6,this}get scrolledIntoView(){return(this.updated&C6)>0}}function _6(t,e){return!e||!t?t:t.bind(e)}let Mf=class{constructor(e,n,r){this.name=e,this.init=_6(n.init,r),this.apply=_6(n.apply,r)}};const KP=[new Mf("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Mf("selection",{init(t,e){return t.selection||je.atStart(e.doc)},apply(t){return t.selection}}),new Mf("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Mf("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class Uy{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=KP.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 Mf(r.key,r.spec.state,r))})}}class _u{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;rr.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],o=i.spec.state;o&&o.toJSON&&(n[r]=o.toJSON.call(i,this[i.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new Uy(e.schema,e.plugins),o=new _u(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=fl.fromJSON(e.schema,n.doc);else if(s.name=="selection")o.selection=je.fromJSON(o.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],u=l.spec.state;if(l.key==s.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){o[s.name]=u.fromJSON.call(l,e,n[a],o);return}}o[s.name]=s.init(e,o)}}),o}}function uM(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=uM(i,e,{})),n[r]=i}return n}let Kr=class{constructor(e){this.spec=e,this.props={},e.props&&uM(e.props,this,this.props),this.key=e.key?e.key.key:cM("plugin")}getState(e){return e[this.key]}};const Hy=Object.create(null);function cM(t){return t in Hy?t+"$"+ ++Hy[t]:(Hy[t]=0,t+"$")}let xo=class{constructor(e="key"){this.key=cM(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}};const Tn=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},$d=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let Pv=null;const Ro=function(t,e,n){let r=Pv||(Pv=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},GP=function(){Pv=null},Tl=function(t,e,n,r){return n&&(A6(t,e,n,r,-1)||A6(t,e,n,r,1))},ZP=/^(img|br|input|textarea|hr)$/i;function A6(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:Xi(t))){let o=t.parentNode;if(!o||o.nodeType!=1||yh(t)||ZP.test(t.nodeName)||t.contentEditable=="false")return!1;e=Tn(t)+(i<0?0:1),t=o}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.contentEditable=="false")return!1;e=i<0?Xi(t):0}else return!1}}function Xi(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function YP(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=Xi(t)}else if(t.parentNode&&!yh(t))e=Tn(t),t=t.parentNode;else return null}}function QP(t,e){for(;;){if(t.nodeType==3&&e2),ri=nc||(bo?/Mac/.test(bo.platform):!1),rz=bo?/Win/.test(bo.platform):!1,Si=/Android \d/.test(Ea),bh=!!T6&&"webkitFontSmoothing"in T6.documentElement.style,iz=bh?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function oz(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Do(t,e){return typeof t=="number"?t:t[e]}function sz(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function M6(t,e,n){let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,o=t.dom.ownerDocument;for(let s=n||t.dom;s;s=$d(s)){if(s.nodeType!=1)continue;let a=s,l=a==o.body,u=l?oz(o):sz(a),c=0,f=0;if(e.topu.bottom-Do(r,"bottom")&&(f=e.bottom-e.top>u.bottom-u.top?e.top+Do(i,"top")-u.top:e.bottom-u.bottom+Do(i,"bottom")),e.leftu.right-Do(r,"right")&&(c=e.right-u.right+Do(i,"right")),c||f)if(l)o.defaultView.scrollBy(c,f);else{let d=a.scrollLeft,h=a.scrollTop;f&&(a.scrollTop+=f),c&&(a.scrollLeft+=c);let p=a.scrollLeft-d,m=a.scrollTop-h;e={left:e.left-p,top:e.top-m,right:e.right-p,bottom:e.bottom-m}}if(l||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function az(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let o=(e.left+e.right)/2,s=n+1;s=n-20){r=a,i=l.top;break}}return{refDOM:r,refTop:i,stack:dM(t.dom)}}function dM(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=$d(r));return e}function lz({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;hM(n,r==0?0:r-e)}function hM(t,e){for(let n=0;n=a){s=Math.max(p.bottom,s),a=Math.min(p.top,a);let m=p.left>e.left?p.left-e.left:p.right=(p.left+p.right)/2?1:0));continue}}else p.top>e.top&&!l&&p.left<=e.left&&p.right>=e.left&&(l=c,u={left:Math.max(p.left,Math.min(p.right,e.left)),top:p.top});!n&&(e.left>=p.right&&e.top>=p.top||e.left>=p.left&&e.top>=p.bottom)&&(o=f+1)}}return!n&&l&&(n=l,i=u,r=0),n&&n.nodeType==3?cz(n,i):!n||r&&n.nodeType==1?{node:t,offset:o}:pM(n,i)}function cz(t,e){let n=t.nodeValue.length,r=document.createRange();for(let i=0;i=(o.left+o.right)/2?1:0)}}return{node:t,offset:0}}function Tx(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function fz(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(r,i,o)}function hz(t,e,n,r){let i=-1;for(let o=e,s=!1;o!=t.dom;){let a=t.docView.nearestDesc(o,!0);if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)){let l=a.dom.getBoundingClientRect();if(a.node.isBlock&&a.parent&&(!s&&l.left>r.left||l.top>r.top?i=a.posBefore:(!s&&l.right-1?i:t.docView.posFromDOM(e,n,-1)}function mM(t,e,n){let r=t.childNodes.length;if(r&&n.tope.top&&i++}let u;bh&&i&&r.nodeType==1&&(u=r.childNodes[i-1]).nodeType==1&&u.contentEditable=="false"&&u.getBoundingClientRect().top>=e.top&&i--,r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(a=hz(t,r,i,e))}a==null&&(a=dz(t,s,e));let l=t.docView.nearestDesc(s,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function O6(t){return t.top=0&&i==r.nodeValue.length?(l--,c=1):n<0?l--:u++,af(_s(Ro(r,l,u),c),c<0)}if(!t.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==Xi(r))){let l=r.childNodes[i-1];if(l.nodeType==1)return Wy(l.getBoundingClientRect(),!1)}if(o==null&&i=0)}if(o==null&&i&&(n<0||i==Xi(r))){let l=r.childNodes[i-1],u=l.nodeType==3?Ro(l,Xi(l)-(s?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(u)return af(_s(u,1),!1)}if(o==null&&i=0)}function af(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function Wy(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function yM(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}function gz(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return yM(t,e,()=>{let{node:o}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(o,!0);if(!a)break;if(a.node.isBlock){o=a.contentDOM||a.dom;break}o=a.dom.parentNode}let s=gM(t,i.pos,1);for(let a=o.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=Ro(a,0,a.nodeValue.length).getClientRects();else continue;for(let u=0;uc.top+1&&(n=="up"?s.top-c.top>(c.bottom-s.top)*2:c.bottom-s.bottom>(s.bottom-c.top)*2))return!1}}return!0})}const yz=/[\u0590-\u08ac]/;function bz(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,a=t.domSelection();return!yz.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?o:s:yM(t,e,()=>{let{focusNode:l,focusOffset:u,anchorNode:c,anchorOffset:f}=t.domSelectionRange(),d=a.caretBidiLevel;a.modify("move",n,"character");let h=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:p,focusOffset:m}=t.domSelectionRange(),b=p&&!h.contains(p.nodeType==1?p:p.parentNode)||l==p&&u==m;try{a.collapse(c,f),l&&(l!=c||u!=f)&&a.extend&&a.extend(l,u)}catch{}return d!=null&&(a.caretBidiLevel=d),b})}let D6=null,N6=null,$6=!1;function vz(t,e,n){return D6==e&&N6==n?$6:(D6=e,N6=n,$6=n=="up"||n=="down"?gz(t,e,n):bz(t,e,n))}const ci=0,I6=1,Ga=2,vo=3;class vh{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=ci,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;nTn(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,i=e;i;i=i.parentNode){let o=this.getDesc(i),s;if(o&&(!n||o.node))if(r&&(s=o.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return o}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;ne||s instanceof vM){i=e-o;break}o=a}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof bM&&o.side>=0;r--);if(n<=0){let o,s=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,s=!1);return o&&n&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,n):{node:this.contentDOM,offset:o?Tn(o.dom)+1:0}}else{let o,s=!0;for(;o=r=c&&n<=u-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,c);e=s;for(let f=a;f>0;f--){let d=this.children[f-1];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(1)){i=Tn(d.dom)+1;break}e-=d.size}i==-1&&(i=0)}if(i>-1&&(u>n||a==this.children.length-1)){n=u;for(let c=a+1;ch&&sn){let h=a;a=l,l=h}let d=document.createRange();d.setEnd(l.node,l.offset),d.setStart(a.node,a.offset),u.removeAllRanges(),u.addRange(d)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,i=0;i=r:er){let a=r+o.border,l=s-o.border;if(e>=a&&n<=l){this.dirty=e==r||n==s?Ga:I6,e==a&&n==l&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=vo:o.markDirty(e-a,n-a);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?Ga:vo}r=s}this.dirty=Ga}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?Ga:I6;n.dirty{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!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(e,[],s,null),this.widget=n,this.widget=n,o=this}matchesWidget(e){return this.dirty==ci&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class wz extends vh{constructor(e,n,r,i){super(e,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class Ml extends vh{constructor(e,n,r,i){super(e,[],r,i),this.mark=n}static create(e,n,r,i){let o=i.nodeViews[n.type.name],s=o&&o(n,i,r);return(!s||!s.dom)&&(s=mh.renderSpec(document,n.type.spec.toDOM(n,r))),new Ml(e,n,s.dom,s.contentDOM||s.dom)}parseRule(){return this.dirty&vo||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=vo&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=ci){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty0&&(o=Hv(o,0,e,r));for(let a=0;a{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},r,i),c=u&&u.dom,f=u&&u.contentDOM;if(n.isText){if(!c)c=document.createTextNode(n.text);else if(c.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else c||({dom:c,contentDOM:f}=mh.renderSpec(document,n.type.spec.toDOM(n)));!f&&!n.isText&&c.nodeName!="BR"&&(c.hasAttribute("contenteditable")||(c.contentEditable="false"),n.type.spec.draggable&&(c.draggable=!0));let d=c;return c=xM(c,r,n),u?l=new kz(e,n,r,i,c,f||null,d,u,o,s+1):n.isText?new X1(e,n,r,i,c,d,o):new oa(e,n,r,i,c,f||null,d,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>oe.empty)}return e}matchesNode(e,n,r){return this.dirty==ci&&e.eq(this.node)&&Uv(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,i=n,o=e.composing?this.localCompositionInfo(e,n):null,s=o&&o.pos>-1?o:null,a=o&&o.pos<0,l=new Ez(this,s&&s.node,e);_z(this.node,this.innerDeco,(u,c,f)=>{u.spec.marks?l.syncToMarks(u.spec.marks,r,e):u.type.side>=0&&!f&&l.syncToMarks(c==this.node.childCount?ft.none:this.node.child(c).marks,r,e),l.placeWidget(u,e,i)},(u,c,f,d)=>{l.syncToMarks(u.marks,r,e);let h;l.findNodeMatch(u,c,f,d)||a&&e.state.selection.from>i&&e.state.selection.to-1&&l.updateNodeAt(u,c,f,h,e)||l.updateNextNode(u,c,f,e,d,i)||l.addNode(u,c,f,e,i),i+=u.nodeSize}),l.syncToMarks([],r,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==Ga)&&(s&&this.protectLocalComposition(e,s),wM(this.contentDOM,this.children,e),nc&&Az(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof He)||rn+this.node.content.size)return null;let o=e.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let s=o.nodeValue,a=Tz(this.node.content,s,r-n,i-n);return a<0?null:{node:o,pos:a,text:s}}else return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let o=n;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let s=new wz(this,o,n,i);e.input.compositionNodes.push(s),this.children=Hv(this.children,r,r+i.length,e,s)}update(e,n,r,i){return this.dirty==vo||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,i),!0)}updateInner(e,n,r,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=ci}updateOuterDeco(e){if(Uv(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=kM(this.dom,this.nodeDOM,Vv(this.outerDeco,this.node,n),Vv(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.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 R6(t,e,n,r,i){xM(r,e,t);let o=new oa(void 0,t,e,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class X1 extends oa{constructor(e,n,r,i,o,s,a){super(e,n,r,i,o,null,s,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,i){return this.dirty==vo||this.dirty!=ci&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=ci||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=ci,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let i=this.node.cut(e,n),o=document.createTextNode(i.text);return new X1(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=vo)}get domAtom(){return!1}isText(e){return this.node.text==e}}class vM extends vh{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==ci&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class kz extends oa{constructor(e,n,r,i,o,s,a,l,u,c){super(e,n,r,i,o,s,a,u,c),this.spec=l}update(e,n,r,i){if(this.dirty==vo)return!1;if(this.spec.update){let o=this.spec.update(e,n,r);return o&&this.updateInner(e,n,r,i),o}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,i){this.spec.setSelection?this.spec.setSelection(e,n,r):super.setSelection(e,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function wM(t,e,n){let r=t.firstChild,i=!1;for(let o=0;o>1,s=Math.min(o,e.length);for(;i-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=Ml.create(this.top,e[o],n,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,o++}}findNodeMatch(e,n,r,i){let o=-1,s;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,r))o=this.top.children.indexOf(s,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a0;){let a;for(;;)if(r){let u=n.children[r-1];if(u instanceof Ml)n=u,r=u.children.length;else{a=u,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(i-1))break;--i,o.set(a,i),s.push(a)}}return{index:i,matched:o,matches:s.reverse()}}function Cz(t,e){return t.type.side-e.type.side}function _z(t,e,n,r){let i=e.locals(t),o=0;if(i.length==0){for(let u=0;uo;)a.push(i[s++]);let p=o+d.nodeSize;if(d.isText){let b=p;s!b.inline):a.slice();r(d,m,e.forChild(o,d),h),o=p}}function Az(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function Tz(t,e,n,r){for(let i=0,o=0;i=n){if(o>=r&&l.slice(r-e.length-a,r-a)==e)return r-e.length;let u=a=0&&u+e.length+a>=n)return a+u;if(n==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}function Hv(t,e,n,r,i){let o=[];for(let s=0,a=0;s=n||c<=e?o.push(l):(un&&o.push(l.slice(n-u,l.size,r)))}return o}function Mx(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),o=i&&i.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a=r.resolve(s),l,u;if(Q1(n)){for(l=a;i&&!i.node;)i=i.parent;let c=i.node;if(i&&c.isAtom&&_e.isSelectable(c)&&i.parent&&!(c.isInline&&XP(n.focusNode,n.focusOffset,i.dom))){let f=i.posBefore;u=new _e(s==f?a:r.resolve(f))}}else{let c=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null;l=r.resolve(c)}if(!u){let c=e=="pointer"||t.state.selection.head{(n.anchorNode!=r||n.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!EM(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function Oz(t){let e=t.domSelection(),n=document.createRange(),r=t.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setEnd(r.parentNode,Tn(r)+1):n.setEnd(r,0),n.collapse(!1),e.removeAllRanges(),e.addRange(n),!i&&!t.state.selection.visible&&wr&&ia<=11&&(r.disabled=!0,r.disabled=!1)}function SM(t,e){if(e instanceof _e){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(z6(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else z6(t)}function z6(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Ox(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||He.between(e,n,r)}function j6(t){return t.editable&&!t.hasFocus()?!1:CM(t)}function CM(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function Dz(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return Tl(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Wv(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return o&&je.findFrom(o,e)}function Ms(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function q6(t,e,n){let r=t.state.selection;if(r instanceof He)if(n.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=t.state.doc.resolve(i.pos+o.nodeSize*(e<0?-1:1));return Ms(t,new He(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=Wv(t.state,e);return i&&i instanceof _e?Ms(t,i):!1}else if(!(ri&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return!1;let a=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=t.docView.descAt(a))&&!s.contentDOM?_e.isSelectable(o)?Ms(t,new _e(e<0?t.state.doc.resolve(i.pos-o.nodeSize):i)):bh?Ms(t,new He(t.state.doc.resolve(e<0?a:a+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof _e&&r.node.isInline)return Ms(t,new He(e>0?r.$to:r.$from));{let i=Wv(t.state,e);return i?Ms(t,i):!1}}}function rm(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function ed(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Kl(t,e){return e<0?Nz(t):$z(t)}function Nz(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,s=!1;for($i&&n.nodeType==1&&r0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(ed(a,-1))i=n,o=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(_M(n))break;{let a=n.previousSibling;for(;a&&ed(a,-1);)i=n.parentNode,o=Tn(a),a=a.previousSibling;if(a)n=a,r=rm(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?Jv(t,n,r):i&&Jv(t,i,o)}function $z(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=rm(n),o,s;for(;;)if(r{t.state==i&&Ho(t)},50)}function V6(t,e){let n=t.state.doc.resolve(e);if(!(Xn||rz)&&n.parent.inlineContent){let i=t.coordsAtPos(e);if(e>n.start()){let o=t.coordsAtPos(e-1),s=(o.top+o.bottom)/2;if(s>i.top&&s1)return o.lefti.top&&s1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function U6(t,e,n){let r=t.state.selection;if(r instanceof He&&!r.empty||n.indexOf("s")>-1||ri&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=Wv(t.state,e);if(s&&s instanceof _e)return Ms(t,s)}if(!i.parent.inlineContent){let s=e<0?i:o,a=r instanceof dl?je.near(s,e):je.findFrom(s,e);return a?Ms(t,a):!1}return!1}function H6(t,e){if(!(t.state.selection instanceof He))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let s=t.state.tr;return e<0?s.delete(n.pos-o.nodeSize,n.pos):s.delete(n.pos,n.pos+o.nodeSize),t.dispatch(s),!0}return!1}function W6(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function Fz(t){if(!sr||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;W6(t,r,"true"),setTimeout(()=>W6(t,r,"false"),20)}return!1}function Lz(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function Bz(t,e){let n=e.keyCode,r=Lz(e);if(n==8||ri&&n==72&&r=="c")return H6(t,-1)||Kl(t,-1);if(n==46&&!e.shiftKey||ri&&n==68&&r=="c")return H6(t,1)||Kl(t,1);if(n==13||n==27)return!0;if(n==37||ri&&n==66&&r=="c"){let i=n==37?V6(t,t.state.selection.from)=="ltr"?-1:1:-1;return q6(t,i,r)||Kl(t,i)}else if(n==39||ri&&n==70&&r=="c"){let i=n==39?V6(t,t.state.selection.from)=="ltr"?1:-1:1;return q6(t,i,r)||Kl(t,i)}else{if(n==38||ri&&n==80&&r=="c")return U6(t,-1,r)||Kl(t,-1);if(n==40||ri&&n==78&&r=="c")return Fz(t)||U6(t,1,r)||Kl(t,1);if(r==(ri?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function AM(t,e){t.someProp("transformCopied",h=>{e=h(e,t)});let n=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let h=r.firstChild;n.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),r=h.content}let s=t.someProp("clipboardSerializer")||mh.fromSchema(t.state.schema),a=$M(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let u=l.firstChild,c,f=0;for(;u&&u.nodeType==1&&(c=NM[u.nodeName.toLowerCase()]);){for(let h=c.length-1;h>=0;h--){let p=a.createElement(c[h]);for(;l.firstChild;)p.appendChild(l.firstChild);l.appendChild(p),f++}u=l.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${i} ${o}${f?` -${f}`:""} ${JSON.stringify(n)}`);let d=t.someProp("clipboardTextSerializer",h=>h(e,t))||e.content.textBetween(0,e.content.size,` + */var JB=ka("filled","brand-github-filled","IconBrandGithubFilled",[["path",{d:"M5.315 2.1c.791 -.113 1.9 .145 3.333 .966l.272 .161l.16 .1l.397 -.083a13.3 13.3 0 0 1 4.59 -.08l.456 .08l.396 .083l.161 -.1c1.385 -.84 2.487 -1.17 3.322 -1.148l.164 .008l.147 .017l.076 .014l.05 .011l.144 .047a1 1 0 0 1 .53 .514a5.2 5.2 0 0 1 .397 2.91l-.047 .267l-.046 .196l.123 .163c.574 .795 .93 1.728 1.03 2.707l.023 .295l.007 .272c0 3.855 -1.659 5.883 -4.644 6.68l-.245 .061l-.132 .029l.014 .161l.008 .157l.004 .365l-.002 .213l-.003 3.834a1 1 0 0 1 -.883 .993l-.117 .007h-6a1 1 0 0 1 -.993 -.883l-.007 -.117v-.734c-1.818 .26 -3.03 -.424 -4.11 -1.878l-.535 -.766c-.28 -.396 -.455 -.579 -.589 -.644l-.048 -.019a1 1 0 0 1 .564 -1.918c.642 .188 1.074 .568 1.57 1.239l.538 .769c.76 1.079 1.36 1.459 2.609 1.191l.001 -.678l-.018 -.168a5.03 5.03 0 0 1 -.021 -.824l.017 -.185l.019 -.12l-.108 -.024c-2.976 -.71 -4.703 -2.573 -4.875 -6.139l-.01 -.31l-.004 -.292a5.6 5.6 0 0 1 .908 -3.051l.152 -.222l.122 -.163l-.045 -.196a5.2 5.2 0 0 1 .145 -2.642l.1 -.282l.106 -.253a1 1 0 0 1 .529 -.514l.144 -.047l.154 -.03z",key:"svg-0"}]]);function En(t){this.content=t}En.prototype={constructor:En,find:function(t){for(var e=0;e>1}};En.from=function(t){if(t instanceof En)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new En(e)};function ET(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),o=e.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)n++;return n}if(i.content.size||o.content.size){let s=ET(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function ST(t,e,n,r){for(let i=t.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let s=t.child(--i),a=e.child(--o),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 u=0,c=Math.min(s.text.length,a.text.length);for(;ue&&r(l,i+a,o||null,s)!==!1&&l.content.size){let c=a+1;l.nodesBetween(Math.max(0,e-c),Math.min(l.content.size,n-c),r,i+c)}a=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let o="",s=!0;return this.nodesBetween(e,n,(a,l)=>{let u=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&u||a.isTextblock)&&r&&(s?s=!1:o+=r),o+=u},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);oe)for(let o=0,s=0;se&&((sn)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,n-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,n-s-1))),r.push(a),i+=a.nodeSize),s=l}return new Zn(r,i)}cutByIndex(e,n){return e==n?Zn.empty:e==0&&n==this.content.length?this:new Zn(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new Zn(i,o)}addToStart(e){return new Zn([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Zn(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;nthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),s=i+o.nodeSize;if(s>=e)return s==e||n>0?ap(r+1,s):ap(r,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return Zn.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new Zn(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Zn.empty;let n,r=0;for(let i=0;ithis.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;nr.type.rank-i.type.rank),n}};ft.none=[];let X0=class extends Error{},he=class iu{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=_T(this.content,e+this.openStart,n);return r&&new iu(r,this.openStart,this.openEnd)}removeBetween(e,n){return new iu(CT(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return iu.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new iu(oe.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new iu(e,r,i)}};he.empty=new he(oe.empty,0,0);function CT(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:s,offset:a}=t.findIndex(n);if(i==e||o.isText){if(a!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(CT(o.content,e-i-1,n-i-1)))}function _T(t,e,n,r){let{index:i,offset:o}=t.findIndex(e),s=t.maybeChild(i);if(o==e||s.isText)return t.cut(0,e).append(n).append(t.cut(e));let a=_T(s.content,e-o-1,n);return a&&t.replaceChild(i,s.copy(a))}function KB(t,e,n){if(n.openStart>t.depth)throw new X0("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new X0("Inconsistent open depths");return AT(t,e,n,0)}function AT(t,e,n,r){let i=t.index(r),o=t.node(r);if(i==e.index(r)&&r=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Yf(t,e,n,r){let i=(e||t).node(n),o=0,s=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(ul(t.nodeAfter,r),o++));for(let a=o;ai&&Ov(t,e,i+1),s=r.depth>i&&Ov(n,r,i+1),a=[];return Yf(null,t,i,a),o&&s&&e.index(i)==n.index(i)?(TT(o,s),ul(cl(o,MT(t,e,n,r,i+1)),a)):(o&&ul(cl(o,em(t,e,i+1)),a),Yf(e,n,i,a),s&&ul(cl(s,em(n,r,i+1)),a)),Yf(r,null,i,a),new oe(a)}function em(t,e,n){let r=[];if(Yf(null,t,n,r),t.depth>n){let i=Ov(t,e,n+1);ul(cl(i,em(t,e,n+1)),r)}return Yf(e,null,n,r),new oe(r)}function GB(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)i=e.node(o).copy(oe.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}let l6=class Dv{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new tm(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let s=e;;){let{index:a,offset:l}=s.content.findIndex(o),u=o-l;if(r.push(s,a,i+l),!u||(s=s.child(a),s.isText))break;o=u-1,i+=l+1}return new Dv(n,r,o)}static resolveCached(e,n){let r=u6.get(e);if(r)for(let o=0;oe&&this.nodesBetween(e,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),OT(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=oe.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),a=s&&s.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=i;ln.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=oe.fromJSON(e,n.content),o=e.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};fl.prototype.text=void 0;let XB=class $v extends fl{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):OT(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new $v(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new $v(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function OT(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}let Nd=class DT{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new eP(e,n);if(r.next==null)return DT.empty;let i=NT(r);r.next&&r.err("Unexpected trailing text");let o=aP(sP(i));return lP(o,r),o}matchType(e){for(let n=0;nu.createAndFill()));for(let u=0;u=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s"+e.indexOf(r.next[s].next);return o}).join(` +`)}};Nd.empty=new Nd(!0);let eP=class{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}};function NT(t){let e=[];do e.push(tP(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function tP(t){let e=[];do e.push(nP(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function nP(t){let e=oP(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=rP(t,e);else break;return e}function c6(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function rP(t,e){let n=c6(t),r=n;return t.eat(",")&&(t.next!="}"?r=c6(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function iP(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let o in n){let s=n[o];s.groups.indexOf(e)>-1&&i.push(s)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function oP(t){if(t.eat("(")){let e=NT(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=iP(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function sP(t){let e=[[]];return i(o(t,0),n()),e;function n(){return e.push([])-1}function r(s,a,l){let u={term:l,to:a};return e[s].push(u),u}function i(s,a){s.forEach(l=>l.to=a)}function o(s,a){if(s.type=="choice")return s.exprs.reduce((l,u)=>l.concat(o(u,a)),[]);if(s.type=="seq")for(let l=0;;l++){let u=o(s.exprs[l],a);if(l==s.exprs.length-1)return u;i(u,a=n())}else if(s.type=="star"){let l=n();return r(a,l),i(o(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=n();return i(o(s.expr,a),l),i(o(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(a)].concat(o(s.expr,a));if(s.type=="range"){let l=a;for(let u=0;u{t[s].forEach(({term:a,to:l})=>{if(!a)return;let u;for(let c=0;c{u||i.push([a,u=[]]),u.indexOf(c)==-1&&u.push(c)})})});let o=e[r.join(",")]=new Nd(r.indexOf(t.length-1)>-1);for(let s=0;s-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;nr[o]=new BT(o,n,s));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function uP(t){let e=t.split("|");return n=>{let r=n===null?"null":typeof n;if(e.indexOf(r)<0)throw new RangeError(`Expected value of type ${e}, got ${r}`)}}let cP=class{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default,this.validate=typeof e.validate=="string"?uP(e.validate):e.validate}get isRequired(){return!this.hasDefault}},PT=class zT{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=LT(i.attrs),this.excluded=null;let o=IT(this.attrs);this.instance=o?new ft(this,o):null}create(e=null){return!e&&this.instance?this.instance:new ft(this,RT(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new zT(o,i++,n,s)),r}removeFromSet(e){for(var n=0;n-1}},jT=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=En.from(e.nodes),n.marks=En.from(e.marks||{}),this.nodes=d6.compile(this.spec.nodes,this),this.marks=PT.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],s=o.spec.content||"",a=o.spec.marks;if(o.contentMatch=r[s]||(r[s]=Nd.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=a=="_"?null:a?h6(this,a.split(" ")):a==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:h6(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(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof d6){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,i)}text(e,n){let r=this.nodes.text;return new XB(r,r.defaultAttrs,e,ft.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return fl.fromJSON(this,e)}markFromJSON(e){return ft.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}};function h6(t,e){let n=[];for(let r=0;r-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function fP(t){return t.tag!=null}function dP(t){return t.style!=null}let xx=class Iv{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(fP(i))this.tags.push(i);else if(dP(i)){let o=/[^=]*/.exec(i.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let o=e.nodes[i.node];return o.contentMatch.matchType(o)})}parse(e,n={}){let r=new m6(this,n,!1);return r.addAll(e,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new m6(this,n,!0);return r.addAll(e,n.from,n.to),he.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;ie.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(s.getAttrs){let l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let n=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s{r(s=g6(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=g6(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Iv(e,Iv.schemaRules(e)))}};const qT={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},hP={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},UT={ol:!0,ul:!0},nm=1,rm=2,Qf=4;function p6(t,e,n){return e!=null?(e?nm:0)|(e==="full"?rm:0):t&&t.whitespace=="pre"?nm|rm:n&~Qf}let lp=class{constructor(e,n,r,i,o,s,a){this.type=e,this.attrs=n,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=a,this.content=[],this.activeMarks=ft.none,this.stashMarks=[],this.match=s||(a&Qf?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(oe.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&nm)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=oe.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(oe.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}popFromStashMark(e){for(let n=this.stashMarks.length-1;n>=0;n--)if(e.eq(this.stashMarks[n]))return this.stashMarks.splice(n,1)[0]}applyPending(e){for(let n=0,r=this.pendingMarks;nthis.addAll(e)),s&&this.sync(a),this.needsBlock=l}else this.withStyleRules(e,()=>{this.addElementByRule(e,o,o.consuming===!1?i:void 0)})}leafFallback(e){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(` +`))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let n=ft.none,r=ft.none;if(e.length)for(let i=0;i{l.clearMark(u)&&(r=u.addToSet(r))}):n=this.parser.schema.marks[l.mark].create(l.attrs).addToSet(n),l.consuming===!1)a=l;else break}}return[n,r]}addElementByRule(e,n,r){let i,o,s;n.node?(o=this.parser.schema.nodes[n.node],o.isLeaf?this.insertNode(o.create(n.attrs))||this.leafFallback(e):i=this.enter(o,n.attrs||null,n.preserveWhitespace)):(s=this.parser.schema.marks[n.mark].create(n.attrs),this.addPendingMark(s));let a=this.top;if(o&&o.isLeaf)this.findInside(e);else if(r)this.addElement(e,r);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l)}i&&this.sync(a)&&this.open--,s&&this.removePendingMark(s,a)}addAll(e,n,r){let i=n||0;for(let o=n?e.childNodes[n]:e.firstChild,s=r==null?null:e.childNodes[r];o!=s;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o);this.findAtPoint(e,i)}findPlace(e){let n,r;for(let i=this.open;i>=0;i--){let o=this.nodes[i],s=o.findWrapping(e);if(s&&(!n||n.length>s.length)&&(n=s,r=o,!s.length)||o.solid)break}if(!n)return!1;this.sync(r);for(let i=0;ithis.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let n=this.open;n>=0;n--)if(this.nodes[n]==e)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(a,l)=>{for(;a>=0;a--){let u=n[a];if(u==""){if(a==n.length-1||a==0)continue;for(;l>=o;l--)if(s(a-1,l))return!0;return!1}else{let c=l>0||l==0&&i?this.nodes[l].type:r&&l>=o?r.node(l-o).type:null;if(!c||c.name!=u&&c.groups.indexOf(u)==-1)return!1;l--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(e){let n=yP(e,this.top.pendingMarks);n&&this.top.stashMarks.push(n),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,n){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let s=i.popFromStashMark(e);s&&i.type&&i.type.allowsMarkType(s.type)&&(i.activeMarks=s.addToSet(i.activeMarks))}if(i==n)break}}};function pP(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&UT.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function mP(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function g6(t){let e={};for(let n in t)e[n]=t[n];return e}function gP(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],s=a=>{o.push(a);for(let l=0;l{if(o.length||s.marks.length){let a=0,l=0;for(;a=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&o0(Py(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null){return o0(e,n,r)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new VT(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=y6(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return y6(e.marks)}};function y6(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Py(t){return t.document||window.document}const b6=new WeakMap;function bP(t){let e=b6.get(t);return e===void 0&&b6.set(t,e=vP(t)),e}function vP(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=i.indexOf(" ");s>0&&(n=i.slice(0,s),i=i.slice(s+1));let a,l=n?t.createElementNS(n,i):t.createElement(i),u=e[1],c=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){c=2;for(let f in u)if(u[f]!=null){let d=f.indexOf(" ");d>0?l.setAttributeNS(f.slice(0,d),f.slice(d+1),u[f]):l.setAttribute(f,u[f])}}for(let f=c;fc)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:h,contentDOM:p}=o0(t,d,n,r);if(l.appendChild(h),p){if(a)throw new RangeError("Multiple content holes");a=p}}}return{dom:l,contentDOM:a}}const HT=65535,WT=Math.pow(2,16);function wP(t,e){return t+e*WT}function v6(t){return t&HT}function kP(t){return(t-(t&HT))/WT}const JT=1,KT=2,s0=4,GT=8;let Rv=class{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo>)>0}get deletedBefore(){return(this.delInfo&(JT|s0))>0}get deletedAfter(){return(this.delInfo&(KT|s0))>0}get deletedAcross(){return(this.delInfo&s0)>0}},Al=class ou{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&ou.empty)return ou.empty}recover(e){let n=0,r=v6(e);if(!this.inverted)for(let i=0;ie)break;let u=this.ranges[a+o],c=this.ranges[a+s],f=l+u;if(e<=f){let d=u?e==l?-1:e==f?1:n:n,h=l+i+(d<0?0:c);if(r)return h;let p=e==(n<0?l:f)?null:wP(a/3,e-l),m=e==l?KT:e==f?JT:s0;return(n<0?e!=l:e!=f)&&(m|=GT),new Rv(h,m,p)}i+=c-u}return r?e+i:new Rv(e+i,0,null)}touches(e,n){let r=0,i=v6(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;ae)break;let u=this.ranges[a+o],c=l+u;if(e<=c&&a==i*3)return!0;r+=this.ranges[a+s]-u}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i=0;n--){let i=e.getMirror(n);this.appendMap(e.maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new a0;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;ro&&l!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return Xn.fromReplace(e,this.from,this.to,o)}invert(){return new yh(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new xf(n.pos,r.pos,this.mark)}merge(e){return e instanceof xf&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new xf(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new xf(n.from,n.to,e.markFromJSON(n.mark))}};Jn.jsonID("addMark",Sx);let yh=class Ef extends Jn{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new he(Ex(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return Xn.fromReplace(e,this.from,this.to,r)}invert(){return new Sx(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Ef(n.pos,r.pos,this.mark)}merge(e){return e instanceof Ef&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ef(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Ef(n.from,n.to,e.markFromJSON(n.mark))}};Jn.jsonID("removeMark",yh);let Cx=class Sf extends Jn{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Xn.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Xn.fromReplace(e,this.pos,this.pos+1,new he(oe.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;ir.pos?null:new l0(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new l0(n.from,n.to,n.gapFrom,n.gapTo,he.fromJSON(e,n.slice),n.insert,!!n.structure)}};Jn.jsonID("replaceAround",_r);function Lv(t,e,n){let r=t.resolve(e),i=n-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function xP(t,e,n,r){let i=[],o=[],s,a;t.doc.nodesBetween(e,n,(l,u,c)=>{if(!l.isInline)return;let f=l.marks;if(!r.isInSet(f)&&c.type.allowsMarkType(r.type)){let d=Math.max(u,e),h=Math.min(u+l.nodeSize,n),p=r.addToSet(f);for(let m=0;mt.step(l)),o.forEach(l=>t.step(l))}function EP(t,e,n,r){let i=[],o=0;t.doc.nodesBetween(e,n,(s,a)=>{if(!s.isInline)return;o++;let l=null;if(r instanceof PT){let u=s.marks,c;for(;c=r.isInSet(u);)(l||(l=[])).push(c),u=c.removeFromSet(u)}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let u=Math.min(a+s.nodeSize,n);for(let c=0;ct.step(new yh(s.from,s.to,s.style)))}function YT(t,e,n,r=n.contentMatch,i=!0){let o=t.doc.nodeAt(e),s=[],a=e+1;for(let l=0;l=0;l--)t.step(s[l])}function SP(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Nc(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let i=t.$from.node(r),o=t.$from.index(r),s=t.$to.indexAfter(r);if(rn;p--)m||r.index(p)>0?(m=!0,c=oe.from(r.node(p).copy(c)),f++):l--;let d=oe.empty,h=0;for(let p=o,m=!1;p>n;p--)m||i.after(p+1)=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=oe.from(n[s].type.create(n[s].attrs,r))}let i=e.start,o=e.end;t.step(new _r(i,o,i,o,new he(r,0,0),n.length,!0))}function MP(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,n,(s,a)=>{if(s.isTextblock&&!s.hasMarkup(r,i)&&NP(t.doc,t.mapping.slice(o).map(a),r)){let l=null;if(r.schema.linebreakReplacement){let d=r.whitespace=="pre",h=!!r.contentMatch.matchType(r.schema.linebreakReplacement);d&&!h?l=!1:!d&&h&&(l=!0)}l===!1&&DP(t,s,a,o),YT(t,t.mapping.slice(o).map(a,1),r,void 0,l===null);let u=t.mapping.slice(o),c=u.map(a,1),f=u.map(a+s.nodeSize,1);return t.step(new _r(c,f,c+1,f-1,new he(oe.from(r.create(i,null,s.marks)),0,0),1,!0)),l===!0&&OP(t,s,a,o),!1}})}function OP(t,e,n,r){e.forEach((i,o)=>{if(i.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(i.text);){let l=t.mapping.slice(r).map(n+1+o+s.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function DP(t,e,n,r){e.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+o);t.replaceWith(s,s+1,e.type.schema.text(` +`))}})}function NP(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function $P(t,e,n,r,i){let o=t.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return t.replaceWith(e,e+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new _r(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new he(oe.from(s),0,0),1,!0))}function Lu(t,e,n=1,r){let i=t.resolve(e),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let u=i.depth-1,c=n-2;u>o;u--,c--){let f=i.node(u),d=i.index(u);if(f.type.spec.isolating)return!1;let h=f.content.cutByIndex(d,f.childCount),p=r&&r[c+1];p&&(h=h.replaceChild(0,p.type.create(p.attrs)));let m=r&&r[c]||f;if(!f.canReplace(d+1,f.childCount)||!m.type.validContent(h))return!1}let a=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type)}function IP(t,e,n=1,r){let i=t.doc.resolve(e),o=oe.empty,s=oe.empty;for(let a=i.depth,l=i.depth-n,u=n-1;a>l;a--,u--){o=oe.from(i.node(a).copy(o));let c=r&&r[u];s=oe.from(c?c.type.create(c.attrs,s):i.node(a).copy(s))}t.step(new Ni(e,e,new he(o.append(s),n,n),!0))}function xa(t,e){let n=t.resolve(e),r=n.index();return QT(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function QT(t,e){return!!(t&&e&&!t.isLeaf&&t.canAppend(e))}function Z1(t,e,n=-1){let r=t.resolve(e);for(let i=r.depth;;i--){let o,s,a=r.index(i);if(i==r.depth?(o=r.nodeBefore,s=r.nodeAfter):n>0?(o=r.node(i+1),a++,s=r.node(i).maybeChild(a)):(o=r.node(i).maybeChild(a-1),s=r.node(i+1)),o&&!o.isTextblock&&QT(o,s)&&r.node(i).canReplace(a,a+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}function RP(t,e,n){let r=new Ni(e-n,e+n,he.empty,!0);t.step(r)}function FP(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o=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),u=r.node(s),c=!1;if(o==1)c=u.canReplace(l,l,i);else{let f=u.contentMatchAt(l).findWrapping(i.firstChild.type);c=f&&u.canReplaceWith(l,l,f[0])}if(c)return a==0?r.pos:a<0?r.before(s+1):r.after(s+1)}return null}function Y1(t,e,n=e,r=he.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),o=t.resolve(n);return eM(i,o,r)?new Ni(e,n,r):new LP(i,o,r).fit()}function eM(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}let LP=class{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=oe.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=oe.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,a=i.depth;for(;s&&a&&o.childCount==1;)o=o.firstChild.content,s--,a--;let l=new he(o,s,a);return e>-1?new _r(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new Ni(r.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=jy(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:u}=this.frontier[a],c,f=null;if(n==1&&(s?u.matchType(s.type)||(f=u.fillBefore(oe.from(s),!1)):o&&l.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:a,parent:o,inject:f};if(n==2&&s&&(c=u.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:o,wrap:c};if(o&&u.matchType(o.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=jy(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new he(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=jy(e,n);if(i.childCount<=1&&n>0){let o=e.size-n<=n+i.size;this.unplaced=new he(Cf(e,n-1,1),n-1,o?n-1:r)}else this.unplaced=new he(Cf(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let m=0;m1||l==0||m.content.size)&&(f=b,c.push(tM(m.mark(d.allowedMarks(m.marks)),u==1?l:0,u==a.childCount?h:-1)))}let p=u==a.childCount;p||(h=-1),this.placed=_f(this.placed,n,oe.from(c)),this.frontier[n].match=f,p&&h<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,b=a;m1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n=0;a--){let{match:l,type:u}=this.frontier[a],c=qy(e,a,u,l,!0);if(!c||c.childCount)continue e}return{depth:n,fit:s,move:o?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=_f(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=_f(this.placed,this.depth,oe.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(oe.empty,!0);n.childCount&&(this.placed=_f(this.placed,this.frontier.length,n))}};function Cf(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Cf(t.firstChild.content,e-1,n)))}function _f(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(_f(t.lastChild.content,e-1,n)))}function jy(t,e){for(let n=0;n1&&(r=r.replaceChild(0,tM(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(oe.empty,!0)))),t.copy(r)}function qy(t,e,n,r,i){let o=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!BP(n,o.content,s)?a:null}function BP(t,e,n){for(let r=n;r0;d--,h--){let p=i.node(d).type.spec;if(p.defining||p.definingAsContext||p.isolating)break;s.indexOf(d)>-1?a=d:i.before(d)==h&&s.splice(1,0,-d)}let l=s.indexOf(a),u=[],c=r.openStart;for(let d=r.content,h=0;;h++){let p=d.firstChild;if(u.push(p),h==r.openStart)break;d=p.content}for(let d=c-1;d>=0;d--){let h=u[d],p=PP(h.type);if(p&&!h.sameMarkup(i.node(Math.abs(a)-1)))c=d;else if(p||!h.type.isTextblock)break}for(let d=r.openStart;d>=0;d--){let h=(d+c+1)%(r.openStart+1),p=u[h];if(p)for(let m=0;m=0&&(t.replace(e,n,r),!(t.steps.length>f));d--){let h=s[d];h<0||(e=i.before(h),n=o.after(h))}}function nM(t,e,n,r,i){if(er){let o=i.contentMatchAt(0),s=o.fillBefore(t).append(t);t=s.append(o.matchFragment(s).fillBefore(oe.empty,!0))}return t}function jP(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=FP(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new he(oe.from(r),0,0))}function qP(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),o=rM(r,i);for(let s=0;s0&&(l||r.node(a-1).canReplace(r.index(a-1),i.indexAfter(a-1))))return t.delete(r.before(a),i.after(a))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s)return t.delete(r.before(s),n);t.delete(e,n)}function rM(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let o=t.start(i);if(oe.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&n.push(i)}return n}let iM=class u0 extends Jn{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return Xn.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Xn.fromReplace(e,this.pos,this.pos+1,new he(oe.from(i),0,n.isLeaf?0:1))}getMap(){return Al.empty}invert(e){return new u0(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new u0(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new u0(n.pos,n.attr,n.value)}};Jn.jsonID("attr",iM);let oM=class Bv extends Jn{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return Xn.ok(r)}getMap(){return Al.empty}invert(e){return new Bv(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Bv(n.attr,n.value)}};Jn.jsonID("docAttr",oM);let tc=class extends Error{};tc=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};tc.prototype=Object.create(Error.prototype);tc.prototype.constructor=tc;tc.prototype.name="TransformError";let UP=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new ZT}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new tc(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=he.empty){let i=Y1(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new he(oe.from(r),0,0))}delete(e,n){return this.replace(e,n,he.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return zP(this,e,n,r),this}replaceRangeWith(e,n,r){return jP(this,e,n,r),this}deleteRange(e,n){return qP(this,e,n),this}lift(e,n){return CP(this,e,n),this}join(e,n=1){return RP(this,e,n),this}wrap(e,n){return TP(this,e,n),this}setBlockType(e,n=e,r,i=null){return MP(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return $P(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new iM(e,n,r)),this}setDocAttribute(e,n){return this.step(new oM(e,n)),this}addNodeMark(e,n){return this.step(new Cx(e,n)),this}removeNodeMark(e,n){if(!(n instanceof ft)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new _x(e,n)),this}split(e,n=1,r){return IP(this,e,n,r),this}addMark(e,n,r){return xP(this,e,n,r),this}removeMark(e,n,r){return EP(this,e,n,r),this}clearIncompatible(e,n,r){return YT(this,e,n,r),this}};const Uy=Object.create(null);let je=class{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new VP(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n=0;o--){let s=n<0?su(e.node(0),e.node(o),e.before(o+1),e.index(o),n,r):su(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,n,r);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new dl(e.node(0))}static atStart(e){return su(e,e,0,0,1)||new dl(e)}static atEnd(e){return su(e,e,e.content.size,e.childCount,-1)||new dl(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Uy[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Uy)throw new RangeError("Duplicate use of selection JSON ID "+e);return Uy[e]=n,n.prototype.jsonID=e,n}getBookmark(){return He.between(this.$anchor,this.$head).getBookmark()}};je.prototype.visible=!0;let VP=class{constructor(e,n){this.$from=e,this.$to=n}},k6=!1;function x6(t){!k6&&!t.parent.inlineContent&&(k6=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}let He=class Af extends je{constructor(e,n=e){x6(e),x6(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return je.near(r);let i=e.resolve(n.map(this.anchor));return new Af(i.parent.inlineContent?i:r,r)}replace(e,n=he.empty){if(super.replace(e,n),n==he.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof Af&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new sM(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Af(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=je.findFrom(n,r,!0)||je.findFrom(n,-r,!0);if(o)n=o.$head;else return je.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(je.findFrom(e,-r,!0)||je.findFrom(e,r,!0)).$anchor,e.pos0?0:1);i>0?s=0;s+=i){let a=e.child(s);if(a.isAtom){if(!o&&_e.isSelectable(a))return _e.create(t,n-(i<0?a.nodeSize:0))}else{let l=su(t,a,n+i,i<0?a.childCount:0,i,o);if(l)return l}n+=a.nodeSize*i}return null}function E6(t,e,n){let r=t.steps.length-1;if(r{s==null&&(s=c)}),t.setSelection(je.near(t.doc.resolve(s),n))}const S6=1,up=2,C6=4;class JP extends UP{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(e){return this.storedMarks=e,this.updated|=up,this}ensureMarks(e){return ft.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&up)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~up,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||ft.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(n);o=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(e,o)),this.selection.empty||this.setSelection(je.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=C6,this}get scrolledIntoView(){return(this.updated&C6)>0}}function _6(t,e){return!e||!t?t:t.bind(e)}let Mf=class{constructor(e,n,r){this.name=e,this.init=_6(n.init,r),this.apply=_6(n.apply,r)}};const KP=[new Mf("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Mf("selection",{init(t,e){return t.selection||je.atStart(e.doc)},apply(t){return t.selection}}),new Mf("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Mf("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class Vy{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=KP.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 Mf(r.key,r.spec.state,r))})}}class _u{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;rr.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],o=i.spec.state;o&&o.toJSON&&(n[r]=o.toJSON.call(i,this[i.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new Vy(e.schema,e.plugins),o=new _u(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=fl.fromJSON(e.schema,n.doc);else if(s.name=="selection")o.selection=je.fromJSON(o.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],u=l.spec.state;if(l.key==s.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){o[s.name]=u.fromJSON.call(l,e,n[a],o);return}}o[s.name]=s.init(e,o)}}),o}}function uM(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=uM(i,e,{})),n[r]=i}return n}let Kr=class{constructor(e){this.spec=e,this.props={},e.props&&uM(e.props,this,this.props),this.key=e.key?e.key.key:cM("plugin")}getState(e){return e[this.key]}};const Hy=Object.create(null);function cM(t){return t in Hy?t+"$"+ ++Hy[t]:(Hy[t]=0,t+"$")}let xo=class{constructor(e="key"){this.key=cM(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}};const Tn=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},$d=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let Pv=null;const Ro=function(t,e,n){let r=Pv||(Pv=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},GP=function(){Pv=null},Tl=function(t,e,n,r){return n&&(A6(t,e,n,r,-1)||A6(t,e,n,r,1))},ZP=/^(img|br|input|textarea|hr)$/i;function A6(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:Xi(t))){let o=t.parentNode;if(!o||o.nodeType!=1||bh(t)||ZP.test(t.nodeName)||t.contentEditable=="false")return!1;e=Tn(t)+(i<0?0:1),t=o}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.contentEditable=="false")return!1;e=i<0?Xi(t):0}else return!1}}function Xi(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function YP(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=Xi(t)}else if(t.parentNode&&!bh(t))e=Tn(t),t=t.parentNode;else return null}}function QP(t,e){for(;;){if(t.nodeType==3&&e2),ri=nc||(bo?/Mac/.test(bo.platform):!1),rz=bo?/Win/.test(bo.platform):!1,Si=/Android \d/.test(Ea),vh=!!T6&&"webkitFontSmoothing"in T6.documentElement.style,iz=vh?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function oz(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Do(t,e){return typeof t=="number"?t:t[e]}function sz(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function M6(t,e,n){let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,o=t.dom.ownerDocument;for(let s=n||t.dom;s;s=$d(s)){if(s.nodeType!=1)continue;let a=s,l=a==o.body,u=l?oz(o):sz(a),c=0,f=0;if(e.topu.bottom-Do(r,"bottom")&&(f=e.bottom-e.top>u.bottom-u.top?e.top+Do(i,"top")-u.top:e.bottom-u.bottom+Do(i,"bottom")),e.leftu.right-Do(r,"right")&&(c=e.right-u.right+Do(i,"right")),c||f)if(l)o.defaultView.scrollBy(c,f);else{let d=a.scrollLeft,h=a.scrollTop;f&&(a.scrollTop+=f),c&&(a.scrollLeft+=c);let p=a.scrollLeft-d,m=a.scrollTop-h;e={left:e.left-p,top:e.top-m,right:e.right-p,bottom:e.bottom-m}}if(l||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function az(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let o=(e.left+e.right)/2,s=n+1;s=n-20){r=a,i=l.top;break}}return{refDOM:r,refTop:i,stack:dM(t.dom)}}function dM(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=$d(r));return e}function lz({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;hM(n,r==0?0:r-e)}function hM(t,e){for(let n=0;n=a){s=Math.max(p.bottom,s),a=Math.min(p.top,a);let m=p.left>e.left?p.left-e.left:p.right=(p.left+p.right)/2?1:0));continue}}else p.top>e.top&&!l&&p.left<=e.left&&p.right>=e.left&&(l=c,u={left:Math.max(p.left,Math.min(p.right,e.left)),top:p.top});!n&&(e.left>=p.right&&e.top>=p.top||e.left>=p.left&&e.top>=p.bottom)&&(o=f+1)}}return!n&&l&&(n=l,i=u,r=0),n&&n.nodeType==3?cz(n,i):!n||r&&n.nodeType==1?{node:t,offset:o}:pM(n,i)}function cz(t,e){let n=t.nodeValue.length,r=document.createRange();for(let i=0;i=(o.left+o.right)/2?1:0)}}return{node:t,offset:0}}function Tx(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function fz(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(r,i,o)}function hz(t,e,n,r){let i=-1;for(let o=e,s=!1;o!=t.dom;){let a=t.docView.nearestDesc(o,!0);if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)){let l=a.dom.getBoundingClientRect();if(a.node.isBlock&&a.parent&&(!s&&l.left>r.left||l.top>r.top?i=a.posBefore:(!s&&l.right-1?i:t.docView.posFromDOM(e,n,-1)}function mM(t,e,n){let r=t.childNodes.length;if(r&&n.tope.top&&i++}let u;vh&&i&&r.nodeType==1&&(u=r.childNodes[i-1]).nodeType==1&&u.contentEditable=="false"&&u.getBoundingClientRect().top>=e.top&&i--,r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(a=hz(t,r,i,e))}a==null&&(a=dz(t,s,e));let l=t.docView.nearestDesc(s,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function O6(t){return t.top=0&&i==r.nodeValue.length?(l--,c=1):n<0?l--:u++,af(_s(Ro(r,l,u),c),c<0)}if(!t.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==Xi(r))){let l=r.childNodes[i-1];if(l.nodeType==1)return Wy(l.getBoundingClientRect(),!1)}if(o==null&&i=0)}if(o==null&&i&&(n<0||i==Xi(r))){let l=r.childNodes[i-1],u=l.nodeType==3?Ro(l,Xi(l)-(s?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(u)return af(_s(u,1),!1)}if(o==null&&i=0)}function af(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function Wy(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function yM(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}function gz(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return yM(t,e,()=>{let{node:o}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(o,!0);if(!a)break;if(a.node.isBlock){o=a.contentDOM||a.dom;break}o=a.dom.parentNode}let s=gM(t,i.pos,1);for(let a=o.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=Ro(a,0,a.nodeValue.length).getClientRects();else continue;for(let u=0;uc.top+1&&(n=="up"?s.top-c.top>(c.bottom-s.top)*2:c.bottom-s.bottom>(s.bottom-c.top)*2))return!1}}return!0})}const yz=/[\u0590-\u08ac]/;function bz(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,a=t.domSelection();return!yz.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?o:s:yM(t,e,()=>{let{focusNode:l,focusOffset:u,anchorNode:c,anchorOffset:f}=t.domSelectionRange(),d=a.caretBidiLevel;a.modify("move",n,"character");let h=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:p,focusOffset:m}=t.domSelectionRange(),b=p&&!h.contains(p.nodeType==1?p:p.parentNode)||l==p&&u==m;try{a.collapse(c,f),l&&(l!=c||u!=f)&&a.extend&&a.extend(l,u)}catch{}return d!=null&&(a.caretBidiLevel=d),b})}let D6=null,N6=null,$6=!1;function vz(t,e,n){return D6==e&&N6==n?$6:(D6=e,N6=n,$6=n=="up"||n=="down"?gz(t,e,n):bz(t,e,n))}const ci=0,I6=1,Ga=2,vo=3;class wh{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=ci,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;nTn(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,i=e;i;i=i.parentNode){let o=this.getDesc(i),s;if(o&&(!n||o.node))if(r&&(s=o.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return o}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;ne||s instanceof vM){i=e-o;break}o=a}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof bM&&o.side>=0;r--);if(n<=0){let o,s=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,s=!1);return o&&n&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,n):{node:this.contentDOM,offset:o?Tn(o.dom)+1:0}}else{let o,s=!0;for(;o=r=c&&n<=u-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,c);e=s;for(let f=a;f>0;f--){let d=this.children[f-1];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(1)){i=Tn(d.dom)+1;break}e-=d.size}i==-1&&(i=0)}if(i>-1&&(u>n||a==this.children.length-1)){n=u;for(let c=a+1;ch&&sn){let h=a;a=l,l=h}let d=document.createRange();d.setEnd(l.node,l.offset),d.setStart(a.node,a.offset),u.removeAllRanges(),u.addRange(d)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,i=0;i=r:er){let a=r+o.border,l=s-o.border;if(e>=a&&n<=l){this.dirty=e==r||n==s?Ga:I6,e==a&&n==l&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=vo:o.markDirty(e-a,n-a);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?Ga:vo}r=s}this.dirty=Ga}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?Ga:I6;n.dirty{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!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(e,[],s,null),this.widget=n,this.widget=n,o=this}matchesWidget(e){return this.dirty==ci&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class wz extends wh{constructor(e,n,r,i){super(e,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class Ml extends wh{constructor(e,n,r,i){super(e,[],r,i),this.mark=n}static create(e,n,r,i){let o=i.nodeViews[n.type.name],s=o&&o(n,i,r);return(!s||!s.dom)&&(s=gh.renderSpec(document,n.type.spec.toDOM(n,r))),new Ml(e,n,s.dom,s.contentDOM||s.dom)}parseRule(){return this.dirty&vo||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=vo&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=ci){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty0&&(o=Hv(o,0,e,r));for(let a=0;a{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},r,i),c=u&&u.dom,f=u&&u.contentDOM;if(n.isText){if(!c)c=document.createTextNode(n.text);else if(c.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else c||({dom:c,contentDOM:f}=gh.renderSpec(document,n.type.spec.toDOM(n)));!f&&!n.isText&&c.nodeName!="BR"&&(c.hasAttribute("contenteditable")||(c.contentEditable="false"),n.type.spec.draggable&&(c.draggable=!0));let d=c;return c=xM(c,r,n),u?l=new kz(e,n,r,i,c,f||null,d,u,o,s+1):n.isText?new X1(e,n,r,i,c,d,o):new oa(e,n,r,i,c,f||null,d,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>oe.empty)}return e}matchesNode(e,n,r){return this.dirty==ci&&e.eq(this.node)&&Vv(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,i=n,o=e.composing?this.localCompositionInfo(e,n):null,s=o&&o.pos>-1?o:null,a=o&&o.pos<0,l=new Ez(this,s&&s.node,e);_z(this.node,this.innerDeco,(u,c,f)=>{u.spec.marks?l.syncToMarks(u.spec.marks,r,e):u.type.side>=0&&!f&&l.syncToMarks(c==this.node.childCount?ft.none:this.node.child(c).marks,r,e),l.placeWidget(u,e,i)},(u,c,f,d)=>{l.syncToMarks(u.marks,r,e);let h;l.findNodeMatch(u,c,f,d)||a&&e.state.selection.from>i&&e.state.selection.to-1&&l.updateNodeAt(u,c,f,h,e)||l.updateNextNode(u,c,f,e,d,i)||l.addNode(u,c,f,e,i),i+=u.nodeSize}),l.syncToMarks([],r,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==Ga)&&(s&&this.protectLocalComposition(e,s),wM(this.contentDOM,this.children,e),nc&&Az(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof He)||rn+this.node.content.size)return null;let o=e.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let s=o.nodeValue,a=Tz(this.node.content,s,r-n,i-n);return a<0?null:{node:o,pos:a,text:s}}else return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let o=n;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let s=new wz(this,o,n,i);e.input.compositionNodes.push(s),this.children=Hv(this.children,r,r+i.length,e,s)}update(e,n,r,i){return this.dirty==vo||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,i),!0)}updateInner(e,n,r,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=ci}updateOuterDeco(e){if(Vv(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=kM(this.dom,this.nodeDOM,Uv(this.outerDeco,this.node,n),Uv(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.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 R6(t,e,n,r,i){xM(r,e,t);let o=new oa(void 0,t,e,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class X1 extends oa{constructor(e,n,r,i,o,s,a){super(e,n,r,i,o,null,s,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,i){return this.dirty==vo||this.dirty!=ci&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=ci||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=ci,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let i=this.node.cut(e,n),o=document.createTextNode(i.text);return new X1(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=vo)}get domAtom(){return!1}isText(e){return this.node.text==e}}class vM extends wh{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==ci&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class kz extends oa{constructor(e,n,r,i,o,s,a,l,u,c){super(e,n,r,i,o,s,a,u,c),this.spec=l}update(e,n,r,i){if(this.dirty==vo)return!1;if(this.spec.update){let o=this.spec.update(e,n,r);return o&&this.updateInner(e,n,r,i),o}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,i){this.spec.setSelection?this.spec.setSelection(e,n,r):super.setSelection(e,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function wM(t,e,n){let r=t.firstChild,i=!1;for(let o=0;o>1,s=Math.min(o,e.length);for(;i-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=Ml.create(this.top,e[o],n,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,o++}}findNodeMatch(e,n,r,i){let o=-1,s;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,r))o=this.top.children.indexOf(s,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a0;){let a;for(;;)if(r){let u=n.children[r-1];if(u instanceof Ml)n=u,r=u.children.length;else{a=u,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(i-1))break;--i,o.set(a,i),s.push(a)}}return{index:i,matched:o,matches:s.reverse()}}function Cz(t,e){return t.type.side-e.type.side}function _z(t,e,n,r){let i=e.locals(t),o=0;if(i.length==0){for(let u=0;uo;)a.push(i[s++]);let p=o+d.nodeSize;if(d.isText){let b=p;s!b.inline):a.slice();r(d,m,e.forChild(o,d),h),o=p}}function Az(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function Tz(t,e,n,r){for(let i=0,o=0;i=n){if(o>=r&&l.slice(r-e.length-a,r-a)==e)return r-e.length;let u=a=0&&u+e.length+a>=n)return a+u;if(n==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}function Hv(t,e,n,r,i){let o=[];for(let s=0,a=0;s=n||c<=e?o.push(l):(un&&o.push(l.slice(n-u,l.size,r)))}return o}function Mx(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),o=i&&i.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a=r.resolve(s),l,u;if(Q1(n)){for(l=a;i&&!i.node;)i=i.parent;let c=i.node;if(i&&c.isAtom&&_e.isSelectable(c)&&i.parent&&!(c.isInline&&XP(n.focusNode,n.focusOffset,i.dom))){let f=i.posBefore;u=new _e(s==f?a:r.resolve(f))}}else{let c=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null;l=r.resolve(c)}if(!u){let c=e=="pointer"||t.state.selection.head{(n.anchorNode!=r||n.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!EM(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function Oz(t){let e=t.domSelection(),n=document.createRange(),r=t.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setEnd(r.parentNode,Tn(r)+1):n.setEnd(r,0),n.collapse(!1),e.removeAllRanges(),e.addRange(n),!i&&!t.state.selection.visible&&wr&&ia<=11&&(r.disabled=!0,r.disabled=!1)}function SM(t,e){if(e instanceof _e){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(z6(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else z6(t)}function z6(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Ox(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||He.between(e,n,r)}function j6(t){return t.editable&&!t.hasFocus()?!1:CM(t)}function CM(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function Dz(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return Tl(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Wv(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return o&&je.findFrom(o,e)}function Ms(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function q6(t,e,n){let r=t.state.selection;if(r instanceof He)if(n.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=t.state.doc.resolve(i.pos+o.nodeSize*(e<0?-1:1));return Ms(t,new He(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=Wv(t.state,e);return i&&i instanceof _e?Ms(t,i):!1}else if(!(ri&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return!1;let a=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=t.docView.descAt(a))&&!s.contentDOM?_e.isSelectable(o)?Ms(t,new _e(e<0?t.state.doc.resolve(i.pos-o.nodeSize):i)):vh?Ms(t,new He(t.state.doc.resolve(e<0?a:a+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof _e&&r.node.isInline)return Ms(t,new He(e>0?r.$to:r.$from));{let i=Wv(t.state,e);return i?Ms(t,i):!1}}}function im(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function ed(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Kl(t,e){return e<0?Nz(t):$z(t)}function Nz(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,s=!1;for($i&&n.nodeType==1&&r0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(ed(a,-1))i=n,o=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(_M(n))break;{let a=n.previousSibling;for(;a&&ed(a,-1);)i=n.parentNode,o=Tn(a),a=a.previousSibling;if(a)n=a,r=im(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?Jv(t,n,r):i&&Jv(t,i,o)}function $z(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=im(n),o,s;for(;;)if(r{t.state==i&&Ho(t)},50)}function U6(t,e){let n=t.state.doc.resolve(e);if(!(er||rz)&&n.parent.inlineContent){let i=t.coordsAtPos(e);if(e>n.start()){let o=t.coordsAtPos(e-1),s=(o.top+o.bottom)/2;if(s>i.top&&s1)return o.lefti.top&&s1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function V6(t,e,n){let r=t.state.selection;if(r instanceof He&&!r.empty||n.indexOf("s")>-1||ri&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=Wv(t.state,e);if(s&&s instanceof _e)return Ms(t,s)}if(!i.parent.inlineContent){let s=e<0?i:o,a=r instanceof dl?je.near(s,e):je.findFrom(s,e);return a?Ms(t,a):!1}return!1}function H6(t,e){if(!(t.state.selection instanceof He))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let s=t.state.tr;return e<0?s.delete(n.pos-o.nodeSize,n.pos):s.delete(n.pos,n.pos+o.nodeSize),t.dispatch(s),!0}return!1}function W6(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function Fz(t){if(!sr||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;W6(t,r,"true"),setTimeout(()=>W6(t,r,"false"),20)}return!1}function Lz(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function Bz(t,e){let n=e.keyCode,r=Lz(e);if(n==8||ri&&n==72&&r=="c")return H6(t,-1)||Kl(t,-1);if(n==46&&!e.shiftKey||ri&&n==68&&r=="c")return H6(t,1)||Kl(t,1);if(n==13||n==27)return!0;if(n==37||ri&&n==66&&r=="c"){let i=n==37?U6(t,t.state.selection.from)=="ltr"?-1:1:-1;return q6(t,i,r)||Kl(t,i)}else if(n==39||ri&&n==70&&r=="c"){let i=n==39?U6(t,t.state.selection.from)=="ltr"?1:-1:1;return q6(t,i,r)||Kl(t,i)}else{if(n==38||ri&&n==80&&r=="c")return V6(t,-1,r)||Kl(t,-1);if(n==40||ri&&n==78&&r=="c")return Fz(t)||V6(t,1,r)||Kl(t,1);if(r==(ri?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function AM(t,e){t.someProp("transformCopied",h=>{e=h(e,t)});let n=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let h=r.firstChild;n.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),r=h.content}let s=t.someProp("clipboardSerializer")||gh.fromSchema(t.state.schema),a=$M(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let u=l.firstChild,c,f=0;for(;u&&u.nodeType==1&&(c=NM[u.nodeName.toLowerCase()]);){for(let h=c.length-1;h>=0;h--){let p=a.createElement(c[h]);for(;l.firstChild;)p.appendChild(l.firstChild);l.appendChild(p),f++}u=l.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${i} ${o}${f?` -${f}`:""} ${JSON.stringify(n)}`);let d=t.someProp("clipboardTextSerializer",h=>h(e,t))||e.content.textBetween(0,e.content.size,` `);return{dom:l,text:d,slice:e}}function TM(t,e,n,r,i){let o=i.parent.type.spec.code,s,a;if(!n&&!e)return null;let l=e&&(r||o||!n);if(l){if(t.someProp("transformPastedText",d=>{e=d(e,o||r,t)}),o)return e?new he(oe.from(t.state.schema.text(e.replace(/\r\n?/g,` -`))),0,0):he.empty;let f=t.someProp("clipboardTextParser",d=>d(e,i,r,t));if(f)a=f;else{let d=i.marks(),{schema:h}=t.state,p=mh.fromSchema(h);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let b=s.appendChild(document.createElement("p"));m&&b.appendChild(p.serializeNode(h.text(m,d)))})}}else t.someProp("transformPastedHTML",f=>{n=f(n,t)}),s=jz(n),bh&&qz(s);let u=s&&s.querySelector("[data-pm-slice]"),c=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(c&&c[3])for(let f=+c[3];f>0;f--){let d=s.firstChild;for(;d&&d.nodeType!=1;)d=d.nextSibling;if(!d)break;s=d}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||xx.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||c),context:i,ruleFromNode(d){return d.nodeName=="BR"&&!d.nextSibling&&d.parentNode&&!Pz.test(d.parentNode.nodeName)?{ignore:!0}:null}})),c)a=Vz(J6(a,+c[1],+c[2]),c[4]);else if(a=he.maxOpen(zz(a.content,i),!0),a.openStart||a.openEnd){let f=0,d=0;for(let h=a.content.firstChild;f{a=f(a,t)}),a}const Pz=/^(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 zz(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.index(n)),o,s=[];if(t.forEach(a=>{if(!s)return;let l=i.findWrapping(a.type),u;if(!l)return s=null;if(u=s.length&&o.length&&OM(l,o,a,s[s.length-1],0))s[s.length-1]=u;else{s.length&&(s[s.length-1]=DM(s[s.length-1],o.length));let c=MM(a,l);s.push(c),i=i.matchType(c.type),o=l}}),s)return oe.from(s)}return t}function MM(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,oe.from(t));return t}function OM(t,e,n,r,i){if(i1&&(o=0),i=n&&(a=e<0?s.contentMatchAt(0).fillBefore(a,o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(oe.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(a))}function J6(t,e,n){return e]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=$M().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&NM[r[1].toLowerCase()])&&(t=i.map(o=>"<"+o+">").join("")+t+i.map(o=>"").reverse().join("")),n.innerHTML=t,i)for(let o=0;o=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;i=oe.from(l.create(r[a+1],i)),o++,s++}return new he(i,o,s)}const ar={},lr={},Uz={touchstart:!0,touchmove:!0};class Hz{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.compositionNode=null,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 Wz(t){for(let e in ar){let n=ar[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{Kz(t,r)&&!Dx(t,r)&&(t.editable||!(r.type in lr))&&n(t,r)},Uz[e]?{passive:!0}:void 0)}sr&&t.dom.addEventListener("input",()=>null),Gv(t)}function Us(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function Jz(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function Gv(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>Dx(t,r))})}function Dx(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function Kz(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function Gz(t,e){!Dx(t,e)&&ar[e.type]&&(t.editable||!(e.type in lr))&&ar[e.type](t,e)}lr.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!RM(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Si&&Xn&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),nc&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",i=>i(t,qa(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||Bz(t,n)?n.preventDefault():Us(t,"key")};lr.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};lr.keypress=(t,e)=>{let n=e;if(RM(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||ri&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof He)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",o=>o(t,r.$from.pos,r.$to.pos,i))&&t.dispatch(t.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};function eg(t){return{left:t.clientX,top:t.clientY}}function Zz(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function Nx(t,e,n,r,i){if(r==-1)return!1;let o=t.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(t.someProp(e,a=>s>o.depth?a(t,n,o.nodeAfter,o.before(s),i,!0):a(t,n,o.node(s),o.before(s),i,!1)))return!0;return!1}function Bu(t,e,n){t.focused||t.focus();let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function Yz(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&_e.isSelectable(r)?(Bu(t,new _e(n)),!0):!1}function Qz(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof _e&&(r=n.node);let o=t.state.doc.resolve(e);for(let s=o.depth+1;s>0;s--){let a=s>o.depth?o.nodeAfter:o.node(s);if(_e.isSelectable(a)){r&&n.$from.depth>0&&s>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?i=o.before(n.$from.depth):i=o.before(s);break}}return i!=null?(Bu(t,_e.create(t.state.doc,i)),!0):!1}function Xz(t,e,n,r,i){return Nx(t,"handleClickOn",e,n,r)||t.someProp("handleClick",o=>o(t,e,r))||(i?Qz(t,n):Yz(t,n))}function ej(t,e,n,r){return Nx(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function tj(t,e,n,r){return Nx(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||nj(t,n,r)}function nj(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(Bu(t,He.create(r,0,r.content.size)),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let s=o>i.depth?i.nodeAfter:i.node(o),a=i.before(o);if(s.inlineContent)Bu(t,He.create(r,a+1,a+1+s.content.size));else if(_e.isSelectable(s))Bu(t,_e.create(r,a));else continue;return!0}}function $x(t){return im(t)}const IM=ri?"metaKey":"ctrlKey";ar.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=$x(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&Zz(n,t.input.lastClick)&&!n[IM]&&(t.input.lastClick.type=="singleClick"?o="doubleClick":t.input.lastClick.type=="doubleClick"&&(o="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let s=t.posAtCoords(eg(n));s&&(o=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new rj(t,s,n,!!r)):(o=="doubleClick"?ej:tj)(t,s.pos,s.inside,n)?n.preventDefault():Us(t,"pointer"))};class rj{constructor(e,n,r,i){this.view=e,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[IM],this.allowDefault=r.shiftKey;let o,s;if(n.inside>-1)o=e.state.doc.nodeAt(n.inside),s=n.inside;else{let c=e.state.doc.resolve(n.pos);o=c.parent,s=c.depth?c.before():0}const a=i?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l&&l.dom.nodeType==1?l.dom:null;let{selection:u}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||u instanceof _e&&u.from<=s&&u.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&$i&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Us(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Ho(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(eg(e))),this.updateAllowDefault(e),this.allowDefault||!n?Us(this.view,"pointer"):Xz(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||sr&&this.mightDrag&&!this.mightDrag.node.isAtom||Xn&&!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)?(Bu(this.view,je.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):Us(this.view,"pointer")}move(e){this.updateAllowDefault(e),Us(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}ar.touchstart=t=>{t.input.lastTouch=Date.now(),$x(t),Us(t,"pointer")};ar.touchmove=t=>{t.input.lastTouch=Date.now(),Us(t,"pointer")};ar.contextmenu=t=>$x(t);function RM(t,e){return t.composing?!0:sr&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const ij=Si?5e3:-1;lr.compositionstart=lr.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),im(t,!0),t.markCursor=null;else if(im(t),$i&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(s.nodeType==3){t.domSelection().collapse(s,s.nodeValue.length);break}else i=s,o=-1}}t.input.composing=!0}FM(t,ij)};lr.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,FM(t,20))};function FM(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>im(t),e))}function LM(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=sj());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function oj(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=YP(e.focusNode,e.focusOffset),r=QP(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,o=t.domObserver.lastChangedTextNode;if(n==o||r==o)return o;if(!i||!i.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let s=n.pmViewDesc;if(!(!s||!s.isText(n.nodeValue)))return r}}return n||r}function sj(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function im(t,e=!1){if(!(Si&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),LM(t),e||t.docView&&t.docView.dirty){let n=Mx(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):t.updateState(t.state),!0}return!1}}function aj(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const Id=wr&&ia<15||nc&&iz<604;ar.copy=lr.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let o=Id?null:n.clipboardData,s=r.content(),{dom:a,text:l}=AM(t,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):aj(t,a),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function lj(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function uj(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Rd(t,r.value,null,i,e):Rd(t,r.textContent,r.innerHTML,i,e)},50)}function Rd(t,e,n,r,i){let o=TM(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,i,o||he.empty)))return!0;if(!o)return!1;let s=lj(o),a=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(o);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function BM(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}lr.paste=(t,e)=>{let n=e;if(t.composing&&!Si)return;let r=Id?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&Rd(t,BM(r),r.getData("text/html"),i,n)?n.preventDefault():uj(t,n)};class PM{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const zM=ri?"altKey":"ctrlKey";ar.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=t.state.selection,o=i.empty?null:t.posAtCoords(eg(n)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof _e?i.to-1:i.to))){if(r&&r.mightDrag)s=_e.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let f=t.docView.nearestDesc(n.target,!0);f&&f.node.type.spec.draggable&&f!=t.docView&&(s=_e.create(t.state.doc,f.posBefore))}}let a=(s||t.state.selection).content(),{dom:l,text:u,slice:c}=AM(t,a);n.dataTransfer.clearData(),n.dataTransfer.setData(Id?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",Id||n.dataTransfer.setData("text/plain",u),t.dragging=new PM(c,!n[zM],s)};ar.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};lr.dragover=lr.dragenter=(t,e)=>e.preventDefault();lr.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(eg(n));if(!i)return;let o=t.state.doc.resolve(i.pos),s=r&&r.slice;s?t.someProp("transformPasted",p=>{s=p(s,t)}):s=TM(t,BM(n.dataTransfer),Id?null:n.dataTransfer.getData("text/html"),!1,o);let a=!!(r&&!n[zM]);if(t.someProp("handleDrop",p=>p(t,n,s||he.empty,a))){n.preventDefault();return}if(!s)return;n.preventDefault();let l=s?XT(t.state.doc,o.pos,s):o.pos;l==null&&(l=o.pos);let u=t.state.tr;if(a){let{node:p}=r;p?p.replace(u):u.deleteSelection()}let c=u.mapping.map(l),f=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,d=u.doc;if(f?u.replaceRangeWith(c,c,s.content.firstChild):u.replaceRange(c,c,s),u.doc.eq(d))return;let h=u.doc.resolve(c);if(f&&_e.isSelectable(s.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(s.content.firstChild))u.setSelection(new _e(h));else{let p=u.mapping.map(l);u.mapping.maps[u.mapping.maps.length-1].forEach((m,b,y,v)=>p=v),u.setSelection(Ox(t,h,u.doc.resolve(p)))}t.focus(),t.dispatch(u.setMeta("uiEvent","drop"))};ar.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Ho(t)},20))};ar.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};ar.beforeinput=(t,e)=>{if(Xn&&Si&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",o=>o(t,qa(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in lr)ar[t]=lr[t];function Fd(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class om{constructor(e,n){this.toDOM=e,this.spec=n||hl,this.side=this.spec.side||0}map(e,n,r,i){let{pos:o,deleted:s}=e.mapResult(n.from+i,this.side<0?-1:1);return s?null:new Br(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof om&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Fd(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class sa{constructor(e,n){this.attrs=e,this.spec=n||hl}map(e,n,r,i){let o=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,s=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new Br(o,s,this)}valid(e,n){return n.from=e&&(!o||o(a.spec))&&r.push(a.copy(a.from+i,a.to+i))}for(let s=0;se){let a=this.children[s]+1;this.children[s+2].findInner(e-a,n-a,r,i+a,o)}}map(e,n,r){return this==Ln||e.maps.length==0?this:this.mapInner(e,n,0,0,r||hl)}mapInner(e,n,r,i,o){let s;for(let a=0;a{let u=l+r,c;if(c=VM(n,a,u)){for(i||(i=this.children.slice());oa&&f.to=e){this.children[a]==e&&(r=this.children[a+2]);break}let o=e+1,s=o+n.content.size;for(let a=0;ao&&l.type instanceof sa){let u=Math.max(o,l.from)-o,c=Math.min(s,l.to)-o;ui.map(e,n,hl));return Ls.from(r)}forChild(e,n){if(n.isLeaf)return Kt.empty;let r=[];for(let i=0;in instanceof Kt)?e:e.reduce((n,r)=>n.concat(r instanceof Kt?r:r.members),[]))}}}function fj(t,e,n,r,i,o,s){let a=t.slice();for(let u=0,c=o;u{let b=m-p-(h-d);for(let y=0;yv+c-f)continue;let w=a[y]+c-f;h>=w?a[y+1]=d<=w?-2:-1:d>=c&&b&&(a[y]+=b,a[y+1]+=b)}f+=b}),c=n.maps[u].map(c,-1)}let l=!1;for(let u=0;u=r.content.size){l=!0;continue}let d=n.map(t[u+1]+o,-1),h=d-i,{index:p,offset:m}=r.content.findIndex(f),b=r.maybeChild(p);if(b&&m==f&&m+b.nodeSize==h){let y=a[u+2].mapInner(n,b,c+1,t[u]+o+1,s);y!=Ln?(a[u]=f,a[u+1]=h,a[u+2]=y):(a[u+1]=-2,l=!0)}else l=!0}if(l){let u=dj(a,t,e,n,i,o,s),c=sm(u,r,0,s);e=c.local;for(let f=0;fn&&s.to{let u=VM(t,a,l+n);if(u){o=!0;let c=sm(u,a,n+l+1,r);c!=Ln&&i.push(l,l+a.nodeSize,c)}});let s=qM(o?UM(t):t,-n).sort(pl);for(let a=0;a0;)e++;t.splice(e,0,n)}function Ky(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=Ln&&e.push(r)}),t.cursorWrapper&&e.push(Kt.create(t.state.doc,[t.cursorWrapper.deco])),Ls.from(e)}const hj={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},pj=wr&&ia<=11;class mj{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class gj{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new mj,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;ii.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),pj&&(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,hj)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;nthis.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(j6(this.view)){if(this.suppressingSelectionUpdates)return Ho(this.view);if(wr&&ia<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Tl(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let o=e.focusNode;o;o=$d(o))n.add(o);for(let o=e.anchorNode;o;o=$d(o))if(n.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&j6(e)&&!this.ignoreSelectionChange(r),o=-1,s=-1,a=!1,l=[];if(e.editable)for(let c=0;cf.nodeName=="BR");if(c.length==2){let[f,d]=c;f.parentNode&&f.parentNode.parentNode==d.parentNode?d.remove():f.remove()}else{let{focusNode:f}=this.currentSelection;for(let d of c){let h=d.parentNode;h&&h.nodeName=="LI"&&(!f||vj(e,f)!=h)&&d.remove()}}}let u=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)-1||i)&&(o>-1&&(e.docView.markDirty(o,s),yj(e)),this.handleDOMChange(o,s,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Ho(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let c=0;ci;b--){let y=r.childNodes[b-1],v=y.pmViewDesc;if(y.nodeName=="BR"&&!v){o=b;break}if(!v||v.size)break}let f=t.state.doc,d=t.someProp("domParser")||xx.fromSchema(t.state.schema),h=f.resolve(s),p=null,m=d.parse(r,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:i,to:o,preserveWhitespace:h.parent.type.whitespace=="pre"?"full":!0,findPositions:u,ruleFromNode:kj,context:h});if(u&&u[0].pos!=null){let b=u[0].pos,y=u[1]&&u[1].pos;y==null&&(y=b),p={anchor:b+s,head:y+s}}return{doc:m,sel:p,from:s,to:a}}function kj(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(sr&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||sr&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const xj=/^(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 Ej(t,e,n,r,i){let o=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let O=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,N=Mx(t,O);if(N&&!t.state.selection.eq(N)){if(Xn&&Si&&t.input.lastKeyCode===13&&Date.now()-100R(t,qa(13,"Enter"))))return;let C=t.state.tr.setSelection(N);O=="pointer"?C.setMeta("pointer",!0):O=="key"&&C.scrollIntoView(),o&&C.setMeta("composition",o),t.dispatch(C)}return}let s=t.state.doc.resolve(e),a=s.sharedDepth(n);e=s.before(a+1),n=t.state.doc.resolve(n).after(a+1);let l=t.state.selection,u=wj(t,e,n),c=t.state.doc,f=c.slice(u.from,u.to),d,h;t.input.lastKeyCode===8&&Date.now()-100Date.now()-225||Si)&&i.some(O=>O.nodeType==1&&!xj.test(O.nodeName))&&(!p||p.endA>=p.endB)&&t.someProp("handleKeyDown",O=>O(t,qa(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!p)if(r&&l instanceof He&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(u.sel&&u.sel.anchor!=u.sel.head))p={start:l.from,endA:l.to,endB:l.to};else{if(u.sel){let O=X6(t,t.state.doc,u.sel);if(O&&!O.eq(t.state.selection)){let N=t.state.tr.setSelection(O);o&&N.setMeta("composition",o),t.dispatch(N)}}return}t.input.domChangeCount++,t.state.selection.fromt.state.selection.from&&p.start<=t.state.selection.from+2&&t.state.selection.from>=u.from?p.start=t.state.selection.from:p.endA=t.state.selection.to-2&&t.state.selection.to<=u.to&&(p.endB+=t.state.selection.to-p.endA,p.endA=t.state.selection.to)),wr&&ia<=11&&p.endB==p.start+1&&p.endA==p.start&&p.start>u.from&&u.doc.textBetween(p.start-u.from-1,p.start-u.from+1)=="  "&&(p.start--,p.endA--,p.endB--);let m=u.doc.resolveNoCache(p.start-u.from),b=u.doc.resolveNoCache(p.endB-u.from),y=c.resolve(p.start),v=m.sameParent(b)&&m.parent.inlineContent&&y.end()>=p.endA,w;if((nc&&t.input.lastIOSEnter>Date.now()-225&&(!v||i.some(O=>O.nodeName=="DIV"||O.nodeName=="P"))||!v&&m.posO(t,qa(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>p.start&&Cj(c,p.start,p.endA,m,b)&&t.someProp("handleKeyDown",O=>O(t,qa(8,"Backspace")))){Si&&Xn&&t.domObserver.suppressSelectionUpdates();return}Xn&&Si&&p.endB==p.start&&(t.input.lastAndroidDelete=Date.now()),Si&&!v&&m.start()!=b.start()&&b.parentOffset==0&&m.depth==b.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==p.endA&&(p.endB-=2,b=u.doc.resolveNoCache(p.endB-u.from),setTimeout(()=>{t.someProp("handleKeyDown",function(O){return O(t,qa(13,"Enter"))})},20));let g=p.start,x=p.endA,k,E,D;if(v){if(m.pos==b.pos)wr&&ia<=11&&m.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Ho(t),20)),k=t.state.tr.delete(g,x),E=c.resolve(p.start).marksAcross(c.resolve(p.endA));else if(p.endA==p.endB&&(D=Sj(m.parent.content.cut(m.parentOffset,b.parentOffset),y.parent.content.cut(y.parentOffset,p.endA-y.start()))))k=t.state.tr,D.type=="add"?k.addMark(g,x,D.mark):k.removeMark(g,x,D.mark);else if(m.parent.child(m.index()).isText&&m.index()==b.index()-(b.textOffset?0:1)){let O=m.parent.textBetween(m.parentOffset,b.parentOffset);if(t.someProp("handleTextInput",N=>N(t,g,x,O)))return;k=t.state.tr.insertText(O,g,x)}}if(k||(k=t.state.tr.replace(g,x,u.doc.slice(p.start-u.from,p.endB-u.from))),u.sel){let O=X6(t,k.doc,u.sel);O&&!(Xn&&Si&&t.composing&&O.empty&&(p.start!=p.endB||t.input.lastAndroidDeletee.content.size?null:Ox(t,e.resolve(n.anchor),e.resolve(n.head))}function Sj(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,o=r,s,a,l;for(let c=0;cc.mark(a.addToSet(c.marks));else if(i.length==0&&o.length==1)a=o[0],s="remove",l=c=>c.mark(a.removeFromSet(c.marks));else return null;let u=[];for(let c=0;cn||Gy(s,!0,!1)0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let o=t.node(r).maybeChild(t.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function _j(t,e,n,r,i){let o=t.findDiffStart(e,n);if(o==null)return null;let{a:s,b:a}=t.findDiffEnd(e,n+t.size,n+e.size);if(i=="end"){let l=Math.max(0,o-Math.min(s,a));r-=s+l-o}if(s=s?o-r:0;o-=l,o&&o=a?o-r:0;o-=l,o&&o=56320&&e<=57343&&n>=55296&&n<=56319}class Aj{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Hz,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(oC),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=rC(this),nC(this),this.nodeViews=iC(this),this.docView=R6(this.state.doc,tC(this),Ky(this),this.dom,this),this.domObserver=new gj(this,(r,i,o,s)=>Ej(this,r,i,o,s)),this.domObserver.start(),Wz(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Gv(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(oC),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let i=this.state,o=!1,s=!1;e.storedMarks&&this.composing&&(LM(this),s=!0),this.state=e;let a=i.plugins!=e.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let h=iC(this);Mj(h,this.nodeViews)&&(this.nodeViews=h,o=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&Gv(this),this.editable=rC(this),nC(this);let l=Ky(this),u=tC(this),c=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",f=o||!this.docView.matchesNode(e.doc,u,l);(f||!e.selection.eq(i.selection))&&(s=!0);let d=c=="preserve"&&s&&this.dom.style.overflowAnchor==null&&az(this);if(s){this.domObserver.stop();let h=f&&(wr||Xn)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&Tj(i.selection,e.selection);if(f){let p=Xn?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=oj(this)),(o||!this.docView.update(e.doc,u,l,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=R6(e.doc,u,l,this.dom,this)),p&&!this.trackWrites&&(h=!0)}h||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&Dz(this))?Ho(this,h):(SM(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():d&&lz(d)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof _e){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&M6(this,n.getBoundingClientRect(),e)}else M6(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n0&&this.state.doc.nodeAt(o))==r.node&&(i=o)}this.dragging=new PM(e.slice,e.move,i<0?void 0:_e.create(this.state.doc,i))}someProp(e,n){let r=this._props&&this._props[e],i;if(r!=null&&(i=n?n(r):r))return i;for(let s=0;sn.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return pz(this,e)}coordsAtPos(e,n=1){return gM(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let i=this.docView.posFromDOM(e,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,n){return vz(this,n||this.state,e)}pasteHTML(e,n){return Rd(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return Rd(this,e,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(Jz(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Ky(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,GP())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return Gz(this,e)}dispatch(e){let n=this._props.dispatchTransaction;n?n.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return sr&&this.root.nodeType===11&&ez(this.dom.ownerDocument)==this.dom&&bj(this,e)||e}domSelection(){return this.root.getSelection()}}function tC(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[Br.node(0,t.state.doc.content.size,e)]}function nC(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Br.widget(t.state.selection.head,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function rC(t){return!t.someProp("editable",e=>e(t.state)===!1)}function Tj(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function iC(t){let e=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function Mj(t,e){let n=0,r=0;for(let i in t){if(t[i]!=e[i])return!0;n++}for(let i in e)r++;return n!=r}function oC(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var da={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:"'"},am={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Oj=typeof navigator<"u"&&/Mac/.test(navigator.platform),Dj=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Mn=0;Mn<10;Mn++)da[48+Mn]=da[96+Mn]=String(Mn);for(var Mn=1;Mn<=24;Mn++)da[Mn+111]="F"+Mn;for(var Mn=65;Mn<=90;Mn++)da[Mn]=String.fromCharCode(Mn+32),am[Mn]=String.fromCharCode(Mn);for(var Zy in da)am.hasOwnProperty(Zy)||(am[Zy]=da[Zy]);function Nj(t){var e=Oj&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Dj&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?am:da)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const $j=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function Ij(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,o,s;for(let a=0;a127)&&(o=da[r.keyCode])&&o!=i){let a=e[Yy(o,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}const Lj=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function WM(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const Bj=(t,e,n)=>{let r=WM(t,n);if(!r)return!1;let i=Rx(r);if(!i){let s=r.blockRange(),a=s&&Nc(s);return a==null?!1:(e&&e(t.tr.lift(s,a).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&ZM(t,i,e))return!0;if(r.parent.content.size==0&&(rc(o,"end")||_e.isSelectable(o))){let s=Y1(t.doc,r.before(),r.after(),he.empty);if(s&&s.slice.size{let r=WM(t,n);if(!r)return!1;let i=Rx(r);return i?JM(t,i,e):!1},zj=(t,e,n)=>{let r=KM(t,n);if(!r)return!1;let i=Fx(r);return i?JM(t,i,e):!1};function JM(t,e,n){let r=e.nodeBefore,i=r,o=e.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let c=i.lastChild;if(!c)return!1;i=c}let s=e.nodeAfter,a=s,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let c=a.firstChild;if(!c)return!1;a=c}let u=Y1(t.doc,o,l,he.empty);if(!u||u.from!=o||u instanceof Ni&&u.slice.size>=l-o)return!1;if(n){let c=t.tr.step(u);c.setSelection(He.create(c.doc,o)),n(c.scrollIntoView())}return!0}function rc(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const jj=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;o=Rx(r)}let s=o&&o.nodeBefore;return!s||!_e.isSelectable(s)?!1:(e&&e(t.tr.setSelection(_e.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function Rx(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function KM(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset{let r=KM(t,n);if(!r)return!1;let i=Fx(r);if(!i)return!1;let o=i.nodeAfter;if(ZM(t,i,e))return!0;if(r.parent.content.size==0&&(rc(o,"start")||_e.isSelectable(o))){let s=Y1(t.doc,r.before(),r.after(),he.empty);if(s&&s.slice.size{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset=0;e--){let n=t.node(e);if(t.index(e)+1{let n=t.selection,r=n instanceof _e,i;if(r){if(n.node.isTextblock||!xa(t.doc,n.from))return!1;i=n.from}else if(i=Z1(t.doc,n.from,-1),i==null)return!1;if(e){let o=t.tr.join(i);r&&o.setSelection(_e.create(o.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},Hj=(t,e)=>{let n=t.selection,r;if(n instanceof _e){if(n.node.isTextblock||!xa(t.doc,n.to))return!1;r=n.to}else if(r=Z1(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},Wj=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),o=i&&Nc(i);return o==null?!1:(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},Jj=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(` -`).scrollIntoView()),!0)};function GM(t){for(let e=0;e{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=GM(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let a=n.after(),l=t.tr.replaceWith(a,a,s.createAndFill());l.setSelection(je.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},Gj=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof dl||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=GM(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!r.parentOffset&&i.index(){let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(Lu(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Nc(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)},Yj=(t,e)=>{let{$from:n,to:r}=t.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),e&&e(t.tr.setSelection(_e.create(t.doc,i))),!0)};function Qj(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||xa(t.doc,e.pos))?!1:(n&&n(t.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0)}function ZM(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o,s;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(Qj(t,e,n))return!0;let a=e.parent.canReplace(e.index(),e.index()+1);if(a&&(o=(s=r.contentMatchAt(r.childCount)).findWrapping(i.type))&&s.matchType(o[0]||i.type).validEnd){if(n){let f=e.pos+i.nodeSize,d=oe.empty;for(let m=o.length-1;m>=0;m--)d=oe.from(o[m].create(null,d));d=oe.from(r.copy(d));let h=t.tr.step(new _r(e.pos-1,f,e.pos,f,new he(d,1,0),o.length,!0)),p=f+2*o.length;xa(h.doc,p)&&h.join(p),n(h.scrollIntoView())}return!0}let l=je.findFrom(e,1),u=l&&l.$from.blockRange(l.$to),c=u&&Nc(u);if(c!=null&&c>=e.depth)return n&&n(t.tr.lift(u,c).scrollIntoView()),!0;if(a&&rc(i,"start",!0)&&rc(r,"end")){let f=r,d=[];for(;d.push(f),!f.isTextblock;)f=f.lastChild;let h=i,p=1;for(;!h.isTextblock;h=h.firstChild)p++;if(f.canReplace(f.childCount,f.childCount,h.content)){if(n){let m=oe.empty;for(let y=d.length-1;y>=0;y--)m=oe.from(d[y].copy(m));let b=t.tr.step(new _r(e.pos-d.length,e.pos+i.nodeSize,e.pos+p,e.pos+i.nodeSize-p,new he(m,d.length,0),0,!0));n(b.scrollIntoView())}return!0}}return!1}function YM(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(n&&n(e.tr.setSelection(He.create(e.doc,t<0?i.start(o):i.end(o)))),!0):!1}}const Xj=YM(-1),eq=YM(1);function tq(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=s&&Ax(s,t,e);return a?(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0):!1}}function sC(t,e=null){return function(n,r){let i=!1;for(let o=0;o{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)i=!0;else{let c=n.doc.resolve(u),f=c.index();i=c.parent.canReplaceWith(f,f+1,t)}})}if(!i)return!1;if(r){let o=n.tr;for(let s=0;s=2&&i.node(s.depth-1).type.compatibleContent(t)&&s.startIndex==0){if(i.index(s.depth-1)==0)return!1;let c=n.doc.resolve(s.start-2);l=new em(c,c,s.depth),s.endIndex=0;c--)o=oe.from(n[c].type.create(n[c].attrs,o));t.step(new _r(e.start-(r?2:0),e.end,e.start,e.end,new he(o,0,0),n.length,!0));let s=0;for(let c=0;cs.childCount>0&&s.firstChild.type==t);return o?n?r.node(o.depth-1).type==t?oq(e,n,t,o):sq(e,n,o):!0:!1}}function oq(t,e,n,r){let i=t.tr,o=r.end,s=r.$to.end(r.depth);om;p--)h-=i.child(p).nodeSize,r.delete(h-1,h+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==i.childCount,u=o.node(-1),c=o.index(-1);if(!u.canReplace(c+(a?0:1),c+1,s.content.append(l?oe.empty:oe.from(i))))return!1;let f=o.pos,d=f+s.nodeSize;return r.step(new _r(f-(a?1:0),d+(l?1:0),f+1,d-1,new he((a?oe.empty:oe.from(i.copy(oe.empty))).append(l?oe.empty:oe.from(i.copy(oe.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function aq(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,u=>u.childCount>0&&u.firstChild.type==t);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let a=o.parent,l=a.child(s-1);if(l.type!=t)return!1;if(n){let u=l.lastChild&&l.lastChild.type==a.type,c=oe.from(u?t.create():null),f=new he(oe.from(t.create(null,oe.from(a.type.create(null,c)))),u?3:1,0),d=o.start,h=o.end;n(e.tr.step(new _r(d-(u?3:1),h,d,h,f,1,!0)).scrollIntoView())}return!0}}function tg(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}let ng=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:n,state:r}=this,{view:i}=n,{tr:o}=r,s=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...c)=>{const f=l(...c)(s);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),f}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i,a=[],l=!!e,u=e||o.tr,c=()=>(!l&&n&&!u.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(u),a.every(d=>d===!0)),f={...Object.fromEntries(Object.entries(r).map(([d,h])=>[d,(...m)=>{const b=this.buildProps(u,n),y=h(...m)(b);return a.push(y),f}])),run:c};return f}createCan(e){const{rawCommands:n,state:r}=this,i=!1,o=e||r.tr,s=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(n).map(([l,u])=>[l,(...c)=>u(...c)({...s,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(e,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i,a={tr:e,editor:i,view:s,state:tg({state:o,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([l,u])=>[l,(...c)=>u(...c)(a)]))}};return a}};class lq{constructor(){this.callbacks={}}on(e,n){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(n),this}emit(e,...n){const r=this.callbacks[e];return r&&r.forEach(i=>i.apply(this,n)),this}off(e,n){const r=this.callbacks[e];return r&&(n?this.callbacks[e]=r.filter(i=>i!==n):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}function ye(t,e,n){return t.config[e]===void 0&&t.parent?ye(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?ye(t.parent,e,n):null}):t.config[e]}function rg(t){const e=t.filter(i=>i.type==="extension"),n=t.filter(i=>i.type==="node"),r=t.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function QM(t){const e=[],{nodeExtensions:n,markExtensions:r}=rg(t),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage,extensions:i},l=ye(s,"addGlobalAttributes",a);if(!l)return;l().forEach(c=>{c.types.forEach(f=>{Object.entries(c.attributes).forEach(([d,h])=>{e.push({type:f,name:d,attribute:{...o,...h}})})})})}),i.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage},l=ye(s,"addAttributes",a);if(!l)return;const u=l();Object.entries(u).forEach(([c,f])=>{const d={...o,...f};typeof(d==null?void 0:d.default)=="function"&&(d.default=d.default()),d!=null&&d.isRequired&&(d==null?void 0:d.default)===void 0&&delete d.default,e.push({type:s.name,name:c,attribute:d})})}),e}function yn(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function nn(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){const a=o?o.split(" "):[],l=r[i]?r[i].split(" "):[],u=a.filter(c=>!l.includes(c));r[i]=[...l,...u].join(" ")}else i==="style"?r[i]=[r[i],o].join("; "):r[i]=o}),r},{})}function Zv(t,e){return e.filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>nn(n,r),{})}function XM(t){return typeof t=="function"}function Ue(t,e=void 0,...n){return XM(t)?e?t.bind(e)(...n):t(...n):t}function uq(t={}){return Object.keys(t).length===0&&t.constructor===Object}function cq(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function aC(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const i=e.reduce((o,s)=>{const a=s.attribute.parseHTML?s.attribute.parseHTML(n):cq(n.getAttribute(s.name));return a==null?o:{...o,[s.name]:a}},{});return{...r,...i}}}}function lC(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&uq(n)?!1:n!=null))}function fq(t,e){var n;const r=QM(t),{nodeExtensions:i,markExtensions:o}=rg(t),s=(n=i.find(u=>ye(u,"topNode")))===null||n===void 0?void 0:n.name,a=Object.fromEntries(i.map(u=>{const c=r.filter(y=>y.type===u.name),f={name:u.name,options:u.options,storage:u.storage,editor:e},d=t.reduce((y,v)=>{const w=ye(v,"extendNodeSchema",f);return{...y,...w?w(u):{}}},{}),h=lC({...d,content:Ue(ye(u,"content",f)),marks:Ue(ye(u,"marks",f)),group:Ue(ye(u,"group",f)),inline:Ue(ye(u,"inline",f)),atom:Ue(ye(u,"atom",f)),selectable:Ue(ye(u,"selectable",f)),draggable:Ue(ye(u,"draggable",f)),code:Ue(ye(u,"code",f)),whitespace:Ue(ye(u,"whitespace",f)),defining:Ue(ye(u,"defining",f)),isolating:Ue(ye(u,"isolating",f)),attrs:Object.fromEntries(c.map(y=>{var v;return[y.name,{default:(v=y==null?void 0:y.attribute)===null||v===void 0?void 0:v.default}]}))}),p=Ue(ye(u,"parseHTML",f));p&&(h.parseDOM=p.map(y=>aC(y,c)));const m=ye(u,"renderHTML",f);m&&(h.toDOM=y=>m({node:y,HTMLAttributes:Zv(y,c)}));const b=ye(u,"renderText",f);return b&&(h.toText=b),[u.name,h]})),l=Object.fromEntries(o.map(u=>{const c=r.filter(b=>b.type===u.name),f={name:u.name,options:u.options,storage:u.storage,editor:e},d=t.reduce((b,y)=>{const v=ye(y,"extendMarkSchema",f);return{...b,...v?v(u):{}}},{}),h=lC({...d,inclusive:Ue(ye(u,"inclusive",f)),excludes:Ue(ye(u,"excludes",f)),group:Ue(ye(u,"group",f)),spanning:Ue(ye(u,"spanning",f)),code:Ue(ye(u,"code",f)),attrs:Object.fromEntries(c.map(b=>{var y;return[b.name,{default:(y=b==null?void 0:b.attribute)===null||y===void 0?void 0:y.default}]}))}),p=Ue(ye(u,"parseHTML",f));p&&(h.parseDOM=p.map(b=>aC(b,c)));const m=ye(u,"renderHTML",f);return m&&(h.toDOM=b=>m({mark:b,HTMLAttributes:Zv(b,c)})),[u.name,h]}));return new jT({topNode:s,nodes:a,marks:l})}function Qy(t,e){return e.nodes[t]||e.marks[t]||null}function uC(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}const dq=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(i,o,s,a)=>{var l,u;const c=((u=(l=i.type.spec).toText)===null||u===void 0?void 0:u.call(l,{node:i,pos:o,parent:s,index:a}))||i.textContent||"%leaf%";n+=c.slice(0,Math.max(0,r-o))}),n};function Lx(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class ig{constructor(e){this.find=e.find,this.handler=e.handler}}const hq=(t,e)=>{if(Lx(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function up(t){var e;const{editor:n,from:r,to:i,text:o,rules:s,plugin:a}=t,{view:l}=n;if(l.composing)return!1;const u=l.state.doc.resolve(r);if(u.parent.type.spec.code||!((e=u.nodeBefore||u.nodeAfter)===null||e===void 0)&&e.marks.find(d=>d.type.spec.code))return!1;let c=!1;const f=dq(u)+o;return s.forEach(d=>{if(c)return;const h=hq(f,d.find);if(!h)return;const p=l.state.tr,m=tg({state:l.state,transaction:p}),b={from:r-(h[0].length-o.length),to:i},{commands:y,chain:v,can:w}=new ng({editor:n,state:m});d.handler({state:m,range:b,match:h,commands:y,chain:v,can:w})===null||!p.steps.length||(p.setMeta(a,{transform:p,from:r,to:i,text:o}),l.dispatch(p),c=!0)}),c}function pq(t){const{editor:e,rules:n}=t,r=new Kr({state:{init(){return null},apply(i,o){const s=i.getMeta(r);if(s)return s;const a=i.getMeta("applyInputRules");return!!a&&setTimeout(()=>{const{from:u,text:c}=a,f=u+c.length;up({editor:e,from:u,to:f,text:c,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:o}},props:{handleTextInput(i,o,s,a){return up({editor:e,from:o,to:s,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&up({editor:e,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;const{$cursor:s}=i.state.selection;return s?up({editor:e,from:s.pos,to:s.pos,text:` -`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function mq(t){return typeof t=="number"}let gq=class{constructor(e){this.find=e.find,this.handler=e.handler}};const yq=(t,e,n)=>{if(Lx(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(i=>{const o=[i.text];return o.index=i.index,o.input=t,o.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(i.replaceWith)),o}):[]};function bq(t){const{editor:e,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:a}=t,{commands:l,chain:u,can:c}=new ng({editor:e,state:n}),f=[];return n.doc.nodesBetween(r,i,(h,p)=>{if(!h.isTextblock||h.type.spec.code)return;const m=Math.max(r,p),b=Math.min(i,p+h.content.size),y=h.textBetween(m-p,b-p,void 0,"");yq(y,o.find,s).forEach(w=>{if(w.index===void 0)return;const g=m+w.index+1,x=g+w[0].length,k={from:n.tr.mapping.map(g),to:n.tr.mapping.map(x)},E=o.handler({state:n,range:k,match:w,commands:l,chain:u,can:c,pasteEvent:s,dropEvent:a});f.push(E)})}),f.every(h=>h!==null)}const vq=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)===null||e===void 0||e.setData("text/html",t),n};function wq(t){const{editor:e,rules:n}=t;let r=null,i=!1,o=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a=typeof DragEvent<"u"?new DragEvent("drop"):null;const l=({state:c,from:f,to:d,rule:h,pasteEvt:p})=>{const m=c.tr,b=tg({state:c,transaction:m});if(!(!bq({editor:e,state:b,from:Math.max(f-1,0),to:d.b-1,rule:h,pasteEvent:p,dropEvent:a})||!m.steps.length))return a=typeof DragEvent<"u"?new DragEvent("drop"):null,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,m};return n.map(c=>new Kr({view(f){const d=h=>{var p;r=!((p=f.dom.parentElement)===null||p===void 0)&&p.contains(h.target)?f.dom.parentElement:null};return window.addEventListener("dragstart",d),{destroy(){window.removeEventListener("dragstart",d)}}},props:{handleDOMEvents:{drop:(f,d)=>(o=r===f.dom.parentElement,a=d,!1),paste:(f,d)=>{var h;const p=(h=d.clipboardData)===null||h===void 0?void 0:h.getData("text/html");return s=d,i=!!(p!=null&&p.includes("data-pm-slice")),!1}}},appendTransaction:(f,d,h)=>{const p=f[0],m=p.getMeta("uiEvent")==="paste"&&!i,b=p.getMeta("uiEvent")==="drop"&&!o,y=p.getMeta("applyPasteRules"),v=!!y;if(!m&&!b&&!v)return;if(v){const{from:x,text:k}=y,E=x+k.length,D=vq(k);return l({rule:c,state:h,from:x,to:{b:E},pasteEvt:D})}const w=d.doc.content.findDiffStart(h.doc.content),g=d.doc.content.findDiffEnd(h.doc.content);if(!(!mq(w)||!g||w===g.b))return l({rule:c,state:h,from:w,to:g,pasteEvt:s})}}))}function kq(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return[...new Set(e)]}class Au{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=Au.resolve(e),this.schema=fq(this.extensions,n),this.setupExtensions()}static resolve(e){const n=Au.sort(Au.flatten(e)),r=kq(n.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),n}static flatten(e){return e.map(n=>{const r={name:n.name,options:n.options,storage:n.storage},i=ye(n,"addExtensions",r);return i?[n,...this.flatten(i())]:n}).flat(10)}static sort(e){return e.sort((r,i)=>{const o=ye(r,"priority")||100,s=ye(i,"priority")||100;return o>s?-1:o{const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:Qy(n.name,this.schema)},i=ye(n,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,n=Au.sort([...this.extensions].reverse()),r=[],i=[],o=n.map(s=>{const a={name:s.name,options:s.options,storage:s.storage,editor:e,type:Qy(s.name,this.schema)},l=[],u=ye(s,"addKeyboardShortcuts",a);let c={};if(s.type==="mark"&&ye(s,"exitable",a)&&(c.ArrowRight=()=>Ll.handleExit({editor:e,mark:s})),u){const m=Object.fromEntries(Object.entries(u()).map(([b,y])=>[b,()=>y({editor:e})]));c={...c,...m}}const f=Fj(c);l.push(f);const d=ye(s,"addInputRules",a);uC(s,e.options.enableInputRules)&&d&&r.push(...d());const h=ye(s,"addPasteRules",a);uC(s,e.options.enablePasteRules)&&h&&i.push(...h());const p=ye(s,"addProseMirrorPlugins",a);if(p){const m=p();l.push(...m)}return l}).flat();return[pq({editor:e,rules:r}),...wq({editor:e,rules:i}),...o]}get attributes(){return QM(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:n}=rg(this.extensions);return Object.fromEntries(n.filter(r=>!!ye(r,"addNodeView")).map(r=>{const i=this.attributes.filter(l=>l.type===r.name),o={name:r.name,options:r.options,storage:r.storage,editor:e,type:yn(r.name,this.schema)},s=ye(r,"addNodeView",o);if(!s)return[];const a=(l,u,c,f)=>{const d=Zv(l,i);return s()({editor:e,node:l,getPos:c,decorations:f,HTMLAttributes:d,extension:r})};return[r.name,a]}))}setupExtensions(){this.extensions.forEach(e=>{var n;this.editor.extensionStorage[e.name]=e.storage;const r={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:Qy(e.name,this.schema)};e.type==="mark"&&(!((n=Ue(ye(e,"keepOnSplit",r)))!==null&&n!==void 0)||n)&&this.splittableMarks.push(e.name);const i=ye(e,"onBeforeCreate",r),o=ye(e,"onCreate",r),s=ye(e,"onUpdate",r),a=ye(e,"onSelectionUpdate",r),l=ye(e,"onTransaction",r),u=ye(e,"onFocus",r),c=ye(e,"onBlur",r),f=ye(e,"onDestroy",r);i&&this.editor.on("beforeCreate",i),o&&this.editor.on("create",o),s&&this.editor.on("update",s),a&&this.editor.on("selectionUpdate",a),l&&this.editor.on("transaction",l),u&&this.editor.on("focus",u),c&&this.editor.on("blur",c),f&&this.editor.on("destroy",f)})}}function xq(t){return Object.prototype.toString.call(t).slice(8,-1)}function cp(t){return xq(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function og(t,e){const n={...t};return cp(t)&&cp(e)&&Object.keys(e).forEach(r=>{cp(e[r])&&cp(t[r])?n[r]=og(t[r],e[r]):n[r]=e[r]}),n}let Eo=class Yv{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Ue(ye(this,"addOptions",{name:this.name}))),this.storage=Ue(ye(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Yv(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>og(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Yv({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Ue(ye(n,"addOptions",{name:n.name})),n.storage=Ue(ye(n,"addStorage",{name:n.name,options:n.options})),n}};function eO(t,e,n){const{from:r,to:i}=e,{blockSeparator:o=` +`))),0,0):he.empty;let f=t.someProp("clipboardTextParser",d=>d(e,i,r,t));if(f)a=f;else{let d=i.marks(),{schema:h}=t.state,p=gh.fromSchema(h);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let b=s.appendChild(document.createElement("p"));m&&b.appendChild(p.serializeNode(h.text(m,d)))})}}else t.someProp("transformPastedHTML",f=>{n=f(n,t)}),s=jz(n),vh&&qz(s);let u=s&&s.querySelector("[data-pm-slice]"),c=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(c&&c[3])for(let f=+c[3];f>0;f--){let d=s.firstChild;for(;d&&d.nodeType!=1;)d=d.nextSibling;if(!d)break;s=d}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||xx.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||c),context:i,ruleFromNode(d){return d.nodeName=="BR"&&!d.nextSibling&&d.parentNode&&!Pz.test(d.parentNode.nodeName)?{ignore:!0}:null}})),c)a=Uz(J6(a,+c[1],+c[2]),c[4]);else if(a=he.maxOpen(zz(a.content,i),!0),a.openStart||a.openEnd){let f=0,d=0;for(let h=a.content.firstChild;f{a=f(a,t)}),a}const Pz=/^(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 zz(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.index(n)),o,s=[];if(t.forEach(a=>{if(!s)return;let l=i.findWrapping(a.type),u;if(!l)return s=null;if(u=s.length&&o.length&&OM(l,o,a,s[s.length-1],0))s[s.length-1]=u;else{s.length&&(s[s.length-1]=DM(s[s.length-1],o.length));let c=MM(a,l);s.push(c),i=i.matchType(c.type),o=l}}),s)return oe.from(s)}return t}function MM(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,oe.from(t));return t}function OM(t,e,n,r,i){if(i1&&(o=0),i=n&&(a=e<0?s.contentMatchAt(0).fillBefore(a,o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(oe.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(a))}function J6(t,e,n){return e]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=$M().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&NM[r[1].toLowerCase()])&&(t=i.map(o=>"<"+o+">").join("")+t+i.map(o=>"").reverse().join("")),n.innerHTML=t,i)for(let o=0;o=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;i=oe.from(l.create(r[a+1],i)),o++,s++}return new he(i,o,s)}const ar={},lr={},Vz={touchstart:!0,touchmove:!0};class Hz{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.compositionNode=null,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 Wz(t){for(let e in ar){let n=ar[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{Kz(t,r)&&!Dx(t,r)&&(t.editable||!(r.type in lr))&&n(t,r)},Vz[e]?{passive:!0}:void 0)}sr&&t.dom.addEventListener("input",()=>null),Gv(t)}function Vs(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function Jz(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function Gv(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>Dx(t,r))})}function Dx(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function Kz(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function Gz(t,e){!Dx(t,e)&&ar[e.type]&&(t.editable||!(e.type in lr))&&ar[e.type](t,e)}lr.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!RM(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Si&&er&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),nc&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",i=>i(t,qa(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||Bz(t,n)?n.preventDefault():Vs(t,"key")};lr.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};lr.keypress=(t,e)=>{let n=e;if(RM(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||ri&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof He)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",o=>o(t,r.$from.pos,r.$to.pos,i))&&t.dispatch(t.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};function eg(t){return{left:t.clientX,top:t.clientY}}function Zz(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function Nx(t,e,n,r,i){if(r==-1)return!1;let o=t.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(t.someProp(e,a=>s>o.depth?a(t,n,o.nodeAfter,o.before(s),i,!0):a(t,n,o.node(s),o.before(s),i,!1)))return!0;return!1}function Bu(t,e,n){t.focused||t.focus();let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function Yz(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&_e.isSelectable(r)?(Bu(t,new _e(n)),!0):!1}function Qz(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof _e&&(r=n.node);let o=t.state.doc.resolve(e);for(let s=o.depth+1;s>0;s--){let a=s>o.depth?o.nodeAfter:o.node(s);if(_e.isSelectable(a)){r&&n.$from.depth>0&&s>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?i=o.before(n.$from.depth):i=o.before(s);break}}return i!=null?(Bu(t,_e.create(t.state.doc,i)),!0):!1}function Xz(t,e,n,r,i){return Nx(t,"handleClickOn",e,n,r)||t.someProp("handleClick",o=>o(t,e,r))||(i?Qz(t,n):Yz(t,n))}function ej(t,e,n,r){return Nx(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function tj(t,e,n,r){return Nx(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||nj(t,n,r)}function nj(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(Bu(t,He.create(r,0,r.content.size)),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let s=o>i.depth?i.nodeAfter:i.node(o),a=i.before(o);if(s.inlineContent)Bu(t,He.create(r,a+1,a+1+s.content.size));else if(_e.isSelectable(s))Bu(t,_e.create(r,a));else continue;return!0}}function $x(t){return om(t)}const IM=ri?"metaKey":"ctrlKey";ar.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=$x(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&Zz(n,t.input.lastClick)&&!n[IM]&&(t.input.lastClick.type=="singleClick"?o="doubleClick":t.input.lastClick.type=="doubleClick"&&(o="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let s=t.posAtCoords(eg(n));s&&(o=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new rj(t,s,n,!!r)):(o=="doubleClick"?ej:tj)(t,s.pos,s.inside,n)?n.preventDefault():Vs(t,"pointer"))};class rj{constructor(e,n,r,i){this.view=e,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[IM],this.allowDefault=r.shiftKey;let o,s;if(n.inside>-1)o=e.state.doc.nodeAt(n.inside),s=n.inside;else{let c=e.state.doc.resolve(n.pos);o=c.parent,s=c.depth?c.before():0}const a=i?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l&&l.dom.nodeType==1?l.dom:null;let{selection:u}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||u instanceof _e&&u.from<=s&&u.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&$i&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Vs(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Ho(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(eg(e))),this.updateAllowDefault(e),this.allowDefault||!n?Vs(this.view,"pointer"):Xz(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||sr&&this.mightDrag&&!this.mightDrag.node.isAtom||er&&!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)?(Bu(this.view,je.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):Vs(this.view,"pointer")}move(e){this.updateAllowDefault(e),Vs(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}ar.touchstart=t=>{t.input.lastTouch=Date.now(),$x(t),Vs(t,"pointer")};ar.touchmove=t=>{t.input.lastTouch=Date.now(),Vs(t,"pointer")};ar.contextmenu=t=>$x(t);function RM(t,e){return t.composing?!0:sr&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const ij=Si?5e3:-1;lr.compositionstart=lr.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),om(t,!0),t.markCursor=null;else if(om(t),$i&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(s.nodeType==3){t.domSelection().collapse(s,s.nodeValue.length);break}else i=s,o=-1}}t.input.composing=!0}FM(t,ij)};lr.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,FM(t,20))};function FM(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>om(t),e))}function LM(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=sj());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function oj(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=YP(e.focusNode,e.focusOffset),r=QP(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,o=t.domObserver.lastChangedTextNode;if(n==o||r==o)return o;if(!i||!i.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let s=n.pmViewDesc;if(!(!s||!s.isText(n.nodeValue)))return r}}return n||r}function sj(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function om(t,e=!1){if(!(Si&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),LM(t),e||t.docView&&t.docView.dirty){let n=Mx(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):t.updateState(t.state),!0}return!1}}function aj(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const Id=wr&&ia<15||nc&&iz<604;ar.copy=lr.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let o=Id?null:n.clipboardData,s=r.content(),{dom:a,text:l}=AM(t,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):aj(t,a),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function lj(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function uj(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Rd(t,r.value,null,i,e):Rd(t,r.textContent,r.innerHTML,i,e)},50)}function Rd(t,e,n,r,i){let o=TM(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,i,o||he.empty)))return!0;if(!o)return!1;let s=lj(o),a=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(o);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function BM(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}lr.paste=(t,e)=>{let n=e;if(t.composing&&!Si)return;let r=Id?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&Rd(t,BM(r),r.getData("text/html"),i,n)?n.preventDefault():uj(t,n)};class PM{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const zM=ri?"altKey":"ctrlKey";ar.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=t.state.selection,o=i.empty?null:t.posAtCoords(eg(n)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof _e?i.to-1:i.to))){if(r&&r.mightDrag)s=_e.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let f=t.docView.nearestDesc(n.target,!0);f&&f.node.type.spec.draggable&&f!=t.docView&&(s=_e.create(t.state.doc,f.posBefore))}}let a=(s||t.state.selection).content(),{dom:l,text:u,slice:c}=AM(t,a);n.dataTransfer.clearData(),n.dataTransfer.setData(Id?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",Id||n.dataTransfer.setData("text/plain",u),t.dragging=new PM(c,!n[zM],s)};ar.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};lr.dragover=lr.dragenter=(t,e)=>e.preventDefault();lr.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(eg(n));if(!i)return;let o=t.state.doc.resolve(i.pos),s=r&&r.slice;s?t.someProp("transformPasted",p=>{s=p(s,t)}):s=TM(t,BM(n.dataTransfer),Id?null:n.dataTransfer.getData("text/html"),!1,o);let a=!!(r&&!n[zM]);if(t.someProp("handleDrop",p=>p(t,n,s||he.empty,a))){n.preventDefault();return}if(!s)return;n.preventDefault();let l=s?XT(t.state.doc,o.pos,s):o.pos;l==null&&(l=o.pos);let u=t.state.tr;if(a){let{node:p}=r;p?p.replace(u):u.deleteSelection()}let c=u.mapping.map(l),f=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,d=u.doc;if(f?u.replaceRangeWith(c,c,s.content.firstChild):u.replaceRange(c,c,s),u.doc.eq(d))return;let h=u.doc.resolve(c);if(f&&_e.isSelectable(s.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(s.content.firstChild))u.setSelection(new _e(h));else{let p=u.mapping.map(l);u.mapping.maps[u.mapping.maps.length-1].forEach((m,b,y,v)=>p=v),u.setSelection(Ox(t,h,u.doc.resolve(p)))}t.focus(),t.dispatch(u.setMeta("uiEvent","drop"))};ar.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Ho(t)},20))};ar.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};ar.beforeinput=(t,e)=>{if(er&&Si&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",o=>o(t,qa(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in lr)ar[t]=lr[t];function Fd(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class sm{constructor(e,n){this.toDOM=e,this.spec=n||hl,this.side=this.spec.side||0}map(e,n,r,i){let{pos:o,deleted:s}=e.mapResult(n.from+i,this.side<0?-1:1);return s?null:new Br(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof sm&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Fd(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class sa{constructor(e,n){this.attrs=e,this.spec=n||hl}map(e,n,r,i){let o=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,s=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new Br(o,s,this)}valid(e,n){return n.from=e&&(!o||o(a.spec))&&r.push(a.copy(a.from+i,a.to+i))}for(let s=0;se){let a=this.children[s]+1;this.children[s+2].findInner(e-a,n-a,r,i+a,o)}}map(e,n,r){return this==Ln||e.maps.length==0?this:this.mapInner(e,n,0,0,r||hl)}mapInner(e,n,r,i,o){let s;for(let a=0;a{let u=l+r,c;if(c=UM(n,a,u)){for(i||(i=this.children.slice());oa&&f.to=e){this.children[a]==e&&(r=this.children[a+2]);break}let o=e+1,s=o+n.content.size;for(let a=0;ao&&l.type instanceof sa){let u=Math.max(o,l.from)-o,c=Math.min(s,l.to)-o;ui.map(e,n,hl));return Ls.from(r)}forChild(e,n){if(n.isLeaf)return Kt.empty;let r=[];for(let i=0;in instanceof Kt)?e:e.reduce((n,r)=>n.concat(r instanceof Kt?r:r.members),[]))}}}function fj(t,e,n,r,i,o,s){let a=t.slice();for(let u=0,c=o;u{let b=m-p-(h-d);for(let y=0;yv+c-f)continue;let w=a[y]+c-f;h>=w?a[y+1]=d<=w?-2:-1:d>=c&&b&&(a[y]+=b,a[y+1]+=b)}f+=b}),c=n.maps[u].map(c,-1)}let l=!1;for(let u=0;u=r.content.size){l=!0;continue}let d=n.map(t[u+1]+o,-1),h=d-i,{index:p,offset:m}=r.content.findIndex(f),b=r.maybeChild(p);if(b&&m==f&&m+b.nodeSize==h){let y=a[u+2].mapInner(n,b,c+1,t[u]+o+1,s);y!=Ln?(a[u]=f,a[u+1]=h,a[u+2]=y):(a[u+1]=-2,l=!0)}else l=!0}if(l){let u=dj(a,t,e,n,i,o,s),c=am(u,r,0,s);e=c.local;for(let f=0;fn&&s.to{let u=UM(t,a,l+n);if(u){o=!0;let c=am(u,a,n+l+1,r);c!=Ln&&i.push(l,l+a.nodeSize,c)}});let s=qM(o?VM(t):t,-n).sort(pl);for(let a=0;a0;)e++;t.splice(e,0,n)}function Ky(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=Ln&&e.push(r)}),t.cursorWrapper&&e.push(Kt.create(t.state.doc,[t.cursorWrapper.deco])),Ls.from(e)}const hj={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},pj=wr&&ia<=11;class mj{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class gj{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new mj,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;ii.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),pj&&(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,hj)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;nthis.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(j6(this.view)){if(this.suppressingSelectionUpdates)return Ho(this.view);if(wr&&ia<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Tl(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let o=e.focusNode;o;o=$d(o))n.add(o);for(let o=e.anchorNode;o;o=$d(o))if(n.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&j6(e)&&!this.ignoreSelectionChange(r),o=-1,s=-1,a=!1,l=[];if(e.editable)for(let c=0;cf.nodeName=="BR");if(c.length==2){let[f,d]=c;f.parentNode&&f.parentNode.parentNode==d.parentNode?d.remove():f.remove()}else{let{focusNode:f}=this.currentSelection;for(let d of c){let h=d.parentNode;h&&h.nodeName=="LI"&&(!f||vj(e,f)!=h)&&d.remove()}}}let u=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)-1||i)&&(o>-1&&(e.docView.markDirty(o,s),yj(e)),this.handleDOMChange(o,s,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Ho(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let c=0;ci;b--){let y=r.childNodes[b-1],v=y.pmViewDesc;if(y.nodeName=="BR"&&!v){o=b;break}if(!v||v.size)break}let f=t.state.doc,d=t.someProp("domParser")||xx.fromSchema(t.state.schema),h=f.resolve(s),p=null,m=d.parse(r,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:i,to:o,preserveWhitespace:h.parent.type.whitespace=="pre"?"full":!0,findPositions:u,ruleFromNode:kj,context:h});if(u&&u[0].pos!=null){let b=u[0].pos,y=u[1]&&u[1].pos;y==null&&(y=b),p={anchor:b+s,head:y+s}}return{doc:m,sel:p,from:s,to:a}}function kj(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(sr&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||sr&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const xj=/^(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 Ej(t,e,n,r,i){let o=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let O=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,N=Mx(t,O);if(N&&!t.state.selection.eq(N)){if(er&&Si&&t.input.lastKeyCode===13&&Date.now()-100R(t,qa(13,"Enter"))))return;let C=t.state.tr.setSelection(N);O=="pointer"?C.setMeta("pointer",!0):O=="key"&&C.scrollIntoView(),o&&C.setMeta("composition",o),t.dispatch(C)}return}let s=t.state.doc.resolve(e),a=s.sharedDepth(n);e=s.before(a+1),n=t.state.doc.resolve(n).after(a+1);let l=t.state.selection,u=wj(t,e,n),c=t.state.doc,f=c.slice(u.from,u.to),d,h;t.input.lastKeyCode===8&&Date.now()-100Date.now()-225||Si)&&i.some(O=>O.nodeType==1&&!xj.test(O.nodeName))&&(!p||p.endA>=p.endB)&&t.someProp("handleKeyDown",O=>O(t,qa(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!p)if(r&&l instanceof He&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(u.sel&&u.sel.anchor!=u.sel.head))p={start:l.from,endA:l.to,endB:l.to};else{if(u.sel){let O=X6(t,t.state.doc,u.sel);if(O&&!O.eq(t.state.selection)){let N=t.state.tr.setSelection(O);o&&N.setMeta("composition",o),t.dispatch(N)}}return}t.input.domChangeCount++,t.state.selection.fromt.state.selection.from&&p.start<=t.state.selection.from+2&&t.state.selection.from>=u.from?p.start=t.state.selection.from:p.endA=t.state.selection.to-2&&t.state.selection.to<=u.to&&(p.endB+=t.state.selection.to-p.endA,p.endA=t.state.selection.to)),wr&&ia<=11&&p.endB==p.start+1&&p.endA==p.start&&p.start>u.from&&u.doc.textBetween(p.start-u.from-1,p.start-u.from+1)=="  "&&(p.start--,p.endA--,p.endB--);let m=u.doc.resolveNoCache(p.start-u.from),b=u.doc.resolveNoCache(p.endB-u.from),y=c.resolve(p.start),v=m.sameParent(b)&&m.parent.inlineContent&&y.end()>=p.endA,w;if((nc&&t.input.lastIOSEnter>Date.now()-225&&(!v||i.some(O=>O.nodeName=="DIV"||O.nodeName=="P"))||!v&&m.posO(t,qa(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>p.start&&Cj(c,p.start,p.endA,m,b)&&t.someProp("handleKeyDown",O=>O(t,qa(8,"Backspace")))){Si&&er&&t.domObserver.suppressSelectionUpdates();return}er&&Si&&p.endB==p.start&&(t.input.lastAndroidDelete=Date.now()),Si&&!v&&m.start()!=b.start()&&b.parentOffset==0&&m.depth==b.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==p.endA&&(p.endB-=2,b=u.doc.resolveNoCache(p.endB-u.from),setTimeout(()=>{t.someProp("handleKeyDown",function(O){return O(t,qa(13,"Enter"))})},20));let g=p.start,x=p.endA,k,E,D;if(v){if(m.pos==b.pos)wr&&ia<=11&&m.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Ho(t),20)),k=t.state.tr.delete(g,x),E=c.resolve(p.start).marksAcross(c.resolve(p.endA));else if(p.endA==p.endB&&(D=Sj(m.parent.content.cut(m.parentOffset,b.parentOffset),y.parent.content.cut(y.parentOffset,p.endA-y.start()))))k=t.state.tr,D.type=="add"?k.addMark(g,x,D.mark):k.removeMark(g,x,D.mark);else if(m.parent.child(m.index()).isText&&m.index()==b.index()-(b.textOffset?0:1)){let O=m.parent.textBetween(m.parentOffset,b.parentOffset);if(t.someProp("handleTextInput",N=>N(t,g,x,O)))return;k=t.state.tr.insertText(O,g,x)}}if(k||(k=t.state.tr.replace(g,x,u.doc.slice(p.start-u.from,p.endB-u.from))),u.sel){let O=X6(t,k.doc,u.sel);O&&!(er&&Si&&t.composing&&O.empty&&(p.start!=p.endB||t.input.lastAndroidDeletee.content.size?null:Ox(t,e.resolve(n.anchor),e.resolve(n.head))}function Sj(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,o=r,s,a,l;for(let c=0;cc.mark(a.addToSet(c.marks));else if(i.length==0&&o.length==1)a=o[0],s="remove",l=c=>c.mark(a.removeFromSet(c.marks));else return null;let u=[];for(let c=0;cn||Gy(s,!0,!1)0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let o=t.node(r).maybeChild(t.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function _j(t,e,n,r,i){let o=t.findDiffStart(e,n);if(o==null)return null;let{a:s,b:a}=t.findDiffEnd(e,n+t.size,n+e.size);if(i=="end"){let l=Math.max(0,o-Math.min(s,a));r-=s+l-o}if(s=s?o-r:0;o-=l,o&&o=a?o-r:0;o-=l,o&&o=56320&&e<=57343&&n>=55296&&n<=56319}class Aj{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Hz,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(oC),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=rC(this),nC(this),this.nodeViews=iC(this),this.docView=R6(this.state.doc,tC(this),Ky(this),this.dom,this),this.domObserver=new gj(this,(r,i,o,s)=>Ej(this,r,i,o,s)),this.domObserver.start(),Wz(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Gv(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(oC),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let i=this.state,o=!1,s=!1;e.storedMarks&&this.composing&&(LM(this),s=!0),this.state=e;let a=i.plugins!=e.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let h=iC(this);Mj(h,this.nodeViews)&&(this.nodeViews=h,o=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&Gv(this),this.editable=rC(this),nC(this);let l=Ky(this),u=tC(this),c=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",f=o||!this.docView.matchesNode(e.doc,u,l);(f||!e.selection.eq(i.selection))&&(s=!0);let d=c=="preserve"&&s&&this.dom.style.overflowAnchor==null&&az(this);if(s){this.domObserver.stop();let h=f&&(wr||er)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&Tj(i.selection,e.selection);if(f){let p=er?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=oj(this)),(o||!this.docView.update(e.doc,u,l,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=R6(e.doc,u,l,this.dom,this)),p&&!this.trackWrites&&(h=!0)}h||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&Dz(this))?Ho(this,h):(SM(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():d&&lz(d)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof _e){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&M6(this,n.getBoundingClientRect(),e)}else M6(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n0&&this.state.doc.nodeAt(o))==r.node&&(i=o)}this.dragging=new PM(e.slice,e.move,i<0?void 0:_e.create(this.state.doc,i))}someProp(e,n){let r=this._props&&this._props[e],i;if(r!=null&&(i=n?n(r):r))return i;for(let s=0;sn.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return pz(this,e)}coordsAtPos(e,n=1){return gM(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let i=this.docView.posFromDOM(e,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,n){return vz(this,n||this.state,e)}pasteHTML(e,n){return Rd(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return Rd(this,e,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(Jz(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Ky(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,GP())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return Gz(this,e)}dispatch(e){let n=this._props.dispatchTransaction;n?n.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return sr&&this.root.nodeType===11&&ez(this.dom.ownerDocument)==this.dom&&bj(this,e)||e}domSelection(){return this.root.getSelection()}}function tC(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[Br.node(0,t.state.doc.content.size,e)]}function nC(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Br.widget(t.state.selection.head,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function rC(t){return!t.someProp("editable",e=>e(t.state)===!1)}function Tj(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function iC(t){let e=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function Mj(t,e){let n=0,r=0;for(let i in t){if(t[i]!=e[i])return!0;n++}for(let i in e)r++;return n!=r}function oC(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var da={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:"'"},lm={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Oj=typeof navigator<"u"&&/Mac/.test(navigator.platform),Dj=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Mn=0;Mn<10;Mn++)da[48+Mn]=da[96+Mn]=String(Mn);for(var Mn=1;Mn<=24;Mn++)da[Mn+111]="F"+Mn;for(var Mn=65;Mn<=90;Mn++)da[Mn]=String.fromCharCode(Mn+32),lm[Mn]=String.fromCharCode(Mn);for(var Zy in da)lm.hasOwnProperty(Zy)||(lm[Zy]=da[Zy]);function Nj(t){var e=Oj&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Dj&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?lm:da)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const $j=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function Ij(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,o,s;for(let a=0;a127)&&(o=da[r.keyCode])&&o!=i){let a=e[Yy(o,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}const Lj=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function WM(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const Bj=(t,e,n)=>{let r=WM(t,n);if(!r)return!1;let i=Rx(r);if(!i){let s=r.blockRange(),a=s&&Nc(s);return a==null?!1:(e&&e(t.tr.lift(s,a).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&ZM(t,i,e))return!0;if(r.parent.content.size==0&&(rc(o,"end")||_e.isSelectable(o))){let s=Y1(t.doc,r.before(),r.after(),he.empty);if(s&&s.slice.size{let r=WM(t,n);if(!r)return!1;let i=Rx(r);return i?JM(t,i,e):!1},zj=(t,e,n)=>{let r=KM(t,n);if(!r)return!1;let i=Fx(r);return i?JM(t,i,e):!1};function JM(t,e,n){let r=e.nodeBefore,i=r,o=e.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let c=i.lastChild;if(!c)return!1;i=c}let s=e.nodeAfter,a=s,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let c=a.firstChild;if(!c)return!1;a=c}let u=Y1(t.doc,o,l,he.empty);if(!u||u.from!=o||u instanceof Ni&&u.slice.size>=l-o)return!1;if(n){let c=t.tr.step(u);c.setSelection(He.create(c.doc,o)),n(c.scrollIntoView())}return!0}function rc(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const jj=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;o=Rx(r)}let s=o&&o.nodeBefore;return!s||!_e.isSelectable(s)?!1:(e&&e(t.tr.setSelection(_e.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function Rx(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function KM(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset{let r=KM(t,n);if(!r)return!1;let i=Fx(r);if(!i)return!1;let o=i.nodeAfter;if(ZM(t,i,e))return!0;if(r.parent.content.size==0&&(rc(o,"start")||_e.isSelectable(o))){let s=Y1(t.doc,r.before(),r.after(),he.empty);if(s&&s.slice.size{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset=0;e--){let n=t.node(e);if(t.index(e)+1{let n=t.selection,r=n instanceof _e,i;if(r){if(n.node.isTextblock||!xa(t.doc,n.from))return!1;i=n.from}else if(i=Z1(t.doc,n.from,-1),i==null)return!1;if(e){let o=t.tr.join(i);r&&o.setSelection(_e.create(o.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},Hj=(t,e)=>{let n=t.selection,r;if(n instanceof _e){if(n.node.isTextblock||!xa(t.doc,n.to))return!1;r=n.to}else if(r=Z1(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},Wj=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),o=i&&Nc(i);return o==null?!1:(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},Jj=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(` +`).scrollIntoView()),!0)};function GM(t){for(let e=0;e{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=GM(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let a=n.after(),l=t.tr.replaceWith(a,a,s.createAndFill());l.setSelection(je.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},Gj=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof dl||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=GM(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!r.parentOffset&&i.index(){let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(Lu(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Nc(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)},Yj=(t,e)=>{let{$from:n,to:r}=t.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),e&&e(t.tr.setSelection(_e.create(t.doc,i))),!0)};function Qj(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||xa(t.doc,e.pos))?!1:(n&&n(t.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0)}function ZM(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o,s;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(Qj(t,e,n))return!0;let a=e.parent.canReplace(e.index(),e.index()+1);if(a&&(o=(s=r.contentMatchAt(r.childCount)).findWrapping(i.type))&&s.matchType(o[0]||i.type).validEnd){if(n){let f=e.pos+i.nodeSize,d=oe.empty;for(let m=o.length-1;m>=0;m--)d=oe.from(o[m].create(null,d));d=oe.from(r.copy(d));let h=t.tr.step(new _r(e.pos-1,f,e.pos,f,new he(d,1,0),o.length,!0)),p=f+2*o.length;xa(h.doc,p)&&h.join(p),n(h.scrollIntoView())}return!0}let l=je.findFrom(e,1),u=l&&l.$from.blockRange(l.$to),c=u&&Nc(u);if(c!=null&&c>=e.depth)return n&&n(t.tr.lift(u,c).scrollIntoView()),!0;if(a&&rc(i,"start",!0)&&rc(r,"end")){let f=r,d=[];for(;d.push(f),!f.isTextblock;)f=f.lastChild;let h=i,p=1;for(;!h.isTextblock;h=h.firstChild)p++;if(f.canReplace(f.childCount,f.childCount,h.content)){if(n){let m=oe.empty;for(let y=d.length-1;y>=0;y--)m=oe.from(d[y].copy(m));let b=t.tr.step(new _r(e.pos-d.length,e.pos+i.nodeSize,e.pos+p,e.pos+i.nodeSize-p,new he(m,d.length,0),0,!0));n(b.scrollIntoView())}return!0}}return!1}function YM(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(n&&n(e.tr.setSelection(He.create(e.doc,t<0?i.start(o):i.end(o)))),!0):!1}}const Xj=YM(-1),eq=YM(1);function tq(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=s&&Ax(s,t,e);return a?(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0):!1}}function sC(t,e=null){return function(n,r){let i=!1;for(let o=0;o{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)i=!0;else{let c=n.doc.resolve(u),f=c.index();i=c.parent.canReplaceWith(f,f+1,t)}})}if(!i)return!1;if(r){let o=n.tr;for(let s=0;s=2&&i.node(s.depth-1).type.compatibleContent(t)&&s.startIndex==0){if(i.index(s.depth-1)==0)return!1;let c=n.doc.resolve(s.start-2);l=new tm(c,c,s.depth),s.endIndex=0;c--)o=oe.from(n[c].type.create(n[c].attrs,o));t.step(new _r(e.start-(r?2:0),e.end,e.start,e.end,new he(o,0,0),n.length,!0));let s=0;for(let c=0;cs.childCount>0&&s.firstChild.type==t);return o?n?r.node(o.depth-1).type==t?oq(e,n,t,o):sq(e,n,o):!0:!1}}function oq(t,e,n,r){let i=t.tr,o=r.end,s=r.$to.end(r.depth);om;p--)h-=i.child(p).nodeSize,r.delete(h-1,h+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==i.childCount,u=o.node(-1),c=o.index(-1);if(!u.canReplace(c+(a?0:1),c+1,s.content.append(l?oe.empty:oe.from(i))))return!1;let f=o.pos,d=f+s.nodeSize;return r.step(new _r(f-(a?1:0),d+(l?1:0),f+1,d-1,new he((a?oe.empty:oe.from(i.copy(oe.empty))).append(l?oe.empty:oe.from(i.copy(oe.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function aq(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,u=>u.childCount>0&&u.firstChild.type==t);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let a=o.parent,l=a.child(s-1);if(l.type!=t)return!1;if(n){let u=l.lastChild&&l.lastChild.type==a.type,c=oe.from(u?t.create():null),f=new he(oe.from(t.create(null,oe.from(a.type.create(null,c)))),u?3:1,0),d=o.start,h=o.end;n(e.tr.step(new _r(d-(u?3:1),h,d,h,f,1,!0)).scrollIntoView())}return!0}}function tg(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}let ng=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:n,state:r}=this,{view:i}=n,{tr:o}=r,s=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...c)=>{const f=l(...c)(s);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),f}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i,a=[],l=!!e,u=e||o.tr,c=()=>(!l&&n&&!u.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(u),a.every(d=>d===!0)),f={...Object.fromEntries(Object.entries(r).map(([d,h])=>[d,(...m)=>{const b=this.buildProps(u,n),y=h(...m)(b);return a.push(y),f}])),run:c};return f}createCan(e){const{rawCommands:n,state:r}=this,i=!1,o=e||r.tr,s=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(n).map(([l,u])=>[l,(...c)=>u(...c)({...s,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(e,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i,a={tr:e,editor:i,view:s,state:tg({state:o,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([l,u])=>[l,(...c)=>u(...c)(a)]))}};return a}};class lq{constructor(){this.callbacks={}}on(e,n){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(n),this}emit(e,...n){const r=this.callbacks[e];return r&&r.forEach(i=>i.apply(this,n)),this}off(e,n){const r=this.callbacks[e];return r&&(n?this.callbacks[e]=r.filter(i=>i!==n):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}function ye(t,e,n){return t.config[e]===void 0&&t.parent?ye(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?ye(t.parent,e,n):null}):t.config[e]}function rg(t){const e=t.filter(i=>i.type==="extension"),n=t.filter(i=>i.type==="node"),r=t.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function QM(t){const e=[],{nodeExtensions:n,markExtensions:r}=rg(t),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage,extensions:i},l=ye(s,"addGlobalAttributes",a);if(!l)return;l().forEach(c=>{c.types.forEach(f=>{Object.entries(c.attributes).forEach(([d,h])=>{e.push({type:f,name:d,attribute:{...o,...h}})})})})}),i.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage},l=ye(s,"addAttributes",a);if(!l)return;const u=l();Object.entries(u).forEach(([c,f])=>{const d={...o,...f};typeof(d==null?void 0:d.default)=="function"&&(d.default=d.default()),d!=null&&d.isRequired&&(d==null?void 0:d.default)===void 0&&delete d.default,e.push({type:s.name,name:c,attribute:d})})}),e}function yn(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function nn(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){const a=o?o.split(" "):[],l=r[i]?r[i].split(" "):[],u=a.filter(c=>!l.includes(c));r[i]=[...l,...u].join(" ")}else i==="style"?r[i]=[r[i],o].join("; "):r[i]=o}),r},{})}function Zv(t,e){return e.filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>nn(n,r),{})}function XM(t){return typeof t=="function"}function Ve(t,e=void 0,...n){return XM(t)?e?t.bind(e)(...n):t(...n):t}function uq(t={}){return Object.keys(t).length===0&&t.constructor===Object}function cq(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function aC(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const i=e.reduce((o,s)=>{const a=s.attribute.parseHTML?s.attribute.parseHTML(n):cq(n.getAttribute(s.name));return a==null?o:{...o,[s.name]:a}},{});return{...r,...i}}}}function lC(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&uq(n)?!1:n!=null))}function fq(t,e){var n;const r=QM(t),{nodeExtensions:i,markExtensions:o}=rg(t),s=(n=i.find(u=>ye(u,"topNode")))===null||n===void 0?void 0:n.name,a=Object.fromEntries(i.map(u=>{const c=r.filter(y=>y.type===u.name),f={name:u.name,options:u.options,storage:u.storage,editor:e},d=t.reduce((y,v)=>{const w=ye(v,"extendNodeSchema",f);return{...y,...w?w(u):{}}},{}),h=lC({...d,content:Ve(ye(u,"content",f)),marks:Ve(ye(u,"marks",f)),group:Ve(ye(u,"group",f)),inline:Ve(ye(u,"inline",f)),atom:Ve(ye(u,"atom",f)),selectable:Ve(ye(u,"selectable",f)),draggable:Ve(ye(u,"draggable",f)),code:Ve(ye(u,"code",f)),whitespace:Ve(ye(u,"whitespace",f)),defining:Ve(ye(u,"defining",f)),isolating:Ve(ye(u,"isolating",f)),attrs:Object.fromEntries(c.map(y=>{var v;return[y.name,{default:(v=y==null?void 0:y.attribute)===null||v===void 0?void 0:v.default}]}))}),p=Ve(ye(u,"parseHTML",f));p&&(h.parseDOM=p.map(y=>aC(y,c)));const m=ye(u,"renderHTML",f);m&&(h.toDOM=y=>m({node:y,HTMLAttributes:Zv(y,c)}));const b=ye(u,"renderText",f);return b&&(h.toText=b),[u.name,h]})),l=Object.fromEntries(o.map(u=>{const c=r.filter(b=>b.type===u.name),f={name:u.name,options:u.options,storage:u.storage,editor:e},d=t.reduce((b,y)=>{const v=ye(y,"extendMarkSchema",f);return{...b,...v?v(u):{}}},{}),h=lC({...d,inclusive:Ve(ye(u,"inclusive",f)),excludes:Ve(ye(u,"excludes",f)),group:Ve(ye(u,"group",f)),spanning:Ve(ye(u,"spanning",f)),code:Ve(ye(u,"code",f)),attrs:Object.fromEntries(c.map(b=>{var y;return[b.name,{default:(y=b==null?void 0:b.attribute)===null||y===void 0?void 0:y.default}]}))}),p=Ve(ye(u,"parseHTML",f));p&&(h.parseDOM=p.map(b=>aC(b,c)));const m=ye(u,"renderHTML",f);return m&&(h.toDOM=b=>m({mark:b,HTMLAttributes:Zv(b,c)})),[u.name,h]}));return new jT({topNode:s,nodes:a,marks:l})}function Qy(t,e){return e.nodes[t]||e.marks[t]||null}function uC(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}const dq=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(i,o,s,a)=>{var l,u;const c=((u=(l=i.type.spec).toText)===null||u===void 0?void 0:u.call(l,{node:i,pos:o,parent:s,index:a}))||i.textContent||"%leaf%";n+=c.slice(0,Math.max(0,r-o))}),n};function Lx(t){return Object.prototype.toString.call(t)==="[object RegExp]"}let ig=class{constructor(e){this.find=e.find,this.handler=e.handler}};const hq=(t,e)=>{if(Lx(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function cp(t){var e;const{editor:n,from:r,to:i,text:o,rules:s,plugin:a}=t,{view:l}=n;if(l.composing)return!1;const u=l.state.doc.resolve(r);if(u.parent.type.spec.code||!((e=u.nodeBefore||u.nodeAfter)===null||e===void 0)&&e.marks.find(d=>d.type.spec.code))return!1;let c=!1;const f=dq(u)+o;return s.forEach(d=>{if(c)return;const h=hq(f,d.find);if(!h)return;const p=l.state.tr,m=tg({state:l.state,transaction:p}),b={from:r-(h[0].length-o.length),to:i},{commands:y,chain:v,can:w}=new ng({editor:n,state:m});d.handler({state:m,range:b,match:h,commands:y,chain:v,can:w})===null||!p.steps.length||(p.setMeta(a,{transform:p,from:r,to:i,text:o}),l.dispatch(p),c=!0)}),c}function pq(t){const{editor:e,rules:n}=t,r=new Kr({state:{init(){return null},apply(i,o){const s=i.getMeta(r);if(s)return s;const a=i.getMeta("applyInputRules");return!!a&&setTimeout(()=>{const{from:u,text:c}=a,f=u+c.length;cp({editor:e,from:u,to:f,text:c,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:o}},props:{handleTextInput(i,o,s,a){return cp({editor:e,from:o,to:s,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&cp({editor:e,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;const{$cursor:s}=i.state.selection;return s?cp({editor:e,from:s.pos,to:s.pos,text:` +`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function mq(t){return typeof t=="number"}let gq=class{constructor(e){this.find=e.find,this.handler=e.handler}};const yq=(t,e,n)=>{if(Lx(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(i=>{const o=[i.text];return o.index=i.index,o.input=t,o.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(i.replaceWith)),o}):[]};function bq(t){const{editor:e,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:a}=t,{commands:l,chain:u,can:c}=new ng({editor:e,state:n}),f=[];return n.doc.nodesBetween(r,i,(h,p)=>{if(!h.isTextblock||h.type.spec.code)return;const m=Math.max(r,p),b=Math.min(i,p+h.content.size),y=h.textBetween(m-p,b-p,void 0,"");yq(y,o.find,s).forEach(w=>{if(w.index===void 0)return;const g=m+w.index+1,x=g+w[0].length,k={from:n.tr.mapping.map(g),to:n.tr.mapping.map(x)},E=o.handler({state:n,range:k,match:w,commands:l,chain:u,can:c,pasteEvent:s,dropEvent:a});f.push(E)})}),f.every(h=>h!==null)}const vq=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)===null||e===void 0||e.setData("text/html",t),n};function wq(t){const{editor:e,rules:n}=t;let r=null,i=!1,o=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a=typeof DragEvent<"u"?new DragEvent("drop"):null;const l=({state:c,from:f,to:d,rule:h,pasteEvt:p})=>{const m=c.tr,b=tg({state:c,transaction:m});if(!(!bq({editor:e,state:b,from:Math.max(f-1,0),to:d.b-1,rule:h,pasteEvent:p,dropEvent:a})||!m.steps.length))return a=typeof DragEvent<"u"?new DragEvent("drop"):null,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,m};return n.map(c=>new Kr({view(f){const d=h=>{var p;r=!((p=f.dom.parentElement)===null||p===void 0)&&p.contains(h.target)?f.dom.parentElement:null};return window.addEventListener("dragstart",d),{destroy(){window.removeEventListener("dragstart",d)}}},props:{handleDOMEvents:{drop:(f,d)=>(o=r===f.dom.parentElement,a=d,!1),paste:(f,d)=>{var h;const p=(h=d.clipboardData)===null||h===void 0?void 0:h.getData("text/html");return s=d,i=!!(p!=null&&p.includes("data-pm-slice")),!1}}},appendTransaction:(f,d,h)=>{const p=f[0],m=p.getMeta("uiEvent")==="paste"&&!i,b=p.getMeta("uiEvent")==="drop"&&!o,y=p.getMeta("applyPasteRules"),v=!!y;if(!m&&!b&&!v)return;if(v){const{from:x,text:k}=y,E=x+k.length,D=vq(k);return l({rule:c,state:h,from:x,to:{b:E},pasteEvt:D})}const w=d.doc.content.findDiffStart(h.doc.content),g=d.doc.content.findDiffEnd(h.doc.content);if(!(!mq(w)||!g||w===g.b))return l({rule:c,state:h,from:w,to:g,pasteEvt:s})}}))}function kq(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return[...new Set(e)]}class Au{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=Au.resolve(e),this.schema=fq(this.extensions,n),this.setupExtensions()}static resolve(e){const n=Au.sort(Au.flatten(e)),r=kq(n.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),n}static flatten(e){return e.map(n=>{const r={name:n.name,options:n.options,storage:n.storage},i=ye(n,"addExtensions",r);return i?[n,...this.flatten(i())]:n}).flat(10)}static sort(e){return e.sort((r,i)=>{const o=ye(r,"priority")||100,s=ye(i,"priority")||100;return o>s?-1:o{const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:Qy(n.name,this.schema)},i=ye(n,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,n=Au.sort([...this.extensions].reverse()),r=[],i=[],o=n.map(s=>{const a={name:s.name,options:s.options,storage:s.storage,editor:e,type:Qy(s.name,this.schema)},l=[],u=ye(s,"addKeyboardShortcuts",a);let c={};if(s.type==="mark"&&ye(s,"exitable",a)&&(c.ArrowRight=()=>Ll.handleExit({editor:e,mark:s})),u){const m=Object.fromEntries(Object.entries(u()).map(([b,y])=>[b,()=>y({editor:e})]));c={...c,...m}}const f=Fj(c);l.push(f);const d=ye(s,"addInputRules",a);uC(s,e.options.enableInputRules)&&d&&r.push(...d());const h=ye(s,"addPasteRules",a);uC(s,e.options.enablePasteRules)&&h&&i.push(...h());const p=ye(s,"addProseMirrorPlugins",a);if(p){const m=p();l.push(...m)}return l}).flat();return[pq({editor:e,rules:r}),...wq({editor:e,rules:i}),...o]}get attributes(){return QM(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:n}=rg(this.extensions);return Object.fromEntries(n.filter(r=>!!ye(r,"addNodeView")).map(r=>{const i=this.attributes.filter(l=>l.type===r.name),o={name:r.name,options:r.options,storage:r.storage,editor:e,type:yn(r.name,this.schema)},s=ye(r,"addNodeView",o);if(!s)return[];const a=(l,u,c,f)=>{const d=Zv(l,i);return s()({editor:e,node:l,getPos:c,decorations:f,HTMLAttributes:d,extension:r})};return[r.name,a]}))}setupExtensions(){this.extensions.forEach(e=>{var n;this.editor.extensionStorage[e.name]=e.storage;const r={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:Qy(e.name,this.schema)};e.type==="mark"&&(!((n=Ve(ye(e,"keepOnSplit",r)))!==null&&n!==void 0)||n)&&this.splittableMarks.push(e.name);const i=ye(e,"onBeforeCreate",r),o=ye(e,"onCreate",r),s=ye(e,"onUpdate",r),a=ye(e,"onSelectionUpdate",r),l=ye(e,"onTransaction",r),u=ye(e,"onFocus",r),c=ye(e,"onBlur",r),f=ye(e,"onDestroy",r);i&&this.editor.on("beforeCreate",i),o&&this.editor.on("create",o),s&&this.editor.on("update",s),a&&this.editor.on("selectionUpdate",a),l&&this.editor.on("transaction",l),u&&this.editor.on("focus",u),c&&this.editor.on("blur",c),f&&this.editor.on("destroy",f)})}}function xq(t){return Object.prototype.toString.call(t).slice(8,-1)}function fp(t){return xq(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function og(t,e){const n={...t};return fp(t)&&fp(e)&&Object.keys(e).forEach(r=>{fp(e[r])&&fp(t[r])?n[r]=og(t[r],e[r]):n[r]=e[r]}),n}let Eo=class Yv{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Ve(ye(this,"addOptions",{name:this.name}))),this.storage=Ve(ye(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Yv(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>og(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Yv({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Ve(ye(n,"addOptions",{name:n.name})),n.storage=Ve(ye(n,"addStorage",{name:n.name,options:n.options})),n}};function eO(t,e,n){const{from:r,to:i}=e,{blockSeparator:o=` -`,textSerializers:s={}}=n||{};let a="";return t.nodesBetween(r,i,(l,u,c,f)=>{var d;l.isBlock&&u>r&&(a+=o);const h=s==null?void 0:s[l.type.name];if(h)return c&&(a+=h({node:l,pos:u,parent:c,index:f,range:e})),!1;l.isText&&(a+=(d=l==null?void 0:l.text)===null||d===void 0?void 0:d.slice(Math.max(r,u)-u,i-u))}),a}function tO(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const Eq=Eo.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Kr({key:new xo("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,{ranges:o}=i,s=Math.min(...o.map(c=>c.$from.pos)),a=Math.max(...o.map(c=>c.$to.pos)),l=tO(n);return eO(r,{from:s,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),Sq=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),Cq=(t=!1)=>({commands:e})=>e.setContent("",t),_q=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:s})=>{t.doc.nodesBetween(o.pos,s.pos,(a,l)=>{if(a.type.isText)return;const{doc:u,mapping:c}=e,f=u.resolve(c.map(l)),d=u.resolve(c.map(l+a.nodeSize)),h=f.blockRange(d);if(!h)return;const p=Nc(h);if(a.type.isTextblock){const{defaultType:m}=f.parent.contentMatchAt(f.index());e.setNodeMarkup(h.start,m)}(p||p===0)&&e.lift(h,p)})}),!0},Aq=t=>e=>t(e),Tq=()=>({state:t,dispatch:e})=>Gj(t,e),Mq=(t,e)=>({editor:n,tr:r})=>{const{state:i}=n,o=i.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const s=r.mapping.map(e);return r.insert(s,o.content),r.setSelection(new He(r.doc.resolve(s-1))),!0},Oq=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const i=t.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(e){const a=i.before(o),l=i.after(o);t.delete(a,l).scrollIntoView()}return!0}return!1},Dq=t=>({tr:e,state:n,dispatch:r})=>{const i=yn(t,n.schema),o=e.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===i){if(r){const l=o.before(s),u=o.after(s);e.delete(l,u).scrollIntoView()}return!0}return!1},Nq=t=>({tr:e,dispatch:n})=>{const{from:r,to:i}=t;return n&&e.delete(r,i),!0},$q=()=>({state:t,dispatch:e})=>Lj(t,e),Iq=()=>({commands:t})=>t.keyboardShortcut("Enter"),Rq=()=>({state:t,dispatch:e})=>Kj(t,e);function lm(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:Lx(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function Qv(t,e,n={}){return t.find(r=>r.type===e&&lm(r.attrs,n))}function Fq(t,e,n={}){return!!Qv(t,e,n)}function Bx(t,e,n={}){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if(t.parentOffset===r.offset&&r.offset!==0&&(r=t.parent.childBefore(t.parentOffset)),!r.node)return;const i=Qv([...r.node.marks],e,n);if(!i)return;let o=r.index,s=t.start()+r.offset,a=o+1,l=s+r.node.nodeSize;for(Qv([...r.node.marks],e,n);o>0&&i.isInSet(t.parent.child(o-1).marks);)o-=1,s-=t.parent.child(o).nodeSize;for(;a({tr:n,state:r,dispatch:i})=>{const o=Sa(t,r.schema),{doc:s,selection:a}=n,{$from:l,from:u,to:c}=a;if(i){const f=Bx(l,o,e);if(f&&f.from<=u&&f.to>=c){const d=He.create(s,f.from,f.to);n.setSelection(d)}}return!0},Bq=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r({editor:n,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const s=()=>{sg()&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&t===null||t===!1)return!0;if(o&&t===null&&!nO(n.state.selection))return s(),!0;const a=rO(i.doc,t)||n.state.selection,l=n.state.selection.eq(a);return o&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},zq=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),jq=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),iO=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&iO(r)}return t};function cC(t){const e=`${t}`,n=new window.DOMParser().parseFromString(e,"text/html").body;return iO(n)}function um(t,e,n){n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,i=typeof t=="string";if(r)try{return Array.isArray(t)&&t.length>0?oe.fromArray(t.map(s=>e.nodeFromJSON(s))):e.nodeFromJSON(t)}catch(o){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",o),um("",e,n)}if(i){let o=e,s=!1,a="";n.errorOnInvalidContent&&(o=new jT({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(s=!0,a=typeof c=="string"?c:c.outerHTML,null)}]}})}));const l=xx.fromSchema(o),u=n.slice?l.parseSlice(cC(t),n.parseOptions).content:l.parse(cC(t),n.parseOptions);if(n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)});return u}return um("",e,n)}function qq(t,e,n){const r=t.steps.length-1;if(r{s===0&&(s=c)}),t.setSelection(je.near(t.doc.resolve(s),n))}const Vq=t=>!("type"in t),Uq=(t,e,n)=>({tr:r,dispatch:i,editor:o})=>{var s;if(i){n={parseOptions:{},updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let a;try{a=um(e,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:(s=n.errorOnInvalidContent)!==null&&s!==void 0?s:o.options.enableContentCheck})}catch{return!1}let{from:l,to:u}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},c=!0,f=!0;if((Vq(a)?a:[a]).forEach(p=>{p.check(),c=c?p.isText&&p.marks.length===0:!1,f=f?p.isBlock:!1}),l===u&&f){const{parent:p}=r.doc.resolve(l);p.isTextblock&&!p.type.spec.code&&!p.childCount&&(l-=1,u+=1)}let h;c?(Array.isArray(e)?h=e.map(p=>p.text||"").join(""):typeof e=="object"&&e&&e.text?h=e.text:h=e,r.insertText(h,l,u)):(h=a,r.replaceWith(l,u,h)),n.updateSelection&&qq(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:l,text:h}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:l,text:h})}return!0},Hq=()=>({state:t,dispatch:e})=>Uj(t,e),Wq=()=>({state:t,dispatch:e})=>Hj(t,e),Jq=()=>({state:t,dispatch:e})=>Bj(t,e),Kq=()=>({state:t,dispatch:e})=>qj(t,e),Gq=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Z1(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},Zq=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Z1(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},Yq=()=>({state:t,dispatch:e})=>Pj(t,e),Qq=()=>({state:t,dispatch:e})=>zj(t,e);function oO(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function Xq(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,i,o,s;for(let a=0;a({editor:e,view:n,tr:r,dispatch:i})=>{const o=Xq(t).split(/-(?!$)/),s=o.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),a=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{n.someProp("handleKeyDown",u=>u(n,a))});return l==null||l.steps.forEach(u=>{const c=u.map(r.mapping);c&&i&&r.maybeStep(c)}),!0};function Ld(t,e,n={}){const{from:r,to:i,empty:o}=t.selection,s=e?yn(e,t.schema):null,a=[];t.doc.nodesBetween(r,i,(f,d)=>{if(f.isText)return;const h=Math.max(r,d),p=Math.min(i,d+f.nodeSize);a.push({node:f,from:h,to:p})});const l=i-r,u=a.filter(f=>s?s.name===f.node.type.name:!0).filter(f=>lm(f.node.attrs,n,{strict:!1}));return o?!!u.length:u.reduce((f,d)=>f+d.to-d.from,0)>=l}const tV=(t,e={})=>({state:n,dispatch:r})=>{const i=yn(t,n.schema);return Ld(n,i,e)?Wj(n,r):!1},nV=()=>({state:t,dispatch:e})=>Zj(t,e),rV=t=>({state:e,dispatch:n})=>{const r=yn(t,e.schema);return iq(r)(e,n)},iV=()=>({state:t,dispatch:e})=>Jj(t,e);function ag(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function fC(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,i)=>(n.includes(i)||(r[i]=t[i]),r),{})}const oV=(t,e)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=ag(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(o=yn(t,r.schema)),a==="mark"&&(s=Sa(t,r.schema)),i&&n.selection.ranges.forEach(l=>{r.doc.nodesBetween(l.$from.pos,l.$to.pos,(u,c)=>{o&&o===u.type&&n.setNodeMarkup(c,void 0,fC(u.attrs,e)),s&&u.marks.length&&u.marks.forEach(f=>{s===f.type&&n.addMark(c,c+u.nodeSize,s.create(fC(f.attrs,e)))})})}),!0):!1},sV=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),aV=()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size}),lV=()=>({state:t,dispatch:e})=>jj(t,e),uV=()=>({state:t,dispatch:e})=>Vj(t,e),cV=()=>({state:t,dispatch:e})=>Yj(t,e),fV=()=>({state:t,dispatch:e})=>eq(t,e),dV=()=>({state:t,dispatch:e})=>Xj(t,e);function Xv(t,e,n={},r={}){return um(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const hV=(t,e=!1,n={},r={})=>({editor:i,tr:o,dispatch:s,commands:a})=>{var l,u;const{doc:c}=o;if(n.preserveWhitespace!=="full"){const f=Xv(t,i.schema,n,{errorOnInvalidContent:(l=r.errorOnInvalidContent)!==null&&l!==void 0?l:i.options.enableContentCheck});return s&&o.replaceWith(0,c.content.size,f).setMeta("preventUpdate",!e),!0}return s&&o.setMeta("preventUpdate",!e),a.insertContentAt({from:0,to:c.content.size},t,{parseOptions:n,errorOnInvalidContent:(u=r.errorOnInvalidContent)!==null&&u!==void 0?u:i.options.enableContentCheck})};function lg(t,e){const n=Sa(e,t.schema),{from:r,to:i,empty:o}=t.selection,s=[];o?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,i,l=>{s.push(...l.marks)});const a=s.find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function pV(t){for(let e=0;e0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function Px(t){return e=>mV(e.$from,t)}function gV(t,e){const n=mh.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function yV(t,e){const n={from:0,to:t.content.size};return eO(t,n,e)}function bV(t,e){const n=yn(e,t.schema),{from:r,to:i}=t.selection,o=[];t.doc.nodesBetween(r,i,a=>{o.push(a)});const s=o.reverse().find(a=>a.type.name===n.name);return s?{...s.attrs}:{}}function vV(t,e){const n=ag(typeof e=="string"?e:e.name,t.schema);return n==="node"?bV(t,e):n==="mark"?lg(t,e):{}}function sO(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(i=>{const o=n.resolve(t-1),s=Bx(o,i.type);s&&r.push({mark:i,...s})}):n.nodesBetween(t,e,(i,o)=>{!i||(i==null?void 0:i.nodeSize)===void 0||r.push(...i.marks.map(s=>({from:o,to:o+i.nodeSize,mark:s})))}),r}function c0(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=t.find(o=>o.type===e&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function ew(t,e,n={}){const{empty:r,ranges:i}=t.selection,o=e?Sa(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(f=>o?o.name===f.type.name:!0).find(f=>lm(f.attrs,n,{strict:!1}));let s=0;const a=[];if(i.forEach(({$from:f,$to:d})=>{const h=f.pos,p=d.pos;t.doc.nodesBetween(h,p,(m,b)=>{if(!m.isText&&!m.marks.length)return;const y=Math.max(h,b),v=Math.min(p,b+m.nodeSize),w=v-y;s+=w,a.push(...m.marks.map(g=>({mark:g,from:y,to:v})))})}),s===0)return!1;const l=a.filter(f=>o?o.name===f.mark.type.name:!0).filter(f=>lm(f.mark.attrs,n,{strict:!1})).reduce((f,d)=>f+d.to-d.from,0),u=a.filter(f=>o?f.mark.type!==o&&f.mark.type.excludes(o):!0).reduce((f,d)=>f+d.to-d.from,0);return(l>0?l+u:l)>=s}function wV(t,e,n={}){if(!e)return Ld(t,null,n)||ew(t,null,n);const r=ag(e,t.schema);return r==="node"?Ld(t,e,n):r==="mark"?ew(t,e,n):!1}function dC(t,e){const{nodeExtensions:n}=rg(e),r=n.find(s=>s.name===t);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=Ue(ye(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function kV(t){const e=t.type.createAndFill();return e?t.eq(e):!1}function xV(t){return t instanceof _e}function EV(t,e,n){var r;const{selection:i}=e;let o=null;if(nO(i)&&(o=i.$cursor),o){const a=(r=t.storedMarks)!==null&&r!==void 0?r:o.marks();return!!n.isInSet(a)||!a.some(l=>l.type.excludes(n))}const{ranges:s}=i;return s.some(({$from:a,$to:l})=>{let u=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.pos,l.pos,(c,f,d)=>{if(u)return!1;if(c.isInline){const h=!d||d.type.allowsMarkType(n),p=!!n.isInSet(c.marks)||!c.marks.some(m=>m.type.excludes(n));u=h&&p}return!u}),u})}const SV=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:s,ranges:a}=o,l=Sa(t,r.schema);if(i)if(s){const u=lg(r,l);n.addStoredMark(l.create({...u,...e}))}else a.forEach(u=>{const c=u.$from.pos,f=u.$to.pos;r.doc.nodesBetween(c,f,(d,h)=>{const p=Math.max(h,c),m=Math.min(h+d.nodeSize,f);d.marks.find(y=>y.type===l)?d.marks.forEach(y=>{l===y.type&&n.addMark(p,m,l.create({...y.attrs,...e}))}):n.addMark(p,m,l.create(e))})});return EV(r,n,l)},CV=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),_V=(t,e={})=>({state:n,dispatch:r,chain:i})=>{const o=yn(t,n.schema);return o.isTextblock?i().command(({commands:s})=>sC(o,e)(n)?!0:s.clearNodes()).command(({state:s})=>sC(o,e)(s,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},AV=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,i=Ya(t,0,r.content.size),o=_e.create(r,i);e.setSelection(o)}return!0},TV=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:i,to:o}=typeof t=="number"?{from:t,to:t}:t,s=He.atStart(r).from,a=He.atEnd(r).to,l=Ya(i,s,a),u=Ya(o,s,a),c=He.create(r,l,u);e.setSelection(c)}return!0},MV=t=>({state:e,dispatch:n})=>{const r=yn(t,e.schema);return aq(r)(e,n)};function hC(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(i=>e==null?void 0:e.includes(i.type.name));t.tr.ensureMarks(r)}}const OV=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{const{selection:o,doc:s}=e,{$from:a,$to:l}=o,u=i.extensionManager.attributes,c=c0(u,a.node().type.name,a.node().attrs);if(o instanceof _e&&o.node.isBlock)return!a.parentOffset||!Lu(s,a.pos)?!1:(r&&(t&&hC(n,i.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;if(r){const f=l.parentOffset===l.parent.content.size;o instanceof He&&e.deleteSelection();const d=a.depth===0?void 0:pV(a.node(-1).contentMatchAt(a.indexAfter(-1)));let h=f&&d?[{type:d,attrs:c}]:void 0,p=Lu(e.doc,e.mapping.map(a.pos),1,h);if(!h&&!p&&Lu(e.doc,e.mapping.map(a.pos),1,d?[{type:d}]:void 0)&&(p=!0,h=d?[{type:d,attrs:c}]:void 0),p&&(e.split(e.mapping.map(a.pos),1,h),d&&!f&&!a.parentOffset&&a.parent.type!==d)){const m=e.mapping.map(a.before()),b=e.doc.resolve(m);a.node(-1).canReplaceWith(b.index(),b.index()+1,d)&&e.setNodeMarkup(e.mapping.map(a.before()),d)}t&&hC(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},DV=t=>({tr:e,state:n,dispatch:r,editor:i})=>{var o;const s=yn(t,n.schema),{$from:a,$to:l}=n.selection,u=n.selection.node;if(u&&u.isBlock||a.depth<2||!a.sameParent(l))return!1;const c=a.node(-1);if(c.type!==s)return!1;const f=i.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==s||a.index(-2)!==a.node(-2).childCount-1)return!1;if(r){let b=oe.empty;const y=a.index(-1)?1:a.index(-2)?2:3;for(let E=a.depth-y;E>=a.depth-3;E-=1)b=oe.from(a.node(E).copy(b));const v=a.indexAfter(-1){if(k>-1)return!1;E.isTextblock&&E.content.size===0&&(k=D+1)}),k>-1&&e.setSelection(He.near(e.doc.resolve(k))),e.scrollIntoView()}return!0}const d=l.pos===a.end()?c.contentMatchAt(0).defaultType:null,h=c0(f,c.type.name,c.attrs),p=c0(f,a.node().type.name,a.node().attrs);e.delete(a.pos,l.pos);const m=d?[{type:s,attrs:h},{type:d,attrs:p}]:[{type:s,attrs:h}];if(!Lu(e.doc,a.pos,2))return!1;if(r){const{selection:b,storedMarks:y}=n,{splittableMarks:v}=i.extensionManager,w=y||b.$to.parentOffset&&b.$from.marks();if(e.split(a.pos,2,m).scrollIntoView(),!w||!r)return!0;const g=w.filter(x=>v.includes(x.type.name));e.ensureMarks(g)}return!0},Xy=(t,e)=>{const n=Px(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&xa(t.doc,n.pos)&&t.join(n.pos),!0},eb=(t,e)=>{const n=Px(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&xa(t.doc,r)&&t.join(r),!0},NV=(t,e,n,r={})=>({editor:i,tr:o,state:s,dispatch:a,chain:l,commands:u,can:c})=>{const{extensions:f,splittableMarks:d}=i.extensionManager,h=yn(t,s.schema),p=yn(e,s.schema),{selection:m,storedMarks:b}=s,{$from:y,$to:v}=m,w=y.blockRange(v),g=b||m.$to.parentOffset&&m.$from.marks();if(!w)return!1;const x=Px(k=>dC(k.type.name,f))(m);if(w.depth>=1&&x&&w.depth-x.depth<=1){if(x.node.type===h)return u.liftListItem(p);if(dC(x.node.type.name,f)&&h.validContent(x.node.content)&&a)return l().command(()=>(o.setNodeMarkup(x.pos,h),!0)).command(()=>Xy(o,h)).command(()=>eb(o,h)).run()}return!n||!g||!a?l().command(()=>c().wrapInList(h,r)?!0:u.clearNodes()).wrapInList(h,r).command(()=>Xy(o,h)).command(()=>eb(o,h)).run():l().command(()=>{const k=c().wrapInList(h,r),E=g.filter(D=>d.includes(D.type.name));return o.ensureMarks(E),k?!0:u.clearNodes()}).wrapInList(h,r).command(()=>Xy(o,h)).command(()=>eb(o,h)).run()},$V=(t,e={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,s=Sa(t,r.schema);return ew(r,s,e)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,e)},IV=(t,e,n={})=>({state:r,commands:i})=>{const o=yn(t,r.schema),s=yn(e,r.schema);return Ld(r,o,n)?i.setNode(s):i.setNode(o,n)},RV=(t,e={})=>({state:n,commands:r})=>{const i=yn(t,n.schema);return Ld(n,i,e)?r.lift(i):r.wrapIn(i,e)},FV=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r=0;l-=1)s.step(a.steps[l].invert(a.docs[l]));if(o.text){const l=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,t.schema.text(o.text,l))}else s.delete(o.from,o.to)}return!0}}return!1},LV=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:i}=n;return r||e&&i.forEach(o=>{t.removeMark(o.$from.pos,o.$to.pos)}),!0},BV=(t,e={})=>({tr:n,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:s=!1}=e,{selection:a}=n,l=Sa(t,r.schema),{$from:u,empty:c,ranges:f}=a;if(!i)return!0;if(c&&s){let{from:d,to:h}=a;const p=(o=u.marks().find(b=>b.type===l))===null||o===void 0?void 0:o.attrs,m=Bx(u,l,p);m&&(d=m.from,h=m.to),n.removeMark(d,h,l)}else f.forEach(d=>{n.removeMark(d.$from.pos,d.$to.pos,l)});return n.removeStoredMark(l),!0},PV=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=ag(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(o=yn(t,r.schema)),a==="mark"&&(s=Sa(t,r.schema)),i&&n.selection.ranges.forEach(l=>{const u=l.$from.pos,c=l.$to.pos;r.doc.nodesBetween(u,c,(f,d)=>{o&&o===f.type&&n.setNodeMarkup(d,void 0,{...f.attrs,...e}),s&&f.marks.length&&f.marks.forEach(h=>{if(s===h.type){const p=Math.max(d,u),m=Math.min(d+f.nodeSize,c);n.addMark(p,m,s.create({...h.attrs,...e}))}})})}),!0):!1},zV=(t,e={})=>({state:n,dispatch:r})=>{const i=yn(t,n.schema);return tq(i,e)(n,r)},jV=(t,e={})=>({state:n,dispatch:r})=>{const i=yn(t,n.schema);return nq(i,e)(n,r)};var qV=Object.freeze({__proto__:null,blur:Sq,clearContent:Cq,clearNodes:_q,command:Aq,createParagraphNear:Tq,cut:Mq,deleteCurrentNode:Oq,deleteNode:Dq,deleteRange:Nq,deleteSelection:$q,enter:Iq,exitCode:Rq,extendMarkRange:Lq,first:Bq,focus:Pq,forEach:zq,insertContent:jq,insertContentAt:Uq,joinBackward:Jq,joinDown:Wq,joinForward:Kq,joinItemBackward:Gq,joinItemForward:Zq,joinTextblockBackward:Yq,joinTextblockForward:Qq,joinUp:Hq,keyboardShortcut:eV,lift:tV,liftEmptyBlock:nV,liftListItem:rV,newlineInCode:iV,resetAttributes:oV,scrollIntoView:sV,selectAll:aV,selectNodeBackward:lV,selectNodeForward:uV,selectParentNode:cV,selectTextblockEnd:fV,selectTextblockStart:dV,setContent:hV,setMark:SV,setMeta:CV,setNode:_V,setNodeSelection:AV,setTextSelection:TV,sinkListItem:MV,splitBlock:OV,splitListItem:DV,toggleList:NV,toggleMark:$V,toggleNode:IV,toggleWrap:RV,undoInputRule:FV,unsetAllMarks:LV,unsetMark:BV,updateAttributes:PV,wrapIn:zV,wrapInList:jV});const VV=Eo.create({name:"commands",addCommands(){return{...qV}}}),UV=Eo.create({name:"editable",addProseMirrorPlugins(){return[new Kr({key:new xo("editable"),props:{editable:()=>this.editor.options.editable}})]}}),HV=Eo.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new Kr({key:new xo("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),WV=Eo.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:a})=>{const{selection:l,doc:u}=a,{empty:c,$anchor:f}=l,{pos:d,parent:h}=f,p=f.parent.isTextblock&&d>0?a.doc.resolve(d-1):f,m=p.parent.type.spec.isolating,b=f.pos-f.parentOffset,y=m&&p.parent.childCount===1?b===f.pos:je.atStart(u).from===d;return!c||!h.type.isTextblock||h.textContent.length||!y||y&&f.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return sg()||oO()?o:i},addProseMirrorPlugins(){return[new Kr({key:new xo("clearDocument"),appendTransaction:(t,e,n)=>{if(!(t.some(p=>p.docChanged)&&!e.doc.eq(n.doc)))return;const{empty:i,from:o,to:s}=e.selection,a=je.atStart(e.doc).from,l=je.atEnd(e.doc).to;if(i||!(o===a&&s===l)||!(n.doc.textBetween(0,n.doc.content.size," "," ").length===0))return;const f=n.tr,d=tg({state:n,transaction:f}),{commands:h}=new ng({editor:this.editor,state:d});if(h.clearNodes(),!!f.steps.length)return f}})]}}),JV=Eo.create({name:"tabindex",addProseMirrorPlugins(){return[new Kr({key:new xo("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class Va{get name(){return this.node.type.name}constructor(e,n,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=i}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new Va(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new Va(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new Va(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const i=n.isBlock&&!n.isTextblock,o=this.pos+r+1,s=this.resolvedPos.doc.resolve(o);if(!i&&s.depth<=this.depth)return;const a=new Va(s,this.editor,i,i?n:null);i&&(a.actualDepth=this.depth+1),e.push(new Va(s,this.editor,i,i?n:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===e)if(Object.keys(n).length>0){const o=i.node.attrs,s=Object.keys(n);for(let a=0;a{r&&i.length>0||(s.node.type.name===e&&o.every(l=>n[l]===s.node.attrs[l])&&i.push(s),!(r&&i.length>0)&&(i=i.concat(s.querySelectorAll(e,n,r))))}),i}setAttribute(e){const n=this.editor.state.selection;this.editor.chain().setTextSelection(this.from).updateAttributes(this.node.type.name,e).setTextSelection(n.from).run()}}const KV=`.ProseMirror { +`,textSerializers:s={}}=n||{};let a="";return t.nodesBetween(r,i,(l,u,c,f)=>{var d;l.isBlock&&u>r&&(a+=o);const h=s==null?void 0:s[l.type.name];if(h)return c&&(a+=h({node:l,pos:u,parent:c,index:f,range:e})),!1;l.isText&&(a+=(d=l==null?void 0:l.text)===null||d===void 0?void 0:d.slice(Math.max(r,u)-u,i-u))}),a}function tO(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const Eq=Eo.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Kr({key:new xo("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,{ranges:o}=i,s=Math.min(...o.map(c=>c.$from.pos)),a=Math.max(...o.map(c=>c.$to.pos)),l=tO(n);return eO(r,{from:s,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),Sq=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),Cq=(t=!1)=>({commands:e})=>e.setContent("",t),_q=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:s})=>{t.doc.nodesBetween(o.pos,s.pos,(a,l)=>{if(a.type.isText)return;const{doc:u,mapping:c}=e,f=u.resolve(c.map(l)),d=u.resolve(c.map(l+a.nodeSize)),h=f.blockRange(d);if(!h)return;const p=Nc(h);if(a.type.isTextblock){const{defaultType:m}=f.parent.contentMatchAt(f.index());e.setNodeMarkup(h.start,m)}(p||p===0)&&e.lift(h,p)})}),!0},Aq=t=>e=>t(e),Tq=()=>({state:t,dispatch:e})=>Gj(t,e),Mq=(t,e)=>({editor:n,tr:r})=>{const{state:i}=n,o=i.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const s=r.mapping.map(e);return r.insert(s,o.content),r.setSelection(new He(r.doc.resolve(s-1))),!0},Oq=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const i=t.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(e){const a=i.before(o),l=i.after(o);t.delete(a,l).scrollIntoView()}return!0}return!1},Dq=t=>({tr:e,state:n,dispatch:r})=>{const i=yn(t,n.schema),o=e.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===i){if(r){const l=o.before(s),u=o.after(s);e.delete(l,u).scrollIntoView()}return!0}return!1},Nq=t=>({tr:e,dispatch:n})=>{const{from:r,to:i}=t;return n&&e.delete(r,i),!0},$q=()=>({state:t,dispatch:e})=>Lj(t,e),Iq=()=>({commands:t})=>t.keyboardShortcut("Enter"),Rq=()=>({state:t,dispatch:e})=>Kj(t,e);function um(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:Lx(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function Qv(t,e,n={}){return t.find(r=>r.type===e&&um(r.attrs,n))}function Fq(t,e,n={}){return!!Qv(t,e,n)}function Bx(t,e,n={}){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if(t.parentOffset===r.offset&&r.offset!==0&&(r=t.parent.childBefore(t.parentOffset)),!r.node)return;const i=Qv([...r.node.marks],e,n);if(!i)return;let o=r.index,s=t.start()+r.offset,a=o+1,l=s+r.node.nodeSize;for(Qv([...r.node.marks],e,n);o>0&&i.isInSet(t.parent.child(o-1).marks);)o-=1,s-=t.parent.child(o).nodeSize;for(;a({tr:n,state:r,dispatch:i})=>{const o=Sa(t,r.schema),{doc:s,selection:a}=n,{$from:l,from:u,to:c}=a;if(i){const f=Bx(l,o,e);if(f&&f.from<=u&&f.to>=c){const d=He.create(s,f.from,f.to);n.setSelection(d)}}return!0},Bq=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r({editor:n,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const s=()=>{sg()&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&t===null||t===!1)return!0;if(o&&t===null&&!nO(n.state.selection))return s(),!0;const a=rO(i.doc,t)||n.state.selection,l=n.state.selection.eq(a);return o&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},zq=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),jq=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),iO=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&iO(r)}return t};function cC(t){const e=`${t}`,n=new window.DOMParser().parseFromString(e,"text/html").body;return iO(n)}function cm(t,e,n){n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,i=typeof t=="string";if(r)try{return Array.isArray(t)&&t.length>0?oe.fromArray(t.map(s=>e.nodeFromJSON(s))):e.nodeFromJSON(t)}catch(o){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",o),cm("",e,n)}if(i){let o=e,s=!1,a="";n.errorOnInvalidContent&&(o=new jT({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(s=!0,a=typeof c=="string"?c:c.outerHTML,null)}]}})}));const l=xx.fromSchema(o),u=n.slice?l.parseSlice(cC(t),n.parseOptions).content:l.parse(cC(t),n.parseOptions);if(n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)});return u}return cm("",e,n)}function qq(t,e,n){const r=t.steps.length-1;if(r{s===0&&(s=c)}),t.setSelection(je.near(t.doc.resolve(s),n))}const Uq=t=>!("type"in t),Vq=(t,e,n)=>({tr:r,dispatch:i,editor:o})=>{var s;if(i){n={parseOptions:{},updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let a;try{a=cm(e,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:(s=n.errorOnInvalidContent)!==null&&s!==void 0?s:o.options.enableContentCheck})}catch{return!1}let{from:l,to:u}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},c=!0,f=!0;if((Uq(a)?a:[a]).forEach(p=>{p.check(),c=c?p.isText&&p.marks.length===0:!1,f=f?p.isBlock:!1}),l===u&&f){const{parent:p}=r.doc.resolve(l);p.isTextblock&&!p.type.spec.code&&!p.childCount&&(l-=1,u+=1)}let h;c?(Array.isArray(e)?h=e.map(p=>p.text||"").join(""):typeof e=="object"&&e&&e.text?h=e.text:h=e,r.insertText(h,l,u)):(h=a,r.replaceWith(l,u,h)),n.updateSelection&&qq(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:l,text:h}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:l,text:h})}return!0},Hq=()=>({state:t,dispatch:e})=>Vj(t,e),Wq=()=>({state:t,dispatch:e})=>Hj(t,e),Jq=()=>({state:t,dispatch:e})=>Bj(t,e),Kq=()=>({state:t,dispatch:e})=>qj(t,e),Gq=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Z1(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},Zq=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Z1(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},Yq=()=>({state:t,dispatch:e})=>Pj(t,e),Qq=()=>({state:t,dispatch:e})=>zj(t,e);function oO(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function Xq(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,i,o,s;for(let a=0;a({editor:e,view:n,tr:r,dispatch:i})=>{const o=Xq(t).split(/-(?!$)/),s=o.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),a=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{n.someProp("handleKeyDown",u=>u(n,a))});return l==null||l.steps.forEach(u=>{const c=u.map(r.mapping);c&&i&&r.maybeStep(c)}),!0};function Ld(t,e,n={}){const{from:r,to:i,empty:o}=t.selection,s=e?yn(e,t.schema):null,a=[];t.doc.nodesBetween(r,i,(f,d)=>{if(f.isText)return;const h=Math.max(r,d),p=Math.min(i,d+f.nodeSize);a.push({node:f,from:h,to:p})});const l=i-r,u=a.filter(f=>s?s.name===f.node.type.name:!0).filter(f=>um(f.node.attrs,n,{strict:!1}));return o?!!u.length:u.reduce((f,d)=>f+d.to-d.from,0)>=l}const tU=(t,e={})=>({state:n,dispatch:r})=>{const i=yn(t,n.schema);return Ld(n,i,e)?Wj(n,r):!1},nU=()=>({state:t,dispatch:e})=>Zj(t,e),rU=t=>({state:e,dispatch:n})=>{const r=yn(t,e.schema);return iq(r)(e,n)},iU=()=>({state:t,dispatch:e})=>Jj(t,e);function ag(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function fC(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,i)=>(n.includes(i)||(r[i]=t[i]),r),{})}const oU=(t,e)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=ag(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(o=yn(t,r.schema)),a==="mark"&&(s=Sa(t,r.schema)),i&&n.selection.ranges.forEach(l=>{r.doc.nodesBetween(l.$from.pos,l.$to.pos,(u,c)=>{o&&o===u.type&&n.setNodeMarkup(c,void 0,fC(u.attrs,e)),s&&u.marks.length&&u.marks.forEach(f=>{s===f.type&&n.addMark(c,c+u.nodeSize,s.create(fC(f.attrs,e)))})})}),!0):!1},sU=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),aU=()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size}),lU=()=>({state:t,dispatch:e})=>jj(t,e),uU=()=>({state:t,dispatch:e})=>Uj(t,e),cU=()=>({state:t,dispatch:e})=>Yj(t,e),fU=()=>({state:t,dispatch:e})=>eq(t,e),dU=()=>({state:t,dispatch:e})=>Xj(t,e);function Xv(t,e,n={},r={}){return cm(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const hU=(t,e=!1,n={},r={})=>({editor:i,tr:o,dispatch:s,commands:a})=>{var l,u;const{doc:c}=o;if(n.preserveWhitespace!=="full"){const f=Xv(t,i.schema,n,{errorOnInvalidContent:(l=r.errorOnInvalidContent)!==null&&l!==void 0?l:i.options.enableContentCheck});return s&&o.replaceWith(0,c.content.size,f).setMeta("preventUpdate",!e),!0}return s&&o.setMeta("preventUpdate",!e),a.insertContentAt({from:0,to:c.content.size},t,{parseOptions:n,errorOnInvalidContent:(u=r.errorOnInvalidContent)!==null&&u!==void 0?u:i.options.enableContentCheck})};function lg(t,e){const n=Sa(e,t.schema),{from:r,to:i,empty:o}=t.selection,s=[];o?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,i,l=>{s.push(...l.marks)});const a=s.find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function pU(t){for(let e=0;e0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function Px(t){return e=>mU(e.$from,t)}function gU(t,e){const n=gh.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function yU(t,e){const n={from:0,to:t.content.size};return eO(t,n,e)}function bU(t,e){const n=yn(e,t.schema),{from:r,to:i}=t.selection,o=[];t.doc.nodesBetween(r,i,a=>{o.push(a)});const s=o.reverse().find(a=>a.type.name===n.name);return s?{...s.attrs}:{}}function vU(t,e){const n=ag(typeof e=="string"?e:e.name,t.schema);return n==="node"?bU(t,e):n==="mark"?lg(t,e):{}}function sO(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(i=>{const o=n.resolve(t-1),s=Bx(o,i.type);s&&r.push({mark:i,...s})}):n.nodesBetween(t,e,(i,o)=>{!i||(i==null?void 0:i.nodeSize)===void 0||r.push(...i.marks.map(s=>({from:o,to:o+i.nodeSize,mark:s})))}),r}function f0(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=t.find(o=>o.type===e&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function ew(t,e,n={}){const{empty:r,ranges:i}=t.selection,o=e?Sa(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(f=>o?o.name===f.type.name:!0).find(f=>um(f.attrs,n,{strict:!1}));let s=0;const a=[];if(i.forEach(({$from:f,$to:d})=>{const h=f.pos,p=d.pos;t.doc.nodesBetween(h,p,(m,b)=>{if(!m.isText&&!m.marks.length)return;const y=Math.max(h,b),v=Math.min(p,b+m.nodeSize),w=v-y;s+=w,a.push(...m.marks.map(g=>({mark:g,from:y,to:v})))})}),s===0)return!1;const l=a.filter(f=>o?o.name===f.mark.type.name:!0).filter(f=>um(f.mark.attrs,n,{strict:!1})).reduce((f,d)=>f+d.to-d.from,0),u=a.filter(f=>o?f.mark.type!==o&&f.mark.type.excludes(o):!0).reduce((f,d)=>f+d.to-d.from,0);return(l>0?l+u:l)>=s}function wU(t,e,n={}){if(!e)return Ld(t,null,n)||ew(t,null,n);const r=ag(e,t.schema);return r==="node"?Ld(t,e,n):r==="mark"?ew(t,e,n):!1}function dC(t,e){const{nodeExtensions:n}=rg(e),r=n.find(s=>s.name===t);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=Ve(ye(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function kU(t){const e=t.type.createAndFill();return e?t.eq(e):!1}function xU(t){return t instanceof _e}function EU(t,e,n){var r;const{selection:i}=e;let o=null;if(nO(i)&&(o=i.$cursor),o){const a=(r=t.storedMarks)!==null&&r!==void 0?r:o.marks();return!!n.isInSet(a)||!a.some(l=>l.type.excludes(n))}const{ranges:s}=i;return s.some(({$from:a,$to:l})=>{let u=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.pos,l.pos,(c,f,d)=>{if(u)return!1;if(c.isInline){const h=!d||d.type.allowsMarkType(n),p=!!n.isInSet(c.marks)||!c.marks.some(m=>m.type.excludes(n));u=h&&p}return!u}),u})}const SU=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:s,ranges:a}=o,l=Sa(t,r.schema);if(i)if(s){const u=lg(r,l);n.addStoredMark(l.create({...u,...e}))}else a.forEach(u=>{const c=u.$from.pos,f=u.$to.pos;r.doc.nodesBetween(c,f,(d,h)=>{const p=Math.max(h,c),m=Math.min(h+d.nodeSize,f);d.marks.find(y=>y.type===l)?d.marks.forEach(y=>{l===y.type&&n.addMark(p,m,l.create({...y.attrs,...e}))}):n.addMark(p,m,l.create(e))})});return EU(r,n,l)},CU=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),_U=(t,e={})=>({state:n,dispatch:r,chain:i})=>{const o=yn(t,n.schema);return o.isTextblock?i().command(({commands:s})=>sC(o,e)(n)?!0:s.clearNodes()).command(({state:s})=>sC(o,e)(s,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},AU=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,i=Ya(t,0,r.content.size),o=_e.create(r,i);e.setSelection(o)}return!0},TU=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:i,to:o}=typeof t=="number"?{from:t,to:t}:t,s=He.atStart(r).from,a=He.atEnd(r).to,l=Ya(i,s,a),u=Ya(o,s,a),c=He.create(r,l,u);e.setSelection(c)}return!0},MU=t=>({state:e,dispatch:n})=>{const r=yn(t,e.schema);return aq(r)(e,n)};function hC(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(i=>e==null?void 0:e.includes(i.type.name));t.tr.ensureMarks(r)}}const OU=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{const{selection:o,doc:s}=e,{$from:a,$to:l}=o,u=i.extensionManager.attributes,c=f0(u,a.node().type.name,a.node().attrs);if(o instanceof _e&&o.node.isBlock)return!a.parentOffset||!Lu(s,a.pos)?!1:(r&&(t&&hC(n,i.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;if(r){const f=l.parentOffset===l.parent.content.size;o instanceof He&&e.deleteSelection();const d=a.depth===0?void 0:pU(a.node(-1).contentMatchAt(a.indexAfter(-1)));let h=f&&d?[{type:d,attrs:c}]:void 0,p=Lu(e.doc,e.mapping.map(a.pos),1,h);if(!h&&!p&&Lu(e.doc,e.mapping.map(a.pos),1,d?[{type:d}]:void 0)&&(p=!0,h=d?[{type:d,attrs:c}]:void 0),p&&(e.split(e.mapping.map(a.pos),1,h),d&&!f&&!a.parentOffset&&a.parent.type!==d)){const m=e.mapping.map(a.before()),b=e.doc.resolve(m);a.node(-1).canReplaceWith(b.index(),b.index()+1,d)&&e.setNodeMarkup(e.mapping.map(a.before()),d)}t&&hC(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},DU=t=>({tr:e,state:n,dispatch:r,editor:i})=>{var o;const s=yn(t,n.schema),{$from:a,$to:l}=n.selection,u=n.selection.node;if(u&&u.isBlock||a.depth<2||!a.sameParent(l))return!1;const c=a.node(-1);if(c.type!==s)return!1;const f=i.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==s||a.index(-2)!==a.node(-2).childCount-1)return!1;if(r){let b=oe.empty;const y=a.index(-1)?1:a.index(-2)?2:3;for(let E=a.depth-y;E>=a.depth-3;E-=1)b=oe.from(a.node(E).copy(b));const v=a.indexAfter(-1){if(k>-1)return!1;E.isTextblock&&E.content.size===0&&(k=D+1)}),k>-1&&e.setSelection(He.near(e.doc.resolve(k))),e.scrollIntoView()}return!0}const d=l.pos===a.end()?c.contentMatchAt(0).defaultType:null,h=f0(f,c.type.name,c.attrs),p=f0(f,a.node().type.name,a.node().attrs);e.delete(a.pos,l.pos);const m=d?[{type:s,attrs:h},{type:d,attrs:p}]:[{type:s,attrs:h}];if(!Lu(e.doc,a.pos,2))return!1;if(r){const{selection:b,storedMarks:y}=n,{splittableMarks:v}=i.extensionManager,w=y||b.$to.parentOffset&&b.$from.marks();if(e.split(a.pos,2,m).scrollIntoView(),!w||!r)return!0;const g=w.filter(x=>v.includes(x.type.name));e.ensureMarks(g)}return!0},Xy=(t,e)=>{const n=Px(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&xa(t.doc,n.pos)&&t.join(n.pos),!0},eb=(t,e)=>{const n=Px(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&xa(t.doc,r)&&t.join(r),!0},NU=(t,e,n,r={})=>({editor:i,tr:o,state:s,dispatch:a,chain:l,commands:u,can:c})=>{const{extensions:f,splittableMarks:d}=i.extensionManager,h=yn(t,s.schema),p=yn(e,s.schema),{selection:m,storedMarks:b}=s,{$from:y,$to:v}=m,w=y.blockRange(v),g=b||m.$to.parentOffset&&m.$from.marks();if(!w)return!1;const x=Px(k=>dC(k.type.name,f))(m);if(w.depth>=1&&x&&w.depth-x.depth<=1){if(x.node.type===h)return u.liftListItem(p);if(dC(x.node.type.name,f)&&h.validContent(x.node.content)&&a)return l().command(()=>(o.setNodeMarkup(x.pos,h),!0)).command(()=>Xy(o,h)).command(()=>eb(o,h)).run()}return!n||!g||!a?l().command(()=>c().wrapInList(h,r)?!0:u.clearNodes()).wrapInList(h,r).command(()=>Xy(o,h)).command(()=>eb(o,h)).run():l().command(()=>{const k=c().wrapInList(h,r),E=g.filter(D=>d.includes(D.type.name));return o.ensureMarks(E),k?!0:u.clearNodes()}).wrapInList(h,r).command(()=>Xy(o,h)).command(()=>eb(o,h)).run()},$U=(t,e={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,s=Sa(t,r.schema);return ew(r,s,e)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,e)},IU=(t,e,n={})=>({state:r,commands:i})=>{const o=yn(t,r.schema),s=yn(e,r.schema);return Ld(r,o,n)?i.setNode(s):i.setNode(o,n)},RU=(t,e={})=>({state:n,commands:r})=>{const i=yn(t,n.schema);return Ld(n,i,e)?r.lift(i):r.wrapIn(i,e)},FU=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r=0;l-=1)s.step(a.steps[l].invert(a.docs[l]));if(o.text){const l=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,t.schema.text(o.text,l))}else s.delete(o.from,o.to)}return!0}}return!1},LU=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:i}=n;return r||e&&i.forEach(o=>{t.removeMark(o.$from.pos,o.$to.pos)}),!0},BU=(t,e={})=>({tr:n,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:s=!1}=e,{selection:a}=n,l=Sa(t,r.schema),{$from:u,empty:c,ranges:f}=a;if(!i)return!0;if(c&&s){let{from:d,to:h}=a;const p=(o=u.marks().find(b=>b.type===l))===null||o===void 0?void 0:o.attrs,m=Bx(u,l,p);m&&(d=m.from,h=m.to),n.removeMark(d,h,l)}else f.forEach(d=>{n.removeMark(d.$from.pos,d.$to.pos,l)});return n.removeStoredMark(l),!0},PU=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=ag(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(o=yn(t,r.schema)),a==="mark"&&(s=Sa(t,r.schema)),i&&n.selection.ranges.forEach(l=>{const u=l.$from.pos,c=l.$to.pos;r.doc.nodesBetween(u,c,(f,d)=>{o&&o===f.type&&n.setNodeMarkup(d,void 0,{...f.attrs,...e}),s&&f.marks.length&&f.marks.forEach(h=>{if(s===h.type){const p=Math.max(d,u),m=Math.min(d+f.nodeSize,c);n.addMark(p,m,s.create({...h.attrs,...e}))}})})}),!0):!1},zU=(t,e={})=>({state:n,dispatch:r})=>{const i=yn(t,n.schema);return tq(i,e)(n,r)},jU=(t,e={})=>({state:n,dispatch:r})=>{const i=yn(t,n.schema);return nq(i,e)(n,r)};var qU=Object.freeze({__proto__:null,blur:Sq,clearContent:Cq,clearNodes:_q,command:Aq,createParagraphNear:Tq,cut:Mq,deleteCurrentNode:Oq,deleteNode:Dq,deleteRange:Nq,deleteSelection:$q,enter:Iq,exitCode:Rq,extendMarkRange:Lq,first:Bq,focus:Pq,forEach:zq,insertContent:jq,insertContentAt:Vq,joinBackward:Jq,joinDown:Wq,joinForward:Kq,joinItemBackward:Gq,joinItemForward:Zq,joinTextblockBackward:Yq,joinTextblockForward:Qq,joinUp:Hq,keyboardShortcut:eU,lift:tU,liftEmptyBlock:nU,liftListItem:rU,newlineInCode:iU,resetAttributes:oU,scrollIntoView:sU,selectAll:aU,selectNodeBackward:lU,selectNodeForward:uU,selectParentNode:cU,selectTextblockEnd:fU,selectTextblockStart:dU,setContent:hU,setMark:SU,setMeta:CU,setNode:_U,setNodeSelection:AU,setTextSelection:TU,sinkListItem:MU,splitBlock:OU,splitListItem:DU,toggleList:NU,toggleMark:$U,toggleNode:IU,toggleWrap:RU,undoInputRule:FU,unsetAllMarks:LU,unsetMark:BU,updateAttributes:PU,wrapIn:zU,wrapInList:jU});const UU=Eo.create({name:"commands",addCommands(){return{...qU}}}),VU=Eo.create({name:"editable",addProseMirrorPlugins(){return[new Kr({key:new xo("editable"),props:{editable:()=>this.editor.options.editable}})]}}),HU=Eo.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new Kr({key:new xo("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),WU=Eo.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:a})=>{const{selection:l,doc:u}=a,{empty:c,$anchor:f}=l,{pos:d,parent:h}=f,p=f.parent.isTextblock&&d>0?a.doc.resolve(d-1):f,m=p.parent.type.spec.isolating,b=f.pos-f.parentOffset,y=m&&p.parent.childCount===1?b===f.pos:je.atStart(u).from===d;return!c||!h.type.isTextblock||h.textContent.length||!y||y&&f.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return sg()||oO()?o:i},addProseMirrorPlugins(){return[new Kr({key:new xo("clearDocument"),appendTransaction:(t,e,n)=>{if(!(t.some(p=>p.docChanged)&&!e.doc.eq(n.doc)))return;const{empty:i,from:o,to:s}=e.selection,a=je.atStart(e.doc).from,l=je.atEnd(e.doc).to;if(i||!(o===a&&s===l)||!(n.doc.textBetween(0,n.doc.content.size," "," ").length===0))return;const f=n.tr,d=tg({state:n,transaction:f}),{commands:h}=new ng({editor:this.editor,state:d});if(h.clearNodes(),!!f.steps.length)return f}})]}}),JU=Eo.create({name:"tabindex",addProseMirrorPlugins(){return[new Kr({key:new xo("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class Ua{get name(){return this.node.type.name}constructor(e,n,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=i}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new Ua(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new Ua(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new Ua(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const i=n.isBlock&&!n.isTextblock,o=this.pos+r+1,s=this.resolvedPos.doc.resolve(o);if(!i&&s.depth<=this.depth)return;const a=new Ua(s,this.editor,i,i?n:null);i&&(a.actualDepth=this.depth+1),e.push(new Ua(s,this.editor,i,i?n:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===e)if(Object.keys(n).length>0){const o=i.node.attrs,s=Object.keys(n);for(let a=0;a{r&&i.length>0||(s.node.type.name===e&&o.every(l=>n[l]===s.node.attrs[l])&&i.push(s),!(r&&i.length>0)&&(i=i.concat(s.querySelectorAll(e,n,r))))}),i}setAttribute(e){const n=this.editor.state.selection;this.editor.chain().setTextSelection(this.from).updateAttributes(this.node.type.name,e).setTextSelection(n.from).run()}}const KU=`.ProseMirror { position: relative; } @@ -173,9 +173,9 @@ img.ProseMirror-separator { .tippy-box[data-animation=fade][data-state=hidden] { opacity: 0 -}`;function GV(t,e,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute("data-tiptap-style",""),i.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(i),i}let aO=class extends lq{constructor(e={}){super(),this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n}},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=GV(KV,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,n=!0){this.setOptions({editable:e}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,n){const r=XM(n)?n(e,[...this.state.plugins]):[...this.state.plugins,e],i=this.state.reconfigure({plugins:r});this.view.updateState(i)}unregisterPlugin(e){if(this.isDestroyed)return;const n=typeof e=="string"?`${e}$`:e.key,r=this.state.reconfigure({plugins:this.state.plugins.filter(i=>!i.key.startsWith(n))});this.view.updateState(r)}createExtensionManager(){var e,n;const i=[...this.options.enableCoreExtensions?[UV,Eq.configure({blockSeparator:(n=(e=this.options.coreExtensionOptions)===null||e===void 0?void 0:e.clipboardTextSerializer)===null||n===void 0?void 0:n.blockSeparator}),VV,HV,WV,JV]:[],...this.options.extensions].filter(o=>["extension","node","mark"].includes(o==null?void 0:o.type));this.extensionManager=new Au(i,this)}createCommandManager(){this.commandManager=new ng({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){let e;try{e=Xv(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(o){if(!(o instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(o.message))throw o;this.emit("contentError",{editor:this,error:o,disableCollaboration:()=>{this.options.extensions=this.options.extensions.filter(s=>s.name!=="collaboration"),this.createExtensionManager()}}),e=Xv(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const n=rO(e,this.options.autofocus);this.view=new Aj(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:_u.create({doc:e,selection:n||void 0})});const r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.createNodeViews(),this.prependClass();const i=this.view.dom;i.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(s=>{var a;return(a=this.capturedTransaction)===null||a===void 0?void 0:a.step(s)});return}const n=this.state.apply(e),r=!this.state.selection.eq(n.selection);this.view.updateState(n),this.emit("transaction",{editor:this,transaction:e}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const i=e.getMeta("focus"),o=e.getMeta("blur");i&&this.emit("focus",{editor:this,event:i.event,transaction:e}),o&&this.emit("blur",{editor:this,event:o.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return vV(this.state,e)}isActive(e,n){const r=typeof e=="string"?e:null,i=typeof e=="string"?n:e;return wV(this.state,r,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return gV(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:n=` +}`;function GU(t,e,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute("data-tiptap-style",""),i.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(i),i}let aO=class extends lq{constructor(e={}){super(),this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n}},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=GU(KU,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,n=!0){this.setOptions({editable:e}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,n){const r=XM(n)?n(e,[...this.state.plugins]):[...this.state.plugins,e],i=this.state.reconfigure({plugins:r});this.view.updateState(i)}unregisterPlugin(e){if(this.isDestroyed)return;const n=typeof e=="string"?`${e}$`:e.key,r=this.state.reconfigure({plugins:this.state.plugins.filter(i=>!i.key.startsWith(n))});this.view.updateState(r)}createExtensionManager(){var e,n;const i=[...this.options.enableCoreExtensions?[VU,Eq.configure({blockSeparator:(n=(e=this.options.coreExtensionOptions)===null||e===void 0?void 0:e.clipboardTextSerializer)===null||n===void 0?void 0:n.blockSeparator}),UU,HU,WU,JU]:[],...this.options.extensions].filter(o=>["extension","node","mark"].includes(o==null?void 0:o.type));this.extensionManager=new Au(i,this)}createCommandManager(){this.commandManager=new ng({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){let e;try{e=Xv(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(o){if(!(o instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(o.message))throw o;this.emit("contentError",{editor:this,error:o,disableCollaboration:()=>{this.options.extensions=this.options.extensions.filter(s=>s.name!=="collaboration"),this.createExtensionManager()}}),e=Xv(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const n=rO(e,this.options.autofocus);this.view=new Aj(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:_u.create({doc:e,selection:n||void 0})});const r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.createNodeViews(),this.prependClass();const i=this.view.dom;i.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(s=>{var a;return(a=this.capturedTransaction)===null||a===void 0?void 0:a.step(s)});return}const n=this.state.apply(e),r=!this.state.selection.eq(n.selection);this.view.updateState(n),this.emit("transaction",{editor:this,transaction:e}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const i=e.getMeta("focus"),o=e.getMeta("blur");i&&this.emit("focus",{editor:this,event:i.event,transaction:e}),o&&this.emit("blur",{editor:this,event:o.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return vU(this.state,e)}isActive(e,n){const r=typeof e=="string"?e:null,i=typeof e=="string"?n:e;return wU(this.state,r,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return gU(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:n=` -`,textSerializers:r={}}=e||{};return yV(this.state.doc,{blockSeparator:n,textSerializers:{...tO(this.schema),...r}})}get isEmpty(){return kV(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}$node(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelector(e,n))||null}$nodes(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelectorAll(e,n))||null}$pos(e){const n=this.state.doc.resolve(e);return new Va(n,this)}get $doc(){return this.$pos(0)}};function ic(t){return new ig({find:t.find,handler:({state:e,range:n,match:r})=>{const i=Ue(t.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=e,s=r[r.length-1],a=r[0];if(s){const l=a.search(/\S/),u=n.from+a.indexOf(s),c=u+s.length;if(sO(n.from,n.to,e.doc).filter(h=>h.mark.type.excluded.find(m=>m===t.type&&m!==h.mark.type)).filter(h=>h.to>u).length)return null;cn.from&&o.delete(n.from+l,u);const d=n.from+l+s.length;o.addMark(n.from+l,d,t.type.create(i||{})),o.removeStoredMark(t.type)}}})}function ZV(t){return new ig({find:t.find,handler:({state:e,range:n,match:r})=>{const i=Ue(t.getAttributes,void 0,r)||{},{tr:o}=e,s=n.from;let a=n.to;const l=t.type.create(i);if(r[1]){const u=r[0].lastIndexOf(r[1]);let c=s+u;c>a?c=a:a=c+r[1].length;const f=r[0][r[0].length-1];o.insertText(f,s+r[0].length-1),o.replaceWith(c,a,l)}else if(r[0]){const u=t.type.isInline?s:s-1;o.insert(u,t.type.create(i)).delete(o.mapping.map(s),o.mapping.map(a))}o.scrollIntoView()}})}function tw(t){return new ig({find:t.find,handler:({state:e,range:n,match:r})=>{const i=e.doc.resolve(n.from),o=Ue(t.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,o)}})}function Bd(t){return new ig({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{const o=Ue(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),l=s.doc.resolve(n.from).blockRange(),u=l&&Ax(l,t.type,o);if(!u)return null;if(s.wrap(l,u),t.keepMarks&&t.editor){const{selection:f,storedMarks:d}=e,{splittableMarks:h}=t.editor.extensionManager,p=d||f.$to.parentOffset&&f.$from.marks();if(p){const m=p.filter(b=>h.includes(b.type.name));s.ensureMarks(m)}}if(t.keepAttributes){const f=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(f,o).run()}const c=s.doc.resolve(n.from-1).nodeBefore;c&&c.type===t.type&&xa(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,c))&&s.join(n.from-1)}})}let Ll=class nw{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Ue(ye(this,"addOptions",{name:this.name}))),this.storage=Ue(ye(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new nw(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>og(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new nw(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Ue(ye(n,"addOptions",{name:n.name})),n.storage=Ue(ye(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const s=i.marks();if(!!!s.find(u=>(u==null?void 0:u.type.name)===n.name))return!1;const l=s.find(u=>(u==null?void 0:u.type.name)===n.name);return l&&r.removeStoredMark(l),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}},Gr=class rw{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Ue(ye(this,"addOptions",{name:this.name}))),this.storage=Ue(ye(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new rw(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>og(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new rw(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Ue(ye(n,"addOptions",{name:n.name})),n.storage=Ue(ye(n,"addStorage",{name:n.name,options:n.options})),n}};function YV(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}class QV{constructor(e,n,r){this.isDragging=!1,this.component=e,this.editor=n.editor,this.options={stopEvent:null,ignoreMutation:null,...r},this.extension=n.extension,this.node=n.node,this.decorations=n.decorations,this.getPos=n.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var n,r,i,o,s,a,l;const{view:u}=this.editor,c=e.target,f=c.nodeType===3?(n=c.parentElement)===null||n===void 0?void 0:n.closest("[data-drag-handle]"):c.closest("[data-drag-handle]");if(!this.dom||!((r=this.contentDOM)===null||r===void 0)&&r.contains(c)||!f)return;let d=0,h=0;if(this.dom!==f){const b=this.dom.getBoundingClientRect(),y=f.getBoundingClientRect(),v=(i=e.offsetX)!==null&&i!==void 0?i:(o=e.nativeEvent)===null||o===void 0?void 0:o.offsetX,w=(s=e.offsetY)!==null&&s!==void 0?s:(a=e.nativeEvent)===null||a===void 0?void 0:a.offsetY;d=y.x-b.x+v,h=y.y-b.y+w}(l=e.dataTransfer)===null||l===void 0||l.setDragImage(this.dom,d,h);const p=_e.create(u.state.doc,this.getPos()),m=u.state.tr.setSelection(p);u.dispatch(m)}stopEvent(e){var n;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:e});const r=e.target;if(!(this.dom.contains(r)&&!(!((n=this.contentDOM)===null||n===void 0)&&n.contains(r))))return!1;const o=e.type.startsWith("drag"),s=e.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(r.tagName)||r.isContentEditable)&&!s&&!o)return!0;const{isEditable:l}=this.editor,{isDragging:u}=this,c=!!this.node.type.spec.draggable,f=_e.isSelectable(this.node),d=e.type==="copy",h=e.type==="paste",p=e.type==="cut",m=e.type==="mousedown";if(!c&&f&&o&&e.preventDefault(),c&&o&&!u)return e.preventDefault(),!1;if(c&&l&&!u&&m){const b=r.closest("[data-drag-handle]");b&&(this.dom===b||this.dom.contains(b))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(u||s||d||h||p||m&&f)}ignoreMutation(e){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:e}):this.node.isLeaf||this.node.isAtom?!0:e.type==="selection"||this.dom.contains(e.target)&&e.type==="childList"&&(sg()||YV())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(r=>r.isContentEditable)?!1:this.contentDOM===e.target&&e.type==="attributes"?!0:!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command(({tr:n})=>{const r=this.getPos();return n.setNodeMarkup(r,void 0,{...this.node.attrs,...e}),!0})}deleteNode(){const e=this.getPos(),n=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:n})}}function oc(t){return new gq({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{const o=Ue(t.getAttributes,void 0,r,i);if(o===!1||o===null)return null;const{tr:s}=e,a=r[r.length-1],l=r[0];let u=n.to;if(a){const c=l.search(/\S/),f=n.from+l.indexOf(a),d=f+a.length;if(sO(n.from,n.to,e.doc).filter(p=>p.mark.type.excluded.find(b=>b===t.type&&b!==p.mark.type)).filter(p=>p.to>f).length)return null;dn.from&&s.delete(n.from+c,f),u=n.from+c+a.length,s.addMark(n.from+c,u,t.type.create(o||{})),s.removeStoredMark(t.type)}}})}function XV(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}var kr="top",pi="bottom",mi="right",xr="left",zx="auto",wh=[kr,pi,mi,xr],sc="start",Pd="end",eU="clippingParents",lO="viewport",lf="popper",tU="reference",pC=wh.reduce(function(t,e){return t.concat([e+"-"+sc,e+"-"+Pd])},[]),uO=[].concat(wh,[zx]).reduce(function(t,e){return t.concat([e,e+"-"+sc,e+"-"+Pd])},[]),nU="beforeRead",rU="read",iU="afterRead",oU="beforeMain",sU="main",aU="afterMain",lU="beforeWrite",uU="write",cU="afterWrite",fU=[nU,rU,iU,oU,sU,aU,lU,uU,cU];function wo(t){return t?(t.nodeName||"").toLowerCase():null}function Vr(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Ol(t){var e=Vr(t).Element;return t instanceof e||t instanceof Element}function fi(t){var e=Vr(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function jx(t){if(typeof ShadowRoot>"u")return!1;var e=Vr(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function dU(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},i=e.attributes[n]||{},o=e.elements[n];!fi(o)||!wo(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var a=i[s];a===!1?o.removeAttribute(s):o.setAttribute(s,a===!0?"":a)}))})}function hU(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),a=s.reduce(function(l,u){return l[u]="",l},{});!fi(i)||!wo(i)||(Object.assign(i.style,a),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const cO={name:"applyStyles",enabled:!0,phase:"write",fn:dU,effect:hU,requires:["computeStyles"]};function go(t){return t.split("-")[0]}var ml=Math.max,cm=Math.min,ac=Math.round;function iw(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function fO(){return!/^((?!chrome|android).)*safari/i.test(iw())}function lc(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,o=1;e&&fi(t)&&(i=t.offsetWidth>0&&ac(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&ac(r.height)/t.offsetHeight||1);var s=Ol(t)?Vr(t):window,a=s.visualViewport,l=!fO()&&n,u=(r.left+(l&&a?a.offsetLeft:0))/i,c=(r.top+(l&&a?a.offsetTop:0))/o,f=r.width/i,d=r.height/o;return{width:f,height:d,top:c,right:u+f,bottom:c+d,left:u,x:u,y:c}}function qx(t){var e=lc(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function dO(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&jx(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Yo(t){return Vr(t).getComputedStyle(t)}function pU(t){return["table","td","th"].indexOf(wo(t))>=0}function Ca(t){return((Ol(t)?t.ownerDocument:t.document)||window.document).documentElement}function ug(t){return wo(t)==="html"?t:t.assignedSlot||t.parentNode||(jx(t)?t.host:null)||Ca(t)}function mC(t){return!fi(t)||Yo(t).position==="fixed"?null:t.offsetParent}function mU(t){var e=/firefox/i.test(iw()),n=/Trident/i.test(iw());if(n&&fi(t)){var r=Yo(t);if(r.position==="fixed")return null}var i=ug(t);for(jx(i)&&(i=i.host);fi(i)&&["html","body"].indexOf(wo(i))<0;){var o=Yo(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function kh(t){for(var e=Vr(t),n=mC(t);n&&pU(n)&&Yo(n).position==="static";)n=mC(n);return n&&(wo(n)==="html"||wo(n)==="body"&&Yo(n).position==="static")?e:n||mU(t)||e}function Vx(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function td(t,e,n){return ml(t,cm(e,n))}function gU(t,e,n){var r=td(t,e,n);return r>n?n:r}function hO(){return{top:0,right:0,bottom:0,left:0}}function pO(t){return Object.assign({},hO(),t)}function mO(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var yU=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,pO(typeof e!="number"?e:mO(e,wh))};function bU(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=go(n.placement),l=Vx(a),u=[xr,mi].indexOf(a)>=0,c=u?"height":"width";if(!(!o||!s)){var f=yU(i.padding,n),d=qx(o),h=l==="y"?kr:xr,p=l==="y"?pi:mi,m=n.rects.reference[c]+n.rects.reference[l]-s[l]-n.rects.popper[c],b=s[l]-n.rects.reference[l],y=kh(o),v=y?l==="y"?y.clientHeight||0:y.clientWidth||0:0,w=m/2-b/2,g=f[h],x=v-d[c]-f[p],k=v/2-d[c]/2+w,E=td(g,k,x),D=l;n.modifiersData[r]=(e={},e[D]=E,e.centerOffset=E-k,e)}}function vU(t){var e=t.state,n=t.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||dO(e.elements.popper,i)&&(e.elements.arrow=i))}const wU={name:"arrow",enabled:!0,phase:"main",fn:bU,effect:vU,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function uc(t){return t.split("-")[1]}var kU={top:"auto",right:"auto",bottom:"auto",left:"auto"};function xU(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:ac(n*i)/i||0,y:ac(r*i)/i||0}}function gC(t){var e,n=t.popper,r=t.popperRect,i=t.placement,o=t.variation,s=t.offsets,a=t.position,l=t.gpuAcceleration,u=t.adaptive,c=t.roundOffsets,f=t.isFixed,d=s.x,h=d===void 0?0:d,p=s.y,m=p===void 0?0:p,b=typeof c=="function"?c({x:h,y:m}):{x:h,y:m};h=b.x,m=b.y;var y=s.hasOwnProperty("x"),v=s.hasOwnProperty("y"),w=xr,g=kr,x=window;if(u){var k=kh(n),E="clientHeight",D="clientWidth";if(k===Vr(n)&&(k=Ca(n),Yo(k).position!=="static"&&a==="absolute"&&(E="scrollHeight",D="scrollWidth")),k=k,i===kr||(i===xr||i===mi)&&o===Pd){g=pi;var O=f&&k===x&&x.visualViewport?x.visualViewport.height:k[E];m-=O-r.height,m*=l?1:-1}if(i===xr||(i===kr||i===pi)&&o===Pd){w=mi;var N=f&&k===x&&x.visualViewport?x.visualViewport.width:k[D];h-=N-r.width,h*=l?1:-1}}var C=Object.assign({position:a},u&&kU),R=c===!0?xU({x:h,y:m},Vr(n)):{x:h,y:m};if(h=R.x,m=R.y,l){var T;return Object.assign({},C,(T={},T[g]=v?"0":"",T[w]=y?"0":"",T.transform=(x.devicePixelRatio||1)<=1?"translate("+h+"px, "+m+"px)":"translate3d("+h+"px, "+m+"px, 0)",T))}return Object.assign({},C,(e={},e[g]=v?m+"px":"",e[w]=y?h+"px":"",e.transform="",e))}function EU(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,s=o===void 0?!0:o,a=n.roundOffsets,l=a===void 0?!0:a,u={placement:go(e.placement),variation:uc(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,gC(Object.assign({},u,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,gC(Object.assign({},u,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const SU={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:EU,data:{}};var fp={passive:!0};function CU(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,o=i===void 0?!0:i,s=r.resize,a=s===void 0?!0:s,l=Vr(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&u.forEach(function(c){c.addEventListener("scroll",n.update,fp)}),a&&l.addEventListener("resize",n.update,fp),function(){o&&u.forEach(function(c){c.removeEventListener("scroll",n.update,fp)}),a&&l.removeEventListener("resize",n.update,fp)}}const _U={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:CU,data:{}};var AU={left:"right",right:"left",bottom:"top",top:"bottom"};function f0(t){return t.replace(/left|right|bottom|top/g,function(e){return AU[e]})}var TU={start:"end",end:"start"};function yC(t){return t.replace(/start|end/g,function(e){return TU[e]})}function Ux(t){var e=Vr(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Hx(t){return lc(Ca(t)).left+Ux(t).scrollLeft}function MU(t,e){var n=Vr(t),r=Ca(t),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;var u=fO();(u||!u&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a+Hx(t),y:l}}function OU(t){var e,n=Ca(t),r=Ux(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=ml(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=ml(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+Hx(t),l=-r.scrollTop;return Yo(i||n).direction==="rtl"&&(a+=ml(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}function Wx(t){var e=Yo(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function gO(t){return["html","body","#document"].indexOf(wo(t))>=0?t.ownerDocument.body:fi(t)&&Wx(t)?t:gO(ug(t))}function nd(t,e){var n;e===void 0&&(e=[]);var r=gO(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=Vr(r),s=i?[o].concat(o.visualViewport||[],Wx(r)?r:[]):r,a=e.concat(s);return i?a:a.concat(nd(ug(s)))}function ow(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function DU(t,e){var n=lc(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function bC(t,e,n){return e===lO?ow(MU(t,n)):Ol(e)?DU(e,n):ow(OU(Ca(t)))}function NU(t){var e=nd(ug(t)),n=["absolute","fixed"].indexOf(Yo(t).position)>=0,r=n&&fi(t)?kh(t):t;return Ol(r)?e.filter(function(i){return Ol(i)&&dO(i,r)&&wo(i)!=="body"}):[]}function $U(t,e,n,r){var i=e==="clippingParents"?NU(t):[].concat(e),o=[].concat(i,[n]),s=o[0],a=o.reduce(function(l,u){var c=bC(t,u,r);return l.top=ml(c.top,l.top),l.right=cm(c.right,l.right),l.bottom=cm(c.bottom,l.bottom),l.left=ml(c.left,l.left),l},bC(t,s,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function yO(t){var e=t.reference,n=t.element,r=t.placement,i=r?go(r):null,o=r?uc(r):null,s=e.x+e.width/2-n.width/2,a=e.y+e.height/2-n.height/2,l;switch(i){case kr:l={x:s,y:e.y-n.height};break;case pi:l={x:s,y:e.y+e.height};break;case mi:l={x:e.x+e.width,y:a};break;case xr:l={x:e.x-n.width,y:a};break;default:l={x:e.x,y:e.y}}var u=i?Vx(i):null;if(u!=null){var c=u==="y"?"height":"width";switch(o){case sc:l[u]=l[u]-(e[c]/2-n[c]/2);break;case Pd:l[u]=l[u]+(e[c]/2-n[c]/2);break}}return l}function zd(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,o=n.strategy,s=o===void 0?t.strategy:o,a=n.boundary,l=a===void 0?eU:a,u=n.rootBoundary,c=u===void 0?lO:u,f=n.elementContext,d=f===void 0?lf:f,h=n.altBoundary,p=h===void 0?!1:h,m=n.padding,b=m===void 0?0:m,y=pO(typeof b!="number"?b:mO(b,wh)),v=d===lf?tU:lf,w=t.rects.popper,g=t.elements[p?v:d],x=$U(Ol(g)?g:g.contextElement||Ca(t.elements.popper),l,c,s),k=lc(t.elements.reference),E=yO({reference:k,element:w,strategy:"absolute",placement:i}),D=ow(Object.assign({},w,E)),O=d===lf?D:k,N={top:x.top-O.top+y.top,bottom:O.bottom-x.bottom+y.bottom,left:x.left-O.left+y.left,right:O.right-x.right+y.right},C=t.modifiersData.offset;if(d===lf&&C){var R=C[i];Object.keys(N).forEach(function(T){var q=[mi,pi].indexOf(T)>=0?1:-1,A=[kr,pi].indexOf(T)>=0?"y":"x";N[T]+=R[A]*q})}return N}function IU(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?uO:l,c=uc(r),f=c?a?pC:pC.filter(function(p){return uc(p)===c}):wh,d=f.filter(function(p){return u.indexOf(p)>=0});d.length===0&&(d=f);var h=d.reduce(function(p,m){return p[m]=zd(t,{placement:m,boundary:i,rootBoundary:o,padding:s})[go(m)],p},{});return Object.keys(h).sort(function(p,m){return h[p]-h[m]})}function RU(t){if(go(t)===zx)return[];var e=f0(t);return[yC(t),e,yC(e)]}function FU(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!0:s,l=n.fallbackPlacements,u=n.padding,c=n.boundary,f=n.rootBoundary,d=n.altBoundary,h=n.flipVariations,p=h===void 0?!0:h,m=n.allowedAutoPlacements,b=e.options.placement,y=go(b),v=y===b,w=l||(v||!p?[f0(b)]:RU(b)),g=[b].concat(w).reduce(function(fe,ke){return fe.concat(go(ke)===zx?IU(e,{placement:ke,boundary:c,rootBoundary:f,padding:u,flipVariations:p,allowedAutoPlacements:m}):ke)},[]),x=e.rects.reference,k=e.rects.popper,E=new Map,D=!0,O=g[0],N=0;N=0,A=q?"width":"height",S=zd(e,{placement:C,boundary:c,rootBoundary:f,altBoundary:d,padding:u}),P=q?T?mi:xr:T?pi:kr;x[A]>k[A]&&(P=f0(P));var B=f0(P),j=[];if(o&&j.push(S[R]<=0),a&&j.push(S[P]<=0,S[B]<=0),j.every(function(fe){return fe})){O=C,D=!1;break}E.set(C,j)}if(D)for(var z=p?3:1,J=function(ke){var ve=g.find(function(xe){var Se=E.get(xe);if(Se)return Se.slice(0,ke).every(function(Oe){return Oe})});if(ve)return O=ve,"break"},K=z;K>0;K--){var ae=J(K);if(ae==="break")break}e.placement!==O&&(e.modifiersData[r]._skip=!0,e.placement=O,e.reset=!0)}}const LU={name:"flip",enabled:!0,phase:"main",fn:FU,requiresIfExists:["offset"],data:{_skip:!1}};function vC(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function wC(t){return[kr,mi,pi,xr].some(function(e){return t[e]>=0})}function BU(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,s=zd(e,{elementContext:"reference"}),a=zd(e,{altBoundary:!0}),l=vC(s,r),u=vC(a,i,o),c=wC(l),f=wC(u);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":f})}const PU={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:BU};function zU(t,e,n){var r=go(t),i=[xr,kr].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*i,[xr,mi].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function jU(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,s=uO.reduce(function(c,f){return c[f]=zU(f,e.rects,o),c},{}),a=s[e.placement],l=a.x,u=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=u),e.modifiersData[r]=s}const qU={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:jU};function VU(t){var e=t.state,n=t.name;e.modifiersData[n]=yO({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const UU={name:"popperOffsets",enabled:!0,phase:"read",fn:VU,data:{}};function HU(t){return t==="x"?"y":"x"}function WU(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!1:s,l=n.boundary,u=n.rootBoundary,c=n.altBoundary,f=n.padding,d=n.tether,h=d===void 0?!0:d,p=n.tetherOffset,m=p===void 0?0:p,b=zd(e,{boundary:l,rootBoundary:u,padding:f,altBoundary:c}),y=go(e.placement),v=uc(e.placement),w=!v,g=Vx(y),x=HU(g),k=e.modifiersData.popperOffsets,E=e.rects.reference,D=e.rects.popper,O=typeof m=="function"?m(Object.assign({},e.rects,{placement:e.placement})):m,N=typeof O=="number"?{mainAxis:O,altAxis:O}:Object.assign({mainAxis:0,altAxis:0},O),C=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,R={x:0,y:0};if(k){if(o){var T,q=g==="y"?kr:xr,A=g==="y"?pi:mi,S=g==="y"?"height":"width",P=k[g],B=P+b[q],j=P-b[A],z=h?-D[S]/2:0,J=v===sc?E[S]:D[S],K=v===sc?-D[S]:-E[S],ae=e.elements.arrow,fe=h&&ae?qx(ae):{width:0,height:0},ke=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:hO(),ve=ke[q],xe=ke[A],Se=td(0,E[S],fe[S]),Oe=w?E[S]/2-z-Se-ve-N.mainAxis:J-Se-ve-N.mainAxis,Fe=w?-E[S]/2+z+Se+xe+N.mainAxis:K+Se+xe+N.mainAxis,mt=e.elements.arrow&&kh(e.elements.arrow),Ce=mt?g==="y"?mt.clientTop||0:mt.clientLeft||0:0,pe=(T=C==null?void 0:C[g])!=null?T:0,De=P+Oe-pe-Ce,Le=P+Fe-pe,Ge=td(h?cm(B,De):B,P,h?ml(j,Le):j);k[g]=Ge,R[g]=Ge-P}if(a){var Qt,rt=g==="x"?kr:xr,it=g==="x"?pi:mi,bt=k[x],Ft=x==="y"?"height":"width",Lt=bt+b[rt],at=bt-b[it],gt=[kr,xr].indexOf(y)!==-1,Y=(Qt=C==null?void 0:C[x])!=null?Qt:0,U=gt?Lt:bt-E[Ft]-D[Ft]-Y+N.altAxis,W=gt?bt+E[Ft]+D[Ft]-Y-N.altAxis:at,X=h&>?gU(U,bt,W):td(h?U:Lt,bt,h?W:at);k[x]=X,R[x]=X-bt}e.modifiersData[r]=R}}const JU={name:"preventOverflow",enabled:!0,phase:"main",fn:WU,requiresIfExists:["offset"]};function KU(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function GU(t){return t===Vr(t)||!fi(t)?Ux(t):KU(t)}function ZU(t){var e=t.getBoundingClientRect(),n=ac(e.width)/t.offsetWidth||1,r=ac(e.height)/t.offsetHeight||1;return n!==1||r!==1}function YU(t,e,n){n===void 0&&(n=!1);var r=fi(e),i=fi(e)&&ZU(e),o=Ca(e),s=lc(t,i,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((wo(e)!=="body"||Wx(o))&&(a=GU(e)),fi(e)?(l=lc(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):o&&(l.x=Hx(o))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function QU(t){var e=new Map,n=new Set,r=[];t.forEach(function(o){e.set(o.name,o)});function i(o){n.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(a){if(!n.has(a)){var l=e.get(a);l&&i(l)}}),r.push(o)}return t.forEach(function(o){n.has(o.name)||i(o)}),r}function XU(t){var e=QU(t);return fU.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function eH(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function tH(t){var e=t.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var kC={placement:"bottom",modifiers:[],strategy:"absolute"};function xC(){for(var t=arguments.length,e=new Array(t),n=0;n-1}function xO(t,e){return typeof t=="function"?t.apply(void 0,e):t}function EC(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function aH(t){return t.split(/\s+/).filter(Boolean)}function lu(t){return[].concat(t)}function SC(t,e){t.indexOf(e)===-1&&t.push(e)}function lH(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function uH(t){return t.split("-")[0]}function fm(t){return[].slice.call(t)}function CC(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function rd(){return document.createElement("div")}function cg(t){return["Element","Fragment"].some(function(e){return Jx(t,e)})}function cH(t){return Jx(t,"NodeList")}function fH(t){return Jx(t,"MouseEvent")}function dH(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function hH(t){return cg(t)?[t]:cH(t)?fm(t):Array.isArray(t)?t:fm(document.querySelectorAll(t))}function nb(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function _C(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function pH(t){var e,n=lu(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function mH(t,e){var n=e.clientX,r=e.clientY;return t.every(function(i){var o=i.popperRect,s=i.popperState,a=i.props,l=a.interactiveBorder,u=uH(s.placement),c=s.modifiersData.offset;if(!c)return!0;var f=u==="bottom"?c.top.y:0,d=u==="top"?c.bottom.y:0,h=u==="right"?c.left.x:0,p=u==="left"?c.right.x:0,m=o.top-r+f>l,b=r-o.bottom-d>l,y=o.left-n+h>l,v=n-o.right-p>l;return m||b||y||v})}function rb(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){t[r](i,n)})}function AC(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var Zi={isTouch:!1},TC=0;function gH(){Zi.isTouch||(Zi.isTouch=!0,window.performance&&document.addEventListener("mousemove",EO))}function EO(){var t=performance.now();t-TC<20&&(Zi.isTouch=!1,document.removeEventListener("mousemove",EO)),TC=t}function yH(){var t=document.activeElement;if(dH(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function bH(){document.addEventListener("touchstart",gH,Pa),window.addEventListener("blur",yH)}var vH=typeof window<"u"&&typeof document<"u",wH=vH?!!window.msCrypto:!1,kH={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},xH={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Ai=Object.assign({appendTo:kO,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},kH,xH),EH=Object.keys(Ai),SH=function(e){var n=Object.keys(e);n.forEach(function(r){Ai[r]=e[r]})};function SO(t){var e=t.plugins||[],n=e.reduce(function(r,i){var o=i.name,s=i.defaultValue;if(o){var a;r[o]=t[o]!==void 0?t[o]:(a=Ai[o])!=null?a:s}return r},{});return Object.assign({},t,n)}function CH(t,e){var n=e?Object.keys(SO(Object.assign({},Ai,{plugins:e}))):EH,r=n.reduce(function(i,o){var s=(t.getAttribute("data-tippy-"+o)||"").trim();if(!s)return i;if(o==="content")i[o]=s;else try{i[o]=JSON.parse(s)}catch{i[o]=s}return i},{});return r}function MC(t,e){var n=Object.assign({},e,{content:xO(e.content,[t])},e.ignoreAttributes?{}:CH(t,e.plugins));return n.aria=Object.assign({},Ai.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?e.interactive:n.aria.expanded,content:n.aria.content==="auto"?e.interactive?null:"describedby":n.aria.content},n}var _H=function(){return"innerHTML"};function sw(t,e){t[_H()]=e}function OC(t){var e=rd();return t===!0?e.className=vO:(e.className=wO,cg(t)?e.appendChild(t):sw(e,t)),e}function DC(t,e){cg(e.content)?(sw(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?sw(t,e.content):t.textContent=e.content)}function aw(t){var e=t.firstElementChild,n=fm(e.children);return{box:e,content:n.find(function(r){return r.classList.contains(bO)}),arrow:n.find(function(r){return r.classList.contains(vO)||r.classList.contains(wO)}),backdrop:n.find(function(r){return r.classList.contains(sH)})}}function CO(t){var e=rd(),n=rd();n.className=oH,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=rd();r.className=bO,r.setAttribute("data-state","hidden"),DC(r,t.props),e.appendChild(n),n.appendChild(r),i(t.props,t.props);function i(o,s){var a=aw(e),l=a.box,u=a.content,c=a.arrow;s.theme?l.setAttribute("data-theme",s.theme):l.removeAttribute("data-theme"),typeof s.animation=="string"?l.setAttribute("data-animation",s.animation):l.removeAttribute("data-animation"),s.inertia?l.setAttribute("data-inertia",""):l.removeAttribute("data-inertia"),l.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?l.setAttribute("role",s.role):l.removeAttribute("role"),(o.content!==s.content||o.allowHTML!==s.allowHTML)&&DC(u,t.props),s.arrow?c?o.arrow!==s.arrow&&(l.removeChild(c),l.appendChild(OC(s.arrow))):l.appendChild(OC(s.arrow)):c&&l.removeChild(c)}return{popper:e,onUpdate:i}}CO.$$tippy=!0;var AH=1,dp=[],ib=[];function TH(t,e){var n=MC(t,Object.assign({},Ai,SO(CC(e)))),r,i,o,s=!1,a=!1,l=!1,u=!1,c,f,d,h=[],p=EC(De,n.interactiveDebounce),m,b=AH++,y=null,v=lH(n.plugins),w={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},g={id:b,reference:t,popper:rd(),popperInstance:y,props:n,state:w,plugins:v,clearDelayTimeouts:U,setProps:W,setContent:X,show:se,hide:ge,hideWithInteractivity:Pe,enable:gt,disable:Y,unmount:Be,destroy:nt};if(!n.render)return g;var x=n.render(g),k=x.popper,E=x.onUpdate;k.setAttribute("data-tippy-root",""),k.id="tippy-"+g.id,g.popper=k,t._tippy=g,k._tippy=g;var D=v.map(function(G){return G.fn(g)}),O=t.hasAttribute("aria-expanded");return mt(),z(),P(),B("onCreate",[g]),n.showOnCreate&&Lt(),k.addEventListener("mouseenter",function(){g.props.interactive&&g.state.isVisible&&g.clearDelayTimeouts()}),k.addEventListener("mouseleave",function(){g.props.interactive&&g.props.trigger.indexOf("mouseenter")>=0&&q().addEventListener("mousemove",p)}),g;function N(){var G=g.props.touch;return Array.isArray(G)?G:[G,0]}function C(){return N()[0]==="hold"}function R(){var G;return!!((G=g.props.render)!=null&&G.$$tippy)}function T(){return m||t}function q(){var G=T().parentNode;return G?pH(G):document}function A(){return aw(k)}function S(G){return g.state.isMounted&&!g.state.isVisible||Zi.isTouch||c&&c.type==="focus"?0:tb(g.props.delay,G?0:1,Ai.delay)}function P(G){G===void 0&&(G=!1),k.style.pointerEvents=g.props.interactive&&!G?"":"none",k.style.zIndex=""+g.props.zIndex}function B(G,re,me){if(me===void 0&&(me=!0),D.forEach(function(Ae){Ae[G]&&Ae[G].apply(Ae,re)}),me){var Ee;(Ee=g.props)[G].apply(Ee,re)}}function j(){var G=g.props.aria;if(G.content){var re="aria-"+G.content,me=k.id,Ee=lu(g.props.triggerTarget||t);Ee.forEach(function(Ae){var ot=Ae.getAttribute(re);if(g.state.isVisible)Ae.setAttribute(re,ot?ot+" "+me:me);else{var _t=ot&&ot.replace(me,"").trim();_t?Ae.setAttribute(re,_t):Ae.removeAttribute(re)}})}}function z(){if(!(O||!g.props.aria.expanded)){var G=lu(g.props.triggerTarget||t);G.forEach(function(re){g.props.interactive?re.setAttribute("aria-expanded",g.state.isVisible&&re===T()?"true":"false"):re.removeAttribute("aria-expanded")})}}function J(){q().removeEventListener("mousemove",p),dp=dp.filter(function(G){return G!==p})}function K(G){if(!(Zi.isTouch&&(l||G.type==="mousedown"))){var re=G.composedPath&&G.composedPath()[0]||G.target;if(!(g.props.interactive&&AC(k,re))){if(lu(g.props.triggerTarget||t).some(function(me){return AC(me,re)})){if(Zi.isTouch||g.state.isVisible&&g.props.trigger.indexOf("click")>=0)return}else B("onClickOutside",[g,G]);g.props.hideOnClick===!0&&(g.clearDelayTimeouts(),g.hide(),a=!0,setTimeout(function(){a=!1}),g.state.isMounted||ve())}}}function ae(){l=!0}function fe(){l=!1}function ke(){var G=q();G.addEventListener("mousedown",K,!0),G.addEventListener("touchend",K,Pa),G.addEventListener("touchstart",fe,Pa),G.addEventListener("touchmove",ae,Pa)}function ve(){var G=q();G.removeEventListener("mousedown",K,!0),G.removeEventListener("touchend",K,Pa),G.removeEventListener("touchstart",fe,Pa),G.removeEventListener("touchmove",ae,Pa)}function xe(G,re){Oe(G,function(){!g.state.isVisible&&k.parentNode&&k.parentNode.contains(k)&&re()})}function Se(G,re){Oe(G,re)}function Oe(G,re){var me=A().box;function Ee(Ae){Ae.target===me&&(rb(me,"remove",Ee),re())}if(G===0)return re();rb(me,"remove",f),rb(me,"add",Ee),f=Ee}function Fe(G,re,me){me===void 0&&(me=!1);var Ee=lu(g.props.triggerTarget||t);Ee.forEach(function(Ae){Ae.addEventListener(G,re,me),h.push({node:Ae,eventType:G,handler:re,options:me})})}function mt(){C()&&(Fe("touchstart",pe,{passive:!0}),Fe("touchend",Le,{passive:!0})),aH(g.props.trigger).forEach(function(G){if(G!=="manual")switch(Fe(G,pe),G){case"mouseenter":Fe("mouseleave",Le);break;case"focus":Fe(wH?"focusout":"blur",Ge);break;case"focusin":Fe("focusout",Ge);break}})}function Ce(){h.forEach(function(G){var re=G.node,me=G.eventType,Ee=G.handler,Ae=G.options;re.removeEventListener(me,Ee,Ae)}),h=[]}function pe(G){var re,me=!1;if(!(!g.state.isEnabled||Qt(G)||a)){var Ee=((re=c)==null?void 0:re.type)==="focus";c=G,m=G.currentTarget,z(),!g.state.isVisible&&fH(G)&&dp.forEach(function(Ae){return Ae(G)}),G.type==="click"&&(g.props.trigger.indexOf("mouseenter")<0||s)&&g.props.hideOnClick!==!1&&g.state.isVisible?me=!0:Lt(G),G.type==="click"&&(s=!me),me&&!Ee&&at(G)}}function De(G){var re=G.target,me=T().contains(re)||k.contains(re);if(!(G.type==="mousemove"&&me)){var Ee=Ft().concat(k).map(function(Ae){var ot,_t=Ae._tippy,Xt=(ot=_t.popperInstance)==null?void 0:ot.state;return Xt?{popperRect:Ae.getBoundingClientRect(),popperState:Xt,props:n}:null}).filter(Boolean);mH(Ee,G)&&(J(),at(G))}}function Le(G){var re=Qt(G)||g.props.trigger.indexOf("click")>=0&&s;if(!re){if(g.props.interactive){g.hideWithInteractivity(G);return}at(G)}}function Ge(G){g.props.trigger.indexOf("focusin")<0&&G.target!==T()||g.props.interactive&&G.relatedTarget&&k.contains(G.relatedTarget)||at(G)}function Qt(G){return Zi.isTouch?C()!==G.type.indexOf("touch")>=0:!1}function rt(){it();var G=g.props,re=G.popperOptions,me=G.placement,Ee=G.offset,Ae=G.getReferenceClientRect,ot=G.moveTransition,_t=R()?aw(k).arrow:null,Xt=Ae?{getBoundingClientRect:Ae,contextElement:Ae.contextElement||T()}:t,Nt={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Wt){var vn=Wt.state;if(R()){var Dr=A(),wn=Dr.box;["placement","reference-hidden","escaped"].forEach(function($n){$n==="placement"?wn.setAttribute("data-placement",vn.placement):vn.attributes.popper["data-popper-"+$n]?wn.setAttribute("data-"+$n,""):wn.removeAttribute("data-"+$n)}),vn.attributes.popper={}}}},Ie=[{name:"offset",options:{offset:Ee}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!ot}},Nt];R()&&_t&&Ie.push({name:"arrow",options:{element:_t,padding:3}}),Ie.push.apply(Ie,(re==null?void 0:re.modifiers)||[]),g.popperInstance=iH(Xt,k,Object.assign({},re,{placement:me,onFirstUpdate:d,modifiers:Ie}))}function it(){g.popperInstance&&(g.popperInstance.destroy(),g.popperInstance=null)}function bt(){var G=g.props.appendTo,re,me=T();g.props.interactive&&G===kO||G==="parent"?re=me.parentNode:re=xO(G,[me]),re.contains(k)||re.appendChild(k),g.state.isMounted=!0,rt()}function Ft(){return fm(k.querySelectorAll("[data-tippy-root]"))}function Lt(G){g.clearDelayTimeouts(),G&&B("onTrigger",[g,G]),ke();var re=S(!0),me=N(),Ee=me[0],Ae=me[1];Zi.isTouch&&Ee==="hold"&&Ae&&(re=Ae),re?r=setTimeout(function(){g.show()},re):g.show()}function at(G){if(g.clearDelayTimeouts(),B("onUntrigger",[g,G]),!g.state.isVisible){ve();return}if(!(g.props.trigger.indexOf("mouseenter")>=0&&g.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(G.type)>=0&&s)){var re=S(!1);re?i=setTimeout(function(){g.state.isVisible&&g.hide()},re):o=requestAnimationFrame(function(){g.hide()})}}function gt(){g.state.isEnabled=!0}function Y(){g.hide(),g.state.isEnabled=!1}function U(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function W(G){if(!g.state.isDestroyed){B("onBeforeUpdate",[g,G]),Ce();var re=g.props,me=MC(t,Object.assign({},re,CC(G),{ignoreAttributes:!0}));g.props=me,mt(),re.interactiveDebounce!==me.interactiveDebounce&&(J(),p=EC(De,me.interactiveDebounce)),re.triggerTarget&&!me.triggerTarget?lu(re.triggerTarget).forEach(function(Ee){Ee.removeAttribute("aria-expanded")}):me.triggerTarget&&t.removeAttribute("aria-expanded"),z(),P(),E&&E(re,me),g.popperInstance&&(rt(),Ft().forEach(function(Ee){requestAnimationFrame(Ee._tippy.popperInstance.forceUpdate)})),B("onAfterUpdate",[g,G])}}function X(G){g.setProps({content:G})}function se(){var G=g.state.isVisible,re=g.state.isDestroyed,me=!g.state.isEnabled,Ee=Zi.isTouch&&!g.props.touch,Ae=tb(g.props.duration,0,Ai.duration);if(!(G||re||me||Ee)&&!T().hasAttribute("disabled")&&(B("onShow",[g],!1),g.props.onShow(g)!==!1)){if(g.state.isVisible=!0,R()&&(k.style.visibility="visible"),P(),ke(),g.state.isMounted||(k.style.transition="none"),R()){var ot=A(),_t=ot.box,Xt=ot.content;nb([_t,Xt],0)}d=function(){var Ie;if(!(!g.state.isVisible||u)){if(u=!0,k.offsetHeight,k.style.transition=g.props.moveTransition,R()&&g.props.animation){var Bt=A(),Wt=Bt.box,vn=Bt.content;nb([Wt,vn],Ae),_C([Wt,vn],"visible")}j(),z(),SC(ib,g),(Ie=g.popperInstance)==null||Ie.forceUpdate(),B("onMount",[g]),g.props.animation&&R()&&Se(Ae,function(){g.state.isShown=!0,B("onShown",[g])})}},bt()}}function ge(){var G=!g.state.isVisible,re=g.state.isDestroyed,me=!g.state.isEnabled,Ee=tb(g.props.duration,1,Ai.duration);if(!(G||re||me)&&(B("onHide",[g],!1),g.props.onHide(g)!==!1)){if(g.state.isVisible=!1,g.state.isShown=!1,u=!1,s=!1,R()&&(k.style.visibility="hidden"),J(),ve(),P(!0),R()){var Ae=A(),ot=Ae.box,_t=Ae.content;g.props.animation&&(nb([ot,_t],Ee),_C([ot,_t],"hidden"))}j(),z(),g.props.animation?R()&&xe(Ee,g.unmount):g.unmount()}}function Pe(G){q().addEventListener("mousemove",p),SC(dp,p),p(G)}function Be(){g.state.isVisible&&g.hide(),g.state.isMounted&&(it(),Ft().forEach(function(G){G._tippy.unmount()}),k.parentNode&&k.parentNode.removeChild(k),ib=ib.filter(function(G){return G!==g}),g.state.isMounted=!1,B("onHidden",[g]))}function nt(){g.state.isDestroyed||(g.clearDelayTimeouts(),g.unmount(),Ce(),delete t._tippy,g.state.isDestroyed=!0,B("onDestroy",[g]))}}function $c(t,e){e===void 0&&(e={});var n=Ai.plugins.concat(e.plugins||[]);bH();var r=Object.assign({},e,{plugins:n}),i=hH(t),o=i.reduce(function(s,a){var l=a&&TH(a,r);return l&&s.push(l),s},[]);return cg(t)?o[0]:o}$c.defaultProps=Ai;$c.setDefaultProps=SH;$c.currentInput=Zi;Object.assign({},cO,{effect:function(e){var n=e.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}});$c.setDefaultProps({render:CO});const MH=(...t)=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n&&(n.current=e)})},OH=({renderers:t})=>tt.createElement(tt.Fragment,null,Object.entries(t).map(([e,n])=>qB.createPortal(n.reactElement,n.element,e)));class DH extends tt.Component{constructor(e){super(e),this.editorContentRef=tt.createRef(),this.initialized=!1,this.state={renderers:{}}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const{editor:e}=this.props;if(e&&!e.isDestroyed&&e.options.element){if(e.contentComponent)return;const n=this.editorContentRef.current;n.append(...e.options.element.childNodes),e.setOptions({element:n}),e.contentComponent=this,e.createNodeViews(),this.initialized=!0}}maybeFlushSync(e){this.initialized?K1.flushSync(e):e()}setRenderer(e,n){this.maybeFlushSync(()=>{this.setState(({renderers:r})=>({renderers:{...r,[e]:n}}))})}removeRenderer(e){this.maybeFlushSync(()=>{this.setState(({renderers:n})=>{const r={...n};return delete r[e],{renderers:r}})})}componentWillUnmount(){const{editor:e}=this.props;if(!e||(this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null,!e.options.element.firstChild))return;const n=document.createElement("div");n.append(...e.options.element.childNodes),e.setOptions({element:n})}render(){const{editor:e,innerRef:n,...r}=this.props;return tt.createElement(tt.Fragment,null,tt.createElement("div",{ref:MH(n,this.editorContentRef),...r}),tt.createElement(OH,{renderers:this.state.renderers}))}}const NH=ee.forwardRef((t,e)=>{const n=tt.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return tt.createElement(DH,{key:n,innerRef:e,...t})}),$H=tt.memo(NH);class hp extends aO{constructor(){super(...arguments),this.contentComponent=null}}var _O={exports:{}},ob={},sb={exports:{}},ab={};/** +`,textSerializers:r={}}=e||{};return yU(this.state.doc,{blockSeparator:n,textSerializers:{...tO(this.schema),...r}})}get isEmpty(){return kU(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}$node(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelector(e,n))||null}$nodes(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelectorAll(e,n))||null}$pos(e){const n=this.state.doc.resolve(e);return new Ua(n,this)}get $doc(){return this.$pos(0)}};function ic(t){return new ig({find:t.find,handler:({state:e,range:n,match:r})=>{const i=Ve(t.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=e,s=r[r.length-1],a=r[0];if(s){const l=a.search(/\S/),u=n.from+a.indexOf(s),c=u+s.length;if(sO(n.from,n.to,e.doc).filter(h=>h.mark.type.excluded.find(m=>m===t.type&&m!==h.mark.type)).filter(h=>h.to>u).length)return null;cn.from&&o.delete(n.from+l,u);const d=n.from+l+s.length;o.addMark(n.from+l,d,t.type.create(i||{})),o.removeStoredMark(t.type)}}})}function ZU(t){return new ig({find:t.find,handler:({state:e,range:n,match:r})=>{const i=Ve(t.getAttributes,void 0,r)||{},{tr:o}=e,s=n.from;let a=n.to;const l=t.type.create(i);if(r[1]){const u=r[0].lastIndexOf(r[1]);let c=s+u;c>a?c=a:a=c+r[1].length;const f=r[0][r[0].length-1];o.insertText(f,s+r[0].length-1),o.replaceWith(c,a,l)}else if(r[0]){const u=t.type.isInline?s:s-1;o.insert(u,t.type.create(i)).delete(o.mapping.map(s),o.mapping.map(a))}o.scrollIntoView()}})}function tw(t){return new ig({find:t.find,handler:({state:e,range:n,match:r})=>{const i=e.doc.resolve(n.from),o=Ve(t.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,o)}})}function Bd(t){return new ig({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{const o=Ve(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),l=s.doc.resolve(n.from).blockRange(),u=l&&Ax(l,t.type,o);if(!u)return null;if(s.wrap(l,u),t.keepMarks&&t.editor){const{selection:f,storedMarks:d}=e,{splittableMarks:h}=t.editor.extensionManager,p=d||f.$to.parentOffset&&f.$from.marks();if(p){const m=p.filter(b=>h.includes(b.type.name));s.ensureMarks(m)}}if(t.keepAttributes){const f=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(f,o).run()}const c=s.doc.resolve(n.from-1).nodeBefore;c&&c.type===t.type&&xa(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,c))&&s.join(n.from-1)}})}let Ll=class nw{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Ve(ye(this,"addOptions",{name:this.name}))),this.storage=Ve(ye(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new nw(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>og(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new nw(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Ve(ye(n,"addOptions",{name:n.name})),n.storage=Ve(ye(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const s=i.marks();if(!!!s.find(u=>(u==null?void 0:u.type.name)===n.name))return!1;const l=s.find(u=>(u==null?void 0:u.type.name)===n.name);return l&&r.removeStoredMark(l),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}},Gr=class rw{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Ve(ye(this,"addOptions",{name:this.name}))),this.storage=Ve(ye(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new rw(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>og(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new rw(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Ve(ye(n,"addOptions",{name:n.name})),n.storage=Ve(ye(n,"addStorage",{name:n.name,options:n.options})),n}};function YU(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}class QU{constructor(e,n,r){this.isDragging=!1,this.component=e,this.editor=n.editor,this.options={stopEvent:null,ignoreMutation:null,...r},this.extension=n.extension,this.node=n.node,this.decorations=n.decorations,this.getPos=n.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var n,r,i,o,s,a,l;const{view:u}=this.editor,c=e.target,f=c.nodeType===3?(n=c.parentElement)===null||n===void 0?void 0:n.closest("[data-drag-handle]"):c.closest("[data-drag-handle]");if(!this.dom||!((r=this.contentDOM)===null||r===void 0)&&r.contains(c)||!f)return;let d=0,h=0;if(this.dom!==f){const b=this.dom.getBoundingClientRect(),y=f.getBoundingClientRect(),v=(i=e.offsetX)!==null&&i!==void 0?i:(o=e.nativeEvent)===null||o===void 0?void 0:o.offsetX,w=(s=e.offsetY)!==null&&s!==void 0?s:(a=e.nativeEvent)===null||a===void 0?void 0:a.offsetY;d=y.x-b.x+v,h=y.y-b.y+w}(l=e.dataTransfer)===null||l===void 0||l.setDragImage(this.dom,d,h);const p=_e.create(u.state.doc,this.getPos()),m=u.state.tr.setSelection(p);u.dispatch(m)}stopEvent(e){var n;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:e});const r=e.target;if(!(this.dom.contains(r)&&!(!((n=this.contentDOM)===null||n===void 0)&&n.contains(r))))return!1;const o=e.type.startsWith("drag"),s=e.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(r.tagName)||r.isContentEditable)&&!s&&!o)return!0;const{isEditable:l}=this.editor,{isDragging:u}=this,c=!!this.node.type.spec.draggable,f=_e.isSelectable(this.node),d=e.type==="copy",h=e.type==="paste",p=e.type==="cut",m=e.type==="mousedown";if(!c&&f&&o&&e.preventDefault(),c&&o&&!u)return e.preventDefault(),!1;if(c&&l&&!u&&m){const b=r.closest("[data-drag-handle]");b&&(this.dom===b||this.dom.contains(b))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(u||s||d||h||p||m&&f)}ignoreMutation(e){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:e}):this.node.isLeaf||this.node.isAtom?!0:e.type==="selection"||this.dom.contains(e.target)&&e.type==="childList"&&(sg()||YU())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(r=>r.isContentEditable)?!1:this.contentDOM===e.target&&e.type==="attributes"?!0:!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command(({tr:n})=>{const r=this.getPos();return n.setNodeMarkup(r,void 0,{...this.node.attrs,...e}),!0})}deleteNode(){const e=this.getPos(),n=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:n})}}function oc(t){return new gq({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{const o=Ve(t.getAttributes,void 0,r,i);if(o===!1||o===null)return null;const{tr:s}=e,a=r[r.length-1],l=r[0];let u=n.to;if(a){const c=l.search(/\S/),f=n.from+l.indexOf(a),d=f+a.length;if(sO(n.from,n.to,e.doc).filter(p=>p.mark.type.excluded.find(b=>b===t.type&&b!==p.mark.type)).filter(p=>p.to>f).length)return null;dn.from&&s.delete(n.from+c,f),u=n.from+c+a.length,s.addMark(n.from+c,u,t.type.create(o||{})),s.removeStoredMark(t.type)}}})}function XU(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}var kr="top",pi="bottom",mi="right",xr="left",zx="auto",kh=[kr,pi,mi,xr],sc="start",Pd="end",eV="clippingParents",lO="viewport",lf="popper",tV="reference",pC=kh.reduce(function(t,e){return t.concat([e+"-"+sc,e+"-"+Pd])},[]),uO=[].concat(kh,[zx]).reduce(function(t,e){return t.concat([e,e+"-"+sc,e+"-"+Pd])},[]),nV="beforeRead",rV="read",iV="afterRead",oV="beforeMain",sV="main",aV="afterMain",lV="beforeWrite",uV="write",cV="afterWrite",fV=[nV,rV,iV,oV,sV,aV,lV,uV,cV];function wo(t){return t?(t.nodeName||"").toLowerCase():null}function Ur(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Ol(t){var e=Ur(t).Element;return t instanceof e||t instanceof Element}function fi(t){var e=Ur(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function jx(t){if(typeof ShadowRoot>"u")return!1;var e=Ur(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function dV(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},i=e.attributes[n]||{},o=e.elements[n];!fi(o)||!wo(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var a=i[s];a===!1?o.removeAttribute(s):o.setAttribute(s,a===!0?"":a)}))})}function hV(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),a=s.reduce(function(l,u){return l[u]="",l},{});!fi(i)||!wo(i)||(Object.assign(i.style,a),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const cO={name:"applyStyles",enabled:!0,phase:"write",fn:dV,effect:hV,requires:["computeStyles"]};function go(t){return t.split("-")[0]}var ml=Math.max,fm=Math.min,ac=Math.round;function iw(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function fO(){return!/^((?!chrome|android).)*safari/i.test(iw())}function lc(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,o=1;e&&fi(t)&&(i=t.offsetWidth>0&&ac(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&ac(r.height)/t.offsetHeight||1);var s=Ol(t)?Ur(t):window,a=s.visualViewport,l=!fO()&&n,u=(r.left+(l&&a?a.offsetLeft:0))/i,c=(r.top+(l&&a?a.offsetTop:0))/o,f=r.width/i,d=r.height/o;return{width:f,height:d,top:c,right:u+f,bottom:c+d,left:u,x:u,y:c}}function qx(t){var e=lc(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function dO(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&jx(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Yo(t){return Ur(t).getComputedStyle(t)}function pV(t){return["table","td","th"].indexOf(wo(t))>=0}function Ca(t){return((Ol(t)?t.ownerDocument:t.document)||window.document).documentElement}function ug(t){return wo(t)==="html"?t:t.assignedSlot||t.parentNode||(jx(t)?t.host:null)||Ca(t)}function mC(t){return!fi(t)||Yo(t).position==="fixed"?null:t.offsetParent}function mV(t){var e=/firefox/i.test(iw()),n=/Trident/i.test(iw());if(n&&fi(t)){var r=Yo(t);if(r.position==="fixed")return null}var i=ug(t);for(jx(i)&&(i=i.host);fi(i)&&["html","body"].indexOf(wo(i))<0;){var o=Yo(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function xh(t){for(var e=Ur(t),n=mC(t);n&&pV(n)&&Yo(n).position==="static";)n=mC(n);return n&&(wo(n)==="html"||wo(n)==="body"&&Yo(n).position==="static")?e:n||mV(t)||e}function Ux(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function td(t,e,n){return ml(t,fm(e,n))}function gV(t,e,n){var r=td(t,e,n);return r>n?n:r}function hO(){return{top:0,right:0,bottom:0,left:0}}function pO(t){return Object.assign({},hO(),t)}function mO(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var yV=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,pO(typeof e!="number"?e:mO(e,kh))};function bV(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=go(n.placement),l=Ux(a),u=[xr,mi].indexOf(a)>=0,c=u?"height":"width";if(!(!o||!s)){var f=yV(i.padding,n),d=qx(o),h=l==="y"?kr:xr,p=l==="y"?pi:mi,m=n.rects.reference[c]+n.rects.reference[l]-s[l]-n.rects.popper[c],b=s[l]-n.rects.reference[l],y=xh(o),v=y?l==="y"?y.clientHeight||0:y.clientWidth||0:0,w=m/2-b/2,g=f[h],x=v-d[c]-f[p],k=v/2-d[c]/2+w,E=td(g,k,x),D=l;n.modifiersData[r]=(e={},e[D]=E,e.centerOffset=E-k,e)}}function vV(t){var e=t.state,n=t.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||dO(e.elements.popper,i)&&(e.elements.arrow=i))}const wV={name:"arrow",enabled:!0,phase:"main",fn:bV,effect:vV,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function uc(t){return t.split("-")[1]}var kV={top:"auto",right:"auto",bottom:"auto",left:"auto"};function xV(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:ac(n*i)/i||0,y:ac(r*i)/i||0}}function gC(t){var e,n=t.popper,r=t.popperRect,i=t.placement,o=t.variation,s=t.offsets,a=t.position,l=t.gpuAcceleration,u=t.adaptive,c=t.roundOffsets,f=t.isFixed,d=s.x,h=d===void 0?0:d,p=s.y,m=p===void 0?0:p,b=typeof c=="function"?c({x:h,y:m}):{x:h,y:m};h=b.x,m=b.y;var y=s.hasOwnProperty("x"),v=s.hasOwnProperty("y"),w=xr,g=kr,x=window;if(u){var k=xh(n),E="clientHeight",D="clientWidth";if(k===Ur(n)&&(k=Ca(n),Yo(k).position!=="static"&&a==="absolute"&&(E="scrollHeight",D="scrollWidth")),k=k,i===kr||(i===xr||i===mi)&&o===Pd){g=pi;var O=f&&k===x&&x.visualViewport?x.visualViewport.height:k[E];m-=O-r.height,m*=l?1:-1}if(i===xr||(i===kr||i===pi)&&o===Pd){w=mi;var N=f&&k===x&&x.visualViewport?x.visualViewport.width:k[D];h-=N-r.width,h*=l?1:-1}}var C=Object.assign({position:a},u&&kV),R=c===!0?xV({x:h,y:m},Ur(n)):{x:h,y:m};if(h=R.x,m=R.y,l){var T;return Object.assign({},C,(T={},T[g]=v?"0":"",T[w]=y?"0":"",T.transform=(x.devicePixelRatio||1)<=1?"translate("+h+"px, "+m+"px)":"translate3d("+h+"px, "+m+"px, 0)",T))}return Object.assign({},C,(e={},e[g]=v?m+"px":"",e[w]=y?h+"px":"",e.transform="",e))}function EV(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,s=o===void 0?!0:o,a=n.roundOffsets,l=a===void 0?!0:a,u={placement:go(e.placement),variation:uc(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,gC(Object.assign({},u,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,gC(Object.assign({},u,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const SV={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:EV,data:{}};var dp={passive:!0};function CV(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,o=i===void 0?!0:i,s=r.resize,a=s===void 0?!0:s,l=Ur(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&u.forEach(function(c){c.addEventListener("scroll",n.update,dp)}),a&&l.addEventListener("resize",n.update,dp),function(){o&&u.forEach(function(c){c.removeEventListener("scroll",n.update,dp)}),a&&l.removeEventListener("resize",n.update,dp)}}const _V={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:CV,data:{}};var AV={left:"right",right:"left",bottom:"top",top:"bottom"};function d0(t){return t.replace(/left|right|bottom|top/g,function(e){return AV[e]})}var TV={start:"end",end:"start"};function yC(t){return t.replace(/start|end/g,function(e){return TV[e]})}function Vx(t){var e=Ur(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Hx(t){return lc(Ca(t)).left+Vx(t).scrollLeft}function MV(t,e){var n=Ur(t),r=Ca(t),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;var u=fO();(u||!u&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a+Hx(t),y:l}}function OV(t){var e,n=Ca(t),r=Vx(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=ml(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=ml(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+Hx(t),l=-r.scrollTop;return Yo(i||n).direction==="rtl"&&(a+=ml(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}function Wx(t){var e=Yo(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function gO(t){return["html","body","#document"].indexOf(wo(t))>=0?t.ownerDocument.body:fi(t)&&Wx(t)?t:gO(ug(t))}function nd(t,e){var n;e===void 0&&(e=[]);var r=gO(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=Ur(r),s=i?[o].concat(o.visualViewport||[],Wx(r)?r:[]):r,a=e.concat(s);return i?a:a.concat(nd(ug(s)))}function ow(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function DV(t,e){var n=lc(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function bC(t,e,n){return e===lO?ow(MV(t,n)):Ol(e)?DV(e,n):ow(OV(Ca(t)))}function NV(t){var e=nd(ug(t)),n=["absolute","fixed"].indexOf(Yo(t).position)>=0,r=n&&fi(t)?xh(t):t;return Ol(r)?e.filter(function(i){return Ol(i)&&dO(i,r)&&wo(i)!=="body"}):[]}function $V(t,e,n,r){var i=e==="clippingParents"?NV(t):[].concat(e),o=[].concat(i,[n]),s=o[0],a=o.reduce(function(l,u){var c=bC(t,u,r);return l.top=ml(c.top,l.top),l.right=fm(c.right,l.right),l.bottom=fm(c.bottom,l.bottom),l.left=ml(c.left,l.left),l},bC(t,s,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function yO(t){var e=t.reference,n=t.element,r=t.placement,i=r?go(r):null,o=r?uc(r):null,s=e.x+e.width/2-n.width/2,a=e.y+e.height/2-n.height/2,l;switch(i){case kr:l={x:s,y:e.y-n.height};break;case pi:l={x:s,y:e.y+e.height};break;case mi:l={x:e.x+e.width,y:a};break;case xr:l={x:e.x-n.width,y:a};break;default:l={x:e.x,y:e.y}}var u=i?Ux(i):null;if(u!=null){var c=u==="y"?"height":"width";switch(o){case sc:l[u]=l[u]-(e[c]/2-n[c]/2);break;case Pd:l[u]=l[u]+(e[c]/2-n[c]/2);break}}return l}function zd(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,o=n.strategy,s=o===void 0?t.strategy:o,a=n.boundary,l=a===void 0?eV:a,u=n.rootBoundary,c=u===void 0?lO:u,f=n.elementContext,d=f===void 0?lf:f,h=n.altBoundary,p=h===void 0?!1:h,m=n.padding,b=m===void 0?0:m,y=pO(typeof b!="number"?b:mO(b,kh)),v=d===lf?tV:lf,w=t.rects.popper,g=t.elements[p?v:d],x=$V(Ol(g)?g:g.contextElement||Ca(t.elements.popper),l,c,s),k=lc(t.elements.reference),E=yO({reference:k,element:w,strategy:"absolute",placement:i}),D=ow(Object.assign({},w,E)),O=d===lf?D:k,N={top:x.top-O.top+y.top,bottom:O.bottom-x.bottom+y.bottom,left:x.left-O.left+y.left,right:O.right-x.right+y.right},C=t.modifiersData.offset;if(d===lf&&C){var R=C[i];Object.keys(N).forEach(function(T){var q=[mi,pi].indexOf(T)>=0?1:-1,A=[kr,pi].indexOf(T)>=0?"y":"x";N[T]+=R[A]*q})}return N}function IV(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?uO:l,c=uc(r),f=c?a?pC:pC.filter(function(p){return uc(p)===c}):kh,d=f.filter(function(p){return u.indexOf(p)>=0});d.length===0&&(d=f);var h=d.reduce(function(p,m){return p[m]=zd(t,{placement:m,boundary:i,rootBoundary:o,padding:s})[go(m)],p},{});return Object.keys(h).sort(function(p,m){return h[p]-h[m]})}function RV(t){if(go(t)===zx)return[];var e=d0(t);return[yC(t),e,yC(e)]}function FV(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!0:s,l=n.fallbackPlacements,u=n.padding,c=n.boundary,f=n.rootBoundary,d=n.altBoundary,h=n.flipVariations,p=h===void 0?!0:h,m=n.allowedAutoPlacements,b=e.options.placement,y=go(b),v=y===b,w=l||(v||!p?[d0(b)]:RV(b)),g=[b].concat(w).reduce(function(fe,ke){return fe.concat(go(ke)===zx?IV(e,{placement:ke,boundary:c,rootBoundary:f,padding:u,flipVariations:p,allowedAutoPlacements:m}):ke)},[]),x=e.rects.reference,k=e.rects.popper,E=new Map,D=!0,O=g[0],N=0;N=0,A=q?"width":"height",S=zd(e,{placement:C,boundary:c,rootBoundary:f,altBoundary:d,padding:u}),P=q?T?mi:xr:T?pi:kr;x[A]>k[A]&&(P=d0(P));var B=d0(P),j=[];if(o&&j.push(S[R]<=0),a&&j.push(S[P]<=0,S[B]<=0),j.every(function(fe){return fe})){O=C,D=!1;break}E.set(C,j)}if(D)for(var z=p?3:1,J=function(ke){var ve=g.find(function(xe){var Se=E.get(xe);if(Se)return Se.slice(0,ke).every(function(Oe){return Oe})});if(ve)return O=ve,"break"},K=z;K>0;K--){var ae=J(K);if(ae==="break")break}e.placement!==O&&(e.modifiersData[r]._skip=!0,e.placement=O,e.reset=!0)}}const LV={name:"flip",enabled:!0,phase:"main",fn:FV,requiresIfExists:["offset"],data:{_skip:!1}};function vC(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function wC(t){return[kr,mi,pi,xr].some(function(e){return t[e]>=0})}function BV(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,s=zd(e,{elementContext:"reference"}),a=zd(e,{altBoundary:!0}),l=vC(s,r),u=vC(a,i,o),c=wC(l),f=wC(u);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":f})}const PV={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:BV};function zV(t,e,n){var r=go(t),i=[xr,kr].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*i,[xr,mi].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function jV(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,s=uO.reduce(function(c,f){return c[f]=zV(f,e.rects,o),c},{}),a=s[e.placement],l=a.x,u=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=u),e.modifiersData[r]=s}const qV={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:jV};function UV(t){var e=t.state,n=t.name;e.modifiersData[n]=yO({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const VV={name:"popperOffsets",enabled:!0,phase:"read",fn:UV,data:{}};function HV(t){return t==="x"?"y":"x"}function WV(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!1:s,l=n.boundary,u=n.rootBoundary,c=n.altBoundary,f=n.padding,d=n.tether,h=d===void 0?!0:d,p=n.tetherOffset,m=p===void 0?0:p,b=zd(e,{boundary:l,rootBoundary:u,padding:f,altBoundary:c}),y=go(e.placement),v=uc(e.placement),w=!v,g=Ux(y),x=HV(g),k=e.modifiersData.popperOffsets,E=e.rects.reference,D=e.rects.popper,O=typeof m=="function"?m(Object.assign({},e.rects,{placement:e.placement})):m,N=typeof O=="number"?{mainAxis:O,altAxis:O}:Object.assign({mainAxis:0,altAxis:0},O),C=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,R={x:0,y:0};if(k){if(o){var T,q=g==="y"?kr:xr,A=g==="y"?pi:mi,S=g==="y"?"height":"width",P=k[g],B=P+b[q],j=P-b[A],z=h?-D[S]/2:0,J=v===sc?E[S]:D[S],K=v===sc?-D[S]:-E[S],ae=e.elements.arrow,fe=h&&ae?qx(ae):{width:0,height:0},ke=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:hO(),ve=ke[q],xe=ke[A],Se=td(0,E[S],fe[S]),Oe=w?E[S]/2-z-Se-ve-N.mainAxis:J-Se-ve-N.mainAxis,Fe=w?-E[S]/2+z+Se+xe+N.mainAxis:K+Se+xe+N.mainAxis,mt=e.elements.arrow&&xh(e.elements.arrow),Ce=mt?g==="y"?mt.clientTop||0:mt.clientLeft||0:0,pe=(T=C==null?void 0:C[g])!=null?T:0,De=P+Oe-pe-Ce,Le=P+Fe-pe,Ge=td(h?fm(B,De):B,P,h?ml(j,Le):j);k[g]=Ge,R[g]=Ge-P}if(a){var Qt,rt=g==="x"?kr:xr,it=g==="x"?pi:mi,bt=k[x],Ft=x==="y"?"height":"width",Lt=bt+b[rt],at=bt-b[it],gt=[kr,xr].indexOf(y)!==-1,Y=(Qt=C==null?void 0:C[x])!=null?Qt:0,V=gt?Lt:bt-E[Ft]-D[Ft]-Y+N.altAxis,W=gt?bt+E[Ft]+D[Ft]-Y-N.altAxis:at,X=h&>?gV(V,bt,W):td(h?V:Lt,bt,h?W:at);k[x]=X,R[x]=X-bt}e.modifiersData[r]=R}}const JV={name:"preventOverflow",enabled:!0,phase:"main",fn:WV,requiresIfExists:["offset"]};function KV(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function GV(t){return t===Ur(t)||!fi(t)?Vx(t):KV(t)}function ZV(t){var e=t.getBoundingClientRect(),n=ac(e.width)/t.offsetWidth||1,r=ac(e.height)/t.offsetHeight||1;return n!==1||r!==1}function YV(t,e,n){n===void 0&&(n=!1);var r=fi(e),i=fi(e)&&ZV(e),o=Ca(e),s=lc(t,i,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((wo(e)!=="body"||Wx(o))&&(a=GV(e)),fi(e)?(l=lc(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):o&&(l.x=Hx(o))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function QV(t){var e=new Map,n=new Set,r=[];t.forEach(function(o){e.set(o.name,o)});function i(o){n.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(a){if(!n.has(a)){var l=e.get(a);l&&i(l)}}),r.push(o)}return t.forEach(function(o){n.has(o.name)||i(o)}),r}function XV(t){var e=QV(t);return fV.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function eH(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function tH(t){var e=t.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var kC={placement:"bottom",modifiers:[],strategy:"absolute"};function xC(){for(var t=arguments.length,e=new Array(t),n=0;n-1}function xO(t,e){return typeof t=="function"?t.apply(void 0,e):t}function EC(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function aH(t){return t.split(/\s+/).filter(Boolean)}function lu(t){return[].concat(t)}function SC(t,e){t.indexOf(e)===-1&&t.push(e)}function lH(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function uH(t){return t.split("-")[0]}function dm(t){return[].slice.call(t)}function CC(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function rd(){return document.createElement("div")}function cg(t){return["Element","Fragment"].some(function(e){return Jx(t,e)})}function cH(t){return Jx(t,"NodeList")}function fH(t){return Jx(t,"MouseEvent")}function dH(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function hH(t){return cg(t)?[t]:cH(t)?dm(t):Array.isArray(t)?t:dm(document.querySelectorAll(t))}function nb(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function _C(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function pH(t){var e,n=lu(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function mH(t,e){var n=e.clientX,r=e.clientY;return t.every(function(i){var o=i.popperRect,s=i.popperState,a=i.props,l=a.interactiveBorder,u=uH(s.placement),c=s.modifiersData.offset;if(!c)return!0;var f=u==="bottom"?c.top.y:0,d=u==="top"?c.bottom.y:0,h=u==="right"?c.left.x:0,p=u==="left"?c.right.x:0,m=o.top-r+f>l,b=r-o.bottom-d>l,y=o.left-n+h>l,v=n-o.right-p>l;return m||b||y||v})}function rb(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){t[r](i,n)})}function AC(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var Zi={isTouch:!1},TC=0;function gH(){Zi.isTouch||(Zi.isTouch=!0,window.performance&&document.addEventListener("mousemove",EO))}function EO(){var t=performance.now();t-TC<20&&(Zi.isTouch=!1,document.removeEventListener("mousemove",EO)),TC=t}function yH(){var t=document.activeElement;if(dH(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function bH(){document.addEventListener("touchstart",gH,Pa),window.addEventListener("blur",yH)}var vH=typeof window<"u"&&typeof document<"u",wH=vH?!!window.msCrypto:!1,kH={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},xH={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Ai=Object.assign({appendTo:kO,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},kH,xH),EH=Object.keys(Ai),SH=function(e){var n=Object.keys(e);n.forEach(function(r){Ai[r]=e[r]})};function SO(t){var e=t.plugins||[],n=e.reduce(function(r,i){var o=i.name,s=i.defaultValue;if(o){var a;r[o]=t[o]!==void 0?t[o]:(a=Ai[o])!=null?a:s}return r},{});return Object.assign({},t,n)}function CH(t,e){var n=e?Object.keys(SO(Object.assign({},Ai,{plugins:e}))):EH,r=n.reduce(function(i,o){var s=(t.getAttribute("data-tippy-"+o)||"").trim();if(!s)return i;if(o==="content")i[o]=s;else try{i[o]=JSON.parse(s)}catch{i[o]=s}return i},{});return r}function MC(t,e){var n=Object.assign({},e,{content:xO(e.content,[t])},e.ignoreAttributes?{}:CH(t,e.plugins));return n.aria=Object.assign({},Ai.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?e.interactive:n.aria.expanded,content:n.aria.content==="auto"?e.interactive?null:"describedby":n.aria.content},n}var _H=function(){return"innerHTML"};function sw(t,e){t[_H()]=e}function OC(t){var e=rd();return t===!0?e.className=vO:(e.className=wO,cg(t)?e.appendChild(t):sw(e,t)),e}function DC(t,e){cg(e.content)?(sw(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?sw(t,e.content):t.textContent=e.content)}function aw(t){var e=t.firstElementChild,n=dm(e.children);return{box:e,content:n.find(function(r){return r.classList.contains(bO)}),arrow:n.find(function(r){return r.classList.contains(vO)||r.classList.contains(wO)}),backdrop:n.find(function(r){return r.classList.contains(sH)})}}function CO(t){var e=rd(),n=rd();n.className=oH,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=rd();r.className=bO,r.setAttribute("data-state","hidden"),DC(r,t.props),e.appendChild(n),n.appendChild(r),i(t.props,t.props);function i(o,s){var a=aw(e),l=a.box,u=a.content,c=a.arrow;s.theme?l.setAttribute("data-theme",s.theme):l.removeAttribute("data-theme"),typeof s.animation=="string"?l.setAttribute("data-animation",s.animation):l.removeAttribute("data-animation"),s.inertia?l.setAttribute("data-inertia",""):l.removeAttribute("data-inertia"),l.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?l.setAttribute("role",s.role):l.removeAttribute("role"),(o.content!==s.content||o.allowHTML!==s.allowHTML)&&DC(u,t.props),s.arrow?c?o.arrow!==s.arrow&&(l.removeChild(c),l.appendChild(OC(s.arrow))):l.appendChild(OC(s.arrow)):c&&l.removeChild(c)}return{popper:e,onUpdate:i}}CO.$$tippy=!0;var AH=1,hp=[],ib=[];function TH(t,e){var n=MC(t,Object.assign({},Ai,SO(CC(e)))),r,i,o,s=!1,a=!1,l=!1,u=!1,c,f,d,h=[],p=EC(De,n.interactiveDebounce),m,b=AH++,y=null,v=lH(n.plugins),w={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},g={id:b,reference:t,popper:rd(),popperInstance:y,props:n,state:w,plugins:v,clearDelayTimeouts:V,setProps:W,setContent:X,show:se,hide:ge,hideWithInteractivity:Pe,enable:gt,disable:Y,unmount:Be,destroy:nt};if(!n.render)return g;var x=n.render(g),k=x.popper,E=x.onUpdate;k.setAttribute("data-tippy-root",""),k.id="tippy-"+g.id,g.popper=k,t._tippy=g,k._tippy=g;var D=v.map(function(G){return G.fn(g)}),O=t.hasAttribute("aria-expanded");return mt(),z(),P(),B("onCreate",[g]),n.showOnCreate&&Lt(),k.addEventListener("mouseenter",function(){g.props.interactive&&g.state.isVisible&&g.clearDelayTimeouts()}),k.addEventListener("mouseleave",function(){g.props.interactive&&g.props.trigger.indexOf("mouseenter")>=0&&q().addEventListener("mousemove",p)}),g;function N(){var G=g.props.touch;return Array.isArray(G)?G:[G,0]}function C(){return N()[0]==="hold"}function R(){var G;return!!((G=g.props.render)!=null&&G.$$tippy)}function T(){return m||t}function q(){var G=T().parentNode;return G?pH(G):document}function A(){return aw(k)}function S(G){return g.state.isMounted&&!g.state.isVisible||Zi.isTouch||c&&c.type==="focus"?0:tb(g.props.delay,G?0:1,Ai.delay)}function P(G){G===void 0&&(G=!1),k.style.pointerEvents=g.props.interactive&&!G?"":"none",k.style.zIndex=""+g.props.zIndex}function B(G,re,me){if(me===void 0&&(me=!0),D.forEach(function(Ae){Ae[G]&&Ae[G].apply(Ae,re)}),me){var Ee;(Ee=g.props)[G].apply(Ee,re)}}function j(){var G=g.props.aria;if(G.content){var re="aria-"+G.content,me=k.id,Ee=lu(g.props.triggerTarget||t);Ee.forEach(function(Ae){var ot=Ae.getAttribute(re);if(g.state.isVisible)Ae.setAttribute(re,ot?ot+" "+me:me);else{var _t=ot&&ot.replace(me,"").trim();_t?Ae.setAttribute(re,_t):Ae.removeAttribute(re)}})}}function z(){if(!(O||!g.props.aria.expanded)){var G=lu(g.props.triggerTarget||t);G.forEach(function(re){g.props.interactive?re.setAttribute("aria-expanded",g.state.isVisible&&re===T()?"true":"false"):re.removeAttribute("aria-expanded")})}}function J(){q().removeEventListener("mousemove",p),hp=hp.filter(function(G){return G!==p})}function K(G){if(!(Zi.isTouch&&(l||G.type==="mousedown"))){var re=G.composedPath&&G.composedPath()[0]||G.target;if(!(g.props.interactive&&AC(k,re))){if(lu(g.props.triggerTarget||t).some(function(me){return AC(me,re)})){if(Zi.isTouch||g.state.isVisible&&g.props.trigger.indexOf("click")>=0)return}else B("onClickOutside",[g,G]);g.props.hideOnClick===!0&&(g.clearDelayTimeouts(),g.hide(),a=!0,setTimeout(function(){a=!1}),g.state.isMounted||ve())}}}function ae(){l=!0}function fe(){l=!1}function ke(){var G=q();G.addEventListener("mousedown",K,!0),G.addEventListener("touchend",K,Pa),G.addEventListener("touchstart",fe,Pa),G.addEventListener("touchmove",ae,Pa)}function ve(){var G=q();G.removeEventListener("mousedown",K,!0),G.removeEventListener("touchend",K,Pa),G.removeEventListener("touchstart",fe,Pa),G.removeEventListener("touchmove",ae,Pa)}function xe(G,re){Oe(G,function(){!g.state.isVisible&&k.parentNode&&k.parentNode.contains(k)&&re()})}function Se(G,re){Oe(G,re)}function Oe(G,re){var me=A().box;function Ee(Ae){Ae.target===me&&(rb(me,"remove",Ee),re())}if(G===0)return re();rb(me,"remove",f),rb(me,"add",Ee),f=Ee}function Fe(G,re,me){me===void 0&&(me=!1);var Ee=lu(g.props.triggerTarget||t);Ee.forEach(function(Ae){Ae.addEventListener(G,re,me),h.push({node:Ae,eventType:G,handler:re,options:me})})}function mt(){C()&&(Fe("touchstart",pe,{passive:!0}),Fe("touchend",Le,{passive:!0})),aH(g.props.trigger).forEach(function(G){if(G!=="manual")switch(Fe(G,pe),G){case"mouseenter":Fe("mouseleave",Le);break;case"focus":Fe(wH?"focusout":"blur",Ge);break;case"focusin":Fe("focusout",Ge);break}})}function Ce(){h.forEach(function(G){var re=G.node,me=G.eventType,Ee=G.handler,Ae=G.options;re.removeEventListener(me,Ee,Ae)}),h=[]}function pe(G){var re,me=!1;if(!(!g.state.isEnabled||Qt(G)||a)){var Ee=((re=c)==null?void 0:re.type)==="focus";c=G,m=G.currentTarget,z(),!g.state.isVisible&&fH(G)&&hp.forEach(function(Ae){return Ae(G)}),G.type==="click"&&(g.props.trigger.indexOf("mouseenter")<0||s)&&g.props.hideOnClick!==!1&&g.state.isVisible?me=!0:Lt(G),G.type==="click"&&(s=!me),me&&!Ee&&at(G)}}function De(G){var re=G.target,me=T().contains(re)||k.contains(re);if(!(G.type==="mousemove"&&me)){var Ee=Ft().concat(k).map(function(Ae){var ot,_t=Ae._tippy,Xt=(ot=_t.popperInstance)==null?void 0:ot.state;return Xt?{popperRect:Ae.getBoundingClientRect(),popperState:Xt,props:n}:null}).filter(Boolean);mH(Ee,G)&&(J(),at(G))}}function Le(G){var re=Qt(G)||g.props.trigger.indexOf("click")>=0&&s;if(!re){if(g.props.interactive){g.hideWithInteractivity(G);return}at(G)}}function Ge(G){g.props.trigger.indexOf("focusin")<0&&G.target!==T()||g.props.interactive&&G.relatedTarget&&k.contains(G.relatedTarget)||at(G)}function Qt(G){return Zi.isTouch?C()!==G.type.indexOf("touch")>=0:!1}function rt(){it();var G=g.props,re=G.popperOptions,me=G.placement,Ee=G.offset,Ae=G.getReferenceClientRect,ot=G.moveTransition,_t=R()?aw(k).arrow:null,Xt=Ae?{getBoundingClientRect:Ae,contextElement:Ae.contextElement||T()}:t,Nt={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Wt){var vn=Wt.state;if(R()){var Dr=A(),wn=Dr.box;["placement","reference-hidden","escaped"].forEach(function($n){$n==="placement"?wn.setAttribute("data-placement",vn.placement):vn.attributes.popper["data-popper-"+$n]?wn.setAttribute("data-"+$n,""):wn.removeAttribute("data-"+$n)}),vn.attributes.popper={}}}},Ie=[{name:"offset",options:{offset:Ee}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!ot}},Nt];R()&&_t&&Ie.push({name:"arrow",options:{element:_t,padding:3}}),Ie.push.apply(Ie,(re==null?void 0:re.modifiers)||[]),g.popperInstance=iH(Xt,k,Object.assign({},re,{placement:me,onFirstUpdate:d,modifiers:Ie}))}function it(){g.popperInstance&&(g.popperInstance.destroy(),g.popperInstance=null)}function bt(){var G=g.props.appendTo,re,me=T();g.props.interactive&&G===kO||G==="parent"?re=me.parentNode:re=xO(G,[me]),re.contains(k)||re.appendChild(k),g.state.isMounted=!0,rt()}function Ft(){return dm(k.querySelectorAll("[data-tippy-root]"))}function Lt(G){g.clearDelayTimeouts(),G&&B("onTrigger",[g,G]),ke();var re=S(!0),me=N(),Ee=me[0],Ae=me[1];Zi.isTouch&&Ee==="hold"&&Ae&&(re=Ae),re?r=setTimeout(function(){g.show()},re):g.show()}function at(G){if(g.clearDelayTimeouts(),B("onUntrigger",[g,G]),!g.state.isVisible){ve();return}if(!(g.props.trigger.indexOf("mouseenter")>=0&&g.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(G.type)>=0&&s)){var re=S(!1);re?i=setTimeout(function(){g.state.isVisible&&g.hide()},re):o=requestAnimationFrame(function(){g.hide()})}}function gt(){g.state.isEnabled=!0}function Y(){g.hide(),g.state.isEnabled=!1}function V(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function W(G){if(!g.state.isDestroyed){B("onBeforeUpdate",[g,G]),Ce();var re=g.props,me=MC(t,Object.assign({},re,CC(G),{ignoreAttributes:!0}));g.props=me,mt(),re.interactiveDebounce!==me.interactiveDebounce&&(J(),p=EC(De,me.interactiveDebounce)),re.triggerTarget&&!me.triggerTarget?lu(re.triggerTarget).forEach(function(Ee){Ee.removeAttribute("aria-expanded")}):me.triggerTarget&&t.removeAttribute("aria-expanded"),z(),P(),E&&E(re,me),g.popperInstance&&(rt(),Ft().forEach(function(Ee){requestAnimationFrame(Ee._tippy.popperInstance.forceUpdate)})),B("onAfterUpdate",[g,G])}}function X(G){g.setProps({content:G})}function se(){var G=g.state.isVisible,re=g.state.isDestroyed,me=!g.state.isEnabled,Ee=Zi.isTouch&&!g.props.touch,Ae=tb(g.props.duration,0,Ai.duration);if(!(G||re||me||Ee)&&!T().hasAttribute("disabled")&&(B("onShow",[g],!1),g.props.onShow(g)!==!1)){if(g.state.isVisible=!0,R()&&(k.style.visibility="visible"),P(),ke(),g.state.isMounted||(k.style.transition="none"),R()){var ot=A(),_t=ot.box,Xt=ot.content;nb([_t,Xt],0)}d=function(){var Ie;if(!(!g.state.isVisible||u)){if(u=!0,k.offsetHeight,k.style.transition=g.props.moveTransition,R()&&g.props.animation){var Bt=A(),Wt=Bt.box,vn=Bt.content;nb([Wt,vn],Ae),_C([Wt,vn],"visible")}j(),z(),SC(ib,g),(Ie=g.popperInstance)==null||Ie.forceUpdate(),B("onMount",[g]),g.props.animation&&R()&&Se(Ae,function(){g.state.isShown=!0,B("onShown",[g])})}},bt()}}function ge(){var G=!g.state.isVisible,re=g.state.isDestroyed,me=!g.state.isEnabled,Ee=tb(g.props.duration,1,Ai.duration);if(!(G||re||me)&&(B("onHide",[g],!1),g.props.onHide(g)!==!1)){if(g.state.isVisible=!1,g.state.isShown=!1,u=!1,s=!1,R()&&(k.style.visibility="hidden"),J(),ve(),P(!0),R()){var Ae=A(),ot=Ae.box,_t=Ae.content;g.props.animation&&(nb([ot,_t],Ee),_C([ot,_t],"hidden"))}j(),z(),g.props.animation?R()&&xe(Ee,g.unmount):g.unmount()}}function Pe(G){q().addEventListener("mousemove",p),SC(hp,p),p(G)}function Be(){g.state.isVisible&&g.hide(),g.state.isMounted&&(it(),Ft().forEach(function(G){G._tippy.unmount()}),k.parentNode&&k.parentNode.removeChild(k),ib=ib.filter(function(G){return G!==g}),g.state.isMounted=!1,B("onHidden",[g]))}function nt(){g.state.isDestroyed||(g.clearDelayTimeouts(),g.unmount(),Ce(),delete t._tippy,g.state.isDestroyed=!0,B("onDestroy",[g]))}}function $c(t,e){e===void 0&&(e={});var n=Ai.plugins.concat(e.plugins||[]);bH();var r=Object.assign({},e,{plugins:n}),i=hH(t),o=i.reduce(function(s,a){var l=a&&TH(a,r);return l&&s.push(l),s},[]);return cg(t)?o[0]:o}$c.defaultProps=Ai;$c.setDefaultProps=SH;$c.currentInput=Zi;Object.assign({},cO,{effect:function(e){var n=e.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}});$c.setDefaultProps({render:CO});const MH=(...t)=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n&&(n.current=e)})},OH=({renderers:t})=>tt.createElement(tt.Fragment,null,Object.entries(t).map(([e,n])=>qB.createPortal(n.reactElement,n.element,e)));class DH extends tt.Component{constructor(e){super(e),this.editorContentRef=tt.createRef(),this.initialized=!1,this.state={renderers:{}}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const{editor:e}=this.props;if(e&&!e.isDestroyed&&e.options.element){if(e.contentComponent)return;const n=this.editorContentRef.current;n.append(...e.options.element.childNodes),e.setOptions({element:n}),e.contentComponent=this,e.createNodeViews(),this.initialized=!0}}maybeFlushSync(e){this.initialized?K1.flushSync(e):e()}setRenderer(e,n){this.maybeFlushSync(()=>{this.setState(({renderers:r})=>({renderers:{...r,[e]:n}}))})}removeRenderer(e){this.maybeFlushSync(()=>{this.setState(({renderers:n})=>{const r={...n};return delete r[e],{renderers:r}})})}componentWillUnmount(){const{editor:e}=this.props;if(!e||(this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null,!e.options.element.firstChild))return;const n=document.createElement("div");n.append(...e.options.element.childNodes),e.setOptions({element:n})}render(){const{editor:e,innerRef:n,...r}=this.props;return tt.createElement(tt.Fragment,null,tt.createElement("div",{ref:MH(n,this.editorContentRef),...r}),tt.createElement(OH,{renderers:this.state.renderers}))}}const NH=ee.forwardRef((t,e)=>{const n=tt.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return tt.createElement(DH,{key:n,innerRef:e,...t})}),$H=tt.memo(NH);class pp extends aO{constructor(){super(...arguments),this.contentComponent=null}}var _O={exports:{}},ob={},sb={exports:{}},ab={};/** * @license React * use-sync-external-store-shim.production.min.js * @@ -191,19 +191,19 @@ img.ProseMirror-separator { * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var IC;function FH(){if(IC)return ob;IC=1;var t=tt,e=RH();function n(u,c){return u===c&&(u!==0||1/u===1/c)||u!==u&&c!==c}var r=typeof Object.is=="function"?Object.is:n,i=e.useSyncExternalStore,o=t.useRef,s=t.useEffect,a=t.useMemo,l=t.useDebugValue;return ob.useSyncExternalStoreWithSelector=function(u,c,f,d,h){var p=o(null);if(p.current===null){var m={hasValue:!1,value:null};p.current=m}else m=p.current;p=a(function(){function y(k){if(!v){if(v=!0,w=k,k=d(k),h!==void 0&&m.hasValue){var E=m.value;if(h(E,k))return g=E}return g=k}if(E=g,r(w,k))return E;var D=d(k);return h!==void 0&&h(E,D)?E:(w=k,g=D)}var v=!1,w,g,x=f===void 0?null:f;return[function(){return y(c())},x===null?void 0:function(){return y(x())}]},[c,f,d,h]);var b=i(u,p[0],p[1]);return s(function(){m.hasValue=!0,m.value=b},[b]),l(b),b},ob}_O.exports=FH();var LH=_O.exports;function BH(t){let e=0,n=0,r={editor:t,transactionNumber:0},i=t;const o=new Set;return{getSnapshot(){return e===n||(n=e,r={editor:i,transactionNumber:e}),r},getServerSnapshot(){return{editor:null,transactionNumber:0}},subscribe(a){return o.add(a),()=>{o.delete(a)}},watch(a){if(i=a,i){const l=()=>{e+=1,o.forEach(c=>c())},u=i;return u.on("transaction",l),()=>{u.off("transaction",l)}}}}}function PH(t){const[e]=ee.useState(()=>BH(t.editor)),n=LH.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getServerSnapshot,t.selector,t.equalityFn);return ee.useEffect(()=>e.watch(t.editor),[t.editor]),ee.useDebugValue(n),n}const zH=!1,lw=typeof window>"u",jH=lw||!!(typeof window<"u"&&window.next);function qH(t={},e=[]){const n=ee.useRef(!1),[r,i]=ee.useState(()=>{if(t.immediatelyRender===void 0)return lw||jH?null:new hp(t);if(t.immediatelyRender&&lw&&zH)throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return t.immediatelyRender?new hp(t):null});ee.useDebugValue(r),ee.useEffect(()=>{let E=r;E?Array.isArray(e)&&e.length?(E=new hp(t),i(E)):E.setOptions(t):(E=new hp(t),i(E))},e);const{onBeforeCreate:o,onBlur:s,onCreate:a,onDestroy:l,onFocus:u,onSelectionUpdate:c,onTransaction:f,onUpdate:d,onContentError:h}=t,p=ee.useRef(o),m=ee.useRef(s),b=ee.useRef(a),y=ee.useRef(l),v=ee.useRef(u),w=ee.useRef(c),g=ee.useRef(f),x=ee.useRef(d),k=ee.useRef(h);return ee.useEffect(()=>{r&&(o&&(r.off("beforeCreate",p.current),r.on("beforeCreate",o),p.current=o),s&&(r.off("blur",m.current),r.on("blur",s),m.current=s),a&&(r.off("create",b.current),r.on("create",a),b.current=a),l&&(r.off("destroy",y.current),r.on("destroy",l),y.current=l),u&&(r.off("focus",v.current),r.on("focus",u),v.current=u),c&&(r.off("selectionUpdate",w.current),r.on("selectionUpdate",c),w.current=c),f&&(r.off("transaction",g.current),r.on("transaction",f),g.current=f),d&&(r.off("update",x.current),r.on("update",d),x.current=d),h&&(r.off("contentError",k.current),r.on("contentError",h),k.current=h))},[o,s,a,l,u,c,f,d,h,r]),ee.useEffect(()=>(n.current=!0,()=>{n.current=!1,r&&setTimeout(()=>{!n.current&&!r.isDestroyed&&r.destroy()})}),[]),PH({editor:r,selector:({transactionNumber:E})=>t.shouldRerenderOnTransaction===!1?null:t.immediatelyRender&&E===0?0:E+1}),r}const VH=ee.createContext({editor:null});VH.Consumer;const AO=ee.createContext({onDragStart:void 0}),UH=()=>ee.useContext(AO),_a=tt.forwardRef((t,e)=>{const{onDragStart:n}=UH(),r=t.as||"div";return tt.createElement(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});function HH(t){return!!(typeof t=="function"&&t.prototype&&t.prototype.isReactComponent)}function WH(t){var e;return typeof t=="object"&&((e=t.$$typeof)===null||e===void 0?void 0:e.toString())==="Symbol(react.forward_ref)"}class TO{constructor(e,{editor:n,props:r={},as:i="div",className:o="",attrs:s}){this.ref=null,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=e,this.editor=n,this.props=r,this.element=document.createElement(i),this.element.classList.add("react-renderer"),o&&this.element.classList.add(...o.split(" ")),s&&Object.keys(s).forEach(a=>{this.element.setAttribute(a,s[a])}),this.render()}render(){var e,n;const r=this.component,i=this.props;(HH(r)||WH(r))&&(i.ref=o=>{this.ref=o}),this.reactElement=tt.createElement(r,{...i}),(n=(e=this.editor)===null||e===void 0?void 0:e.contentComponent)===null||n===void 0||n.setRenderer(this.id,this)}updateProps(e={}){this.props={...this.props,...e},this.render()}destroy(){var e,n;(n=(e=this.editor)===null||e===void 0?void 0:e.contentComponent)===null||n===void 0||n.removeRenderer(this.id)}}class JH extends QV{mount(){const e={editor:this.editor,node:this.node,decorations:this.decorations,selected:!1,extension:this.extension,getPos:()=>this.getPos(),updateAttributes:(o={})=>this.updateAttributes(o),deleteNode:()=>this.deleteNode()};if(!this.component.displayName){const o=s=>s.charAt(0).toUpperCase()+s.substring(1);this.component.displayName=o(this.extension.name)}const n=o=>{const s=this.component,a=this.onDragStart.bind(this),l=u=>{u&&this.contentDOMElement&&u.firstChild!==this.contentDOMElement&&u.appendChild(this.contentDOMElement)};return tt.createElement(tt.Fragment,null,tt.createElement(AO.Provider,{value:{onDragStart:a,nodeViewContentRef:l}},tt.createElement(s,{...o})))};n.displayName="ReactNodeView",this.node.isLeaf?this.contentDOMElement=null:this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement&&(this.contentDOMElement.style.whiteSpace="inherit");let r=this.node.isInline?"span":"div";this.options.as&&(r=this.options.as);const{className:i=""}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.renderer=new TO(n,{editor:this.editor,props:e,as:r,className:`node-${this.node.type.name} ${i}`.trim(),attrs:this.options.attrs})}get dom(){var e;if(this.renderer.element.firstElementChild&&!(!((e=this.renderer.element.firstElementChild)===null||e===void 0)&&e.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){const{from:e,to:n}=this.editor.state.selection;if(e<=this.getPos()&&n>=this.getPos()+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}}update(e,n){const r=i=>{this.renderer.updateProps(i)};if(e.type!==this.node.type)return!1;if(typeof this.options.update=="function"){const i=this.node,o=this.decorations;return this.node=e,this.decorations=n,this.options.update({oldNode:i,oldDecorations:o,newNode:e,newDecorations:n,updateProps:()=>r({node:e,decorations:n})})}return e===this.node&&this.decorations===n||(this.node=e,this.decorations=n,r({node:e,decorations:n})),!0}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove("ProseMirror-selectednode")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate),this.contentDOMElement=null}}function hs(t,e){return n=>n.editor.contentComponent?new JH(t,n,e):{}}const KH=/^\s*>\s$/,GH=Gr.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",nn(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Bd({find:KH,type:this.type})]}}),ZH=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,YH=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,QH=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,XH=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,eW=Ll.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",nn(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[ic({find:ZH,type:this.type}),ic({find:QH,type:this.type})]},addPasteRules(){return[oc({find:YH,type:this.type}),oc({find:XH,type:this.type})]}}),tW=Gr.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",nn(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),RC=Ll.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",nn(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=lg(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),FC=/^\s*([-+*])\s$/,nW=Gr.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",nn(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(tW.name,this.editor.getAttributes(RC.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=Bd({find:FC,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Bd({find:FC,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(RC.name),editor:this.editor})),[t]}}),rW=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))$/,iW=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))/g,oW=Ll.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",nn(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[ic({find:rW,type:this.type})]},addPasteRules(){return[oc({find:iW,type:this.type})]}}),sW=/^```([a-z]+)?[\s\n]$/,aW=/^~~~([a-z]+)?[\s\n]$/,lW=Gr.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options,o=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(s=>s.startsWith(n)).map(s=>s.replace(n,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",nn(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(` + */var IC;function FH(){if(IC)return ob;IC=1;var t=tt,e=RH();function n(u,c){return u===c&&(u!==0||1/u===1/c)||u!==u&&c!==c}var r=typeof Object.is=="function"?Object.is:n,i=e.useSyncExternalStore,o=t.useRef,s=t.useEffect,a=t.useMemo,l=t.useDebugValue;return ob.useSyncExternalStoreWithSelector=function(u,c,f,d,h){var p=o(null);if(p.current===null){var m={hasValue:!1,value:null};p.current=m}else m=p.current;p=a(function(){function y(k){if(!v){if(v=!0,w=k,k=d(k),h!==void 0&&m.hasValue){var E=m.value;if(h(E,k))return g=E}return g=k}if(E=g,r(w,k))return E;var D=d(k);return h!==void 0&&h(E,D)?E:(w=k,g=D)}var v=!1,w,g,x=f===void 0?null:f;return[function(){return y(c())},x===null?void 0:function(){return y(x())}]},[c,f,d,h]);var b=i(u,p[0],p[1]);return s(function(){m.hasValue=!0,m.value=b},[b]),l(b),b},ob}_O.exports=FH();var LH=_O.exports;function BH(t){let e=0,n=0,r={editor:t,transactionNumber:0},i=t;const o=new Set;return{getSnapshot(){return e===n||(n=e,r={editor:i,transactionNumber:e}),r},getServerSnapshot(){return{editor:null,transactionNumber:0}},subscribe(a){return o.add(a),()=>{o.delete(a)}},watch(a){if(i=a,i){const l=()=>{e+=1,o.forEach(c=>c())},u=i;return u.on("transaction",l),()=>{u.off("transaction",l)}}}}}function PH(t){const[e]=ee.useState(()=>BH(t.editor)),n=LH.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getServerSnapshot,t.selector,t.equalityFn);return ee.useEffect(()=>e.watch(t.editor),[t.editor]),ee.useDebugValue(n),n}const zH=!1,lw=typeof window>"u",jH=lw||!!(typeof window<"u"&&window.next);function qH(t={},e=[]){const n=ee.useRef(!1),[r,i]=ee.useState(()=>{if(t.immediatelyRender===void 0)return lw||jH?null:new pp(t);if(t.immediatelyRender&&lw&&zH)throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return t.immediatelyRender?new pp(t):null});ee.useDebugValue(r),ee.useEffect(()=>{let E=r;E?Array.isArray(e)&&e.length?(E=new pp(t),i(E)):E.setOptions(t):(E=new pp(t),i(E))},e);const{onBeforeCreate:o,onBlur:s,onCreate:a,onDestroy:l,onFocus:u,onSelectionUpdate:c,onTransaction:f,onUpdate:d,onContentError:h}=t,p=ee.useRef(o),m=ee.useRef(s),b=ee.useRef(a),y=ee.useRef(l),v=ee.useRef(u),w=ee.useRef(c),g=ee.useRef(f),x=ee.useRef(d),k=ee.useRef(h);return ee.useEffect(()=>{r&&(o&&(r.off("beforeCreate",p.current),r.on("beforeCreate",o),p.current=o),s&&(r.off("blur",m.current),r.on("blur",s),m.current=s),a&&(r.off("create",b.current),r.on("create",a),b.current=a),l&&(r.off("destroy",y.current),r.on("destroy",l),y.current=l),u&&(r.off("focus",v.current),r.on("focus",u),v.current=u),c&&(r.off("selectionUpdate",w.current),r.on("selectionUpdate",c),w.current=c),f&&(r.off("transaction",g.current),r.on("transaction",f),g.current=f),d&&(r.off("update",x.current),r.on("update",d),x.current=d),h&&(r.off("contentError",k.current),r.on("contentError",h),k.current=h))},[o,s,a,l,u,c,f,d,h,r]),ee.useEffect(()=>(n.current=!0,()=>{n.current=!1,r&&setTimeout(()=>{!n.current&&!r.isDestroyed&&r.destroy()})}),[]),PH({editor:r,selector:({transactionNumber:E})=>t.shouldRerenderOnTransaction===!1?null:t.immediatelyRender&&E===0?0:E+1}),r}const UH=ee.createContext({editor:null});UH.Consumer;const AO=ee.createContext({onDragStart:void 0}),VH=()=>ee.useContext(AO),_a=tt.forwardRef((t,e)=>{const{onDragStart:n}=VH(),r=t.as||"div";return tt.createElement(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});function HH(t){return!!(typeof t=="function"&&t.prototype&&t.prototype.isReactComponent)}function WH(t){var e;return typeof t=="object"&&((e=t.$$typeof)===null||e===void 0?void 0:e.toString())==="Symbol(react.forward_ref)"}class TO{constructor(e,{editor:n,props:r={},as:i="div",className:o="",attrs:s}){this.ref=null,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=e,this.editor=n,this.props=r,this.element=document.createElement(i),this.element.classList.add("react-renderer"),o&&this.element.classList.add(...o.split(" ")),s&&Object.keys(s).forEach(a=>{this.element.setAttribute(a,s[a])}),this.render()}render(){var e,n;const r=this.component,i=this.props;(HH(r)||WH(r))&&(i.ref=o=>{this.ref=o}),this.reactElement=tt.createElement(r,{...i}),(n=(e=this.editor)===null||e===void 0?void 0:e.contentComponent)===null||n===void 0||n.setRenderer(this.id,this)}updateProps(e={}){this.props={...this.props,...e},this.render()}destroy(){var e,n;(n=(e=this.editor)===null||e===void 0?void 0:e.contentComponent)===null||n===void 0||n.removeRenderer(this.id)}}class JH extends QU{mount(){const e={editor:this.editor,node:this.node,decorations:this.decorations,selected:!1,extension:this.extension,getPos:()=>this.getPos(),updateAttributes:(o={})=>this.updateAttributes(o),deleteNode:()=>this.deleteNode()};if(!this.component.displayName){const o=s=>s.charAt(0).toUpperCase()+s.substring(1);this.component.displayName=o(this.extension.name)}const n=o=>{const s=this.component,a=this.onDragStart.bind(this),l=u=>{u&&this.contentDOMElement&&u.firstChild!==this.contentDOMElement&&u.appendChild(this.contentDOMElement)};return tt.createElement(tt.Fragment,null,tt.createElement(AO.Provider,{value:{onDragStart:a,nodeViewContentRef:l}},tt.createElement(s,{...o})))};n.displayName="ReactNodeView",this.node.isLeaf?this.contentDOMElement=null:this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement&&(this.contentDOMElement.style.whiteSpace="inherit");let r=this.node.isInline?"span":"div";this.options.as&&(r=this.options.as);const{className:i=""}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.renderer=new TO(n,{editor:this.editor,props:e,as:r,className:`node-${this.node.type.name} ${i}`.trim(),attrs:this.options.attrs})}get dom(){var e;if(this.renderer.element.firstElementChild&&!(!((e=this.renderer.element.firstElementChild)===null||e===void 0)&&e.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){const{from:e,to:n}=this.editor.state.selection;if(e<=this.getPos()&&n>=this.getPos()+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}}update(e,n){const r=i=>{this.renderer.updateProps(i)};if(e.type!==this.node.type)return!1;if(typeof this.options.update=="function"){const i=this.node,o=this.decorations;return this.node=e,this.decorations=n,this.options.update({oldNode:i,oldDecorations:o,newNode:e,newDecorations:n,updateProps:()=>r({node:e,decorations:n})})}return e===this.node&&this.decorations===n||(this.node=e,this.decorations=n,r({node:e,decorations:n})),!0}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove("ProseMirror-selectednode")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate),this.contentDOMElement=null}}function hs(t,e){return n=>n.editor.contentComponent?new JH(t,n,e):{}}const KH=/^\s*>\s$/,GH=Gr.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",nn(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Bd({find:KH,type:this.type})]}}),ZH=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,YH=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,QH=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,XH=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,eW=Ll.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",nn(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[ic({find:ZH,type:this.type}),ic({find:QH,type:this.type})]},addPasteRules(){return[oc({find:YH,type:this.type}),oc({find:XH,type:this.type})]}}),tW=Gr.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",nn(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),RC=Ll.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",nn(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=lg(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),FC=/^\s*([-+*])\s$/,nW=Gr.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",nn(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(tW.name,this.editor.getAttributes(RC.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=Bd({find:FC,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Bd({find:FC,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(RC.name),editor:this.editor})),[t]}}),rW=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))$/,iW=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))/g,oW=Ll.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",nn(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[ic({find:rW,type:this.type})]},addPasteRules(){return[oc({find:iW,type:this.type})]}}),sW=/^```([a-z]+)?[\s\n]$/,aW=/^~~~([a-z]+)?[\s\n]$/,lW=Gr.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options,o=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(s=>s.startsWith(n)).map(s=>s.replace(n,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",nn(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(` `);return!o||!s?!1:t.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const a=i.after();return a===void 0||r.nodeAt(a)?!1:t.commands.exitCode()}}},addInputRules(){return[tw({find:sW,type:this.type,getAttributes:t=>({language:t[1]})}),tw({find:aW,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new Kr({key:new xo("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=i==null?void 0:i.mode;if(!n||!o)return!1;const{tr:s,schema:a}=t.state,l=a.text(n.replace(/\r\n?/g,` -`));return s.replaceSelectionWith(this.type.create({language:o},l)),s.selection.$from.parent.type!==this.type&&s.setSelection(He.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}}),uW=Gr.create({name:"doc",topNode:!0,content:"block+"});function cW(t={}){return new Kr({view(e){return new fW(e,t)}})}class fW{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let o=s=>{this[i](s)};return e.dom.addEventListener(i,o),{name:i,handler:o}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r;if(n){let a=e.nodeBefore,l=e.nodeAfter;if(a||l){let u=this.editorView.nodeDOM(this.cursorPos-(a?a.nodeSize:0));if(u){let c=u.getBoundingClientRect(),f=a?c.bottom:c.top;a&&l&&(f=(f+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:c.left,right:c.right,top:f-this.width/2,bottom:f+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 i=this.editorView.dom.offsetParent;this.element||(this.element=i.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 o,s;if(!i||i==document.body&&getComputedStyle(i).position=="static")o=-pageXOffset,s=-pageYOffset;else{let a=i.getBoundingClientRect();o=a.left-i.scrollLeft,s=a.top-i.scrollTop}this.element.style.left=r.left-o+"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(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,o=typeof i=="function"?i(this.editorView,n,e):i;if(n&&!o){let s=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=XT(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(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const dW=Eo.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[cW(this.options)]}});class Rt extends je{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return Rt.valid(r)?new Rt(r):je.near(r)}content(){return he.empty}eq(e){return e instanceof Rt&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Rt(e.resolve(n.pos))}getBookmark(){return new Kx(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!hW(e)||!pW(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&Rt.valid(e))return e;let i=e.pos,o=null;for(let s=e.depth;;s--){let a=e.node(s);if(n>0?e.indexAfter(s)0){o=a.child(n>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;i+=n;let l=e.doc.resolve(i);if(Rt.valid(l))return l}for(;;){let s=n>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!_e.isSelectable(o)){e=e.doc.resolve(i+o.nodeSize*n),r=!1;continue e}break}o=s,i+=n;let a=e.doc.resolve(i);if(Rt.valid(a))return a}return null}}}Rt.prototype.visible=!1;Rt.findFrom=Rt.findGapCursorFrom;je.jsonID("gapcursor",Rt);class Kx{constructor(e){this.pos=e}map(e){return new Kx(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return Rt.valid(n)?new Rt(n):je.near(n)}}function hW(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function pW(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function mW(){return new Kr({props:{decorations:vW,createSelectionBetween(t,e,n){return e.pos==n.pos&&Rt.valid(n)?new Rt(n):null},handleClick:yW,handleKeyDown:gW,handleDOMEvents:{beforeinput:bW}}})}const gW=HM({ArrowLeft:pp("horiz",-1),ArrowRight:pp("horiz",1),ArrowUp:pp("vert",-1),ArrowDown:pp("vert",1)});function pp(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,o){let s=r.selection,a=e>0?s.$to:s.$from,l=s.empty;if(s instanceof He){if(!o.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=r.doc.resolve(e>0?a.after():a.before())}let u=Rt.findGapCursorFrom(a,e,l);return u?(i&&i(r.tr.setSelection(new Rt(u))),!0):!1}}function yW(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!Rt.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&_e.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new Rt(r))),!0)}function bW(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof Rt))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=oe.empty;for(let s=r.length-1;s>=0;s--)i=oe.from(r[s].createAndFill(null,i));let o=t.state.tr.replace(n.pos,n.pos,new he(i,0,0));return o.setSelection(He.near(o.doc.resolve(n.pos+1))),t.dispatch(o),!1}function vW(t){if(!(t.selection instanceof Rt))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Kt.create(t.doc,[Br.widget(t.selection.head,e,{key:"gapcursor"})])}const wW=Eo.create({name:"gapCursor",addProseMirrorPlugins(){return[mW()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=Ue(ye(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}}),kW=Gr.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",nn(this.options.HTMLAttributes,t)]},renderText(){return` -`},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:i,storedMarks:o}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:a}=r.extensionManager,l=o||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:u,dispatch:c})=>{if(c&&l&&s){const f=l.filter(d=>a.includes(d.type.name));u.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),xW=Gr.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,nn(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>tw({find:new RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var dm=200,mn=function(){};mn.prototype.append=function(e){return e.length?(e=mn.from(e),!this.length&&e||e.length=n?mn.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};mn.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};mn.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)};mn.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(e(o,s))},n,r),i};mn.from=function(e){return e instanceof mn?e:e&&e.length?new MO(e):mn.empty};var MO=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,s,a){for(var l=o;l=s;l--)if(i(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=dm)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=dm)return new e(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(mn);mn.empty=new MO([]);var EW=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return ra&&this.right.forEachInner(r,Math.max(i-a,0),Math.min(this.length,o)-a,s+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,s){var a=this.left.length;if(i>a&&this.right.forEachInvertedInner(r,i-a,Math.max(o,a)-a,s+a)===!1||o=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(mn);const SW=500;class Ci{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=e.tr,a,l,u=[],c=[];return this.items.forEach((f,d)=>{if(!f.step){i||(i=this.remapping(r,d+1),o=i.maps.length),o--,c.push(f);return}if(i){c.push(new ps(f.map));let h=f.step.map(i.slice(o)),p;h&&s.maybeStep(h).doc&&(p=s.mapping.maps[s.mapping.maps.length-1],u.push(new ps(p,void 0,void 0,u.length+c.length))),o--,p&&i.appendMap(p,o)}else s.maybeStep(f.step);if(f.selection)return a=i?f.selection.map(i.slice(o)):f.selection,l=new Ci(this.items.slice(0,r).append(c.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:a}}addTransform(e,n,r,i){let o=[],s=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let c=0;c_W&&(a=CW(a,u),s-=u),new Ci(a.append(o),s)}remapping(e,n){let r=new ZT;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},e,n),r}addMaps(e){return this.eventCount==0?this:new Ci(this.items.append(e.map(n=>new ps(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=e.mapping,s=e.steps.length,a=this.eventCount;this.items.forEach(d=>{d.selection&&a--},i);let l=n;this.items.forEach(d=>{let h=o.getMirror(--l);if(h==null)return;s=Math.min(s,h);let p=o.maps[h];if(d.step){let m=e.steps[h].invert(e.docs[h]),b=d.selection&&d.selection.map(o.slice(l+1,h));b&&a++,r.push(new ps(p,m,b))}else r.push(new ps(p))},i);let u=[];for(let d=n;dSW&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],o=0;return this.items.forEach((s,a)=>{if(a>=e)i.push(s),s.selection&&o++;else if(s.step){let l=s.step.map(n.slice(r)),u=l&&l.getMap();if(r--,u&&n.appendMap(u,r),l){let c=s.selection&&s.selection.map(n.slice(r));c&&o++;let f=new ps(u.invert(),l,c),d,h=i.length-1;(d=i.length&&i[h].merge(f))?i[h]=d:i.push(f)}}else s.map&&r--},this.items.length,0),new Ci(mn.from(i.reverse()),o)}}Ci.empty=new Ci(mn.empty,0);function CW(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}let ps=class OO{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new OO(n.getMap().invert(),n,this.selection)}}};class Os{constructor(e,n,r,i,o){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const _W=20;function AW(t,e,n,r){let i=n.getMeta(gl),o;if(i)return i.historyState;n.getMeta(OW)&&(t=new Os(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(gl))return s.getMeta(gl).redo?new Os(t.done.addTransform(n,void 0,r,d0(e)),t.undone,LC(n.mapping.maps),t.prevTime,t.prevComposition):new Os(t.done,t.undone.addTransform(n,void 0,r,d0(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=t.prevTime==0||!s&&t.prevComposition!=a&&(t.prevTime<(n.time||0)-r.newGroupDelay||!TW(n,t.prevRanges)),u=s?lb(t.prevRanges,n.mapping):LC(n.mapping.maps);return new Os(t.done.addTransform(n,l?e.selection.getBookmark():void 0,r,d0(e)),Ci.empty,u,n.time,a??t.prevComposition)}else return(o=n.getMeta("rebased"))?new Os(t.done.rebased(n,o),t.undone.rebased(n,o),lb(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Os(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),lb(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function TW(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let o=0;o=e[o]&&(n=!0)}),n}function LC(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,i,o,s)=>e.push(o,s));return e}function lb(t,e){if(!t)return null;let n=[];for(let r=0;r{let i=gl.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let o=MW(i,n,t);o&&r(e?o.scrollIntoView():o)}return!0}}const NO=DO(!1,!0),$O=DO(!0,!0),NW=Eo.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>NO(t,e),redo:()=>({state:t,dispatch:e})=>$O(t,e)}},addProseMirrorPlugins(){return[DW(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),$W=Gr.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",nn(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{const{selection:n}=e,{$from:r,$to:i}=n,o=t();return r.parentOffset===0?o.insertContentAt({from:Math.max(r.pos-1,0),to:i.pos},{type:this.name}):xV(n)?o.insertContentAt(i.pos,{type:this.name}):o.insertContent({type:this.name}),o.command(({tr:s,dispatch:a})=>{var l;if(a){const{$to:u}=s.selection,c=u.end();if(u.nodeAfter)u.nodeAfter.isTextblock?s.setSelection(He.create(s.doc,u.pos+1)):u.nodeAfter.isBlock?s.setSelection(_e.create(s.doc,u.pos)):s.setSelection(He.create(s.doc,u.pos));else{const f=(l=u.parent.type.contentMatch.defaultType)===null||l===void 0?void 0:l.create();f&&(s.insert(c,f),s.setSelection(He.create(s.doc,c+1)))}s.scrollIntoView()}return!0}).run()}}},addInputRules(){return[ZV({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),IW=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,RW=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,FW=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,LW=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,BW=Ll.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",nn(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[ic({find:IW,type:this.type}),ic({find:FW,type:this.type})]},addPasteRules(){return[oc({find:RW,type:this.type}),oc({find:LW,type:this.type})]}}),PW=Gr.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",nn(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),zW=Gr.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",nn(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),PC=Ll.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",nn(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=lg(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),zC=/^(\d+)\.\s$/,jW=Gr.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",nn(this.options.HTMLAttributes,n),0]:["ol",nn(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(zW.name,this.editor.getAttributes(PC.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=Bd({find:zC,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Bd({find:zC,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(PC.name)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),IO=Gr.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",nn(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),qW=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,VW=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,UW=Ll.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",nn(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[ic({find:qW,type:this.type})]},addPasteRules(){return[oc({find:VW,type:this.type})]}}),HW=Gr.create({name:"text",group:"inline"}),uw=Eo.create({name:"starterKit",addExtensions(){var t,e,n,r,i,o,s,a,l,u,c,f,d,h,p,m,b,y;const v=[];return this.options.bold!==!1&&v.push(eW.configure((t=this.options)===null||t===void 0?void 0:t.bold)),this.options.blockquote!==!1&&v.push(GH.configure((e=this.options)===null||e===void 0?void 0:e.blockquote)),this.options.bulletList!==!1&&v.push(nW.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&v.push(oW.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&v.push(lW.configure((i=this.options)===null||i===void 0?void 0:i.codeBlock)),this.options.document!==!1&&v.push(uW.configure((o=this.options)===null||o===void 0?void 0:o.document)),this.options.dropcursor!==!1&&v.push(dW.configure((s=this.options)===null||s===void 0?void 0:s.dropcursor)),this.options.gapcursor!==!1&&v.push(wW.configure((a=this.options)===null||a===void 0?void 0:a.gapcursor)),this.options.hardBreak!==!1&&v.push(kW.configure((l=this.options)===null||l===void 0?void 0:l.hardBreak)),this.options.heading!==!1&&v.push(xW.configure((u=this.options)===null||u===void 0?void 0:u.heading)),this.options.history!==!1&&v.push(NW.configure((c=this.options)===null||c===void 0?void 0:c.history)),this.options.horizontalRule!==!1&&v.push($W.configure((f=this.options)===null||f===void 0?void 0:f.horizontalRule)),this.options.italic!==!1&&v.push(BW.configure((d=this.options)===null||d===void 0?void 0:d.italic)),this.options.listItem!==!1&&v.push(PW.configure((h=this.options)===null||h===void 0?void 0:h.listItem)),this.options.orderedList!==!1&&v.push(jW.configure((p=this.options)===null||p===void 0?void 0:p.orderedList)),this.options.paragraph!==!1&&v.push(IO.configure((m=this.options)===null||m===void 0?void 0:m.paragraph)),this.options.strike!==!1&&v.push(UW.configure((b=this.options)===null||b===void 0?void 0:b.strike)),this.options.text!==!1&&v.push(HW.configure((y=this.options)===null||y===void 0?void 0:y.text)),v}});function WW(t){var e;const{char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:s}=t,a=XV(n),l=new RegExp(`\\s${a}$`),u=o?"^":"",c=r?new RegExp(`${u}${a}.*?(?=\\s${a}|$)`,"gm"):new RegExp(`${u}(?:^)?${a}[^\\s${a}]*`,"gm"),f=((e=s.nodeBefore)===null||e===void 0?void 0:e.isText)&&s.nodeBefore.text;if(!f)return null;const d=s.pos-f.length,h=Array.from(f.matchAll(c)).pop();if(!h||h.input===void 0||h.index===void 0)return null;const p=h.input.slice(Math.max(0,h.index-1),h.index),m=new RegExp(`^[${i==null?void 0:i.join("")}\0]?$`).test(p);if(i!==null&&!m)return null;const b=d+h.index;let y=b+h[0].length;return r&&l.test(f.slice(y-1,y+1))&&(h[0]+=" ",y+=1),b=s.pos?{range:{from:b,to:y},query:h[0].slice(n.length),text:h[0]}:null}const JW=new xo("suggestion");function KW({pluginKey:t=JW,editor:e,char:n="@",allowSpaces:r=!1,allowedPrefixes:i=[" "],startOfLine:o=!1,decorationTag:s="span",decorationClass:a="suggestion",command:l=()=>null,items:u=()=>[],render:c=()=>({}),allow:f=()=>!0,findSuggestionMatch:d=WW}){let h;const p=c==null?void 0:c(),m=new Kr({key:t,view(){return{update:async(b,y)=>{var v,w,g,x,k,E,D;const O=(v=this.key)===null||v===void 0?void 0:v.getState(y),N=(w=this.key)===null||w===void 0?void 0:w.getState(b.state),C=O.active&&N.active&&O.range.from!==N.range.from,R=!O.active&&N.active,T=O.active&&!N.active,q=!R&&!T&&O.query!==N.query,A=R,S=q||C,P=T;if(!A&&!S&&!P)return;const B=P&&!A?O:N,j=b.dom.querySelector(`[data-decoration-id="${B.decorationId}"]`);h={editor:e,range:B.range,query:B.query,text:B.text,items:[],command:z=>l({editor:e,range:B.range,props:z}),decorationNode:j,clientRect:j?()=>{var z;const{decorationId:J}=(z=this.key)===null||z===void 0?void 0:z.getState(e.state),K=b.dom.querySelector(`[data-decoration-id="${J}"]`);return(K==null?void 0:K.getBoundingClientRect())||null}:null},A&&((g=p==null?void 0:p.onBeforeStart)===null||g===void 0||g.call(p,h)),S&&((x=p==null?void 0:p.onBeforeUpdate)===null||x===void 0||x.call(p,h)),(S||A)&&(h.items=await u({editor:e,query:B.query})),P&&((k=p==null?void 0:p.onExit)===null||k===void 0||k.call(p,h)),S&&((E=p==null?void 0:p.onUpdate)===null||E===void 0||E.call(p,h)),A&&((D=p==null?void 0:p.onStart)===null||D===void 0||D.call(p,h))},destroy:()=>{var b;h&&((b=p==null?void 0:p.onExit)===null||b===void 0||b.call(p,h))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(b,y,v,w){const{isEditable:g}=e,{composing:x}=e.view,{selection:k}=b,{empty:E,from:D}=k,O={...y};if(O.composing=x,g&&(E||e.view.composing)){(Dy.range.to)&&!x&&!y.composing&&(O.active=!1);const N=d({char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:k.$from}),C=`id_${Math.floor(Math.random()*4294967295)}`;N&&f({editor:e,state:w,range:N.range,isActive:y.active})?(O.active=!0,O.decorationId=y.decorationId?y.decorationId:C,O.range=N.range,O.query=N.query,O.text=N.text):O.active=!1}else O.active=!1;return O.active||(O.decorationId=null,O.range={from:0,to:0},O.query=null,O.text=null),O}},props:{handleKeyDown(b,y){var v;const{active:w,range:g}=m.getState(b.state);return w&&((v=p==null?void 0:p.onKeyDown)===null||v===void 0?void 0:v.call(p,{view:b,event:y,range:g}))||!1},decorations(b){const{active:y,range:v,decorationId:w}=m.getState(b);return y?Kt.create(b.doc,[Br.inline(v.from,v.to,{nodeName:s,class:a,"data-decoration-id":w})]):null}}});return m}const GW="modulepreload",ZW=function(t){return"/nostr-editor/"+t},jC={},YW=function(e,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),s=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=Promise.all(n.map(a=>{if(a=ZW(a),a in jC)return;jC[a]=!0;const l=a.endsWith(".css"),u=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${a}"]${u}`))return;const c=document.createElement("link");if(c.rel=l?"stylesheet":GW,l||(c.as="script",c.crossOrigin=""),c.href=a,s&&c.setAttribute("nonce",s),document.head.appendChild(c),l)return new Promise((f,d)=>{c.addEventListener("load",f),c.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${a}`)))})}))}return i.then(()=>e()).catch(o=>{const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=o,window.dispatchEvent(s),!s.defaultPrevented)throw o})};var QW=Object.defineProperty,XW=(t,e,n)=>e in t?QW(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,id=(t,e,n)=>XW(t,typeof e!="symbol"?e+"":e,n);function Sn(t){this.content=t}Sn.prototype={constructor:Sn,find:function(t){for(var e=0;e>1}};Sn.from=function(t){if(t instanceof Sn)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Sn(e)};function RO(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),o=e.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)n++;return n}if(i.content.size||o.content.size){let s=RO(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function FO(t,e,n,r){for(let i=t.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let s=t.child(--i),a=e.child(--o),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 u=0,c=Math.min(s.text.length,a.text.length);for(;ue&&r(l,i+a,o||null,s)!==!1&&l.content.size){let c=a+1;l.nodesBetween(Math.max(0,e-c),Math.min(l.content.size,n-c),r,i+c)}a=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let o="",s=!0;return this.nodesBetween(e,n,(a,l)=>{let u=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&u||a.isTextblock)&&r&&(s?s=!1:o+=r),o+=u},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);oe)for(let o=0,s=0;se&&((sn)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,n-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,n-s-1))),r.push(a),i+=a.nodeSize),s=l}return new Zn(r,i)}cutByIndex(e,n){return e==n?Zn.empty:e==0&&n==this.content.length?this:new Zn(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new Zn(i,o)}addToStart(e){return new Zn([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Zn(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;nthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),s=i+o.nodeSize;if(s>=e)return s==e||n>0?mp(r+1,s):mp(r,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return Zn.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new Zn(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Zn.empty;let n,r=0;for(let i=0;ithis.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;nr.type.rank-i.type.rank),n}};dt.none=[];let pm=class extends Error{},we=class uu{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=BO(this.content,e+this.openStart,n);return r&&new uu(r,this.openStart,this.openEnd)}removeBetween(e,n){return new uu(LO(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return uu.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new uu(ce.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new uu(e,r,i)}};we.empty=new we(ce.empty,0,0);function LO(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:s,offset:a}=t.findIndex(n);if(i==e||o.isText){if(a!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(LO(o.content,e-i-1,n-i-1)))}function BO(t,e,n,r){let{index:i,offset:o}=t.findIndex(e),s=t.maybeChild(i);if(o==e||s.isText)return t.cut(0,e).append(n).append(t.cut(e));let a=BO(s.content,e-o-1,n);return a&&t.replaceChild(i,s.copy(a))}function eJ(t,e,n){if(n.openStart>t.depth)throw new pm("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new pm("Inconsistent open depths");return PO(t,e,n,0)}function PO(t,e,n,r){let i=t.index(r),o=t.node(r);if(i==e.index(r)&&r=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function od(t,e,n,r){let i=(e||t).node(n),o=0,s=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(yl(t.nodeAfter,r),o++));for(let a=o;ai&&fw(t,e,i+1),s=r.depth>i&&fw(n,r,i+1),a=[];return od(null,t,i,a),o&&s&&e.index(i)==n.index(i)?(zO(o,s),yl(bl(o,jO(t,e,n,r,i+1)),a)):(o&&yl(bl(o,mm(t,e,i+1)),a),od(e,n,i,a),s&&yl(bl(s,mm(n,r,i+1)),a)),od(r,null,i,a),new ce(a)}function mm(t,e,n){let r=[];if(od(null,t,n,r),t.depth>n){let i=fw(t,e,n+1);yl(bl(i,mm(t,e,n+1)),r)}return od(e,null,n,r),new ce(r)}function tJ(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)i=e.node(o).copy(ce.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}let qC=class dw{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new gm(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let s=e;;){let{index:a,offset:l}=s.content.findIndex(o),u=o-l;if(r.push(s,a,i+l),!u||(s=s.child(a),s.isText))break;o=u-1,i+=l+1}return new dw(n,r,o)}static resolveCached(e,n){let r=VC.get(e);if(r)for(let o=0;oe&&this.nodesBetween(e,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),qO(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=ce.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),a=s&&s.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=i;ln.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=ce.fromJSON(e,n.content),o=e.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};Pu.prototype.text=void 0;let oJ=class pw extends Pu{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):qO(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new pw(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new pw(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function qO(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}let jd=class VO{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new sJ(e,n);if(r.next==null)return VO.empty;let i=UO(r);r.next&&r.err("Unexpected trailing text");let o=hJ(dJ(i));return pJ(o,r),o}matchType(e){for(let n=0;nu.createAndFill()));for(let u=0;u=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s"+e.indexOf(r.next[s].next);return o}).join(` -`)}};jd.empty=new jd(!0);let sJ=class{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}};function UO(t){let e=[];do e.push(aJ(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function aJ(t){let e=[];do e.push(lJ(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function lJ(t){let e=fJ(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=uJ(t,e);else break;return e}function UC(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function uJ(t,e){let n=UC(t),r=n;return t.eat(",")&&(t.next!="}"?r=UC(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function cJ(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let o in n){let s=n[o];s.groups.indexOf(e)>-1&&i.push(s)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function fJ(t){if(t.eat("(")){let e=UO(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=cJ(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function dJ(t){let e=[[]];return i(o(t,0),n()),e;function n(){return e.push([])-1}function r(s,a,l){let u={term:l,to:a};return e[s].push(u),u}function i(s,a){s.forEach(l=>l.to=a)}function o(s,a){if(s.type=="choice")return s.exprs.reduce((l,u)=>l.concat(o(u,a)),[]);if(s.type=="seq")for(let l=0;;l++){let u=o(s.exprs[l],a);if(l==s.exprs.length-1)return u;i(u,a=n())}else if(s.type=="star"){let l=n();return r(a,l),i(o(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=n();return i(o(s.expr,a),l),i(o(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(a)].concat(o(s.expr,a));if(s.type=="range"){let l=a;for(let u=0;u{t[s].forEach(({term:a,to:l})=>{if(!a)return;let u;for(let c=0;c{u||i.push([a,u=[]]),u.indexOf(c)==-1&&u.push(c)})})});let o=e[r.join(",")]=new jd(r.indexOf(t.length-1)>-1);for(let s=0;s-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;nr[o]=new ZO(o,n,s));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function mJ(t){let e=t.split("|");return n=>{let r=n===null?"null":typeof n;if(e.indexOf(r)<0)throw new RangeError(`Expected value of type ${e}, got ${r}`)}}let gJ=class{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default,this.validate=typeof e.validate=="string"?mJ(e.validate):e.validate}get isRequired(){return!this.hasDefault}},YO=class QO{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=GO(i.attrs),this.excluded=null;let o=WO(this.attrs);this.instance=o?new dt(this,o):null}create(e=null){return!e&&this.instance?this.instance:new dt(this,JO(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new QO(o,i++,n,s)),r}removeFromSet(e){for(var n=0;n-1}},XO=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=Sn.from(e.nodes),n.marks=Sn.from(e.marks||{}),this.nodes=WC.compile(this.spec.nodes,this),this.marks=YO.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],s=o.spec.content||"",a=o.spec.marks;if(o.contentMatch=r[s]||(r[s]=jd.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=a=="_"?null:a?JC(this,a.split(" ")):a==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:JC(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(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof WC){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,i)}text(e,n){let r=this.nodes.text;return new oJ(r,r.defaultAttrs,e,dt.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return Pu.fromJSON(this,e)}markFromJSON(e){return dt.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}};function JC(t,e){let n=[];for(let r=0;r-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function yJ(t){return t.tag!=null}function bJ(t){return t.style!=null}let vJ=class mw{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(yJ(i))this.tags.push(i);else if(bJ(i)){let o=/[^=]*/.exec(i.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let o=e.nodes[i.node];return o.contentMatch.matchType(o)})}parse(e,n={}){let r=new GC(this,n,!1);return r.addAll(e,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new GC(this,n,!0);return r.addAll(e,n.from,n.to),we.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;ie.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(s.getAttrs){let l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let n=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s{r(s=ZC(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=ZC(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new mw(e,mw.schemaRules(e)))}};const eD={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},wJ={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},tD={ol:!0,ul:!0},ym=1,bm=2,sd=4;function KC(t,e,n){return e!=null?(e?ym:0)|(e==="full"?bm:0):t&&t.whitespace=="pre"?ym|bm:n&~sd}let gp=class{constructor(e,n,r,i,o,s,a){this.type=e,this.attrs=n,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=a,this.content=[],this.activeMarks=dt.none,this.stashMarks=[],this.match=s||(a&sd?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(ce.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&ym)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=ce.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(ce.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}popFromStashMark(e){for(let n=this.stashMarks.length-1;n>=0;n--)if(e.eq(this.stashMarks[n]))return this.stashMarks.splice(n,1)[0]}applyPending(e){for(let n=0,r=this.pendingMarks;n{let o=s=>{this[i](s)};return e.dom.addEventListener(i,o),{name:i,handler:o}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r;if(n){let a=e.nodeBefore,l=e.nodeAfter;if(a||l){let u=this.editorView.nodeDOM(this.cursorPos-(a?a.nodeSize:0));if(u){let c=u.getBoundingClientRect(),f=a?c.bottom:c.top;a&&l&&(f=(f+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:c.left,right:c.right,top:f-this.width/2,bottom:f+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 i=this.editorView.dom.offsetParent;this.element||(this.element=i.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 o,s;if(!i||i==document.body&&getComputedStyle(i).position=="static")o=-pageXOffset,s=-pageYOffset;else{let a=i.getBoundingClientRect();o=a.left-i.scrollLeft,s=a.top-i.scrollTop}this.element.style.left=r.left-o+"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(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,o=typeof i=="function"?i(this.editorView,n,e):i;if(n&&!o){let s=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=XT(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(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const dW=Eo.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[cW(this.options)]}});class Rt extends je{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return Rt.valid(r)?new Rt(r):je.near(r)}content(){return he.empty}eq(e){return e instanceof Rt&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Rt(e.resolve(n.pos))}getBookmark(){return new Kx(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!hW(e)||!pW(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&Rt.valid(e))return e;let i=e.pos,o=null;for(let s=e.depth;;s--){let a=e.node(s);if(n>0?e.indexAfter(s)0){o=a.child(n>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;i+=n;let l=e.doc.resolve(i);if(Rt.valid(l))return l}for(;;){let s=n>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!_e.isSelectable(o)){e=e.doc.resolve(i+o.nodeSize*n),r=!1;continue e}break}o=s,i+=n;let a=e.doc.resolve(i);if(Rt.valid(a))return a}return null}}}Rt.prototype.visible=!1;Rt.findFrom=Rt.findGapCursorFrom;je.jsonID("gapcursor",Rt);class Kx{constructor(e){this.pos=e}map(e){return new Kx(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return Rt.valid(n)?new Rt(n):je.near(n)}}function hW(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function pW(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function mW(){return new Kr({props:{decorations:vW,createSelectionBetween(t,e,n){return e.pos==n.pos&&Rt.valid(n)?new Rt(n):null},handleClick:yW,handleKeyDown:gW,handleDOMEvents:{beforeinput:bW}}})}const gW=HM({ArrowLeft:mp("horiz",-1),ArrowRight:mp("horiz",1),ArrowUp:mp("vert",-1),ArrowDown:mp("vert",1)});function mp(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,o){let s=r.selection,a=e>0?s.$to:s.$from,l=s.empty;if(s instanceof He){if(!o.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=r.doc.resolve(e>0?a.after():a.before())}let u=Rt.findGapCursorFrom(a,e,l);return u?(i&&i(r.tr.setSelection(new Rt(u))),!0):!1}}function yW(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!Rt.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&_e.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new Rt(r))),!0)}function bW(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof Rt))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=oe.empty;for(let s=r.length-1;s>=0;s--)i=oe.from(r[s].createAndFill(null,i));let o=t.state.tr.replace(n.pos,n.pos,new he(i,0,0));return o.setSelection(He.near(o.doc.resolve(n.pos+1))),t.dispatch(o),!1}function vW(t){if(!(t.selection instanceof Rt))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Kt.create(t.doc,[Br.widget(t.selection.head,e,{key:"gapcursor"})])}const wW=Eo.create({name:"gapCursor",addProseMirrorPlugins(){return[mW()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=Ve(ye(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}}),kW=Gr.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",nn(this.options.HTMLAttributes,t)]},renderText(){return` +`},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:i,storedMarks:o}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:a}=r.extensionManager,l=o||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:u,dispatch:c})=>{if(c&&l&&s){const f=l.filter(d=>a.includes(d.type.name));u.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),xW=Gr.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,nn(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>tw({find:new RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var hm=200,mn=function(){};mn.prototype.append=function(e){return e.length?(e=mn.from(e),!this.length&&e||e.length=n?mn.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};mn.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};mn.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)};mn.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(e(o,s))},n,r),i};mn.from=function(e){return e instanceof mn?e:e&&e.length?new MO(e):mn.empty};var MO=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,s,a){for(var l=o;l=s;l--)if(i(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=hm)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=hm)return new e(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(mn);mn.empty=new MO([]);var EW=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return ra&&this.right.forEachInner(r,Math.max(i-a,0),Math.min(this.length,o)-a,s+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,s){var a=this.left.length;if(i>a&&this.right.forEachInvertedInner(r,i-a,Math.max(o,a)-a,s+a)===!1||o=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(mn);const SW=500;class Ci{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=e.tr,a,l,u=[],c=[];return this.items.forEach((f,d)=>{if(!f.step){i||(i=this.remapping(r,d+1),o=i.maps.length),o--,c.push(f);return}if(i){c.push(new ps(f.map));let h=f.step.map(i.slice(o)),p;h&&s.maybeStep(h).doc&&(p=s.mapping.maps[s.mapping.maps.length-1],u.push(new ps(p,void 0,void 0,u.length+c.length))),o--,p&&i.appendMap(p,o)}else s.maybeStep(f.step);if(f.selection)return a=i?f.selection.map(i.slice(o)):f.selection,l=new Ci(this.items.slice(0,r).append(c.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:a}}addTransform(e,n,r,i){let o=[],s=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let c=0;c_W&&(a=CW(a,u),s-=u),new Ci(a.append(o),s)}remapping(e,n){let r=new ZT;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},e,n),r}addMaps(e){return this.eventCount==0?this:new Ci(this.items.append(e.map(n=>new ps(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=e.mapping,s=e.steps.length,a=this.eventCount;this.items.forEach(d=>{d.selection&&a--},i);let l=n;this.items.forEach(d=>{let h=o.getMirror(--l);if(h==null)return;s=Math.min(s,h);let p=o.maps[h];if(d.step){let m=e.steps[h].invert(e.docs[h]),b=d.selection&&d.selection.map(o.slice(l+1,h));b&&a++,r.push(new ps(p,m,b))}else r.push(new ps(p))},i);let u=[];for(let d=n;dSW&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],o=0;return this.items.forEach((s,a)=>{if(a>=e)i.push(s),s.selection&&o++;else if(s.step){let l=s.step.map(n.slice(r)),u=l&&l.getMap();if(r--,u&&n.appendMap(u,r),l){let c=s.selection&&s.selection.map(n.slice(r));c&&o++;let f=new ps(u.invert(),l,c),d,h=i.length-1;(d=i.length&&i[h].merge(f))?i[h]=d:i.push(f)}}else s.map&&r--},this.items.length,0),new Ci(mn.from(i.reverse()),o)}}Ci.empty=new Ci(mn.empty,0);function CW(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}let ps=class OO{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new OO(n.getMap().invert(),n,this.selection)}}};class Os{constructor(e,n,r,i,o){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const _W=20;function AW(t,e,n,r){let i=n.getMeta(gl),o;if(i)return i.historyState;n.getMeta(OW)&&(t=new Os(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(gl))return s.getMeta(gl).redo?new Os(t.done.addTransform(n,void 0,r,h0(e)),t.undone,LC(n.mapping.maps),t.prevTime,t.prevComposition):new Os(t.done,t.undone.addTransform(n,void 0,r,h0(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=t.prevTime==0||!s&&t.prevComposition!=a&&(t.prevTime<(n.time||0)-r.newGroupDelay||!TW(n,t.prevRanges)),u=s?lb(t.prevRanges,n.mapping):LC(n.mapping.maps);return new Os(t.done.addTransform(n,l?e.selection.getBookmark():void 0,r,h0(e)),Ci.empty,u,n.time,a??t.prevComposition)}else return(o=n.getMeta("rebased"))?new Os(t.done.rebased(n,o),t.undone.rebased(n,o),lb(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Os(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),lb(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function TW(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let o=0;o=e[o]&&(n=!0)}),n}function LC(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,i,o,s)=>e.push(o,s));return e}function lb(t,e){if(!t)return null;let n=[];for(let r=0;r{let i=gl.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let o=MW(i,n,t);o&&r(e?o.scrollIntoView():o)}return!0}}const NO=DO(!1,!0),$O=DO(!0,!0),NW=Eo.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>NO(t,e),redo:()=>({state:t,dispatch:e})=>$O(t,e)}},addProseMirrorPlugins(){return[DW(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),$W=Gr.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",nn(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{const{selection:n}=e,{$from:r,$to:i}=n,o=t();return r.parentOffset===0?o.insertContentAt({from:Math.max(r.pos-1,0),to:i.pos},{type:this.name}):xU(n)?o.insertContentAt(i.pos,{type:this.name}):o.insertContent({type:this.name}),o.command(({tr:s,dispatch:a})=>{var l;if(a){const{$to:u}=s.selection,c=u.end();if(u.nodeAfter)u.nodeAfter.isTextblock?s.setSelection(He.create(s.doc,u.pos+1)):u.nodeAfter.isBlock?s.setSelection(_e.create(s.doc,u.pos)):s.setSelection(He.create(s.doc,u.pos));else{const f=(l=u.parent.type.contentMatch.defaultType)===null||l===void 0?void 0:l.create();f&&(s.insert(c,f),s.setSelection(He.create(s.doc,c+1)))}s.scrollIntoView()}return!0}).run()}}},addInputRules(){return[ZU({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),IW=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,RW=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,FW=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,LW=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,BW=Ll.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",nn(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[ic({find:IW,type:this.type}),ic({find:FW,type:this.type})]},addPasteRules(){return[oc({find:RW,type:this.type}),oc({find:LW,type:this.type})]}}),PW=Gr.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",nn(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),zW=Gr.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",nn(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),PC=Ll.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",nn(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=lg(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),zC=/^(\d+)\.\s$/,jW=Gr.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",nn(this.options.HTMLAttributes,n),0]:["ol",nn(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(zW.name,this.editor.getAttributes(PC.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=Bd({find:zC,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Bd({find:zC,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(PC.name)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),IO=Gr.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",nn(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),qW=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,UW=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,VW=Ll.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",nn(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[ic({find:qW,type:this.type})]},addPasteRules(){return[oc({find:UW,type:this.type})]}}),HW=Gr.create({name:"text",group:"inline"}),uw=Eo.create({name:"starterKit",addExtensions(){var t,e,n,r,i,o,s,a,l,u,c,f,d,h,p,m,b,y;const v=[];return this.options.bold!==!1&&v.push(eW.configure((t=this.options)===null||t===void 0?void 0:t.bold)),this.options.blockquote!==!1&&v.push(GH.configure((e=this.options)===null||e===void 0?void 0:e.blockquote)),this.options.bulletList!==!1&&v.push(nW.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&v.push(oW.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&v.push(lW.configure((i=this.options)===null||i===void 0?void 0:i.codeBlock)),this.options.document!==!1&&v.push(uW.configure((o=this.options)===null||o===void 0?void 0:o.document)),this.options.dropcursor!==!1&&v.push(dW.configure((s=this.options)===null||s===void 0?void 0:s.dropcursor)),this.options.gapcursor!==!1&&v.push(wW.configure((a=this.options)===null||a===void 0?void 0:a.gapcursor)),this.options.hardBreak!==!1&&v.push(kW.configure((l=this.options)===null||l===void 0?void 0:l.hardBreak)),this.options.heading!==!1&&v.push(xW.configure((u=this.options)===null||u===void 0?void 0:u.heading)),this.options.history!==!1&&v.push(NW.configure((c=this.options)===null||c===void 0?void 0:c.history)),this.options.horizontalRule!==!1&&v.push($W.configure((f=this.options)===null||f===void 0?void 0:f.horizontalRule)),this.options.italic!==!1&&v.push(BW.configure((d=this.options)===null||d===void 0?void 0:d.italic)),this.options.listItem!==!1&&v.push(PW.configure((h=this.options)===null||h===void 0?void 0:h.listItem)),this.options.orderedList!==!1&&v.push(jW.configure((p=this.options)===null||p===void 0?void 0:p.orderedList)),this.options.paragraph!==!1&&v.push(IO.configure((m=this.options)===null||m===void 0?void 0:m.paragraph)),this.options.strike!==!1&&v.push(VW.configure((b=this.options)===null||b===void 0?void 0:b.strike)),this.options.text!==!1&&v.push(HW.configure((y=this.options)===null||y===void 0?void 0:y.text)),v}});function WW(t){var e;const{char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:s}=t,a=XU(n),l=new RegExp(`\\s${a}$`),u=o?"^":"",c=r?new RegExp(`${u}${a}.*?(?=\\s${a}|$)`,"gm"):new RegExp(`${u}(?:^)?${a}[^\\s${a}]*`,"gm"),f=((e=s.nodeBefore)===null||e===void 0?void 0:e.isText)&&s.nodeBefore.text;if(!f)return null;const d=s.pos-f.length,h=Array.from(f.matchAll(c)).pop();if(!h||h.input===void 0||h.index===void 0)return null;const p=h.input.slice(Math.max(0,h.index-1),h.index),m=new RegExp(`^[${i==null?void 0:i.join("")}\0]?$`).test(p);if(i!==null&&!m)return null;const b=d+h.index;let y=b+h[0].length;return r&&l.test(f.slice(y-1,y+1))&&(h[0]+=" ",y+=1),b=s.pos?{range:{from:b,to:y},query:h[0].slice(n.length),text:h[0]}:null}const JW=new xo("suggestion");function KW({pluginKey:t=JW,editor:e,char:n="@",allowSpaces:r=!1,allowedPrefixes:i=[" "],startOfLine:o=!1,decorationTag:s="span",decorationClass:a="suggestion",command:l=()=>null,items:u=()=>[],render:c=()=>({}),allow:f=()=>!0,findSuggestionMatch:d=WW}){let h;const p=c==null?void 0:c(),m=new Kr({key:t,view(){return{update:async(b,y)=>{var v,w,g,x,k,E,D;const O=(v=this.key)===null||v===void 0?void 0:v.getState(y),N=(w=this.key)===null||w===void 0?void 0:w.getState(b.state),C=O.active&&N.active&&O.range.from!==N.range.from,R=!O.active&&N.active,T=O.active&&!N.active,q=!R&&!T&&O.query!==N.query,A=R,S=q||C,P=T;if(!A&&!S&&!P)return;const B=P&&!A?O:N,j=b.dom.querySelector(`[data-decoration-id="${B.decorationId}"]`);h={editor:e,range:B.range,query:B.query,text:B.text,items:[],command:z=>l({editor:e,range:B.range,props:z}),decorationNode:j,clientRect:j?()=>{var z;const{decorationId:J}=(z=this.key)===null||z===void 0?void 0:z.getState(e.state),K=b.dom.querySelector(`[data-decoration-id="${J}"]`);return(K==null?void 0:K.getBoundingClientRect())||null}:null},A&&((g=p==null?void 0:p.onBeforeStart)===null||g===void 0||g.call(p,h)),S&&((x=p==null?void 0:p.onBeforeUpdate)===null||x===void 0||x.call(p,h)),(S||A)&&(h.items=await u({editor:e,query:B.query})),P&&((k=p==null?void 0:p.onExit)===null||k===void 0||k.call(p,h)),S&&((E=p==null?void 0:p.onUpdate)===null||E===void 0||E.call(p,h)),A&&((D=p==null?void 0:p.onStart)===null||D===void 0||D.call(p,h))},destroy:()=>{var b;h&&((b=p==null?void 0:p.onExit)===null||b===void 0||b.call(p,h))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(b,y,v,w){const{isEditable:g}=e,{composing:x}=e.view,{selection:k}=b,{empty:E,from:D}=k,O={...y};if(O.composing=x,g&&(E||e.view.composing)){(Dy.range.to)&&!x&&!y.composing&&(O.active=!1);const N=d({char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:k.$from}),C=`id_${Math.floor(Math.random()*4294967295)}`;N&&f({editor:e,state:w,range:N.range,isActive:y.active})?(O.active=!0,O.decorationId=y.decorationId?y.decorationId:C,O.range=N.range,O.query=N.query,O.text=N.text):O.active=!1}else O.active=!1;return O.active||(O.decorationId=null,O.range={from:0,to:0},O.query=null,O.text=null),O}},props:{handleKeyDown(b,y){var v;const{active:w,range:g}=m.getState(b.state);return w&&((v=p==null?void 0:p.onKeyDown)===null||v===void 0?void 0:v.call(p,{view:b,event:y,range:g}))||!1},decorations(b){const{active:y,range:v,decorationId:w}=m.getState(b);return y?Kt.create(b.doc,[Br.inline(v.from,v.to,{nodeName:s,class:a,"data-decoration-id":w})]):null}}});return m}const GW="modulepreload",ZW=function(t){return"/nostr-editor/"+t},jC={},YW=function(e,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),s=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=Promise.all(n.map(a=>{if(a=ZW(a),a in jC)return;jC[a]=!0;const l=a.endsWith(".css"),u=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${a}"]${u}`))return;const c=document.createElement("link");if(c.rel=l?"stylesheet":GW,l||(c.as="script",c.crossOrigin=""),c.href=a,s&&c.setAttribute("nonce",s),document.head.appendChild(c),l)return new Promise((f,d)=>{c.addEventListener("load",f),c.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${a}`)))})}))}return i.then(()=>e()).catch(o=>{const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=o,window.dispatchEvent(s),!s.defaultPrevented)throw o})};var QW=Object.defineProperty,XW=(t,e,n)=>e in t?QW(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,id=(t,e,n)=>XW(t,typeof e!="symbol"?e+"":e,n);function Sn(t){this.content=t}Sn.prototype={constructor:Sn,find:function(t){for(var e=0;e>1}};Sn.from=function(t){if(t instanceof Sn)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Sn(e)};function RO(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),o=e.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)n++;return n}if(i.content.size||o.content.size){let s=RO(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function FO(t,e,n,r){for(let i=t.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let s=t.child(--i),a=e.child(--o),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 u=0,c=Math.min(s.text.length,a.text.length);for(;ue&&r(l,i+a,o||null,s)!==!1&&l.content.size){let c=a+1;l.nodesBetween(Math.max(0,e-c),Math.min(l.content.size,n-c),r,i+c)}a=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let o="",s=!0;return this.nodesBetween(e,n,(a,l)=>{let u=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&u||a.isTextblock)&&r&&(s?s=!1:o+=r),o+=u},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);oe)for(let o=0,s=0;se&&((sn)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,n-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,n-s-1))),r.push(a),i+=a.nodeSize),s=l}return new Yn(r,i)}cutByIndex(e,n){return e==n?Yn.empty:e==0&&n==this.content.length?this:new Yn(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new Yn(i,o)}addToStart(e){return new Yn([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Yn(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;nthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),s=i+o.nodeSize;if(s>=e)return s==e||n>0?gp(r+1,s):gp(r,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return Yn.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new Yn(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Yn.empty;let n,r=0;for(let i=0;ithis.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;nr.type.rank-i.type.rank),n}};dt.none=[];let mm=class extends Error{},we=class uu{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=BO(this.content,e+this.openStart,n);return r&&new uu(r,this.openStart,this.openEnd)}removeBetween(e,n){return new uu(LO(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return uu.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new uu(ce.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new uu(e,r,i)}};we.empty=new we(ce.empty,0,0);function LO(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:s,offset:a}=t.findIndex(n);if(i==e||o.isText){if(a!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(LO(o.content,e-i-1,n-i-1)))}function BO(t,e,n,r){let{index:i,offset:o}=t.findIndex(e),s=t.maybeChild(i);if(o==e||s.isText)return t.cut(0,e).append(n).append(t.cut(e));let a=BO(s.content,e-o-1,n);return a&&t.replaceChild(i,s.copy(a))}function eJ(t,e,n){if(n.openStart>t.depth)throw new mm("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new mm("Inconsistent open depths");return PO(t,e,n,0)}function PO(t,e,n,r){let i=t.index(r),o=t.node(r);if(i==e.index(r)&&r=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function od(t,e,n,r){let i=(e||t).node(n),o=0,s=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(yl(t.nodeAfter,r),o++));for(let a=o;ai&&fw(t,e,i+1),s=r.depth>i&&fw(n,r,i+1),a=[];return od(null,t,i,a),o&&s&&e.index(i)==n.index(i)?(zO(o,s),yl(bl(o,jO(t,e,n,r,i+1)),a)):(o&&yl(bl(o,gm(t,e,i+1)),a),od(e,n,i,a),s&&yl(bl(s,gm(n,r,i+1)),a)),od(r,null,i,a),new ce(a)}function gm(t,e,n){let r=[];if(od(null,t,n,r),t.depth>n){let i=fw(t,e,n+1);yl(bl(i,gm(t,e,n+1)),r)}return od(e,null,n,r),new ce(r)}function tJ(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)i=e.node(o).copy(ce.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}let qC=class dw{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new ym(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let s=e;;){let{index:a,offset:l}=s.content.findIndex(o),u=o-l;if(r.push(s,a,i+l),!u||(s=s.child(a),s.isText))break;o=u-1,i+=l+1}return new dw(n,r,o)}static resolveCached(e,n){let r=UC.get(e);if(r)for(let o=0;oe&&this.nodesBetween(e,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),qO(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=ce.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),a=s&&s.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=i;ln.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=ce.fromJSON(e,n.content),o=e.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};Pu.prototype.text=void 0;let oJ=class pw extends Pu{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):qO(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new pw(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new pw(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function qO(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}let jd=class UO{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new sJ(e,n);if(r.next==null)return UO.empty;let i=VO(r);r.next&&r.err("Unexpected trailing text");let o=hJ(dJ(i));return pJ(o,r),o}matchType(e){for(let n=0;nu.createAndFill()));for(let u=0;u=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s"+e.indexOf(r.next[s].next);return o}).join(` +`)}};jd.empty=new jd(!0);let sJ=class{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}};function VO(t){let e=[];do e.push(aJ(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function aJ(t){let e=[];do e.push(lJ(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function lJ(t){let e=fJ(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=uJ(t,e);else break;return e}function VC(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function uJ(t,e){let n=VC(t),r=n;return t.eat(",")&&(t.next!="}"?r=VC(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function cJ(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let o in n){let s=n[o];s.groups.indexOf(e)>-1&&i.push(s)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function fJ(t){if(t.eat("(")){let e=VO(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=cJ(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function dJ(t){let e=[[]];return i(o(t,0),n()),e;function n(){return e.push([])-1}function r(s,a,l){let u={term:l,to:a};return e[s].push(u),u}function i(s,a){s.forEach(l=>l.to=a)}function o(s,a){if(s.type=="choice")return s.exprs.reduce((l,u)=>l.concat(o(u,a)),[]);if(s.type=="seq")for(let l=0;;l++){let u=o(s.exprs[l],a);if(l==s.exprs.length-1)return u;i(u,a=n())}else if(s.type=="star"){let l=n();return r(a,l),i(o(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=n();return i(o(s.expr,a),l),i(o(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(a)].concat(o(s.expr,a));if(s.type=="range"){let l=a;for(let u=0;u{t[s].forEach(({term:a,to:l})=>{if(!a)return;let u;for(let c=0;c{u||i.push([a,u=[]]),u.indexOf(c)==-1&&u.push(c)})})});let o=e[r.join(",")]=new jd(r.indexOf(t.length-1)>-1);for(let s=0;s-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;nr[o]=new ZO(o,n,s));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function mJ(t){let e=t.split("|");return n=>{let r=n===null?"null":typeof n;if(e.indexOf(r)<0)throw new RangeError(`Expected value of type ${e}, got ${r}`)}}let gJ=class{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default,this.validate=typeof e.validate=="string"?mJ(e.validate):e.validate}get isRequired(){return!this.hasDefault}},YO=class QO{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=GO(i.attrs),this.excluded=null;let o=WO(this.attrs);this.instance=o?new dt(this,o):null}create(e=null){return!e&&this.instance?this.instance:new dt(this,JO(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new QO(o,i++,n,s)),r}removeFromSet(e){for(var n=0;n-1}},XO=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=Sn.from(e.nodes),n.marks=Sn.from(e.marks||{}),this.nodes=WC.compile(this.spec.nodes,this),this.marks=YO.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],s=o.spec.content||"",a=o.spec.marks;if(o.contentMatch=r[s]||(r[s]=jd.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=a=="_"?null:a?JC(this,a.split(" ")):a==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:JC(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(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof WC){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,i)}text(e,n){let r=this.nodes.text;return new oJ(r,r.defaultAttrs,e,dt.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return Pu.fromJSON(this,e)}markFromJSON(e){return dt.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}};function JC(t,e){let n=[];for(let r=0;r-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function yJ(t){return t.tag!=null}function bJ(t){return t.style!=null}let vJ=class mw{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(yJ(i))this.tags.push(i);else if(bJ(i)){let o=/[^=]*/.exec(i.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let o=e.nodes[i.node];return o.contentMatch.matchType(o)})}parse(e,n={}){let r=new GC(this,n,!1);return r.addAll(e,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new GC(this,n,!0);return r.addAll(e,n.from,n.to),we.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;ie.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(s.getAttrs){let l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let n=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s{r(s=ZC(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=ZC(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new mw(e,mw.schemaRules(e)))}};const eD={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},wJ={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},tD={ol:!0,ul:!0},bm=1,vm=2,sd=4;function KC(t,e,n){return e!=null?(e?bm:0)|(e==="full"?vm:0):t&&t.whitespace=="pre"?bm|vm:n&~sd}let yp=class{constructor(e,n,r,i,o,s,a){this.type=e,this.attrs=n,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=a,this.content=[],this.activeMarks=dt.none,this.stashMarks=[],this.match=s||(a&sd?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(ce.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&bm)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=ce.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(ce.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}popFromStashMark(e){for(let n=this.stashMarks.length-1;n>=0;n--)if(e.eq(this.stashMarks[n]))return this.stashMarks.splice(n,1)[0]}applyPending(e){for(let n=0,r=this.pendingMarks;nthis.addAll(e)),s&&this.sync(a),this.needsBlock=l}else this.withStyleRules(e,()=>{this.addElementByRule(e,o,o.consuming===!1?i:void 0)})}leafFallback(e){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(` -`))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let n=dt.none,r=dt.none;if(e.length)for(let i=0;i{l.clearMark(u)&&(r=u.addToSet(r))}):n=this.parser.schema.marks[l.mark].create(l.attrs).addToSet(n),l.consuming===!1)a=l;else break}}return[n,r]}addElementByRule(e,n,r){let i,o,s;n.node?(o=this.parser.schema.nodes[n.node],o.isLeaf?this.insertNode(o.create(n.attrs))||this.leafFallback(e):i=this.enter(o,n.attrs||null,n.preserveWhitespace)):(s=this.parser.schema.marks[n.mark].create(n.attrs),this.addPendingMark(s));let a=this.top;if(o&&o.isLeaf)this.findInside(e);else if(r)this.addElement(e,r);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l)}i&&this.sync(a)&&this.open--,s&&this.removePendingMark(s,a)}addAll(e,n,r){let i=n||0;for(let o=n?e.childNodes[n]:e.firstChild,s=r==null?null:e.childNodes[r];o!=s;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o);this.findAtPoint(e,i)}findPlace(e){let n,r;for(let i=this.open;i>=0;i--){let o=this.nodes[i],s=o.findWrapping(e);if(s&&(!n||n.length>s.length)&&(n=s,r=o,!s.length)||o.solid)break}if(!n)return!1;this.sync(r);for(let i=0;ithis.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let n=this.open;n>=0;n--)if(this.nodes[n]==e)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(a,l)=>{for(;a>=0;a--){let u=n[a];if(u==""){if(a==n.length-1||a==0)continue;for(;l>=o;l--)if(s(a-1,l))return!0;return!1}else{let c=l>0||l==0&&i?this.nodes[l].type:r&&l>=o?r.node(l-o).type:null;if(!c||c.name!=u&&c.groups.indexOf(u)==-1)return!1;l--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(e){let n=SJ(e,this.top.pendingMarks);n&&this.top.stashMarks.push(n),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,n){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let s=i.popFromStashMark(e);s&&i.type&&i.type.allowsMarkType(s.type)&&(i.activeMarks=s.addToSet(i.activeMarks))}if(i==n)break}}};function kJ(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&tD.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function xJ(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function ZC(t){let e={};for(let n in t)e[n]=t[n];return e}function EJ(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],s=a=>{o.push(a);for(let l=0;l0}get deletedBefore(){return(this.delInfo&(iD|h0))>0}get deletedAfter(){return(this.delInfo&(oD|h0))>0}get deletedAcross(){return(this.delInfo&h0)>0}},Dl=class cu{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&cu.empty)return cu.empty}recover(e){let n=0,r=YC(e);if(!this.inverted)for(let i=0;ie)break;let u=this.ranges[a+o],c=this.ranges[a+s],f=l+u;if(e<=f){let d=u?e==l?-1:e==f?1:n:n,h=l+i+(d<0?0:c);if(r)return h;let p=e==(n<0?l:f)?null:CJ(a/3,e-l),m=e==l?oD:e==f?iD:h0;return(n<0?e!=l:e!=f)&&(m|=sD),new gw(h,m,p)}i+=c-u}return r?e+i:new gw(e+i,0,null)}touches(e,n){let r=0,i=YC(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;ae)break;let u=this.ranges[a+o],c=l+u;if(e<=c&&a==i*3)return!0;r+=this.ranges[a+s]-u}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i=0;n--){let i=e.getMirror(n);this.appendMap(e.maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new ad;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;ro&&l!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return er.fromReplace(e,this.from,this.to,o)}invert(){return new xh(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Df(n.pos,r.pos,this.mark)}merge(e){return e instanceof Df&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Df(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Df(n.from,n.to,e.markFromJSON(n.mark))}};Jn.jsonID("addMark",Zx);let xh=class Nf extends Jn{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new we(Gx(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return er.fromReplace(e,this.from,this.to,r)}invert(){return new Zx(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Nf(n.pos,r.pos,this.mark)}merge(e){return e instanceof Nf&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Nf(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Nf(n.from,n.to,e.markFromJSON(n.mark))}};Jn.jsonID("removeMark",xh);let Yx=class $f extends Jn{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return er.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return er.fromReplace(e,this.pos,this.pos+1,new we(ce.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;ir.pos?null:new p0(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new p0(n.from,n.to,n.gapFrom,n.gapTo,we.fromJSON(e,n.slice),n.insert,!!n.structure)}};Jn.jsonID("replaceAround",Ar);function bw(t,e,n){let r=t.resolve(e),i=n-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function AJ(t,e,n,r){let i=[],o=[],s,a;t.doc.nodesBetween(e,n,(l,u,c)=>{if(!l.isInline)return;let f=l.marks;if(!r.isInSet(f)&&c.type.allowsMarkType(r.type)){let d=Math.max(u,e),h=Math.min(u+l.nodeSize,n),p=r.addToSet(f);for(let m=0;mt.step(l)),o.forEach(l=>t.step(l))}function TJ(t,e,n,r){let i=[],o=0;t.doc.nodesBetween(e,n,(s,a)=>{if(!s.isInline)return;o++;let l=null;if(r instanceof YO){let u=s.marks,c;for(;c=r.isInSet(u);)(l||(l=[])).push(c),u=c.removeFromSet(u)}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let u=Math.min(a+s.nodeSize,n);for(let c=0;ct.step(new xh(s.from,s.to,s.style)))}function aD(t,e,n,r=n.contentMatch,i=!0){let o=t.doc.nodeAt(e),s=[],a=e+1;for(let l=0;l=0;l--)t.step(s[l])}function MJ(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Ic(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let i=t.$from.node(r),o=t.$from.index(r),s=t.$to.indexAfter(r);if(rn;p--)m||r.index(p)>0?(m=!0,c=ce.from(r.node(p).copy(c)),f++):l--;let d=ce.empty,h=0;for(let p=o,m=!1;p>n;p--)m||i.after(p+1)=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=ce.from(n[s].type.create(n[s].attrs,r))}let i=e.start,o=e.end;t.step(new Ar(i,o,i,o,new we(r,0,0),n.length,!0))}function IJ(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,n,(s,a)=>{if(s.isTextblock&&!s.hasMarkup(r,i)&&LJ(t.doc,t.mapping.slice(o).map(a),r)){let l=null;if(r.schema.linebreakReplacement){let d=r.whitespace=="pre",h=!!r.contentMatch.matchType(r.schema.linebreakReplacement);d&&!h?l=!1:!d&&h&&(l=!0)}l===!1&&FJ(t,s,a,o),aD(t,t.mapping.slice(o).map(a,1),r,void 0,l===null);let u=t.mapping.slice(o),c=u.map(a,1),f=u.map(a+s.nodeSize,1);return t.step(new Ar(c,f,c+1,f-1,new we(ce.from(r.create(i,null,s.marks)),0,0),1,!0)),l===!0&&RJ(t,s,a,o),!1}})}function RJ(t,e,n,r){e.forEach((i,o)=>{if(i.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(i.text);){let l=t.mapping.slice(r).map(n+1+o+s.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function FJ(t,e,n,r){e.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+o);t.replaceWith(s,s+1,e.type.schema.text(` -`))}})}function LJ(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function BJ(t,e,n,r,i){let o=t.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return t.replaceWith(e,e+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new Ar(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new we(ce.from(s),0,0),1,!0))}function zu(t,e,n=1,r){let i=t.resolve(e),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let u=i.depth-1,c=n-2;u>o;u--,c--){let f=i.node(u),d=i.index(u);if(f.type.spec.isolating)return!1;let h=f.content.cutByIndex(d,f.childCount),p=r&&r[c+1];p&&(h=h.replaceChild(0,p.type.create(p.attrs)));let m=r&&r[c]||f;if(!f.canReplace(d+1,f.childCount)||!m.type.validContent(h))return!1}let a=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type)}function PJ(t,e,n=1,r){let i=t.doc.resolve(e),o=ce.empty,s=ce.empty;for(let a=i.depth,l=i.depth-n,u=n-1;a>l;a--,u--){o=ce.from(i.node(a).copy(o));let c=r&&r[u];s=ce.from(c?c.type.create(c.attrs,s):i.node(a).copy(s))}t.step(new Ii(e,e,new we(o.append(s),n,n),!0))}function Bl(t,e){let n=t.resolve(e),r=n.index();return uD(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function uD(t,e){return!!(t&&e&&!t.isLeaf&&t.canAppend(e))}function fg(t,e,n=-1){let r=t.resolve(e);for(let i=r.depth;;i--){let o,s,a=r.index(i);if(i==r.depth?(o=r.nodeBefore,s=r.nodeAfter):n>0?(o=r.node(i+1),a++,s=r.node(i).maybeChild(a)):(o=r.node(i).maybeChild(a-1),s=r.node(i+1)),o&&!o.isTextblock&&uD(o,s)&&r.node(i).canReplace(a,a+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}function zJ(t,e,n){let r=new Ii(e-n,e+n,we.empty,!0);t.step(r)}function jJ(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o0;i--)this.placed=ce.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,a=i.depth;for(;s&&a&&o.childCount==1;)o=o.firstChild.content,s--,a--;let l=new we(o,s,a);return e>-1?new Ar(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new Ii(r.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=db(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:u}=this.frontier[a],c,f=null;if(n==1&&(s?u.matchType(s.type)||(f=u.fillBefore(ce.from(s),!1)):o&&l.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:a,parent:o,inject:f};if(n==2&&s&&(c=u.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:o,wrap:c};if(o&&u.matchType(o.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=db(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new we(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=db(e,n);if(i.childCount<=1&&n>0){let o=e.size-n<=n+i.size;this.unplaced=new we(If(e,n-1,1),n-1,o?n-1:r)}else this.unplaced=new we(If(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let m=0;m1||l==0||m.content.size)&&(f=b,c.push(fD(m.mark(d.allowedMarks(m.marks)),u==1?l:0,u==a.childCount?h:-1)))}let p=u==a.childCount;p||(h=-1),this.placed=Rf(this.placed,n,ce.from(c)),this.frontier[n].match=f,p&&h<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,b=a;m1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n=0;a--){let{match:l,type:u}=this.frontier[a],c=hb(e,a,u,l,!0);if(!c||c.childCount)continue e}return{depth:n,fit:s,move:o?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Rf(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=Rf(this.placed,this.depth,ce.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(ce.empty,!0);n.childCount&&(this.placed=Rf(this.placed,this.frontier.length,n))}};function If(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(If(t.firstChild.content,e-1,n)))}function Rf(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Rf(t.lastChild.content,e-1,n)))}function db(t,e){for(let n=0;n1&&(r=r.replaceChild(0,fD(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(ce.empty,!0)))),t.copy(r)}function hb(t,e,n,r,i){let o=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!VJ(n,o.content,s)?a:null}function VJ(t,e,n){for(let r=n;r0;d--,h--){let p=i.node(d).type.spec;if(p.defining||p.definingAsContext||p.isolating)break;s.indexOf(d)>-1?a=d:i.before(d)==h&&s.splice(1,0,-d)}let l=s.indexOf(a),u=[],c=r.openStart;for(let d=r.content,h=0;;h++){let p=d.firstChild;if(u.push(p),h==r.openStart)break;d=p.content}for(let d=c-1;d>=0;d--){let h=u[d],p=UJ(h.type);if(p&&!h.sameMarkup(i.node(Math.abs(a)-1)))c=d;else if(p||!h.type.isTextblock)break}for(let d=r.openStart;d>=0;d--){let h=(d+c+1)%(r.openStart+1),p=u[h];if(p)for(let m=0;m=0&&(t.replace(e,n,r),!(t.steps.length>f));d--){let h=s[d];h<0||(e=i.before(h),n=o.after(h))}}function dD(t,e,n,r,i){if(er){let o=i.contentMatchAt(0),s=o.fillBefore(t).append(t);t=s.append(o.matchFragment(s).fillBefore(ce.empty,!0))}return t}function WJ(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=jJ(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new we(ce.from(r),0,0))}function JJ(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),o=hD(r,i);for(let s=0;s0&&(l||r.node(a-1).canReplace(r.index(a-1),i.indexAfter(a-1))))return t.delete(r.before(a),i.after(a))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s)return t.delete(r.before(s),n);t.delete(e,n)}function hD(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let o=t.start(i);if(oe.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&n.push(i)}return n}let pD=class m0 extends Jn{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return er.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return er.fromReplace(e,this.pos,this.pos+1,new we(ce.from(i),0,n.isLeaf?0:1))}getMap(){return Dl.empty}invert(e){return new m0(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new m0(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new m0(n.pos,n.attr,n.value)}};Jn.jsonID("attr",pD);let mD=class vw extends Jn{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return er.ok(r)}getMap(){return Dl.empty}invert(e){return new vw(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new vw(n.attr,n.value)}};Jn.jsonID("docAttr",mD);let cc=class extends Error{};cc=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};cc.prototype=Object.create(Error.prototype);cc.prototype.constructor=cc;cc.prototype.name="TransformError";class KJ{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new ad}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new cc(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=we.empty){let i=dg(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new we(ce.from(r),0,0))}delete(e,n){return this.replace(e,n,we.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return HJ(this,e,n,r),this}replaceRangeWith(e,n,r){return WJ(this,e,n,r),this}deleteRange(e,n){return JJ(this,e,n),this}lift(e,n){return OJ(this,e,n),this}join(e,n=1){return zJ(this,e,n),this}wrap(e,n){return $J(this,e,n),this}setBlockType(e,n=e,r,i=null){return IJ(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return BJ(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new pD(e,n,r)),this}setDocAttribute(e,n){return this.step(new mD(e,n)),this}addNodeMark(e,n){return this.step(new Yx(e,n)),this}removeNodeMark(e,n){if(!(n instanceof dt)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new Qx(e,n)),this}split(e,n=1,r){return PJ(this,e,n,r),this}addMark(e,n,r){return AJ(this,e,n,r),this}removeMark(e,n,r){return TJ(this,e,n,r),this}clearIncompatible(e,n,r){return aD(this,e,n,r),this}}const pb=Object.create(null);let ht=class{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new GJ(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n=0;o--){let s=n<0?fu(e.node(0),e.node(o),e.before(o+1),e.index(o),n,r):fu(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,n,r);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new ju(e.node(0))}static atStart(e){return fu(e,e,0,0,1)||new ju(e)}static atEnd(e){return fu(e,e,e.content.size,e.childCount,-1)||new ju(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=pb[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in pb)throw new RangeError("Duplicate use of selection JSON ID "+e);return pb[e]=n,n.prototype.jsonID=e,n}getBookmark(){return gn.between(this.$anchor,this.$head).getBookmark()}};ht.prototype.visible=!0;let GJ=class{constructor(e,n){this.$from=e,this.$to=n}},XC=!1;function e4(t){!XC&&!t.parent.inlineContent&&(XC=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}let gn=class Ff extends ht{constructor(e,n=e){e4(e),e4(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return ht.near(r);let i=e.resolve(n.map(this.anchor));return new Ff(i.parent.inlineContent?i:r,r)}replace(e,n=we.empty){if(super.replace(e,n),n==we.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof Ff&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new gD(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Ff(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=ht.findFrom(n,r,!0)||ht.findFrom(n,-r,!0);if(o)n=o.$head;else return ht.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(ht.findFrom(e,-r,!0)||ht.findFrom(e,r,!0)).$anchor,e.pos0?0:1);i>0?s=0;s+=i){let a=e.child(s);if(a.isAtom){if(!o&&Yt.isSelectable(a))return Yt.create(t,n-(i<0?a.nodeSize:0))}else{let l=fu(t,a,n+i,i<0?a.childCount:0,i,o);if(l)return l}n+=a.nodeSize*i}return null}function t4(t,e,n){let r=t.steps.length-1;if(r{s==null&&(s=c)}),t.setSelection(ht.near(t.doc.resolve(s),n))}function n4(t,e){return!e||!t?t:t.bind(e)}let yp=class{constructor(e,n,r){this.name=e,this.init=n4(n.init,r),this.apply=n4(n.apply,r)}};new yp("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new yp("selection",{init(t,e){return t.selection||ht.atStart(e.doc)},apply(t){return t.selection}}),new yp("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new yp("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}});function vD(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=vD(i,e,{})),n[r]=i}return n}let ns=class{constructor(e){this.spec=e,this.props={},e.props&&vD(e.props,this,this.props),this.key=e.key?e.key.key:wD("plugin")}getState(e){return e[this.key]}};const mb=Object.create(null);function wD(t){return t in mb?t+"$"+ ++mb[t]:(mb[t]=0,t+"$")}let rs=class{constructor(e="key"){this.key=wD(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}};const QJ=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function kD(t,e){let{$cursor:n}=t.selection;return!n||n.parentOffset>0?null:n}const XJ=(t,e,n)=>{let r=kD(t);if(!r)return!1;let i=Xx(r);if(!i){let s=r.blockRange(),a=s&&Ic(s);return a==null?!1:(e&&e(t.tr.lift(s,a).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&CD(t,i,e))return!0;if(r.parent.content.size==0&&(fc(o,"end")||Yt.isSelectable(o))){let s=dg(t.doc,r.before(),r.after(),we.empty);if(s&&s.slice.size{let r=kD(t);if(!r)return!1;let i=Xx(r);return i?xD(t,i,e):!1},tK=(t,e,n)=>{let r=ED(t);if(!r)return!1;let i=e3(r);return i?xD(t,i,e):!1};function xD(t,e,n){let r=e.nodeBefore,i=r,o=e.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let c=i.lastChild;if(!c)return!1;i=c}let s=e.nodeAfter,a=s,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let c=a.firstChild;if(!c)return!1;a=c}let u=dg(t.doc,o,l,we.empty);if(!u||u.from!=o||u instanceof Ii&&u.slice.size>=l-o)return!1;if(n){let c=t.tr.step(u);c.setSelection(gn.create(c.doc,o)),n(c.scrollIntoView())}return!0}function fc(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const nK=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(r.parentOffset>0)return!1;o=Xx(r)}let s=o&&o.nodeBefore;return!s||!Yt.isSelectable(s)?!1:(e&&e(t.tr.setSelection(Yt.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function Xx(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function ED(t,e){let{$cursor:n}=t.selection;return!n||n.parentOffset{let r=ED(t);if(!r)return!1;let i=e3(r);if(!i)return!1;let o=i.nodeAfter;if(CD(t,i,e))return!0;if(r.parent.content.size==0&&(fc(o,"start")||Yt.isSelectable(o))){let s=dg(t.doc,r.before(),r.after(),we.empty);if(s&&s.slice.size{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(r.parentOffset=0;e--){let n=t.node(e);if(t.index(e)+1{let n=t.selection,r=n instanceof Yt,i;if(r){if(n.node.isTextblock||!Bl(t.doc,n.from))return!1;i=n.from}else if(i=fg(t.doc,n.from,-1),i==null)return!1;if(e){let o=t.tr.join(i);r&&o.setSelection(Yt.create(o.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},sK=(t,e)=>{let n=t.selection,r;if(n instanceof Yt){if(n.node.isTextblock||!Bl(t.doc,n.to))return!1;r=n.to}else if(r=fg(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},aK=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),o=i&&Ic(i);return o==null?!1:(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},lK=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(` -`).scrollIntoView()),!0)};function SD(t){for(let e=0;e{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=SD(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let a=n.after(),l=t.tr.replaceWith(a,a,s.createAndFill());l.setSelection(ht.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},cK=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof ju||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=SD(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!r.parentOffset&&i.index(){let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(zu(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Ic(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)},dK=(t,e)=>{let{$from:n,to:r}=t.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),e&&e(t.tr.setSelection(Yt.create(t.doc,i))),!0)};function hK(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||Bl(t.doc,e.pos))?!1:(n&&n(t.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0)}function CD(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o,s;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(hK(t,e,n))return!0;let a=e.parent.canReplace(e.index(),e.index()+1);if(a&&(o=(s=r.contentMatchAt(r.childCount)).findWrapping(i.type))&&s.matchType(o[0]||i.type).validEnd){if(n){let f=e.pos+i.nodeSize,d=ce.empty;for(let m=o.length-1;m>=0;m--)d=ce.from(o[m].create(null,d));d=ce.from(r.copy(d));let h=t.tr.step(new Ar(e.pos-1,f,e.pos,f,new we(d,1,0),o.length,!0)),p=f+2*o.length;Bl(h.doc,p)&&h.join(p),n(h.scrollIntoView())}return!0}let l=ht.findFrom(e,1),u=l&&l.$from.blockRange(l.$to),c=u&&Ic(u);if(c!=null&&c>=e.depth)return n&&n(t.tr.lift(u,c).scrollIntoView()),!0;if(a&&fc(i,"start",!0)&&fc(r,"end")){let f=r,d=[];for(;d.push(f),!f.isTextblock;)f=f.lastChild;let h=i,p=1;for(;!h.isTextblock;h=h.firstChild)p++;if(f.canReplace(f.childCount,f.childCount,h.content)){if(n){let m=ce.empty;for(let y=d.length-1;y>=0;y--)m=ce.from(d[y].copy(m));let b=t.tr.step(new Ar(e.pos-d.length,e.pos+i.nodeSize,e.pos+p,e.pos+i.nodeSize-p,new we(m,d.length,0),0,!0));n(b.scrollIntoView())}return!0}}return!1}function _D(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(n&&n(e.tr.setSelection(gn.create(e.doc,t<0?i.start(o):i.end(o)))),!0):!1}}const pK=_D(-1),mK=_D(1);function gK(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=s&&lD(s,t,e);return a?(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0):!1}}function r4(t,e=null){return function(n,r){let i=!1;for(let o=0;o{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)i=!0;else{let c=n.doc.resolve(u),f=c.index();i=c.parent.canReplaceWith(f,f+1,t)}})}if(!i)return!1;if(r){let o=n.tr;for(let s=0;s=2&&i.node(s.depth-1).type.compatibleContent(t)&&s.startIndex==0){if(i.index(s.depth-1)==0)return!1;let c=n.doc.resolve(s.start-2);l=new gm(c,c,s.depth),s.endIndex=0;c--)o=ce.from(n[c].type.create(n[c].attrs,o));t.step(new Ar(e.start-(r?2:0),e.end,e.start,e.end,new we(o,0,0),n.length,!0));let s=0;for(let c=0;cs.childCount>0&&s.firstChild.type==t);return o?n?r.node(o.depth-1).type==t?wK(e,n,t,o):kK(e,n,o):!0:!1}}function wK(t,e,n,r){let i=t.tr,o=r.end,s=r.$to.end(r.depth);om;p--)h-=i.child(p).nodeSize,r.delete(h-1,h+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==i.childCount,u=o.node(-1),c=o.index(-1);if(!u.canReplace(c+(a?0:1),c+1,s.content.append(l?ce.empty:ce.from(i))))return!1;let f=o.pos,d=f+s.nodeSize;return r.step(new Ar(f-(a?1:0),d+(l?1:0),f+1,d-1,new we((a?ce.empty:ce.from(i.copy(ce.empty))).append(l?ce.empty:ce.from(i.copy(ce.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function xK(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,u=>u.childCount>0&&u.firstChild.type==t);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let a=o.parent,l=a.child(s-1);if(l.type!=t)return!1;if(n){let u=l.lastChild&&l.lastChild.type==a.type,c=ce.from(u?t.create():null),f=new we(ce.from(t.create(null,ce.from(a.type.create(null,c)))),u?3:1,0),d=o.start,h=o.end;n(e.tr.step(new Ar(d-(u?3:1),h,d,h,f,1,!0)).scrollIntoView())}return!0}}function AD(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}let EK=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:n,state:r}=this,{view:i}=n,{tr:o}=r,s=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...c)=>{const f=l(...c)(s);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),f}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i,a=[],l=!!e,u=e||o.tr,c=()=>(!l&&n&&!u.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(u),a.every(d=>d===!0)),f={...Object.fromEntries(Object.entries(r).map(([d,h])=>[d,(...m)=>{const b=this.buildProps(u,n),y=h(...m)(b);return a.push(y),f}])),run:c};return f}createCan(e){const{rawCommands:n,state:r}=this,i=!1,o=e||r.tr,s=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(n).map(([l,u])=>[l,(...c)=>u(...c)({...s,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(e,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i,a={tr:e,editor:i,view:s,state:AD({state:o,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([l,u])=>[l,(...c)=>u(...c)(a)]))}};return a}};function tr(t,e,n){return t.config[e]===void 0&&t.parent?tr(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?tr(t.parent,e,n):null}):t.config[e]}function SK(t){const e=t.filter(i=>i.type==="extension"),n=t.filter(i=>i.type==="node"),r=t.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function Nn(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function vm(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){const a=o?o.split(" "):[],l=r[i]?r[i].split(" "):[],u=a.filter(c=>!l.includes(c));r[i]=[...l,...u].join(" ")}else i==="style"?r[i]=[r[i],o].join("; "):r[i]=o}),r},{})}function CK(t){return typeof t=="function"}function nr(t,e=void 0,...n){return CK(t)?e?t.bind(e)(...n):t(...n):t}function _K(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class TD{constructor(e){this.find=e.find,this.handler=e.handler}}function AK(t){return Object.prototype.toString.call(t).slice(8,-1)}function bp(t){return AK(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function hg(t,e){const n={...t};return bp(t)&&bp(e)&&Object.keys(e).forEach(r=>{bp(e[r])&&bp(t[r])?n[r]=hg(t[r],e[r]):n[r]=e[r]}),n}let is=class ww{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=nr(tr(this,"addOptions",{name:this.name}))),this.storage=nr(tr(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new ww(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>hg(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new ww({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=nr(tr(n,"addOptions",{name:n.name})),n.storage=nr(tr(n,"addStorage",{name:n.name,options:n.options})),n}};function TK(t,e,n){const{from:r,to:i}=e,{blockSeparator:o=` +`))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let n=dt.none,r=dt.none;if(e.length)for(let i=0;i{l.clearMark(u)&&(r=u.addToSet(r))}):n=this.parser.schema.marks[l.mark].create(l.attrs).addToSet(n),l.consuming===!1)a=l;else break}}return[n,r]}addElementByRule(e,n,r){let i,o,s;n.node?(o=this.parser.schema.nodes[n.node],o.isLeaf?this.insertNode(o.create(n.attrs))||this.leafFallback(e):i=this.enter(o,n.attrs||null,n.preserveWhitespace)):(s=this.parser.schema.marks[n.mark].create(n.attrs),this.addPendingMark(s));let a=this.top;if(o&&o.isLeaf)this.findInside(e);else if(r)this.addElement(e,r);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l)}i&&this.sync(a)&&this.open--,s&&this.removePendingMark(s,a)}addAll(e,n,r){let i=n||0;for(let o=n?e.childNodes[n]:e.firstChild,s=r==null?null:e.childNodes[r];o!=s;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o);this.findAtPoint(e,i)}findPlace(e){let n,r;for(let i=this.open;i>=0;i--){let o=this.nodes[i],s=o.findWrapping(e);if(s&&(!n||n.length>s.length)&&(n=s,r=o,!s.length)||o.solid)break}if(!n)return!1;this.sync(r);for(let i=0;ithis.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let n=this.open;n>=0;n--)if(this.nodes[n]==e)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(a,l)=>{for(;a>=0;a--){let u=n[a];if(u==""){if(a==n.length-1||a==0)continue;for(;l>=o;l--)if(s(a-1,l))return!0;return!1}else{let c=l>0||l==0&&i?this.nodes[l].type:r&&l>=o?r.node(l-o).type:null;if(!c||c.name!=u&&c.groups.indexOf(u)==-1)return!1;l--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(e){let n=SJ(e,this.top.pendingMarks);n&&this.top.stashMarks.push(n),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,n){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let s=i.popFromStashMark(e);s&&i.type&&i.type.allowsMarkType(s.type)&&(i.activeMarks=s.addToSet(i.activeMarks))}if(i==n)break}}};function kJ(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&tD.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function xJ(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function ZC(t){let e={};for(let n in t)e[n]=t[n];return e}function EJ(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],s=a=>{o.push(a);for(let l=0;l0}get deletedBefore(){return(this.delInfo&(iD|p0))>0}get deletedAfter(){return(this.delInfo&(oD|p0))>0}get deletedAcross(){return(this.delInfo&p0)>0}},Dl=class cu{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&cu.empty)return cu.empty}recover(e){let n=0,r=YC(e);if(!this.inverted)for(let i=0;ie)break;let u=this.ranges[a+o],c=this.ranges[a+s],f=l+u;if(e<=f){let d=u?e==l?-1:e==f?1:n:n,h=l+i+(d<0?0:c);if(r)return h;let p=e==(n<0?l:f)?null:CJ(a/3,e-l),m=e==l?oD:e==f?iD:p0;return(n<0?e!=l:e!=f)&&(m|=sD),new gw(h,m,p)}i+=c-u}return r?e+i:new gw(e+i,0,null)}touches(e,n){let r=0,i=YC(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;ae)break;let u=this.ranges[a+o],c=l+u;if(e<=c&&a==i*3)return!0;r+=this.ranges[a+s]-u}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i=0;n--){let i=e.getMirror(n);this.appendMap(e.maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new ad;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;ro&&l!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return tr.fromReplace(e,this.from,this.to,o)}invert(){return new Eh(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Df(n.pos,r.pos,this.mark)}merge(e){return e instanceof Df&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Df(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Df(n.from,n.to,e.markFromJSON(n.mark))}};Kn.jsonID("addMark",Zx);let Eh=class Nf extends Kn{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new we(Gx(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return tr.fromReplace(e,this.from,this.to,r)}invert(){return new Zx(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Nf(n.pos,r.pos,this.mark)}merge(e){return e instanceof Nf&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Nf(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Nf(n.from,n.to,e.markFromJSON(n.mark))}};Kn.jsonID("removeMark",Eh);let Yx=class $f extends Kn{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return tr.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return tr.fromReplace(e,this.pos,this.pos+1,new we(ce.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;ir.pos?null:new m0(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new m0(n.from,n.to,n.gapFrom,n.gapTo,we.fromJSON(e,n.slice),n.insert,!!n.structure)}};Kn.jsonID("replaceAround",Ar);function bw(t,e,n){let r=t.resolve(e),i=n-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function AJ(t,e,n,r){let i=[],o=[],s,a;t.doc.nodesBetween(e,n,(l,u,c)=>{if(!l.isInline)return;let f=l.marks;if(!r.isInSet(f)&&c.type.allowsMarkType(r.type)){let d=Math.max(u,e),h=Math.min(u+l.nodeSize,n),p=r.addToSet(f);for(let m=0;mt.step(l)),o.forEach(l=>t.step(l))}function TJ(t,e,n,r){let i=[],o=0;t.doc.nodesBetween(e,n,(s,a)=>{if(!s.isInline)return;o++;let l=null;if(r instanceof YO){let u=s.marks,c;for(;c=r.isInSet(u);)(l||(l=[])).push(c),u=c.removeFromSet(u)}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let u=Math.min(a+s.nodeSize,n);for(let c=0;ct.step(new Eh(s.from,s.to,s.style)))}function aD(t,e,n,r=n.contentMatch,i=!0){let o=t.doc.nodeAt(e),s=[],a=e+1;for(let l=0;l=0;l--)t.step(s[l])}function MJ(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Ic(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let i=t.$from.node(r),o=t.$from.index(r),s=t.$to.indexAfter(r);if(rn;p--)m||r.index(p)>0?(m=!0,c=ce.from(r.node(p).copy(c)),f++):l--;let d=ce.empty,h=0;for(let p=o,m=!1;p>n;p--)m||i.after(p+1)=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=ce.from(n[s].type.create(n[s].attrs,r))}let i=e.start,o=e.end;t.step(new Ar(i,o,i,o,new we(r,0,0),n.length,!0))}function IJ(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,n,(s,a)=>{if(s.isTextblock&&!s.hasMarkup(r,i)&&LJ(t.doc,t.mapping.slice(o).map(a),r)){let l=null;if(r.schema.linebreakReplacement){let d=r.whitespace=="pre",h=!!r.contentMatch.matchType(r.schema.linebreakReplacement);d&&!h?l=!1:!d&&h&&(l=!0)}l===!1&&FJ(t,s,a,o),aD(t,t.mapping.slice(o).map(a,1),r,void 0,l===null);let u=t.mapping.slice(o),c=u.map(a,1),f=u.map(a+s.nodeSize,1);return t.step(new Ar(c,f,c+1,f-1,new we(ce.from(r.create(i,null,s.marks)),0,0),1,!0)),l===!0&&RJ(t,s,a,o),!1}})}function RJ(t,e,n,r){e.forEach((i,o)=>{if(i.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(i.text);){let l=t.mapping.slice(r).map(n+1+o+s.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function FJ(t,e,n,r){e.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+o);t.replaceWith(s,s+1,e.type.schema.text(` +`))}})}function LJ(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function BJ(t,e,n,r,i){let o=t.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return t.replaceWith(e,e+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new Ar(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new we(ce.from(s),0,0),1,!0))}function zu(t,e,n=1,r){let i=t.resolve(e),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let u=i.depth-1,c=n-2;u>o;u--,c--){let f=i.node(u),d=i.index(u);if(f.type.spec.isolating)return!1;let h=f.content.cutByIndex(d,f.childCount),p=r&&r[c+1];p&&(h=h.replaceChild(0,p.type.create(p.attrs)));let m=r&&r[c]||f;if(!f.canReplace(d+1,f.childCount)||!m.type.validContent(h))return!1}let a=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type)}function PJ(t,e,n=1,r){let i=t.doc.resolve(e),o=ce.empty,s=ce.empty;for(let a=i.depth,l=i.depth-n,u=n-1;a>l;a--,u--){o=ce.from(i.node(a).copy(o));let c=r&&r[u];s=ce.from(c?c.type.create(c.attrs,s):i.node(a).copy(s))}t.step(new Ii(e,e,new we(o.append(s),n,n),!0))}function Bl(t,e){let n=t.resolve(e),r=n.index();return uD(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function uD(t,e){return!!(t&&e&&!t.isLeaf&&t.canAppend(e))}function fg(t,e,n=-1){let r=t.resolve(e);for(let i=r.depth;;i--){let o,s,a=r.index(i);if(i==r.depth?(o=r.nodeBefore,s=r.nodeAfter):n>0?(o=r.node(i+1),a++,s=r.node(i).maybeChild(a)):(o=r.node(i).maybeChild(a-1),s=r.node(i+1)),o&&!o.isTextblock&&uD(o,s)&&r.node(i).canReplace(a,a+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}function zJ(t,e,n){let r=new Ii(e-n,e+n,we.empty,!0);t.step(r)}function jJ(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o0;i--)this.placed=ce.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,a=i.depth;for(;s&&a&&o.childCount==1;)o=o.firstChild.content,s--,a--;let l=new we(o,s,a);return e>-1?new Ar(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new Ii(r.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=db(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:u}=this.frontier[a],c,f=null;if(n==1&&(s?u.matchType(s.type)||(f=u.fillBefore(ce.from(s),!1)):o&&l.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:a,parent:o,inject:f};if(n==2&&s&&(c=u.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:o,wrap:c};if(o&&u.matchType(o.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=db(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new we(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=db(e,n);if(i.childCount<=1&&n>0){let o=e.size-n<=n+i.size;this.unplaced=new we(If(e,n-1,1),n-1,o?n-1:r)}else this.unplaced=new we(If(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let m=0;m1||l==0||m.content.size)&&(f=b,c.push(fD(m.mark(d.allowedMarks(m.marks)),u==1?l:0,u==a.childCount?h:-1)))}let p=u==a.childCount;p||(h=-1),this.placed=Rf(this.placed,n,ce.from(c)),this.frontier[n].match=f,p&&h<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,b=a;m1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n=0;a--){let{match:l,type:u}=this.frontier[a],c=hb(e,a,u,l,!0);if(!c||c.childCount)continue e}return{depth:n,fit:s,move:o?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Rf(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=Rf(this.placed,this.depth,ce.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(ce.empty,!0);n.childCount&&(this.placed=Rf(this.placed,this.frontier.length,n))}};function If(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(If(t.firstChild.content,e-1,n)))}function Rf(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Rf(t.lastChild.content,e-1,n)))}function db(t,e){for(let n=0;n1&&(r=r.replaceChild(0,fD(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(ce.empty,!0)))),t.copy(r)}function hb(t,e,n,r,i){let o=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!UJ(n,o.content,s)?a:null}function UJ(t,e,n){for(let r=n;r0;d--,h--){let p=i.node(d).type.spec;if(p.defining||p.definingAsContext||p.isolating)break;s.indexOf(d)>-1?a=d:i.before(d)==h&&s.splice(1,0,-d)}let l=s.indexOf(a),u=[],c=r.openStart;for(let d=r.content,h=0;;h++){let p=d.firstChild;if(u.push(p),h==r.openStart)break;d=p.content}for(let d=c-1;d>=0;d--){let h=u[d],p=VJ(h.type);if(p&&!h.sameMarkup(i.node(Math.abs(a)-1)))c=d;else if(p||!h.type.isTextblock)break}for(let d=r.openStart;d>=0;d--){let h=(d+c+1)%(r.openStart+1),p=u[h];if(p)for(let m=0;m=0&&(t.replace(e,n,r),!(t.steps.length>f));d--){let h=s[d];h<0||(e=i.before(h),n=o.after(h))}}function dD(t,e,n,r,i){if(er){let o=i.contentMatchAt(0),s=o.fillBefore(t).append(t);t=s.append(o.matchFragment(s).fillBefore(ce.empty,!0))}return t}function WJ(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=jJ(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new we(ce.from(r),0,0))}function JJ(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),o=hD(r,i);for(let s=0;s0&&(l||r.node(a-1).canReplace(r.index(a-1),i.indexAfter(a-1))))return t.delete(r.before(a),i.after(a))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s)return t.delete(r.before(s),n);t.delete(e,n)}function hD(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let o=t.start(i);if(oe.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&n.push(i)}return n}let pD=class g0 extends Kn{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return tr.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return tr.fromReplace(e,this.pos,this.pos+1,new we(ce.from(i),0,n.isLeaf?0:1))}getMap(){return Dl.empty}invert(e){return new g0(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new g0(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new g0(n.pos,n.attr,n.value)}};Kn.jsonID("attr",pD);let mD=class vw extends Kn{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return tr.ok(r)}getMap(){return Dl.empty}invert(e){return new vw(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new vw(n.attr,n.value)}};Kn.jsonID("docAttr",mD);let cc=class extends Error{};cc=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};cc.prototype=Object.create(Error.prototype);cc.prototype.constructor=cc;cc.prototype.name="TransformError";class KJ{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new ad}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new cc(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=we.empty){let i=dg(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new we(ce.from(r),0,0))}delete(e,n){return this.replace(e,n,we.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return HJ(this,e,n,r),this}replaceRangeWith(e,n,r){return WJ(this,e,n,r),this}deleteRange(e,n){return JJ(this,e,n),this}lift(e,n){return OJ(this,e,n),this}join(e,n=1){return zJ(this,e,n),this}wrap(e,n){return $J(this,e,n),this}setBlockType(e,n=e,r,i=null){return IJ(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return BJ(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new pD(e,n,r)),this}setDocAttribute(e,n){return this.step(new mD(e,n)),this}addNodeMark(e,n){return this.step(new Yx(e,n)),this}removeNodeMark(e,n){if(!(n instanceof dt)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new Qx(e,n)),this}split(e,n=1,r){return PJ(this,e,n,r),this}addMark(e,n,r){return AJ(this,e,n,r),this}removeMark(e,n,r){return TJ(this,e,n,r),this}clearIncompatible(e,n,r){return aD(this,e,n,r),this}}const pb=Object.create(null);let ht=class{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new GJ(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n=0;o--){let s=n<0?fu(e.node(0),e.node(o),e.before(o+1),e.index(o),n,r):fu(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,n,r);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new ju(e.node(0))}static atStart(e){return fu(e,e,0,0,1)||new ju(e)}static atEnd(e){return fu(e,e,e.content.size,e.childCount,-1)||new ju(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=pb[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in pb)throw new RangeError("Duplicate use of selection JSON ID "+e);return pb[e]=n,n.prototype.jsonID=e,n}getBookmark(){return gn.between(this.$anchor,this.$head).getBookmark()}};ht.prototype.visible=!0;let GJ=class{constructor(e,n){this.$from=e,this.$to=n}},XC=!1;function e4(t){!XC&&!t.parent.inlineContent&&(XC=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}let gn=class Ff extends ht{constructor(e,n=e){e4(e),e4(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return ht.near(r);let i=e.resolve(n.map(this.anchor));return new Ff(i.parent.inlineContent?i:r,r)}replace(e,n=we.empty){if(super.replace(e,n),n==we.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof Ff&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new gD(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Ff(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=ht.findFrom(n,r,!0)||ht.findFrom(n,-r,!0);if(o)n=o.$head;else return ht.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(ht.findFrom(e,-r,!0)||ht.findFrom(e,r,!0)).$anchor,e.pos0?0:1);i>0?s=0;s+=i){let a=e.child(s);if(a.isAtom){if(!o&&Yt.isSelectable(a))return Yt.create(t,n-(i<0?a.nodeSize:0))}else{let l=fu(t,a,n+i,i<0?a.childCount:0,i,o);if(l)return l}n+=a.nodeSize*i}return null}function t4(t,e,n){let r=t.steps.length-1;if(r{s==null&&(s=c)}),t.setSelection(ht.near(t.doc.resolve(s),n))}function n4(t,e){return!e||!t?t:t.bind(e)}let bp=class{constructor(e,n,r){this.name=e,this.init=n4(n.init,r),this.apply=n4(n.apply,r)}};new bp("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new bp("selection",{init(t,e){return t.selection||ht.atStart(e.doc)},apply(t){return t.selection}}),new bp("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new bp("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}});function vD(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=vD(i,e,{})),n[r]=i}return n}let ns=class{constructor(e){this.spec=e,this.props={},e.props&&vD(e.props,this,this.props),this.key=e.key?e.key.key:wD("plugin")}getState(e){return e[this.key]}};const mb=Object.create(null);function wD(t){return t in mb?t+"$"+ ++mb[t]:(mb[t]=0,t+"$")}let rs=class{constructor(e="key"){this.key=wD(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}};const QJ=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function kD(t,e){let{$cursor:n}=t.selection;return!n||n.parentOffset>0?null:n}const XJ=(t,e,n)=>{let r=kD(t);if(!r)return!1;let i=Xx(r);if(!i){let s=r.blockRange(),a=s&&Ic(s);return a==null?!1:(e&&e(t.tr.lift(s,a).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&CD(t,i,e))return!0;if(r.parent.content.size==0&&(fc(o,"end")||Yt.isSelectable(o))){let s=dg(t.doc,r.before(),r.after(),we.empty);if(s&&s.slice.size{let r=kD(t);if(!r)return!1;let i=Xx(r);return i?xD(t,i,e):!1},tK=(t,e,n)=>{let r=ED(t);if(!r)return!1;let i=e3(r);return i?xD(t,i,e):!1};function xD(t,e,n){let r=e.nodeBefore,i=r,o=e.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let c=i.lastChild;if(!c)return!1;i=c}let s=e.nodeAfter,a=s,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let c=a.firstChild;if(!c)return!1;a=c}let u=dg(t.doc,o,l,we.empty);if(!u||u.from!=o||u instanceof Ii&&u.slice.size>=l-o)return!1;if(n){let c=t.tr.step(u);c.setSelection(gn.create(c.doc,o)),n(c.scrollIntoView())}return!0}function fc(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const nK=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(r.parentOffset>0)return!1;o=Xx(r)}let s=o&&o.nodeBefore;return!s||!Yt.isSelectable(s)?!1:(e&&e(t.tr.setSelection(Yt.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function Xx(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function ED(t,e){let{$cursor:n}=t.selection;return!n||n.parentOffset{let r=ED(t);if(!r)return!1;let i=e3(r);if(!i)return!1;let o=i.nodeAfter;if(CD(t,i,e))return!0;if(r.parent.content.size==0&&(fc(o,"start")||Yt.isSelectable(o))){let s=dg(t.doc,r.before(),r.after(),we.empty);if(s&&s.slice.size{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(r.parentOffset=0;e--){let n=t.node(e);if(t.index(e)+1{let n=t.selection,r=n instanceof Yt,i;if(r){if(n.node.isTextblock||!Bl(t.doc,n.from))return!1;i=n.from}else if(i=fg(t.doc,n.from,-1),i==null)return!1;if(e){let o=t.tr.join(i);r&&o.setSelection(Yt.create(o.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},sK=(t,e)=>{let n=t.selection,r;if(n instanceof Yt){if(n.node.isTextblock||!Bl(t.doc,n.to))return!1;r=n.to}else if(r=fg(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},aK=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),o=i&&Ic(i);return o==null?!1:(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},lK=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(` +`).scrollIntoView()),!0)};function SD(t){for(let e=0;e{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=SD(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let a=n.after(),l=t.tr.replaceWith(a,a,s.createAndFill());l.setSelection(ht.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},cK=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof ju||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=SD(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!r.parentOffset&&i.index(){let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(zu(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Ic(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)},dK=(t,e)=>{let{$from:n,to:r}=t.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),e&&e(t.tr.setSelection(Yt.create(t.doc,i))),!0)};function hK(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||Bl(t.doc,e.pos))?!1:(n&&n(t.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0)}function CD(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o,s;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(hK(t,e,n))return!0;let a=e.parent.canReplace(e.index(),e.index()+1);if(a&&(o=(s=r.contentMatchAt(r.childCount)).findWrapping(i.type))&&s.matchType(o[0]||i.type).validEnd){if(n){let f=e.pos+i.nodeSize,d=ce.empty;for(let m=o.length-1;m>=0;m--)d=ce.from(o[m].create(null,d));d=ce.from(r.copy(d));let h=t.tr.step(new Ar(e.pos-1,f,e.pos,f,new we(d,1,0),o.length,!0)),p=f+2*o.length;Bl(h.doc,p)&&h.join(p),n(h.scrollIntoView())}return!0}let l=ht.findFrom(e,1),u=l&&l.$from.blockRange(l.$to),c=u&&Ic(u);if(c!=null&&c>=e.depth)return n&&n(t.tr.lift(u,c).scrollIntoView()),!0;if(a&&fc(i,"start",!0)&&fc(r,"end")){let f=r,d=[];for(;d.push(f),!f.isTextblock;)f=f.lastChild;let h=i,p=1;for(;!h.isTextblock;h=h.firstChild)p++;if(f.canReplace(f.childCount,f.childCount,h.content)){if(n){let m=ce.empty;for(let y=d.length-1;y>=0;y--)m=ce.from(d[y].copy(m));let b=t.tr.step(new Ar(e.pos-d.length,e.pos+i.nodeSize,e.pos+p,e.pos+i.nodeSize-p,new we(m,d.length,0),0,!0));n(b.scrollIntoView())}return!0}}return!1}function _D(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(n&&n(e.tr.setSelection(gn.create(e.doc,t<0?i.start(o):i.end(o)))),!0):!1}}const pK=_D(-1),mK=_D(1);function gK(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=s&&lD(s,t,e);return a?(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0):!1}}function r4(t,e=null){return function(n,r){let i=!1;for(let o=0;o{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)i=!0;else{let c=n.doc.resolve(u),f=c.index();i=c.parent.canReplaceWith(f,f+1,t)}})}if(!i)return!1;if(r){let o=n.tr;for(let s=0;s=2&&i.node(s.depth-1).type.compatibleContent(t)&&s.startIndex==0){if(i.index(s.depth-1)==0)return!1;let c=n.doc.resolve(s.start-2);l=new ym(c,c,s.depth),s.endIndex=0;c--)o=ce.from(n[c].type.create(n[c].attrs,o));t.step(new Ar(e.start-(r?2:0),e.end,e.start,e.end,new we(o,0,0),n.length,!0));let s=0;for(let c=0;cs.childCount>0&&s.firstChild.type==t);return o?n?r.node(o.depth-1).type==t?wK(e,n,t,o):kK(e,n,o):!0:!1}}function wK(t,e,n,r){let i=t.tr,o=r.end,s=r.$to.end(r.depth);om;p--)h-=i.child(p).nodeSize,r.delete(h-1,h+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==i.childCount,u=o.node(-1),c=o.index(-1);if(!u.canReplace(c+(a?0:1),c+1,s.content.append(l?ce.empty:ce.from(i))))return!1;let f=o.pos,d=f+s.nodeSize;return r.step(new Ar(f-(a?1:0),d+(l?1:0),f+1,d-1,new we((a?ce.empty:ce.from(i.copy(ce.empty))).append(l?ce.empty:ce.from(i.copy(ce.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function xK(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,u=>u.childCount>0&&u.firstChild.type==t);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let a=o.parent,l=a.child(s-1);if(l.type!=t)return!1;if(n){let u=l.lastChild&&l.lastChild.type==a.type,c=ce.from(u?t.create():null),f=new we(ce.from(t.create(null,ce.from(a.type.create(null,c)))),u?3:1,0),d=o.start,h=o.end;n(e.tr.step(new Ar(d-(u?3:1),h,d,h,f,1,!0)).scrollIntoView())}return!0}}function AD(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}let EK=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:n,state:r}=this,{view:i}=n,{tr:o}=r,s=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...c)=>{const f=l(...c)(s);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),f}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i,a=[],l=!!e,u=e||o.tr,c=()=>(!l&&n&&!u.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(u),a.every(d=>d===!0)),f={...Object.fromEntries(Object.entries(r).map(([d,h])=>[d,(...m)=>{const b=this.buildProps(u,n),y=h(...m)(b);return a.push(y),f}])),run:c};return f}createCan(e){const{rawCommands:n,state:r}=this,i=!1,o=e||r.tr,s=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(n).map(([l,u])=>[l,(...c)=>u(...c)({...s,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(e,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i,a={tr:e,editor:i,view:s,state:AD({state:o,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([l,u])=>[l,(...c)=>u(...c)(a)]))}};return a}};function nr(t,e,n){return t.config[e]===void 0&&t.parent?nr(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?nr(t.parent,e,n):null}):t.config[e]}function SK(t){const e=t.filter(i=>i.type==="extension"),n=t.filter(i=>i.type==="node"),r=t.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function Nn(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function qd(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){const a=o?o.split(" "):[],l=r[i]?r[i].split(" "):[],u=a.filter(c=>!l.includes(c));r[i]=[...l,...u].join(" ")}else i==="style"?r[i]=[r[i],o].join("; "):r[i]=o}),r},{})}function CK(t){return typeof t=="function"}function qn(t,e=void 0,...n){return CK(t)?e?t.bind(e)(...n):t(...n):t}function _K(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class AK{constructor(e){this.find=e.find,this.handler=e.handler}}class TD{constructor(e){this.find=e.find,this.handler=e.handler}}function TK(t){return Object.prototype.toString.call(t).slice(8,-1)}function vp(t){return TK(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function hg(t,e){const n={...t};return vp(t)&&vp(e)&&Object.keys(e).forEach(r=>{vp(e[r])&&vp(t[r])?n[r]=hg(t[r],e[r]):n[r]=e[r]}),n}let is=class ww{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=qn(nr(this,"addOptions",{name:this.name}))),this.storage=qn(nr(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new ww(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>hg(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new ww({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=qn(nr(n,"addOptions",{name:n.name})),n.storage=qn(nr(n,"addStorage",{name:n.name,options:n.options})),n}};function MK(t,e,n){const{from:r,to:i}=e,{blockSeparator:o=` -`,textSerializers:s={}}=n||{};let a="";return t.nodesBetween(r,i,(l,u,c,f)=>{var d;l.isBlock&&u>r&&(a+=o);const h=s==null?void 0:s[l.type.name];if(h)return c&&(a+=h({node:l,pos:u,parent:c,index:f,range:e})),!1;l.isText&&(a+=(d=l==null?void 0:l.text)===null||d===void 0?void 0:d.slice(Math.max(r,u)-u,i-u))}),a}function MK(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}is.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new ns({key:new rs("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,{ranges:o}=i,s=Math.min(...o.map(c=>c.$from.pos)),a=Math.max(...o.map(c=>c.$to.pos)),l=MK(n);return TK(r,{from:s,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}});const OK=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),DK=(t=!1)=>({commands:e})=>e.setContent("",t),NK=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:s})=>{t.doc.nodesBetween(o.pos,s.pos,(a,l)=>{if(a.type.isText)return;const{doc:u,mapping:c}=e,f=u.resolve(c.map(l)),d=u.resolve(c.map(l+a.nodeSize)),h=f.blockRange(d);if(!h)return;const p=Ic(h);if(a.type.isTextblock){const{defaultType:m}=f.parent.contentMatchAt(f.index());e.setNodeMarkup(h.start,m)}(p||p===0)&&e.lift(h,p)})}),!0},$K=t=>e=>t(e),IK=()=>({state:t,dispatch:e})=>cK(t,e),RK=(t,e)=>({editor:n,tr:r})=>{const{state:i}=n,o=i.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const s=r.mapping.map(e);return r.insert(s,o.content),r.setSelection(new gn(r.doc.resolve(s-1))),!0},FK=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const i=t.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(e){const a=i.before(o),l=i.after(o);t.delete(a,l).scrollIntoView()}return!0}return!1},LK=t=>({tr:e,state:n,dispatch:r})=>{const i=Nn(t,n.schema),o=e.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===i){if(r){const l=o.before(s),u=o.after(s);e.delete(l,u).scrollIntoView()}return!0}return!1},BK=t=>({tr:e,dispatch:n})=>{const{from:r,to:i}=t;return n&&e.delete(r,i),!0},PK=()=>({state:t,dispatch:e})=>QJ(t,e),zK=()=>({commands:t})=>t.keyboardShortcut("Enter"),jK=()=>({state:t,dispatch:e})=>uK(t,e);function wm(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:_K(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function kw(t,e,n={}){return t.find(r=>r.type===e&&wm(r.attrs,n))}function qK(t,e,n={}){return!!kw(t,e,n)}function t3(t,e,n={}){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if(t.parentOffset===r.offset&&r.offset!==0&&(r=t.parent.childBefore(t.parentOffset)),!r.node)return;const i=kw([...r.node.marks],e,n);if(!i)return;let o=r.index,s=t.start()+r.offset,a=o+1,l=s+r.node.nodeSize;for(kw([...r.node.marks],e,n);o>0&&i.isInSet(t.parent.child(o-1).marks);)o-=1,s-=t.parent.child(o).nodeSize;for(;a({tr:n,state:r,dispatch:i})=>{const o=Aa(t,r.schema),{doc:s,selection:a}=n,{$from:l,from:u,to:c}=a;if(i){const f=t3(l,o,e);if(f&&f.from<=u&&f.to>=c){const d=gn.create(s,f.from,f.to);n.setSelection(d)}}return!0},UK=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r({editor:n,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const s=()=>{n3()&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&t===null||t===!1)return!0;if(o&&t===null&&!MD(n.state.selection))return s(),!0;const a=HK(i.doc,t)||n.state.selection,l=n.state.selection.eq(a);return o&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},JK=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),KK=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),OD=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&OD(r)}return t};function i4(t){const e=`${t}`,n=new window.DOMParser().parseFromString(e,"text/html").body;return OD(n)}function km(t,e,n){n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,i=typeof t=="string";if(r)try{return Array.isArray(t)&&t.length>0?ce.fromArray(t.map(s=>e.nodeFromJSON(s))):e.nodeFromJSON(t)}catch(o){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",o),km("",e,n)}if(i){let o=e,s=!1,a="";n.errorOnInvalidContent&&(o=new XO({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(s=!0,a=typeof c=="string"?c:c.outerHTML,null)}]}})}));const l=vJ.fromSchema(o),u=n.slice?l.parseSlice(i4(t),n.parseOptions).content:l.parse(i4(t),n.parseOptions);if(n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)});return u}return km("",e,n)}function GK(t,e,n){const r=t.steps.length-1;if(r{s===0&&(s=c)}),t.setSelection(ht.near(t.doc.resolve(s),n))}const ZK=t=>!("type"in t),YK=(t,e,n)=>({tr:r,dispatch:i,editor:o})=>{var s;if(i){n={parseOptions:{},updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let a;try{a=km(e,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:(s=n.errorOnInvalidContent)!==null&&s!==void 0?s:o.options.enableContentCheck})}catch{return!1}let{from:l,to:u}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},c=!0,f=!0;if((ZK(a)?a:[a]).forEach(p=>{p.check(),c=c?p.isText&&p.marks.length===0:!1,f=f?p.isBlock:!1}),l===u&&f){const{parent:p}=r.doc.resolve(l);p.isTextblock&&!p.type.spec.code&&!p.childCount&&(l-=1,u+=1)}let h;c?(Array.isArray(e)?h=e.map(p=>p.text||"").join(""):typeof e=="object"&&e&&e.text?h=e.text:h=e,r.insertText(h,l,u)):(h=a,r.replaceWith(l,u,h)),n.updateSelection&&GK(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:l,text:h}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:l,text:h})}return!0},QK=()=>({state:t,dispatch:e})=>oK(t,e),XK=()=>({state:t,dispatch:e})=>sK(t,e),eG=()=>({state:t,dispatch:e})=>XJ(t,e),tG=()=>({state:t,dispatch:e})=>rK(t,e),nG=()=>({state:t,dispatch:e,tr:n})=>{try{const r=fg(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},rG=()=>({state:t,dispatch:e,tr:n})=>{try{const r=fg(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},iG=()=>({state:t,dispatch:e})=>eK(t,e),oG=()=>({state:t,dispatch:e})=>tK(t,e);function DD(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function sG(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,i,o,s;for(let a=0;a({editor:e,view:n,tr:r,dispatch:i})=>{const o=sG(t).split(/-(?!$)/),s=o.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),a=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{n.someProp("handleKeyDown",u=>u(n,a))});return l==null||l.steps.forEach(u=>{const c=u.map(r.mapping);c&&i&&r.maybeStep(c)}),!0};function r3(t,e,n={}){const{from:r,to:i,empty:o}=t.selection,s=e?Nn(e,t.schema):null,a=[];t.doc.nodesBetween(r,i,(f,d)=>{if(f.isText)return;const h=Math.max(r,d),p=Math.min(i,d+f.nodeSize);a.push({node:f,from:h,to:p})});const l=i-r,u=a.filter(f=>s?s.name===f.node.type.name:!0).filter(f=>wm(f.node.attrs,n,{strict:!1}));return o?!!u.length:u.reduce((f,d)=>f+d.to-d.from,0)>=l}const lG=(t,e={})=>({state:n,dispatch:r})=>{const i=Nn(t,n.schema);return r3(n,i,e)?aK(n,r):!1},uG=()=>({state:t,dispatch:e})=>fK(t,e),cG=t=>({state:e,dispatch:n})=>{const r=Nn(t,e.schema);return vK(r)(e,n)},fG=()=>({state:t,dispatch:e})=>lK(t,e);function i3(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function o4(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,i)=>(n.includes(i)||(r[i]=t[i]),r),{})}const dG=(t,e)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=i3(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(o=Nn(t,r.schema)),a==="mark"&&(s=Aa(t,r.schema)),i&&n.selection.ranges.forEach(l=>{r.doc.nodesBetween(l.$from.pos,l.$to.pos,(u,c)=>{o&&o===u.type&&n.setNodeMarkup(c,void 0,o4(u.attrs,e)),s&&u.marks.length&&u.marks.forEach(f=>{s===f.type&&n.addMark(c,c+u.nodeSize,s.create(o4(f.attrs,e)))})})}),!0):!1},hG=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),pG=()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size}),mG=()=>({state:t,dispatch:e})=>nK(t,e),gG=()=>({state:t,dispatch:e})=>iK(t,e),yG=()=>({state:t,dispatch:e})=>dK(t,e),bG=()=>({state:t,dispatch:e})=>mK(t,e),vG=()=>({state:t,dispatch:e})=>pK(t,e);function wG(t,e,n={},r={}){return km(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const kG=(t,e=!1,n={},r={})=>({editor:i,tr:o,dispatch:s,commands:a})=>{var l,u;const{doc:c}=o;if(n.preserveWhitespace!=="full"){const f=wG(t,i.schema,n,{errorOnInvalidContent:(l=r.errorOnInvalidContent)!==null&&l!==void 0?l:i.options.enableContentCheck});return s&&o.replaceWith(0,c.content.size,f).setMeta("preventUpdate",!e),!0}return s&&o.setMeta("preventUpdate",!e),a.insertContentAt({from:0,to:c.content.size},t,{parseOptions:n,errorOnInvalidContent:(u=r.errorOnInvalidContent)!==null&&u!==void 0?u:i.options.enableContentCheck})};function ND(t,e){const n=Aa(e,t.schema),{from:r,to:i,empty:o}=t.selection,s=[];o?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,i,l=>{s.push(...l.marks)});const a=s.find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function xG(t,e){const n=new KJ(t);return e.forEach(r=>{r.steps.forEach(i=>{n.step(i)})}),n}function EG(t){for(let e=0;e{n(i)&&r.push({node:i,pos:o})}),r}function CG(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function o3(t){return e=>CG(e.$from,t)}function _G(t,e){const n=Nn(e,t.schema),{from:r,to:i}=t.selection,o=[];t.doc.nodesBetween(r,i,a=>{o.push(a)});const s=o.reverse().find(a=>a.type.name===n.name);return s?{...s.attrs}:{}}function AG(t,e){const n=i3(typeof e=="string"?e:e.name,t.schema);return n==="node"?_G(t,e):n==="mark"?ND(t,e):{}}function TG(t,e=JSON.stringify){const n={};return t.filter(r=>{const i=e(r);return Object.prototype.hasOwnProperty.call(n,i)?!1:n[i]=!0})}function MG(t){const e=TG(t);return e.length===1?e:e.filter((n,r)=>!e.filter((o,s)=>s!==r).some(o=>n.oldRange.from>=o.oldRange.from&&n.oldRange.to<=o.oldRange.to&&n.newRange.from>=o.newRange.from&&n.newRange.to<=o.newRange.to))}function OG(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((i,o)=>{const s=[];if(i.ranges.length)i.forEach((a,l)=>{s.push({from:a,to:l})});else{const{from:a,to:l}=n[o];if(a===void 0||l===void 0)return;s.push({from:a,to:l})}s.forEach(({from:a,to:l})=>{const u=e.slice(o).map(a,-1),c=e.slice(o).map(l),f=e.invert().map(u,-1),d=e.invert().map(c);r.push({oldRange:{from:f,to:d},newRange:{from:u,to:c}})})}),MG(r)}function $D(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(i=>{const o=n.resolve(t-1),s=t3(o,i.type);s&&r.push({mark:i,...s})}):n.nodesBetween(t,e,(i,o)=>{!i||(i==null?void 0:i.nodeSize)===void 0||r.push(...i.marks.map(s=>({from:o,to:o+i.nodeSize,mark:s})))}),r}function y0(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=t.find(o=>o.type===e&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function DG(t,e,n={}){const{empty:r,ranges:i}=t.selection,o=e?Aa(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(f=>o?o.name===f.type.name:!0).find(f=>wm(f.attrs,n,{strict:!1}));let s=0;const a=[];if(i.forEach(({$from:f,$to:d})=>{const h=f.pos,p=d.pos;t.doc.nodesBetween(h,p,(m,b)=>{if(!m.isText&&!m.marks.length)return;const y=Math.max(h,b),v=Math.min(p,b+m.nodeSize),w=v-y;s+=w,a.push(...m.marks.map(g=>({mark:g,from:y,to:v})))})}),s===0)return!1;const l=a.filter(f=>o?o.name===f.mark.type.name:!0).filter(f=>wm(f.mark.attrs,n,{strict:!1})).reduce((f,d)=>f+d.to-d.from,0),u=a.filter(f=>o?f.mark.type!==o&&f.mark.type.excludes(o):!0).reduce((f,d)=>f+d.to-d.from,0);return(l>0?l+u:l)>=s}function s4(t,e){const{nodeExtensions:n}=SK(e),r=n.find(s=>s.name===t);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=nr(tr(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function NG(t,e,n){var r;const{selection:i}=e;let o=null;if(MD(i)&&(o=i.$cursor),o){const a=(r=t.storedMarks)!==null&&r!==void 0?r:o.marks();return!!n.isInSet(a)||!a.some(l=>l.type.excludes(n))}const{ranges:s}=i;return s.some(({$from:a,$to:l})=>{let u=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.pos,l.pos,(c,f,d)=>{if(u)return!1;if(c.isInline){const h=!d||d.type.allowsMarkType(n),p=!!n.isInSet(c.marks)||!c.marks.some(m=>m.type.excludes(n));u=h&&p}return!u}),u})}const $G=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:s,ranges:a}=o,l=Aa(t,r.schema);if(i)if(s){const u=ND(r,l);n.addStoredMark(l.create({...u,...e}))}else a.forEach(u=>{const c=u.$from.pos,f=u.$to.pos;r.doc.nodesBetween(c,f,(d,h)=>{const p=Math.max(h,c),m=Math.min(h+d.nodeSize,f);d.marks.find(y=>y.type===l)?d.marks.forEach(y=>{l===y.type&&n.addMark(p,m,l.create({...y.attrs,...e}))}):n.addMark(p,m,l.create(e))})});return NG(r,n,l)},IG=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),RG=(t,e={})=>({state:n,dispatch:r,chain:i})=>{const o=Nn(t,n.schema);return o.isTextblock?i().command(({commands:s})=>r4(o,e)(n)?!0:s.clearNodes()).command(({state:s})=>r4(o,e)(s,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},FG=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,i=Qa(t,0,r.content.size),o=Yt.create(r,i);e.setSelection(o)}return!0},LG=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:i,to:o}=typeof t=="number"?{from:t,to:t}:t,s=gn.atStart(r).from,a=gn.atEnd(r).to,l=Qa(i,s,a),u=Qa(o,s,a),c=gn.create(r,l,u);e.setSelection(c)}return!0},BG=t=>({state:e,dispatch:n})=>{const r=Nn(t,e.schema);return xK(r)(e,n)};function a4(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(i=>e==null?void 0:e.includes(i.type.name));t.tr.ensureMarks(r)}}const PG=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{const{selection:o,doc:s}=e,{$from:a,$to:l}=o,u=i.extensionManager.attributes,c=y0(u,a.node().type.name,a.node().attrs);if(o instanceof Yt&&o.node.isBlock)return!a.parentOffset||!zu(s,a.pos)?!1:(r&&(t&&a4(n,i.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;if(r){const f=l.parentOffset===l.parent.content.size;o instanceof gn&&e.deleteSelection();const d=a.depth===0?void 0:EG(a.node(-1).contentMatchAt(a.indexAfter(-1)));let h=f&&d?[{type:d,attrs:c}]:void 0,p=zu(e.doc,e.mapping.map(a.pos),1,h);if(!h&&!p&&zu(e.doc,e.mapping.map(a.pos),1,d?[{type:d}]:void 0)&&(p=!0,h=d?[{type:d,attrs:c}]:void 0),p&&(e.split(e.mapping.map(a.pos),1,h),d&&!f&&!a.parentOffset&&a.parent.type!==d)){const m=e.mapping.map(a.before()),b=e.doc.resolve(m);a.node(-1).canReplaceWith(b.index(),b.index()+1,d)&&e.setNodeMarkup(e.mapping.map(a.before()),d)}t&&a4(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},zG=t=>({tr:e,state:n,dispatch:r,editor:i})=>{var o;const s=Nn(t,n.schema),{$from:a,$to:l}=n.selection,u=n.selection.node;if(u&&u.isBlock||a.depth<2||!a.sameParent(l))return!1;const c=a.node(-1);if(c.type!==s)return!1;const f=i.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==s||a.index(-2)!==a.node(-2).childCount-1)return!1;if(r){let b=ce.empty;const y=a.index(-1)?1:a.index(-2)?2:3;for(let E=a.depth-y;E>=a.depth-3;E-=1)b=ce.from(a.node(E).copy(b));const v=a.indexAfter(-1){if(k>-1)return!1;E.isTextblock&&E.content.size===0&&(k=D+1)}),k>-1&&e.setSelection(gn.near(e.doc.resolve(k))),e.scrollIntoView()}return!0}const d=l.pos===a.end()?c.contentMatchAt(0).defaultType:null,h=y0(f,c.type.name,c.attrs),p=y0(f,a.node().type.name,a.node().attrs);e.delete(a.pos,l.pos);const m=d?[{type:s,attrs:h},{type:d,attrs:p}]:[{type:s,attrs:h}];if(!zu(e.doc,a.pos,2))return!1;if(r){const{selection:b,storedMarks:y}=n,{splittableMarks:v}=i.extensionManager,w=y||b.$to.parentOffset&&b.$from.marks();if(e.split(a.pos,2,m).scrollIntoView(),!w||!r)return!0;const g=w.filter(x=>v.includes(x.type.name));e.ensureMarks(g)}return!0},gb=(t,e)=>{const n=o3(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&Bl(t.doc,n.pos)&&t.join(n.pos),!0},yb=(t,e)=>{const n=o3(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&Bl(t.doc,r)&&t.join(r),!0},jG=(t,e,n,r={})=>({editor:i,tr:o,state:s,dispatch:a,chain:l,commands:u,can:c})=>{const{extensions:f,splittableMarks:d}=i.extensionManager,h=Nn(t,s.schema),p=Nn(e,s.schema),{selection:m,storedMarks:b}=s,{$from:y,$to:v}=m,w=y.blockRange(v),g=b||m.$to.parentOffset&&m.$from.marks();if(!w)return!1;const x=o3(k=>s4(k.type.name,f))(m);if(w.depth>=1&&x&&w.depth-x.depth<=1){if(x.node.type===h)return u.liftListItem(p);if(s4(x.node.type.name,f)&&h.validContent(x.node.content)&&a)return l().command(()=>(o.setNodeMarkup(x.pos,h),!0)).command(()=>gb(o,h)).command(()=>yb(o,h)).run()}return!n||!g||!a?l().command(()=>c().wrapInList(h,r)?!0:u.clearNodes()).wrapInList(h,r).command(()=>gb(o,h)).command(()=>yb(o,h)).run():l().command(()=>{const k=c().wrapInList(h,r),E=g.filter(D=>d.includes(D.type.name));return o.ensureMarks(E),k?!0:u.clearNodes()}).wrapInList(h,r).command(()=>gb(o,h)).command(()=>yb(o,h)).run()},qG=(t,e={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,s=Aa(t,r.schema);return DG(r,s,e)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,e)},VG=(t,e,n={})=>({state:r,commands:i})=>{const o=Nn(t,r.schema),s=Nn(e,r.schema);return r3(r,o,n)?i.setNode(s):i.setNode(o,n)},UG=(t,e={})=>({state:n,commands:r})=>{const i=Nn(t,n.schema);return r3(n,i,e)?r.lift(i):r.wrapIn(i,e)},HG=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r=0;l-=1)s.step(a.steps[l].invert(a.docs[l]));if(o.text){const l=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,t.schema.text(o.text,l))}else s.delete(o.from,o.to)}return!0}}return!1},WG=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:i}=n;return r||e&&i.forEach(o=>{t.removeMark(o.$from.pos,o.$to.pos)}),!0},JG=(t,e={})=>({tr:n,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:s=!1}=e,{selection:a}=n,l=Aa(t,r.schema),{$from:u,empty:c,ranges:f}=a;if(!i)return!0;if(c&&s){let{from:d,to:h}=a;const p=(o=u.marks().find(b=>b.type===l))===null||o===void 0?void 0:o.attrs,m=t3(u,l,p);m&&(d=m.from,h=m.to),n.removeMark(d,h,l)}else f.forEach(d=>{n.removeMark(d.$from.pos,d.$to.pos,l)});return n.removeStoredMark(l),!0},KG=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=i3(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(o=Nn(t,r.schema)),a==="mark"&&(s=Aa(t,r.schema)),i&&n.selection.ranges.forEach(l=>{const u=l.$from.pos,c=l.$to.pos;r.doc.nodesBetween(u,c,(f,d)=>{o&&o===f.type&&n.setNodeMarkup(d,void 0,{...f.attrs,...e}),s&&f.marks.length&&f.marks.forEach(h=>{if(s===h.type){const p=Math.max(d,u),m=Math.min(d+f.nodeSize,c);n.addMark(p,m,s.create({...h.attrs,...e}))}})})}),!0):!1},GG=(t,e={})=>({state:n,dispatch:r})=>{const i=Nn(t,n.schema);return gK(i,e)(n,r)},ZG=(t,e={})=>({state:n,dispatch:r})=>{const i=Nn(t,n.schema);return yK(i,e)(n,r)};var YG=Object.freeze({__proto__:null,blur:OK,clearContent:DK,clearNodes:NK,command:$K,createParagraphNear:IK,cut:RK,deleteCurrentNode:FK,deleteNode:LK,deleteRange:BK,deleteSelection:PK,enter:zK,exitCode:jK,extendMarkRange:VK,first:UK,focus:WK,forEach:JK,insertContent:KK,insertContentAt:YK,joinBackward:eG,joinDown:XK,joinForward:tG,joinItemBackward:nG,joinItemForward:rG,joinTextblockBackward:iG,joinTextblockForward:oG,joinUp:QK,keyboardShortcut:aG,lift:lG,liftEmptyBlock:uG,liftListItem:cG,newlineInCode:fG,resetAttributes:dG,scrollIntoView:hG,selectAll:pG,selectNodeBackward:mG,selectNodeForward:gG,selectParentNode:yG,selectTextblockEnd:bG,selectTextblockStart:vG,setContent:kG,setMark:$G,setMeta:IG,setNode:RG,setNodeSelection:FG,setTextSelection:LG,sinkListItem:BG,splitBlock:PG,splitListItem:zG,toggleList:jG,toggleMark:qG,toggleNode:VG,toggleWrap:UG,undoInputRule:HG,unsetAllMarks:WG,unsetMark:JG,updateAttributes:KG,wrapIn:GG,wrapInList:ZG});is.create({name:"commands",addCommands(){return{...YG}}});is.create({name:"editable",addProseMirrorPlugins(){return[new ns({key:new rs("editable"),props:{editable:()=>this.editor.options.editable}})]}});is.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new ns({key:new rs("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}});is.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:a})=>{const{selection:l,doc:u}=a,{empty:c,$anchor:f}=l,{pos:d,parent:h}=f,p=f.parent.isTextblock&&d>0?a.doc.resolve(d-1):f,m=p.parent.type.spec.isolating,b=f.pos-f.parentOffset,y=m&&p.parent.childCount===1?b===f.pos:ht.atStart(u).from===d;return!c||!h.type.isTextblock||h.textContent.length||!y||y&&f.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return n3()||DD()?o:i},addProseMirrorPlugins(){return[new ns({key:new rs("clearDocument"),appendTransaction:(t,e,n)=>{if(!(t.some(p=>p.docChanged)&&!e.doc.eq(n.doc)))return;const{empty:i,from:o,to:s}=e.selection,a=ht.atStart(e.doc).from,l=ht.atEnd(e.doc).to;if(i||!(o===a&&s===l)||!(n.doc.textBetween(0,n.doc.content.size," "," ").length===0))return;const f=n.tr,d=AD({state:n,transaction:f}),{commands:h}=new EK({editor:this.editor,state:d});if(h.clearNodes(),!!f.steps.length)return f}})]}});is.create({name:"tabindex",addProseMirrorPlugins(){return[new ns({key:new rs("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class qd{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=nr(tr(this,"addOptions",{name:this.name}))),this.storage=nr(tr(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new qd(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>hg(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new qd(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=nr(tr(n,"addOptions",{name:n.name})),n.storage=nr(tr(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const s=i.marks();if(!!!s.find(u=>(u==null?void 0:u.type.name)===n.name))return!1;const l=s.find(u=>(u==null?void 0:u.type.name)===n.name);return l&&r.removeStoredMark(l),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}}class Ri{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=nr(tr(this,"addOptions",{name:this.name}))),this.storage=nr(tr(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ri(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>hg(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Ri(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=nr(tr(n,"addOptions",{name:n.name})),n.storage=nr(tr(n,"addStorage",{name:n.name,options:n.options})),n}}function ID(t){return new TD({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{const o=nr(t.getAttributes,void 0,r,i);if(o===!1||o===null)return null;const{tr:s}=e,a=r[r.length-1],l=r[0];let u=n.to;if(a){const c=l.search(/\S/),f=n.from+l.indexOf(a),d=f+a.length;if($D(n.from,n.to,e.doc).filter(p=>p.mark.type.excluded.find(b=>b===t.type&&b!==p.mark.type)).filter(p=>p.to>f).length)return null;dn.from&&s.delete(n.from+c,f),u=n.from+c+a.length,s.addMark(n.from+c,u,t.type.create(o||{})),s.removeStoredMark(t.type)}}})}function Eh(t){return new TD({find:t.find,handler({match:e,chain:n,range:r,pasteEvent:i}){const o=nr(t.getAttributes,void 0,e,i);if(o===!1||o===null)return null;e.input&&n().deleteRange(r).insertContentAt(r.from,{type:t.type.name,attrs:o})}})}var RD={};(function(t){/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(t,"__esModule",{value:!0}),t.bytes=t.stringToBytes=t.str=t.bytesToString=t.hex=t.utf8=t.bech32m=t.bech32=t.base58check=t.base58xmr=t.base58xrp=t.base58flickr=t.base58=t.base64url=t.base64=t.base32crockford=t.base32hex=t.base32=t.base16=t.utils=t.assertNumber=void 0;function e(C){if(!Number.isSafeInteger(C))throw new Error(`Wrong integer: ${C}`)}t.assertNumber=e;function n(...C){const R=(A,S)=>P=>A(S(P)),T=Array.from(C).reverse().reduce((A,S)=>A?R(A,S.encode):S.encode,void 0),q=C.reduce((A,S)=>A?R(A,S.decode):S.decode,void 0);return{encode:T,decode:q}}function r(C){return{encode:R=>{if(!Array.isArray(R)||R.length&&typeof R[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return R.map(T=>{if(e(T),T<0||T>=C.length)throw new Error(`Digit index outside alphabet: ${T} (alphabet: ${C.length})`);return C[T]})},decode:R=>{if(!Array.isArray(R)||R.length&&typeof R[0]!="string")throw new Error("alphabet.decode input should be array of strings");return R.map(T=>{if(typeof T!="string")throw new Error(`alphabet.decode: not string element=${T}`);const q=C.indexOf(T);if(q===-1)throw new Error(`Unknown letter: "${T}". Allowed: ${C}`);return q})}}}function i(C=""){if(typeof C!="string")throw new Error("join separator should be string");return{encode:R=>{if(!Array.isArray(R)||R.length&&typeof R[0]!="string")throw new Error("join.encode input should be array of strings");for(let T of R)if(typeof T!="string")throw new Error(`join.encode: non-string input=${T}`);return R.join(C)},decode:R=>{if(typeof R!="string")throw new Error("join.decode input should be string");return R.split(C)}}}function o(C,R="="){if(e(C),typeof R!="string")throw new Error("padding chr should be string");return{encode(T){if(!Array.isArray(T)||T.length&&typeof T[0]!="string")throw new Error("padding.encode input should be array of strings");for(let q of T)if(typeof q!="string")throw new Error(`padding.encode: non-string input=${q}`);for(;T.length*C%8;)T.push(R);return T},decode(T){if(!Array.isArray(T)||T.length&&typeof T[0]!="string")throw new Error("padding.encode input should be array of strings");for(let A of T)if(typeof A!="string")throw new Error(`padding.decode: non-string input=${A}`);let q=T.length;if(q*C%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;q>0&&T[q-1]===R;q--)if(!((q-1)*C%8))throw new Error("Invalid padding: string has too much padding");return T.slice(0,q)}}}function s(C){if(typeof C!="function")throw new Error("normalize fn should be function");return{encode:R=>R,decode:R=>C(R)}}function a(C,R,T){if(R<2)throw new Error(`convertRadix: wrong from=${R}, base cannot be less than 2`);if(T<2)throw new Error(`convertRadix: wrong to=${T}, base cannot be less than 2`);if(!Array.isArray(C))throw new Error("convertRadix: data should be array");if(!C.length)return[];let q=0;const A=[],S=Array.from(C);for(S.forEach(P=>{if(e(P),P<0||P>=R)throw new Error(`Wrong integer: ${P}`)});;){let P=0,B=!0;for(let j=q;jR?l(R,C%R):C,u=(C,R)=>C+(R-l(C,R));function c(C,R,T,q){if(!Array.isArray(C))throw new Error("convertRadix2: data should be array");if(R<=0||R>32)throw new Error(`convertRadix2: wrong from=${R}`);if(T<=0||T>32)throw new Error(`convertRadix2: wrong to=${T}`);if(u(R,T)>32)throw new Error(`convertRadix2: carry overflow from=${R} to=${T} carryBits=${u(R,T)}`);let A=0,S=0;const P=2**T-1,B=[];for(const j of C){if(e(j),j>=2**R)throw new Error(`convertRadix2: invalid data word=${j} from=${R}`);if(A=A<32)throw new Error(`convertRadix2: carry overflow pos=${S} from=${R}`);for(S+=R;S>=T;S-=T)B.push((A>>S-T&P)>>>0);A&=2**S-1}if(A=A<=R)throw new Error("Excess padding");if(!q&&A)throw new Error(`Non-zero padding: ${A}`);return q&&S>0&&B.push(A>>>0),B}function f(C){return e(C),{encode:R=>{if(!(R instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return a(Array.from(R),2**8,C)},decode:R=>{if(!Array.isArray(R)||R.length&&typeof R[0]!="number")throw new Error("radix.decode input should be array of strings");return Uint8Array.from(a(R,C,2**8))}}}function d(C,R=!1){if(e(C),C<=0||C>32)throw new Error("radix2: bits should be in (0..32]");if(u(8,C)>32||u(C,8)>32)throw new Error("radix2: carry overflow");return{encode:T=>{if(!(T instanceof Uint8Array))throw new Error("radix2.encode input should be Uint8Array");return c(Array.from(T),8,C,!R)},decode:T=>{if(!Array.isArray(T)||T.length&&typeof T[0]!="number")throw new Error("radix2.decode input should be array of strings");return Uint8Array.from(c(T,C,8,R))}}}function h(C){if(typeof C!="function")throw new Error("unsafeWrapper fn should be function");return function(...R){try{return C.apply(null,R)}catch{}}}function p(C,R){if(e(C),typeof R!="function")throw new Error("checksum fn should be function");return{encode(T){if(!(T instanceof Uint8Array))throw new Error("checksum.encode: input should be Uint8Array");const q=R(T).slice(0,C),A=new Uint8Array(T.length+C);return A.set(T),A.set(q,T.length),A},decode(T){if(!(T instanceof Uint8Array))throw new Error("checksum.decode: input should be Uint8Array");const q=T.slice(0,-C),A=R(q).slice(0,C),S=T.slice(-C);for(let P=0;PC.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1"))),t.base64=n(d(6),r("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),o(6),i("")),t.base64url=n(d(6),r("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),o(6),i(""));const m=C=>n(f(58),r(C),i(""));t.base58=m("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),t.base58flickr=m("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),t.base58xrp=m("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");const b=[0,2,3,5,6,7,9,10,11];t.base58xmr={encode(C){let R="";for(let T=0;Tn(p(4,R=>C(C(R))),t.base58);t.base58check=y;const v=n(r("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),i("")),w=[996825010,642813549,513874426,1027748829,705979059];function g(C){const R=C>>25;let T=(C&33554431)<<5;for(let q=0;q>q&1)===1&&(T^=w[q]);return T}function x(C,R,T=1){const q=C.length;let A=1;for(let S=0;S126)throw new Error(`Invalid prefix (${C})`);A=g(A)^P>>5}A=g(A);for(let S=0;Sae)throw new TypeError(`Length ${fe} exceeds limit ${ae}`);return J=J.toLowerCase(),`${J}1${v.encode(K)}${x(J,K,R)}`}function B(J,K=90){if(typeof J!="string")throw new Error(`bech32.decode input should be string, not ${typeof J}`);if(J.length<8||K!==!1&&J.length>K)throw new TypeError(`Wrong string length: ${J.length} (${J}). Expected (8..${K})`);const ae=J.toLowerCase();if(J!==ae&&J!==J.toUpperCase())throw new Error("String must be lowercase or uppercase");J=ae;const fe=J.lastIndexOf("1");if(fe===0||fe===-1)throw new Error('Letter "1" must be present between prefix and data only');const ke=J.slice(0,fe),ve=J.slice(fe+1);if(ve.length<6)throw new Error("Data must be at least 6 characters long");const xe=v.decode(ve).slice(0,-6),Se=x(ke,xe,R);if(!ve.endsWith(Se))throw new Error(`Invalid checksum in ${J}: expected "${Se}"`);return{prefix:ke,words:xe}}const j=h(B);function z(J){const{prefix:K,words:ae}=B(J,!1);return{prefix:K,words:ae,bytes:q(ae)}}return{encode:P,decode:B,decodeToBytes:z,decodeUnsafe:j,fromWords:q,fromWordsUnsafe:S,toWords:A}}t.bech32=k("bech32"),t.bech32m=k("bech32m"),t.utf8={encode:C=>new TextDecoder().decode(C),decode:C=>new TextEncoder().encode(C)},t.hex=n(d(4),r("0123456789abcdef"),i(""),s(C=>{if(typeof C!="string"||C.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof C} with length ${C.length}`);return C.toLowerCase()}));const E={utf8:t.utf8,hex:t.hex,base16:t.base16,base32:t.base32,base64:t.base64,base64url:t.base64url,base58:t.base58,base58xmr:t.base58xmr},D=`Invalid encoding type. Available types: ${Object.keys(E).join(", ")}`,O=(C,R)=>{if(typeof C!="string"||!E.hasOwnProperty(C))throw new TypeError(D);if(!(R instanceof Uint8Array))throw new TypeError("bytesToString() expects Uint8Array");return E[C].encode(R)};t.bytesToString=O,t.str=t.bytesToString;const N=(C,R)=>{if(!E.hasOwnProperty(C))throw new TypeError(D);if(typeof R!="string")throw new TypeError("stringToBytes() expects string");return E[C].decode(R)};t.stringToBytes=N,t.bytes=t.stringToBytes})(RD);const{bech32:Yi,hex:_i,utf8:QG}=RD,l4={bech32:"bc",pubKeyHash:0,scriptHash:5,validWitnessVersions:[0]},u4={bech32:"tb",pubKeyHash:111,scriptHash:196,validWitnessVersions:[0]},c4={bech32:"tbs",pubKeyHash:111,scriptHash:196,validWitnessVersions:[0]},f4={bech32:"bcrt",pubKeyHash:111,scriptHash:196,validWitnessVersions:[0]},d4={bech32:"sb",pubKeyHash:63,scriptHash:123,validWitnessVersions:[0]},vp=["option_data_loss_protect","initial_routing_sync","option_upfront_shutdown_script","gossip_queries","var_onion_optin","gossip_queries_ex","option_static_remotekey","payment_secret","basic_mpp","option_support_large_channel"],XG={m:BigInt(1e3),u:BigInt(1e6),n:BigInt(1e9),p:BigInt(1e12)},eZ=BigInt("2100000000000000000"),h4=BigInt(1e11),xw={payment_hash:1,payment_secret:16,description:13,payee:19,description_hash:23,expiry:6,min_final_cltv_expiry:24,fallback_address:9,route_hint:3,feature_bits:5,metadata:27},FD={};for(let t=0,e=Object.keys(xw);t_i.encode(Yi.fromWordsUnsafe(t)),16:t=>_i.encode(Yi.fromWordsUnsafe(t)),13:t=>QG.encode(Yi.fromWordsUnsafe(t)),19:t=>_i.encode(Yi.fromWordsUnsafe(t)),23:t=>_i.encode(Yi.fromWordsUnsafe(t)),27:t=>_i.encode(Yi.fromWordsUnsafe(t)),6:xm,24:xm,3:rZ,5:iZ};function nZ(t){return e=>({tagCode:parseInt(t),words:Yi.encode("unknown",e,Number.MAX_SAFE_INTEGER)})}function xm(t){return t.reverse().reduce((e,n,r)=>e+n*Math.pow(32,r),0)}function rZ(t){const e=[];let n,r,i,o,s,a=Yi.fromWordsUnsafe(t);for(;a.length>0;)n=_i.encode(a.slice(0,33)),r=_i.encode(a.slice(33,41)),i=parseInt(_i.encode(a.slice(41,45)),16),o=parseInt(_i.encode(a.slice(45,49)),16),s=parseInt(_i.encode(a.slice(49,51)),16),a=a.slice(51),e.push({pubkey:n,short_channel_id:r,fee_base_msat:i,fee_proportional_millionths:o,cltv_expiry_delta:s});return e}function iZ(t){const e=t.slice().reverse().map(i=>[!!(i&1),!!(i&2),!!(i&4),!!(i&8),!!(i&16)]).reduce((i,o)=>i.concat(o),[]);for(;e.length{let s;e[o*2]?s="required":e[o*2+1]?s="supported":s="unsupported",n[i]=s});const r=e.slice(vp.length*2);return n.extra_bits={start_bit:vp.length*2,bits:r,has_required:r.reduce((i,o,s)=>s%2!==0?i||!1:i||o,!1)},n}function LD(t,e){let n,r;if(t.slice(-1).match(/^[munp]$/))n=t.slice(-1),r=t.slice(0,-1);else{if(t.slice(-1).match(/^[^munp0-9]$/))throw new Error("Not a valid multiplier for the amount");r=t}if(!r.match(/^\d+$/))throw new Error("Not a valid human readable amount");const i=BigInt(r),o=n?i*h4/XG[n]:i*h4;if(n==="p"&&i%BigInt(10)!==BigInt(0)||o>eZ)throw new Error("Amount is outside of valid range");return e?o.toString():o}function oZ(t,e){if(typeof t!="string")throw new Error("Lightning Payment Request must be string");if(t.slice(0,2).toLowerCase()!=="ln")throw new Error("Not a proper lightning payment request");const n=[],r=Yi.decode(t,Number.MAX_SAFE_INTEGER);t=t.toLowerCase();const i=r.prefix;let o=r.words,s=t.slice(i.length+1),a=o.slice(-104);o=o.slice(0,-104);let l=i.match(/^ln(\S+?)(\d*)([a-zA-Z]?)$/);if(l&&!l[2]&&(l=i.match(/^ln(\S+)$/)),!l)throw new Error("Not a proper lightning payment request");n.push({name:"lightning_network",letters:"ln"});const u=l[1];let c;if(e){if(e.bech32===void 0||e.pubKeyHash===void 0||e.scriptHash===void 0||!Array.isArray(e.validWitnessVersions))throw new Error("Invalid network");c=e}else switch(u){case l4.bech32:c=l4;break;case u4.bech32:c=u4;break;case c4.bech32:c=c4;break;case f4.bech32:c=f4;break;case d4.bech32:c=d4;break}if(!c||c.bech32!==u)throw new Error("Unknown coin bech32 prefix");n.push({name:"coin_network",letters:u,value:c});const f=l[2];let d;if(f){const g=l[3];d=LD(f+g,!0),n.push({name:"amount",letters:l[2]+l[3],value:d})}else d=null;n.push({name:"separator",letters:"1"});const h=xm(o.slice(0,7));o=o.slice(7),n.push({name:"timestamp",letters:s.slice(0,7),value:h}),s=s.slice(7);let p,m,b,y;for(;o.length>0;){const g=o[0].toString();p=FD[g]||"unknown_tag",m=tZ[g]||nZ(g),o=o.slice(1),b=xm(o.slice(0,2)),o=o.slice(2),y=o.slice(0,b),o=o.slice(b),n.push({name:p,tag:s[0],letters:s.slice(0,3+b),value:m(y)}),s=s.slice(3+b)}n.push({name:"signature",letters:s.slice(0,104),value:_i.encode(Yi.fromWordsUnsafe(a))}),s=s.slice(104),n.push({name:"checksum",letters:s});let v={paymentRequest:t,sections:n,get expiry(){let g=n.find(x=>x.name==="expiry");if(g)return w("timestamp")+g.value},get route_hints(){return n.filter(g=>g.name==="route_hint").map(g=>g.value)}};for(let g in xw)g!=="route_hint"&&Object.defineProperty(v,g,{get(){return w(g)}});return v;function w(g){let x=n.find(k=>k.name===g);return x?x.value:void 0}}var p4={decode:oZ,hrpToMillisat:LD},sZ=["/",":","?","#"],aZ=[".","/","@"];function m4(t,e){for(var n,r=0,i=0,o=0,s=t.length,a=0;s--&&++a&&!(r&&sZ.indexOf(t[a])>-1);)t[a]==="."&&(++r,i=a);for(n=a,a=i;a--;)if(aZ.indexOf(t[a])!==-1){o=a+1;break}if(o===0&&n>3)return t;if(o>0&&o<2)return"";if(e.tld){for(var l=0,u=["/","@"],c=i;c--;)if(u.indexOf(t[c])>-1){l=c+1;break}return YW(()=>import("./index-C18jlTme-DjJJTT2G.js"),[]).then(f=>f.i).then(function(f){return Promise.resolve(f.get(t.slice(l,n)))}).catch(function(f){throw console.error(f),Error("You must install psl library (https://www.npmjs.com/package/psl) to use `tld` option")})}return t.slice(o,n)}function lZ(t,e){if(e===void 0&&(e={}),typeof t=="string")return m4(t,e);if(Array.isArray(t)){for(var n=[],r=t.length,i=0;i({index:t.index,replaceWith:t[2],text:t[0],match:t,data:e}),fZ=/.(jpg|jpeg|gif|png|bmp|svg|webp)$/,dZ=/.(webm|mp4|ogg|mov)$/;function hZ(t,e,n){var r,i,o,s;const a=(s=(o=(i=(r=n==null?void 0:n[t])==null?void 0:r.m)==null?void 0:i.split)==null?void 0:o.call(i,"/"))==null?void 0:s[0];if(a==="image")return"image";if(a==="video")return"video";if(/youtube|youtu.be/.test(t))return"youtube";if(/^https?:\/\/(twitter|x)\.com\/(?:#!\/)?(\w+)\/status(es)?\/(\d+)/.test(t))return"tweet";try{const{pathname:l}=new URL(e);return fZ.test(l)?"image":dZ.test(l)?"video":"text"}catch(l){return console.log("url parser error",l),"text"}}const pZ=/(lnbc[0-9a-z]{10,})/g,mZ=Ri.create({name:"bolt11",group:"block",atom:!0,selectable:!0,draggable:!0,addAttributes(){return{lnbc:{default:null},bolt11:{default:null}}},addStorage(){return{markdown:{serialize(t,e){t.write(e.attrs.lnbc)},parse:{}}}},addCommands(){return{insertBolt11:({lnbc:t})=>({commands:e})=>{const n=p4.decode(t);return e.insertContent({type:this.name,attrs:{bolt11:n,lnbc:t}},{updateSelection:!1})}}},renderHTML(){return["div",{}]},renderText(t){return t.node.attrs.lnbc},addPasteRules(){return[Eh({type:this.type,getAttributes:t=>t.data,find:t=>{const e=[];for(const n of t.matchAll(pZ)){const r=p4.decode(n[0]);e.push(dc(n,{bolt11:r,lnbc:n[0]}))}return e}})]}});async function gZ(t){if(!t.hash)throw new Error("No hash function provided");if(!t.sign)throw new Error("No signer provided");const e=Date.now()/1e3,n=await t.hash(t.file),r=await t.sign({kind:24242,content:`Upload ${t.file.name}`,created_at:e,tags:[["t","upload"],["x",n],["expiration",(e+(t.expiration||6e4)).toString()]]});await new Promise(u=>setTimeout(()=>u(),1e3));const i=JSON.stringify(r),s=`Nostr ${btoa(i)}`,a=await fetch(t.serverUrl+"/upload",{method:"PUT",body:t.file,headers:{authorization:s}}),l=await a.json();if(a.status===200)return l;throw new Error(l.message)}function Ew(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function yZ(t){if(typeof t!="boolean")throw new Error(`Expected boolean, not ${t}`)}function BD(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function bZ(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Ew(t.outputLen),Ew(t.blockLen)}function vZ(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function wZ(t,e){BD(t);const n=e.outputLen;if(t.lengtht instanceof Uint8Array,vb=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),qi=(t,e)=>t<<32-e|t>>>e,kZ=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!kZ)throw new Error("Non little-endian hardware is not supported");const xZ=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function ln(t){if(!s3(t))throw new Error("Uint8Array expected");let e="";for(let n=0;nr+i.length,0));let n=0;return t.forEach(r=>{if(!s3(r))throw new Error("Uint8Array expected");e.set(r,n),n+=r.length}),e}let PD=class{clone(){return this._cloneInto()}};function zD(t){const e=r=>t().update(Vd(r)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function jD(t=32){if(bb&&typeof bb.getRandomValues=="function")return bb.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}function SZ(t,e,n,r){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,n,r);const i=BigInt(32),o=BigInt(4294967295),s=Number(n>>i&o),a=Number(n&o),l=r?4:0,u=r?0:4;t.setUint32(e+l,s,r),t.setUint32(e+u,a,r)}let CZ=class extends PD{constructor(e,n,r,i){super(),this.blockLen=e,this.outputLen=n,this.padOffset=r,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=vb(this.buffer)}update(e){oo.exists(this);const{view:n,buffer:r,blockLen:i}=this;e=Vd(e);const o=e.length;for(let s=0;si-s&&(this.process(r,0),s=0);for(let f=s;fc.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;ft&e^~t&n,AZ=(t,e,n)=>t&e^t&n^e&n,TZ=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ms=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),gs=new Uint32Array(64);let qD=class extends CZ{constructor(){super(64,32,8,!1),this.A=ms[0]|0,this.B=ms[1]|0,this.C=ms[2]|0,this.D=ms[3]|0,this.E=ms[4]|0,this.F=ms[5]|0,this.G=ms[6]|0,this.H=ms[7]|0}get(){const{A:e,B:n,C:r,D:i,E:o,F:s,G:a,H:l}=this;return[e,n,r,i,o,s,a,l]}set(e,n,r,i,o,s,a,l){this.A=e|0,this.B=n|0,this.C=r|0,this.D=i|0,this.E=o|0,this.F=s|0,this.G=a|0,this.H=l|0}process(e,n){for(let f=0;f<16;f++,n+=4)gs[f]=e.getUint32(n,!1);for(let f=16;f<64;f++){const d=gs[f-15],h=gs[f-2],p=qi(d,7)^qi(d,18)^d>>>3,m=qi(h,17)^qi(h,19)^h>>>10;gs[f]=m+gs[f-7]+p+gs[f-16]|0}let{A:r,B:i,C:o,D:s,E:a,F:l,G:u,H:c}=this;for(let f=0;f<64;f++){const d=qi(a,6)^qi(a,11)^qi(a,25),h=c+d+_Z(a,l,u)+TZ[f]+gs[f]|0,m=(qi(r,2)^qi(r,13)^qi(r,22))+AZ(r,i,o)|0;c=u,u=l,l=a,a=s+h|0,s=o,o=i,i=r,r=h+m|0}r=r+this.A|0,i=i+this.B|0,o=o+this.C|0,s=s+this.D|0,a=a+this.E|0,l=l+this.F|0,u=u+this.G|0,c=c+this.H|0,this.set(r,i,o,s,a,l,u,c)}roundClean(){gs.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}},MZ=class extends qD{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}};const Rc=zD(()=>new qD);zD(()=>new MZ);function OZ(t){return!(!t.api_url||t.delegated_to_url&&t.api_url)}async function DZ(t){const e="/.well-known/nostr/nip96.json";let n="";try{const{origin:r}=new URL(t);n=r+e}catch{throw new Error("Invalid URL")}try{const r=await fetch(n);if(!r.ok)throw new Error(`Error fetching ${n}: ${r.statusText}`);const i=await r.json();if(!i)throw new Error("No data");if(!OZ(i))throw new Error("Invalid configuration data");return i}catch{throw new Error("Error fetching.")}}function NZ(t){if(typeof t!="object"||t===null||!t.status||!t.message||t.status!=="success"&&t.status!=="error"&&t.status!=="processing"||typeof t.message!="string"||t.status==="processing"&&!t.processing_url||t.processing_url&&typeof t.processing_url!="string"||t.status==="success"&&!t.nip94_event)return!1;if(t.nip94_event){if(!t.nip94_event.tags||!Array.isArray(t.nip94_event.tags)||t.nip94_event.tags.length===0)return!1;for(const e of t.nip94_event.tags)if(!Array.isArray(e)||e.length!==2||typeof e[0]!="string"||typeof e[1]!="string")return!1;if(!t.nip94_event.tags.find(e=>e[0]==="url")||!t.nip94_event.tags.find(e=>e[0]==="ox"))return!1}return!0}async function $Z(t,e,n,r){const i=new FormData;r&&Object.entries(r).forEach(([s,a])=>{a&&i.append(s,a)}),i.append("file",t);const o=await fetch(e,{method:"POST",headers:{Authorization:n},body:i});if(o.ok===!1)throw o.status===413?new Error("File too large!"):o.status===400?new Error("Bad request! Some fields are missing or invalid!"):o.status===403?new Error("Forbidden! Payload tag does not match the requested file!"):o.status===402?new Error("Payment required!"):new Error("Unknown error in uploading file!");try{const s=await o.json();if(!NZ(s))throw new Error("Invalid response from the server!");return s}catch{throw new Error("Error parsing JSON response!")}}/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Fc(t){if(!Number.isSafeInteger(t))throw new Error(`Wrong integer: ${t}`)}function ss(...t){const e=(i,o)=>s=>i(o(s)),n=Array.from(t).reverse().reduce((i,o)=>i?e(i,o.encode):o.encode,void 0),r=t.reduce((i,o)=>i?e(i,o.decode):o.decode,void 0);return{encode:n,decode:r}}function as(t){return{encode:e=>{if(!Array.isArray(e)||e.length&&typeof e[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return e.map(n=>{if(Fc(n),n<0||n>=t.length)throw new Error(`Digit index outside alphabet: ${n} (alphabet: ${t.length})`);return t[n]})},decode:e=>{if(!Array.isArray(e)||e.length&&typeof e[0]!="string")throw new Error("alphabet.decode input should be array of strings");return e.map(n=>{if(typeof n!="string")throw new Error(`alphabet.decode: not string element=${n}`);const r=t.indexOf(n);if(r===-1)throw new Error(`Unknown letter: "${n}". Allowed: ${t}`);return r})}}}function ls(t=""){if(typeof t!="string")throw new Error("join separator should be string");return{encode:e=>{if(!Array.isArray(e)||e.length&&typeof e[0]!="string")throw new Error("join.encode input should be array of strings");for(let n of e)if(typeof n!="string")throw new Error(`join.encode: non-string input=${n}`);return e.join(t)},decode:e=>{if(typeof e!="string")throw new Error("join.decode input should be string");return e.split(t)}}}function mg(t,e="="){if(Fc(t),typeof e!="string")throw new Error("padding chr should be string");return{encode(n){if(!Array.isArray(n)||n.length&&typeof n[0]!="string")throw new Error("padding.encode input should be array of strings");for(let r of n)if(typeof r!="string")throw new Error(`padding.encode: non-string input=${r}`);for(;n.length*t%8;)n.push(e);return n},decode(n){if(!Array.isArray(n)||n.length&&typeof n[0]!="string")throw new Error("padding.encode input should be array of strings");for(let i of n)if(typeof i!="string")throw new Error(`padding.decode: non-string input=${i}`);let r=n.length;if(r*t%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;r>0&&n[r-1]===e;r--)if(!((r-1)*t%8))throw new Error("Invalid padding: string has too much padding");return n.slice(0,r)}}}function VD(t){if(typeof t!="function")throw new Error("normalize fn should be function");return{encode:e=>e,decode:e=>t(e)}}function g4(t,e,n){if(e<2)throw new Error(`convertRadix: wrong from=${e}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: wrong to=${n}, base cannot be less than 2`);if(!Array.isArray(t))throw new Error("convertRadix: data should be array");if(!t.length)return[];let r=0;const i=[],o=Array.from(t);for(o.forEach(s=>{if(Fc(s),s<0||s>=e)throw new Error(`Wrong integer: ${s}`)});;){let s=0,a=!0;for(let l=r;le?UD(e,t%e):t,Em=(t,e)=>t+(e-UD(t,e));function Sw(t,e,n,r){if(!Array.isArray(t))throw new Error("convertRadix2: data should be array");if(e<=0||e>32)throw new Error(`convertRadix2: wrong from=${e}`);if(n<=0||n>32)throw new Error(`convertRadix2: wrong to=${n}`);if(Em(e,n)>32)throw new Error(`convertRadix2: carry overflow from=${e} to=${n} carryBits=${Em(e,n)}`);let i=0,o=0;const s=2**n-1,a=[];for(const l of t){if(Fc(l),l>=2**e)throw new Error(`convertRadix2: invalid data word=${l} from=${e}`);if(i=i<32)throw new Error(`convertRadix2: carry overflow pos=${o} from=${e}`);for(o+=e;o>=n;o-=n)a.push((i>>o-n&s)>>>0);i&=2**o-1}if(i=i<=e)throw new Error("Excess padding");if(!r&&i)throw new Error(`Non-zero padding: ${i}`);return r&&o>0&&a.push(i>>>0),a}function IZ(t){return Fc(t),{encode:e=>{if(!(e instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return g4(Array.from(e),2**8,t)},decode:e=>{if(!Array.isArray(e)||e.length&&typeof e[0]!="number")throw new Error("radix.decode input should be array of strings");return Uint8Array.from(g4(e,t,2**8))}}}function Ta(t,e=!1){if(Fc(t),t<=0||t>32)throw new Error("radix2: bits should be in (0..32]");if(Em(8,t)>32||Em(t,8)>32)throw new Error("radix2: carry overflow");return{encode:n=>{if(!(n instanceof Uint8Array))throw new Error("radix2.encode input should be Uint8Array");return Sw(Array.from(n),8,t,!e)},decode:n=>{if(!Array.isArray(n)||n.length&&typeof n[0]!="number")throw new Error("radix2.decode input should be array of strings");return Uint8Array.from(Sw(n,t,8,e))}}}function y4(t){if(typeof t!="function")throw new Error("unsafeWrapper fn should be function");return function(...e){try{return t.apply(null,e)}catch{}}}const RZ=ss(Ta(4),as("0123456789ABCDEF"),ls("")),FZ=ss(Ta(5),as("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),mg(5),ls(""));ss(Ta(5),as("0123456789ABCDEFGHIJKLMNOPQRSTUV"),mg(5),ls(""));ss(Ta(5),as("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),ls(""),VD(t=>t.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")));const ko=ss(Ta(6),as("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),mg(6),ls("")),LZ=ss(Ta(6),as("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),mg(6),ls("")),a3=t=>ss(IZ(58),as(t),ls("")),Cw=a3("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");a3("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ");a3("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");const b4=[0,2,3,5,6,7,9,10,11],BZ={encode(t){let e="";for(let n=0;n>25;let n=(t&33554431)<<5;for(let r=0;r>r&1)===1&&(n^=v4[r]);return n}function w4(t,e,n=1){const r=t.length;let i=1;for(let o=0;o126)throw new Error(`Invalid prefix (${t})`);i=uf(i)^s>>5}i=uf(i);for(let o=0;od)throw new TypeError(`Length ${h} exceeds limit ${d}`);return c=c.toLowerCase(),`${c}1${_w.encode(f)}${w4(c,f,e)}`}function a(c,f=90){if(typeof c!="string")throw new Error(`bech32.decode input should be string, not ${typeof c}`);if(c.length<8||f!==!1&&c.length>f)throw new TypeError(`Wrong string length: ${c.length} (${c}). Expected (8..${f})`);const d=c.toLowerCase();if(c!==d&&c!==c.toUpperCase())throw new Error("String must be lowercase or uppercase");c=d;const h=c.lastIndexOf("1");if(h===0||h===-1)throw new Error('Letter "1" must be present between prefix and data only');const p=c.slice(0,h),m=c.slice(h+1);if(m.length<6)throw new Error("Data must be at least 6 characters long");const b=_w.decode(m).slice(0,-6),y=w4(p,b,e);if(!m.endsWith(y))throw new Error(`Invalid checksum in ${c}: expected "${y}"`);return{prefix:p,words:b}}const l=y4(a);function u(c){const{prefix:f,words:d}=a(c,!1);return{prefix:f,words:d,bytes:r(d)}}return{encode:s,decode:a,decodeToBytes:u,decodeUnsafe:l,fromWords:r,fromWordsUnsafe:o,toWords:i}}const pc=HD("bech32");HD("bech32m");const PZ={encode:t=>new TextDecoder().decode(t),decode:t=>new TextEncoder().encode(t)},zZ=ss(Ta(4),as("0123456789abcdef"),ls(""),VD(t=>{if(typeof t!="string"||t.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof t} with length ${t.length}`);return t.toLowerCase()})),jZ={utf8:PZ,hex:zZ,base16:RZ,base32:FZ,base64:ko,base64url:LZ,base58:Cw,base58xmr:BZ};`${Object.keys(jZ).join(", ")}`;function k4(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function WD(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function qZ(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");k4(t.outputLen),k4(t.blockLen)}function Sm(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function VZ(t,e){WD(t);const n=e.outputLen;if(t.lengtht instanceof Uint8Array,kb=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),Vi=(t,e)=>t<<32-e|t>>>e,UZ=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!UZ)throw new Error("Non little-endian hardware is not supported");function HZ(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function l3(t){if(typeof t=="string"&&(t=HZ(t)),!JD(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}function WZ(...t){const e=new Uint8Array(t.reduce((r,i)=>r+i.length,0));let n=0;return t.forEach(r=>{if(!JD(r))throw new Error("Uint8Array expected");e.set(r,n),n+=r.length}),e}class KD{clone(){return this._cloneInto()}}function JZ(t){const e=r=>t().update(l3(r)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function GD(t=32){if(wb&&typeof wb.getRandomValues=="function")return wb.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}function KZ(t,e,n,r){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,n,r);const i=BigInt(32),o=BigInt(4294967295),s=Number(n>>i&o),a=Number(n&o),l=r?4:0,u=r?0:4;t.setUint32(e+l,s,r),t.setUint32(e+u,a,r)}class GZ extends KD{constructor(e,n,r,i){super(),this.blockLen=e,this.outputLen=n,this.padOffset=r,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=kb(this.buffer)}update(e){Sm(this);const{view:n,buffer:r,blockLen:i}=this;e=l3(e);const o=e.length;for(let s=0;si-s&&(this.process(r,0),s=0);for(let f=s;fc.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;ft&e^~t&n,YZ=(t,e,n)=>t&e^t&n^e&n,QZ=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ys=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),bs=new Uint32Array(64);class XZ extends GZ{constructor(){super(64,32,8,!1),this.A=ys[0]|0,this.B=ys[1]|0,this.C=ys[2]|0,this.D=ys[3]|0,this.E=ys[4]|0,this.F=ys[5]|0,this.G=ys[6]|0,this.H=ys[7]|0}get(){const{A:e,B:n,C:r,D:i,E:o,F:s,G:a,H:l}=this;return[e,n,r,i,o,s,a,l]}set(e,n,r,i,o,s,a,l){this.A=e|0,this.B=n|0,this.C=r|0,this.D=i|0,this.E=o|0,this.F=s|0,this.G=a|0,this.H=l|0}process(e,n){for(let f=0;f<16;f++,n+=4)bs[f]=e.getUint32(n,!1);for(let f=16;f<64;f++){const d=bs[f-15],h=bs[f-2],p=Vi(d,7)^Vi(d,18)^d>>>3,m=Vi(h,17)^Vi(h,19)^h>>>10;bs[f]=m+bs[f-7]+p+bs[f-16]|0}let{A:r,B:i,C:o,D:s,E:a,F:l,G:u,H:c}=this;for(let f=0;f<64;f++){const d=Vi(a,6)^Vi(a,11)^Vi(a,25),h=c+d+ZZ(a,l,u)+QZ[f]+bs[f]|0,m=(Vi(r,2)^Vi(r,13)^Vi(r,22))+YZ(r,i,o)|0;c=u,u=l,l=a,a=s+h|0,s=o,o=i,i=r,r=h+m|0}r=r+this.A|0,i=i+this.B|0,o=o+this.C|0,s=s+this.D|0,a=a+this.E|0,l=l+this.F|0,u=u+this.G|0,c=c+this.H|0,this.set(r,i,o,s,a,l,u,c)}roundClean(){bs.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Aw=JZ(()=>new XZ);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ZD=BigInt(0),gg=BigInt(1),eY=BigInt(2),yg=t=>t instanceof Uint8Array,tY=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function mc(t){if(!yg(t))throw new Error("Uint8Array expected");let e="";for(let n=0;nr+i.length,0));let n=0;return t.forEach(r=>{if(!yg(r))throw new Error("Uint8Array expected");e.set(r,n),n+=r.length}),e}function rY(t,e){if(t.length!==e.length)return!1;for(let n=0;nZD;t>>=gg,e+=1);return e}function sY(t,e){return t>>BigInt(e)&gg}const aY=(t,e,n)=>t|(n?gg:ZD)<(eY<new Uint8Array(t),x4=t=>Uint8Array.from(t);function QD(t,e,n){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=xb(t),i=xb(t),o=0;const s=()=>{r.fill(1),i.fill(0),o=0},a=(...f)=>n(i,r,...f),l=(f=xb())=>{i=a(x4([0]),f),r=a(),f.length!==0&&(i=a(x4([1]),f),r=a())},u=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const d=[];for(;f{s(),l(f);let h;for(;!(h=d(u()));)l();return s(),h}}const lY={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||t instanceof Uint8Array,isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function Sh(t,e,n={}){const r=(i,o,s)=>{const a=lY[o];if(typeof a!="function")throw new Error(`Invalid validator "${o}", expected function`);const l=t[i];if(!(s&&l===void 0)&&!a(l,t))throw new Error(`Invalid param ${String(i)}=${l} (${typeof l}), expected ${o}`)};for(const[i,o]of Object.entries(e))r(i,o,!1);for(const[i,o]of Object.entries(n))r(i,o,!0);return t}const uY=Object.freeze(Object.defineProperty({__proto__:null,bitGet:sY,bitLen:oY,bitMask:d3,bitSet:aY,bytesToHex:mc,bytesToNumberBE:Er,bytesToNumberLE:c3,concatBytes:Nl,createHmacDrbg:QD,ensureBytes:Bn,equalBytes:rY,hexToBytes:gc,hexToNumber:u3,numberToBytesBE:ha,numberToBytesLE:f3,numberToHexUnpadded:YD,numberToVarBytesBE:nY,utf8ToBytes:iY,validateObject:Sh},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const dn=BigInt(0),qt=BigInt(1),Ua=BigInt(2),cY=BigInt(3),Tw=BigInt(4),E4=BigInt(5),S4=BigInt(8);BigInt(9);BigInt(16);function _n(t,e){const n=t%e;return n>=dn?n:e+n}function fY(t,e,n){if(n<=dn||e 0");if(n===qt)return dn;let r=qt;for(;e>dn;)e&qt&&(r=r*t%n),t=t*t%n,e>>=qt;return r}function Zr(t,e,n){let r=t;for(;e-- >dn;)r*=r,r%=n;return r}function Mw(t,e){if(t===dn||e<=dn)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let n=_n(t,e),r=e,i=dn,o=qt;for(;n!==dn;){const a=r/n,l=r%n,u=i-o*a;r=n,n=l,i=o,o=u}if(r!==qt)throw new Error("invert: does not exist");return _n(i,e)}function dY(t){const e=(t-qt)/Ua;let n,r,i;for(n=t-qt,r=0;n%Ua===dn;n/=Ua,r++);for(i=Ua;i(r[i]="function",r),e);return Sh(t,n)}function gY(t,e,n){if(n 0");if(n===dn)return t.ONE;if(n===qt)return e;let r=t.ONE,i=e;for(;n>dn;)n&qt&&(r=t.mul(r,i)),i=t.sqr(i),n>>=qt;return r}function yY(t,e){const n=new Array(e.length),r=e.reduce((o,s,a)=>t.is0(s)?o:(n[a]=o,t.mul(o,s)),t.ONE),i=t.inv(r);return e.reduceRight((o,s,a)=>t.is0(s)?o:(n[a]=t.mul(o,n[a]),t.mul(o,s)),i),n}function XD(t,e){const n=e!==void 0?e:t.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function bY(t,e,n=!1,r={}){if(t<=dn)throw new Error(`Expected Field ORDER > 0, got ${t}`);const{nBitLength:i,nByteLength:o}=XD(t,e);if(o>2048)throw new Error("Field lengths over 2048 bytes are not supported");const s=hY(t),a=Object.freeze({ORDER:t,BITS:i,BYTES:o,MASK:d3(i),ZERO:dn,ONE:qt,create:l=>_n(l,t),isValid:l=>{if(typeof l!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof l}`);return dn<=l&&ll===dn,isOdd:l=>(l&qt)===qt,neg:l=>_n(-l,t),eql:(l,u)=>l===u,sqr:l=>_n(l*l,t),add:(l,u)=>_n(l+u,t),sub:(l,u)=>_n(l-u,t),mul:(l,u)=>_n(l*u,t),pow:(l,u)=>gY(a,l,u),div:(l,u)=>_n(l*Mw(u,t),t),sqrN:l=>l*l,addN:(l,u)=>l+u,subN:(l,u)=>l-u,mulN:(l,u)=>l*u,inv:l=>Mw(l,t),sqrt:r.sqrt||(l=>s(a,l)),invertBatch:l=>yY(a,l),cmov:(l,u,c)=>c?u:l,toBytes:l=>n?f3(l,o):ha(l,o),fromBytes:l=>{if(l.length!==o)throw new Error(`Fp.fromBytes: expected ${o}, got ${l.length}`);return n?c3(l):Er(l)}});return Object.freeze(a)}function eN(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function tN(t){const e=eN(t);return e+Math.ceil(e/2)}function vY(t,e,n=!1){const r=t.length,i=eN(e),o=tN(e);if(r<16||r1024)throw new Error(`expected ${o}-1024 bytes of input, got ${r}`);const s=n?Er(t):c3(t),a=_n(s,e-qt)+qt;return n?f3(a,i):ha(a,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const wY=BigInt(0),Eb=BigInt(1);function kY(t,e){const n=(i,o)=>{const s=o.negate();return i?s:o},r=i=>{const o=Math.ceil(e/i)+1,s=2**(i-1);return{windows:o,windowSize:s}};return{constTimeNegate:n,unsafeLadder(i,o){let s=t.ZERO,a=i;for(;o>wY;)o&Eb&&(s=s.add(a)),a=a.double(),o>>=Eb;return s},precomputeWindow(i,o){const{windows:s,windowSize:a}=r(o),l=[];let u=i,c=u;for(let f=0;f>=h,b>l&&(b-=d,s+=Eb);const y=m,v=m+Math.abs(b)-1,w=p%2!==0,g=b<0;b===0?c=c.add(n(w,o[y])):u=u.add(n(g,o[v]))}return{p:u,f:c}},wNAFCached(i,o,s,a){const l=i._WINDOW_SIZE||1;let u=o.get(i);return u||(u=this.precomputeWindow(i,l),l!==1&&o.set(i,a(u))),this.wNAF(l,u,s)}}}function nN(t){return mY(t.Fp),Sh(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...XD(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function xY(t){const e=nN(t);Sh(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:i}=e;if(n){if(!r.eql(i,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:EY,hexToBytes:SY}=uY,Xa={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(t){const{Err:e}=Xa;if(t.length<2||t[0]!==2)throw new e("Invalid signature integer tag");const n=t[1],r=t.subarray(2,n+2);if(!n||r.length!==n)throw new e("Invalid signature integer: wrong length");if(r[0]&128)throw new e("Invalid signature integer: negative");if(r[0]===0&&!(r[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:EY(r),l:t.subarray(n+2)}},toSig(t){const{Err:e}=Xa,n=typeof t=="string"?SY(t):t;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let r=n.length;if(r<2||n[0]!=48)throw new e("Invalid signature tag");if(n[1]!==r-2)throw new e("Invalid signature: incorrect length");const{d:i,l:o}=Xa._parseInt(n.subarray(2)),{d:s,l:a}=Xa._parseInt(o);if(a.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s}},hexFromSig(t){const e=u=>Number.parseInt(u[0],16)&8?"00"+u:u,n=u=>{const c=u.toString(16);return c.length&1?`0${c}`:c},r=e(n(t.s)),i=e(n(t.r)),o=r.length/2,s=i.length/2,a=n(o),l=n(s);return`30${n(s+o+4)}02${l}${i}02${a}${r}`}},Lo=BigInt(0),ti=BigInt(1);BigInt(2);const C4=BigInt(3);BigInt(4);function CY(t){const e=xY(t),{Fp:n}=e,r=e.toBytes||((p,m,b)=>{const y=m.toAffine();return Nl(Uint8Array.from([4]),n.toBytes(y.x),n.toBytes(y.y))}),i=e.fromBytes||(p=>{const m=p.subarray(1),b=n.fromBytes(m.subarray(0,n.BYTES)),y=n.fromBytes(m.subarray(n.BYTES,2*n.BYTES));return{x:b,y}});function o(p){const{a:m,b}=e,y=n.sqr(p),v=n.mul(y,p);return n.add(n.add(v,n.mul(p,m)),b)}if(!n.eql(n.sqr(e.Gy),o(e.Gx)))throw new Error("bad generator point: equation left != right");function s(p){return typeof p=="bigint"&&Lon.eql(w,n.ZERO);return v(b)&&v(y)?f.ZERO:new f(b,y,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(m){const b=n.invertBatch(m.map(y=>y.pz));return m.map((y,v)=>y.toAffine(b[v])).map(f.fromAffine)}static fromHex(m){const b=f.fromAffine(i(Bn("pointHex",m)));return b.assertValidity(),b}static fromPrivateKey(m){return f.BASE.multiply(l(m))}_setWindowSize(m){this._WINDOW_SIZE=m,u.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!n.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:m,y:b}=this.toAffine();if(!n.isValid(m)||!n.isValid(b))throw new Error("bad point: x or y not FE");const y=n.sqr(b),v=o(m);if(!n.eql(y,v))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:m}=this.toAffine();if(n.isOdd)return!n.isOdd(m);throw new Error("Field doesn't support isOdd")}equals(m){c(m);const{px:b,py:y,pz:v}=this,{px:w,py:g,pz:x}=m,k=n.eql(n.mul(b,x),n.mul(w,v)),E=n.eql(n.mul(y,x),n.mul(g,v));return k&&E}negate(){return new f(this.px,n.neg(this.py),this.pz)}double(){const{a:m,b}=e,y=n.mul(b,C4),{px:v,py:w,pz:g}=this;let x=n.ZERO,k=n.ZERO,E=n.ZERO,D=n.mul(v,v),O=n.mul(w,w),N=n.mul(g,g),C=n.mul(v,w);return C=n.add(C,C),E=n.mul(v,g),E=n.add(E,E),x=n.mul(m,E),k=n.mul(y,N),k=n.add(x,k),x=n.sub(O,k),k=n.add(O,k),k=n.mul(x,k),x=n.mul(C,x),E=n.mul(y,E),N=n.mul(m,N),C=n.sub(D,N),C=n.mul(m,C),C=n.add(C,E),E=n.add(D,D),D=n.add(E,D),D=n.add(D,N),D=n.mul(D,C),k=n.add(k,D),N=n.mul(w,g),N=n.add(N,N),D=n.mul(N,C),x=n.sub(x,D),E=n.mul(N,O),E=n.add(E,E),E=n.add(E,E),new f(x,k,E)}add(m){c(m);const{px:b,py:y,pz:v}=this,{px:w,py:g,pz:x}=m;let k=n.ZERO,E=n.ZERO,D=n.ZERO;const O=e.a,N=n.mul(e.b,C4);let C=n.mul(b,w),R=n.mul(y,g),T=n.mul(v,x),q=n.add(b,y),A=n.add(w,g);q=n.mul(q,A),A=n.add(C,R),q=n.sub(q,A),A=n.add(b,v);let S=n.add(w,x);return A=n.mul(A,S),S=n.add(C,T),A=n.sub(A,S),S=n.add(y,v),k=n.add(g,x),S=n.mul(S,k),k=n.add(R,T),S=n.sub(S,k),D=n.mul(O,A),k=n.mul(N,T),D=n.add(k,D),k=n.sub(R,D),D=n.add(R,D),E=n.mul(k,D),R=n.add(C,C),R=n.add(R,C),T=n.mul(O,T),A=n.mul(N,A),R=n.add(R,T),T=n.sub(C,T),T=n.mul(O,T),A=n.add(A,T),C=n.mul(R,A),E=n.add(E,C),C=n.mul(S,A),k=n.mul(q,k),k=n.sub(k,C),C=n.mul(q,R),D=n.mul(S,D),D=n.add(D,C),new f(k,E,D)}subtract(m){return this.add(m.negate())}is0(){return this.equals(f.ZERO)}wNAF(m){return h.wNAFCached(this,u,m,b=>{const y=n.invertBatch(b.map(v=>v.pz));return b.map((v,w)=>v.toAffine(y[w])).map(f.fromAffine)})}multiplyUnsafe(m){const b=f.ZERO;if(m===Lo)return b;if(a(m),m===ti)return this;const{endo:y}=e;if(!y)return h.unsafeLadder(this,m);let{k1neg:v,k1:w,k2neg:g,k2:x}=y.splitScalar(m),k=b,E=b,D=this;for(;w>Lo||x>Lo;)w&ti&&(k=k.add(D)),x&ti&&(E=E.add(D)),D=D.double(),w>>=ti,x>>=ti;return v&&(k=k.negate()),g&&(E=E.negate()),E=new f(n.mul(E.px,y.beta),E.py,E.pz),k.add(E)}multiply(m){a(m);let b=m,y,v;const{endo:w}=e;if(w){const{k1neg:g,k1:x,k2neg:k,k2:E}=w.splitScalar(b);let{p:D,f:O}=this.wNAF(x),{p:N,f:C}=this.wNAF(E);D=h.constTimeNegate(g,D),N=h.constTimeNegate(k,N),N=new f(n.mul(N.px,w.beta),N.py,N.pz),y=D.add(N),v=O.add(C)}else{const{p:g,f:x}=this.wNAF(b);y=g,v=x}return f.normalizeZ([y,v])[0]}multiplyAndAddUnsafe(m,b,y){const v=f.BASE,w=(x,k)=>k===Lo||k===ti||!x.equals(v)?x.multiplyUnsafe(k):x.multiply(k),g=w(this,b).add(w(m,y));return g.is0()?void 0:g}toAffine(m){const{px:b,py:y,pz:v}=this,w=this.is0();m==null&&(m=w?n.ONE:n.inv(v));const g=n.mul(b,m),x=n.mul(y,m),k=n.mul(v,m);if(w)return{x:n.ZERO,y:n.ZERO};if(!n.eql(k,n.ONE))throw new Error("invZ was invalid");return{x:g,y:x}}isTorsionFree(){const{h:m,isTorsionFree:b}=e;if(m===ti)return!0;if(b)return b(f,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:m,clearCofactor:b}=e;return m===ti?this:b?b(f,this):this.multiplyUnsafe(e.h)}toRawBytes(m=!0){return this.assertValidity(),r(f,this,m)}toHex(m=!0){return mc(this.toRawBytes(m))}}f.BASE=new f(e.Gx,e.Gy,n.ONE),f.ZERO=new f(n.ZERO,n.ONE,n.ZERO);const d=e.nBitLength,h=kY(f,e.endo?Math.ceil(d/2):d);return{CURVE:e,ProjectivePoint:f,normPrivateKeyToScalar:l,weierstrassEquation:o,isWithinCurveOrder:s}}function _Y(t){const e=nN(t);return Sh(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function AY(t){const e=_Y(t),{Fp:n,n:r}=e,i=n.BYTES+1,o=2*n.BYTES+1;function s(A){return Lomc(ha(A,e.nByteLength));function p(A){const S=r>>ti;return A>S}function m(A){return p(A)?a(-A):A}const b=(A,S,P)=>Er(A.slice(S,P));class y{constructor(S,P,B){this.r=S,this.s=P,this.recovery=B,this.assertValidity()}static fromCompact(S){const P=e.nByteLength;return S=Bn("compactSignature",S,P*2),new y(b(S,0,P),b(S,P,2*P))}static fromDER(S){const{r:P,s:B}=Xa.toSig(Bn("DER",S));return new y(P,B)}assertValidity(){if(!d(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!d(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(S){return new y(this.r,this.s,S)}recoverPublicKey(S){const{r:P,s:B,recovery:j}=this,z=E(Bn("msgHash",S));if(j==null||![0,1,2,3].includes(j))throw new Error("recovery id invalid");const J=j===2||j===3?P+e.n:P;if(J>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const K=j&1?"03":"02",ae=u.fromHex(K+h(J)),fe=l(J),ke=a(-z*fe),ve=a(B*fe),xe=u.BASE.multiplyAndAddUnsafe(ae,ke,ve);if(!xe)throw new Error("point at infinify");return xe.assertValidity(),xe}hasHighS(){return p(this.s)}normalizeS(){return this.hasHighS()?new y(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return gc(this.toDERHex())}toDERHex(){return Xa.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return gc(this.toCompactHex())}toCompactHex(){return h(this.r)+h(this.s)}}const v={isValidPrivateKey(A){try{return c(A),!0}catch{return!1}},normPrivateKeyToScalar:c,randomPrivateKey:()=>{const A=tN(e.n);return vY(e.randomBytes(A),e.n)},precompute(A=8,S=u.BASE){return S._setWindowSize(A),S.multiply(BigInt(3)),S}};function w(A,S=!0){return u.fromPrivateKey(A).toRawBytes(S)}function g(A){const S=A instanceof Uint8Array,P=typeof A=="string",B=(S||P)&&A.length;return S?B===i||B===o:P?B===2*i||B===2*o:A instanceof u}function x(A,S,P=!0){if(g(A))throw new Error("first arg must be private key");if(!g(S))throw new Error("second arg must be public key");return u.fromHex(S).multiply(c(A)).toRawBytes(P)}const k=e.bits2int||function(A){const S=Er(A),P=A.length*8-e.nBitLength;return P>0?S>>BigInt(P):S},E=e.bits2int_modN||function(A){return a(k(A))},D=d3(e.nBitLength);function O(A){if(typeof A!="bigint")throw new Error("bigint expected");if(!(Lo<=A&&AOe in P))throw new Error("sign() legacy options not supported");const{hash:B,randomBytes:j}=e;let{lowS:z,prehash:J,extraEntropy:K}=P;z==null&&(z=!0),A=Bn("msgHash",A),J&&(A=Bn("prehashed msgHash",B(A)));const ae=E(A),fe=c(S),ke=[O(fe),O(ae)];if(K!=null){const Oe=K===!0?j(n.BYTES):K;ke.push(Bn("extraEntropy",Oe))}const ve=Nl(...ke),xe=ae;function Se(Oe){const Fe=k(Oe);if(!d(Fe))return;const mt=l(Fe),Ce=u.BASE.multiply(Fe).toAffine(),pe=a(Ce.x);if(pe===Lo)return;const De=a(mt*a(xe+pe*fe));if(De===Lo)return;let Le=(Ce.x===pe?0:2)|Number(Ce.y&ti),Ge=De;return z&&p(De)&&(Ge=m(De),Le^=1),new y(pe,Ge,Le)}return{seed:ve,k2sig:Se}}const C={lowS:e.lowS,prehash:!1},R={lowS:e.lowS,prehash:!1};function T(A,S,P=C){const{seed:B,k2sig:j}=N(A,S,P),z=e;return QD(z.hash.outputLen,z.nByteLength,z.hmac)(B,j)}u.BASE._setWindowSize(8);function q(A,S,P,B=R){var j;const z=A;if(S=Bn("msgHash",S),P=Bn("publicKey",P),"strict"in B)throw new Error("options.strict was renamed to lowS");const{lowS:J,prehash:K}=B;let ae,fe;try{if(typeof z=="string"||z instanceof Uint8Array)try{ae=y.fromDER(z)}catch(pe){if(!(pe instanceof Xa.Err))throw pe;ae=y.fromCompact(z)}else if(typeof z=="object"&&typeof z.r=="bigint"&&typeof z.s=="bigint"){const{r:pe,s:De}=z;ae=new y(pe,De)}else throw new Error("PARSE");fe=u.fromHex(P)}catch(pe){if(pe.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(J&&ae.hasHighS())return!1;K&&(S=e.hash(S));const{r:ke,s:ve}=ae,xe=E(S),Se=l(ve),Oe=a(xe*Se),Fe=a(ke*Se),mt=(j=u.BASE.multiplyAndAddUnsafe(fe,Oe,Fe))==null?void 0:j.toAffine();return mt?a(mt.x)===ke:!1}return{CURVE:e,getPublicKey:w,getSharedSecret:x,sign:T,verify:q,ProjectivePoint:u,Signature:y,utils:v}}let rN=class extends KD{constructor(e,n){super(),this.finished=!1,this.destroyed=!1,qZ(e);const r=l3(n);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,o=new Uint8Array(i);o.set(r.length>i?e.create().update(r).digest():r);for(let s=0;snew rN(t,e).update(n).digest();iN.create=(t,e)=>new rN(t,e);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function TY(t){return{hash:t,hmac:(e,...n)=>iN(t,e,WZ(...n)),randomBytes:GD}}function MY(t,e){const n=r=>AY({...t,...TY(r)});return Object.freeze({...n(e),create:n})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const bg=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Cm=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),oN=BigInt(1),_m=BigInt(2),_4=(t,e)=>(t+e/_m)/e;function sN(t){const e=bg,n=BigInt(3),r=BigInt(6),i=BigInt(11),o=BigInt(22),s=BigInt(23),a=BigInt(44),l=BigInt(88),u=t*t*t%e,c=u*u*t%e,f=Zr(c,n,e)*c%e,d=Zr(f,n,e)*c%e,h=Zr(d,_m,e)*u%e,p=Zr(h,i,e)*h%e,m=Zr(p,o,e)*p%e,b=Zr(m,a,e)*m%e,y=Zr(b,l,e)*b%e,v=Zr(y,a,e)*m%e,w=Zr(v,n,e)*c%e,g=Zr(w,s,e)*p%e,x=Zr(g,r,e)*u%e,k=Zr(x,_m,e);if(!Ow.eql(Ow.sqr(k),t))throw new Error("Cannot find square root");return k}const Ow=bY(bg,void 0,void 0,{sqrt:sN}),Lc=MY({a:BigInt(0),b:BigInt(7),Fp:Ow,n:Cm,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=Cm,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-oN*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=n,s=BigInt("0x100000000000000000000000000000000"),a=_4(o*t,e),l=_4(-r*t,e);let u=_n(t-a*n-l*i,e),c=_n(-a*r-l*o,e);const f=u>s,d=c>s;if(f&&(u=e-u),d&&(c=e-c),u>s||c>s)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:f,k1:u,k2neg:d,k2:c}}}},Aw),vg=BigInt(0),aN=t=>typeof t=="bigint"&&vgtypeof t=="bigint"&&vgi.charCodeAt(0)));n=Nl(r,r),A4[t]=n}return Aw(Nl(n,...e))}const h3=t=>t.toRawBytes(!0).slice(1),Dw=t=>ha(t,32),Sb=t=>_n(t,bg),Ud=t=>_n(t,Cm),p3=Lc.ProjectivePoint,DY=(t,e,n)=>p3.BASE.multiplyAndAddUnsafe(t,e,n);function Nw(t){let e=Lc.utils.normPrivateKeyToScalar(t),n=p3.fromPrivateKey(e);return{scalar:n.hasEvenY()?e:Ud(-e),bytes:h3(n)}}function lN(t){if(!aN(t))throw new Error("bad x: need 0 < x < p");const e=Sb(t*t),n=Sb(e*t+BigInt(7));let r=sN(n);r%_m!==vg&&(r=Sb(-r));const i=new p3(t,r,oN);return i.assertValidity(),i}function uN(...t){return Ud(Er(Am("BIP0340/challenge",...t)))}function NY(t){return Nw(t).bytes}function $Y(t,e,n=GD(32)){const r=Bn("message",t),{bytes:i,scalar:o}=Nw(e),s=Bn("auxRand",n,32),a=Dw(o^Er(Am("BIP0340/aux",s))),l=Am("BIP0340/nonce",a,i,r),u=Ud(Er(l));if(u===vg)throw new Error("sign failed: k is zero");const{bytes:c,scalar:f}=Nw(u),d=uN(c,i,r),h=new Uint8Array(64);if(h.set(c,0),h.set(Dw(Ud(f+d*o)),32),!cN(h,r,i))throw new Error("sign: Invalid signature produced");return h}function cN(t,e,n){const r=Bn("signature",t,64),i=Bn("message",e),o=Bn("publicKey",n,32);try{const s=lN(Er(o)),a=Er(r.subarray(0,32));if(!aN(a))return!1;const l=Er(r.subarray(32,64));if(!OY(l))return!1;const u=uN(Dw(a),h3(s),i),c=DY(s,l,Ud(-u));return!(!c||!c.hasEvenY()||c.toAffine().x!==a)}catch{return!1}}const eo={getPublicKey:NY,sign:$Y,verify:cN,utils:{randomPrivateKey:Lc.utils.randomPrivateKey,lift_x:lN,pointToBytes:h3,numberToBytesBE:ha,bytesToNumberBE:Er,taggedHash:Am,mod:_n}};var IY=27235,Gl=Symbol("verified"),RY=t=>t instanceof Object;function FY(t){if(!RY(t)||typeof t.kind!="number"||typeof t.content!="string"||typeof t.created_at!="number"||typeof t.pubkey!="string"||!t.pubkey.match(/^[a-f0-9]{64}$/)||!Array.isArray(t.tags))return!1;for(let e=0;ef[0]==="url"))==null?void 0:r[1])||"",c=((o=(i=l.nip94_event)==null?void 0:i.tags.find(f=>f[0]==="x"))==null?void 0:o[1])||"PROCESSING";return{url:u,sha256:c}}catch(s){throw new Error(s)}}function qY(t){return Array.from(new Uint8Array(t)).map(e=>e.toString(16).padStart(2,"0")).join("")}const VY=is.create({name:"fileUpload",addOptions(){return{allowedMimeTypes:["image/jpeg","image/png","image/gif","video/mp4","video/mpeg","video/webm"],immediateUpload:!1,expiration:6e4,async hash(t){return qY(await crypto.subtle.digest("SHA-256",await t.arrayBuffer()))},onDrop(){},onComplete(){}}},addCommands(){return{selectFile:()=>t=>(t.tr.setMeta("selectFiles",!0),!0),uploadFiles:()=>t=>(t.tr.setMeta("uploadFiles",!0),!0)}},addProseMirrorPlugins(){const t=new UY(this.editor,this.options);return[new ns({key:new rs("fileUploadPlugin"),state:{init(){return{}},apply(e){return setTimeout(()=>{e.getMeta("selectFiles")?(t.selectFile(),e.setMeta("selectFiles",null)):e.getMeta("uploadFiles")&&(t.uploadFiles(),e.setMeta("uploadFiles",null))}),{}}},props:{handleDrop:(e,n)=>t.handleDrop(n)}})]}});class UY{constructor(e,n){this.editor=e,this.options=n}get view(){return this.editor.view}addFile(e,n){if(!this.options.allowedMimeTypes.includes(e.type))return!1;const{tr:r}=this.view.state,[i]=e.type.split("/"),o=this.view.state.schema.nodes[i].create({file:e,src:URL.createObjectURL(e),alt:""});return r.insert(n,o),this.view.dispatch(r),this.options.immediateUpload&&this.upload(o,n),this.options.onDrop(this.editor,e,n),!0}findNodes(e){const n=[];return this.view.state.doc.descendants((r,i)=>{(r.type.name==="image"||r.type.name==="video")&&(r.attrs.sha256||(r.attrs.uploading||!1)===e&&n.push([r,i]))}),n}updateNodeAttributes(e,n){const{tr:r}=this.view.state;Object.entries(n).forEach(([i,o])=>o!==void 0&&r.setNodeAttribute(e,i,o)),this.view.dispatch(r)}onUploadDone(e,n){this.findNodes(!0).forEach(([r,i])=>{r.attrs.src===e.attrs.src&&this.updateNodeAttributes(i,{uploading:!1,src:n.url,sha256:n.sha256,uploadError:n.error})})}async upload(e,n){const{sign:r,hash:i,expiration:o}=this.options,{file:s,alt:a,uploadType:l,uploadUrl:u}=e.attrs;this.updateNodeAttributes(n,{uploading:!0,uploadError:null});try{if(l==="nip96"){const c=await jY({file:s,alt:a,sign:r,serverUrl:u});this.onUploadDone(e,c)}else{const c=await gZ({file:s,serverUrl:u,hash:i,sign:r,expiration:o});this.onUploadDone(e,c)}}catch(c){const f=c;throw this.onUploadDone(e,{error:f}),new Error(f)}}async uploadFiles(){const e=this.findNodes(!1).map(([n,r])=>this.upload(n,r));try{await Promise.all(e),this.options.onComplete(this.editor)}catch(n){console.error(n)}}selectFile(){const e=document.createElement("input");e.type="file",e.multiple=!0,e.accept=this.options.allowedMimeTypes.join(","),e.onchange=n=>{const r=n.target.files;r&&Array.from(r).forEach(i=>{if(i){const o=this.view.state.selection.from+1;this.addFile(i,o)}})},e.click()}handleDrop(e){var n,r,i;e.preventDefault();const o=(n=this.view.posAtCoords({left:e.clientX,top:e.clientY}))==null?void 0:n.pos;if(o===void 0)return!1;const s=(i=(r=e.dataTransfer)==null?void 0:r.files)==null?void 0:i[0];s&&this.addFile(s,o)}}const T4={};function HY(t){let e=T4[t];if(e)return e;e=T4[t]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);e.push(r)}for(let n=0;n=55296&&c<=57343?i+="���":i+=String.fromCharCode(c),o+=6;continue}}if((a&248)===240&&o+91114111?i+="����":(f-=65536,i+=String.fromCharCode(55296+(f>>10),56320+(f&1023))),o+=9;continue}}i+="�"}return i})}yc.defaultChars=";/?:@&=+$,#";yc.componentChars="";const M4={};function WY(t){let e=M4[t];if(e)return e;e=M4[t]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);/^[0-9a-z]$/i.test(r)?e.push(r):e.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n"u"&&(n=!0);const r=WY(e);let i="";for(let o=0,s=t.length;o=55296&&a<=57343){if(a>=55296&&a<=56319&&o+1=56320&&l<=57343){i+=encodeURIComponent(t[o]+t[o+1]),o++;continue}}i+="%EF%BF%BD";continue}i+=encodeURIComponent(t[o])}return i}Ch.defaultChars=";/?:@&=+$,-_.!~*'()#";Ch.componentChars="-_.!~*'()";function m3(t){let e="";return e+=t.protocol||"",e+=t.slashes?"//":"",e+=t.auth?t.auth+"@":"",t.hostname&&t.hostname.indexOf(":")!==-1?e+="["+t.hostname+"]":e+=t.hostname||"",e+=t.port?":"+t.port:"",e+=t.pathname||"",e+=t.search||"",e+=t.hash||"",e}function Tm(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const JY=/^([a-z0-9.+-]+:)/i,KY=/:[0-9]*$/,GY=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,ZY=["<",">",'"',"`"," ","\r",` -`," "],YY=["{","}","|","\\","^","`"].concat(ZY),QY=["'"].concat(YY),O4=["%","/","?",";","#"].concat(QY),D4=["/","?","#"],XY=255,N4=/^[+a-z0-9A-Z_-]{0,63}$/,eQ=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,$4={javascript:!0,"javascript:":!0},I4={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function g3(t,e){if(t&&t instanceof Tm)return t;const n=new Tm;return n.parse(t,e),n}Tm.prototype.parse=function(t,e){let n,r,i,o=t;if(o=o.trim(),!e&&t.split("#").length===1){const u=GY.exec(o);if(u)return this.pathname=u[1],u[2]&&(this.search=u[2]),this}let s=JY.exec(o);if(s&&(s=s[0],n=s.toLowerCase(),this.protocol=s,o=o.substr(s.length)),(e||s||o.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i=o.substr(0,2)==="//",i&&!(s&&$4[s])&&(o=o.substr(2),this.slashes=!0)),!$4[s]&&(i||s&&!I4[s])){let u=-1;for(let p=0;p127?v+="x":v+=y[w];if(!v.match(N4)){const w=p.slice(0,m),g=p.slice(m+1),x=y.match(eQ);x&&(w.push(x[1]),g.unshift(x[2])),g.length&&(o=g.join(".")+o),this.hostname=w.join(".");break}}}}this.hostname.length>XY&&(this.hostname=""),h&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const a=o.indexOf("#");a!==-1&&(this.hash=o.substr(a),o=o.slice(0,a));const l=o.indexOf("?");return l!==-1&&(this.search=o.substr(l),o=o.slice(0,l)),o&&(this.pathname=o),I4[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};Tm.prototype.parseHost=function(t){let e=KY.exec(t);e&&(e=e[0],e!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};const tQ=Object.freeze(Object.defineProperty({__proto__:null,decode:yc,encode:Ch,format:m3,parse:g3},Symbol.toStringTag,{value:"Module"})),dN=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,hN=/[\0-\x1F\x7F-\x9F]/,nQ=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,y3=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,pN=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,mN=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,rQ=Object.freeze(Object.defineProperty({__proto__:null,Any:dN,Cc:hN,Cf:nQ,P:y3,S:pN,Z:mN},Symbol.toStringTag,{value:"Module"})),iQ=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(t=>t.charCodeAt(0))),oQ=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(t=>t.charCodeAt(0)));var _b;const sQ=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),aQ=(_b=String.fromCodePoint)!==null&&_b!==void 0?_b:function(t){let e="";return t>65535&&(t-=65536,e+=String.fromCharCode(t>>>10&1023|55296),t=56320|t&1023),e+=String.fromCharCode(t),e};function lQ(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=sQ.get(t))!==null&&e!==void 0?e:t}var cn;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(cn||(cn={}));const uQ=32;var Hs;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(Hs||(Hs={}));function $w(t){return t>=cn.ZERO&&t<=cn.NINE}function cQ(t){return t>=cn.UPPER_A&&t<=cn.UPPER_F||t>=cn.LOWER_A&&t<=cn.LOWER_F}function fQ(t){return t>=cn.UPPER_A&&t<=cn.UPPER_Z||t>=cn.LOWER_A&&t<=cn.LOWER_Z||$w(t)}function dQ(t){return t===cn.EQUALS||fQ(t)}var on;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(on||(on={}));var Bs;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(Bs||(Bs={}));let hQ=class{constructor(e,n,r){this.decodeTree=e,this.emitCodePoint=n,this.errors=r,this.state=on.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Bs.Strict}startEntity(e){this.decodeMode=e,this.state=on.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case on.EntityStart:return e.charCodeAt(n)===cn.NUM?(this.state=on.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=on.NamedEntity,this.stateNamedEntity(e,n));case on.NumericStart:return this.stateNumericStart(e,n);case on.NumericDecimal:return this.stateNumericDecimal(e,n);case on.NumericHex:return this.stateNumericHex(e,n);case on.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|uQ)===cn.LOWER_X?(this.state=on.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=on.NumericDecimal,this.stateNumericDecimal(e,n))}addToNumericResult(e,n,r,i){if(n!==r){const o=r-n;this.result=this.result*Math.pow(i,o)+parseInt(e.substr(n,o),i),this.consumed+=o}}stateNumericHex(e,n){const r=n;for(;n>14;for(;n>14,o!==0){if(s===cn.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==Bs.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:n,decodeTree:r}=this,i=(r[n]&Hs.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[e]&~Hs.VALUE_LENGTH:i[e+1],r),n===3&&this.emitCodePoint(i[e+2],r),r}end(){var e;switch(this.state){case on.NamedEntity:return this.result!==0&&(this.decodeMode!==Bs.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case on.NumericDecimal:return this.emitNumericEntity(0,2);case on.NumericHex:return this.emitNumericEntity(0,3);case on.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case on.EntityStart:return 0}}};function gN(t){let e="";const n=new hQ(t,r=>e+=aQ(r));return function(i,o){let s=0,a=0;for(;(a=i.indexOf("&",a))>=0;){e+=i.slice(s,a),n.startEntity(o);const u=n.write(i,a+1);if(u<0){s=a+n.end();break}s=a+u,a=u===0?s+1:s}const l=e+i.slice(s);return e="",l}}function pQ(t,e,n,r){const i=(e&Hs.BRANCH_LENGTH)>>7,o=e&Hs.JUMP_TABLE;if(i===0)return o!==0&&r===o?n:-1;if(o){const l=r-o;return l<0||l>=i?-1:t[n+l]-1}let s=n,a=s+i-1;for(;s<=a;){const l=s+a>>>1,u=t[l];if(ur)a=l-1;else return t[l+i]}return-1}const mQ=gN(iQ);gN(oQ);function yN(t,e=Bs.Legacy){return mQ(t,e)}function gQ(t){return Object.prototype.toString.call(t)}function b3(t){return gQ(t)==="[object String]"}const yQ=Object.prototype.hasOwnProperty;function bQ(t,e){return yQ.call(t,e)}function kg(t){return Array.prototype.slice.call(arguments,1).forEach(function(n){if(n){if(typeof n!="object")throw new TypeError(n+"must be object");Object.keys(n).forEach(function(r){t[r]=n[r]})}}),t}function bN(t,e,n){return[].concat(t.slice(0,e),n,t.slice(e+1))}function v3(t){return!(t>=55296&&t<=57343||t>=64976&&t<=65007||(t&65535)===65535||(t&65535)===65534||t>=0&&t<=8||t===11||t>=14&&t<=31||t>=127&&t<=159||t>1114111)}function Mm(t){if(t>65535){t-=65536;const e=55296+(t>>10),n=56320+(t&1023);return String.fromCharCode(e,n)}return String.fromCharCode(t)}const vN=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,vQ=/&([a-z#][a-z0-9]{1,31});/gi,wQ=new RegExp(vN.source+"|"+vQ.source,"gi"),kQ=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function xQ(t,e){if(e.charCodeAt(0)===35&&kQ.test(e)){const r=e[1].toLowerCase()==="x"?parseInt(e.slice(2),16):parseInt(e.slice(1),10);return v3(r)?Mm(r):t}const n=yN(t);return n!==t?n:t}function EQ(t){return t.indexOf("\\")<0?t:t.replace(vN,"$1")}function bc(t){return t.indexOf("\\")<0&&t.indexOf("&")<0?t:t.replace(wQ,function(e,n,r){return n||xQ(e,r)})}const SQ=/[&<>"]/,CQ=/[&<>"]/g,_Q={"&":"&","<":"<",">":">",'"':"""};function AQ(t){return _Q[t]}function pa(t){return SQ.test(t)?t.replace(CQ,AQ):t}const TQ=/[.?*+^$[\]\\(){}|-]/g;function MQ(t){return t.replace(TQ,"\\$&")}function wt(t){switch(t){case 9:case 32:return!0}return!1}function Hd(t){if(t>=8192&&t<=8202)return!0;switch(t){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function Wd(t){return y3.test(t)||pN.test(t)}function Jd(t){switch(t){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function xg(t){return t=t.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(t=t.replace(/ẞ/g,"ß")),t.toLowerCase().toUpperCase()}const OQ={mdurl:tQ,ucmicro:rQ},DQ=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:bN,assign:kg,escapeHtml:pa,escapeRE:MQ,fromCodePoint:Mm,has:bQ,isMdAsciiPunct:Jd,isPunctChar:Wd,isSpace:wt,isString:b3,isValidEntityCode:v3,isWhiteSpace:Hd,lib:OQ,normalizeReference:xg,unescapeAll:bc,unescapeMd:EQ},Symbol.toStringTag,{value:"Module"}));function NQ(t,e,n){let r,i,o,s;const a=t.posMax,l=t.pos;for(t.pos=e+1,r=1;t.pos32))return o;if(r===41){if(s===0)break;s--}i++}return e===i||s!==0||(o.str=bc(t.slice(e,i)),o.pos=i,o.ok=!0),o}function IQ(t,e,n,r){let i,o=e;const s={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(r)s.str=r.str,s.marker=r.marker;else{if(o>=n)return s;let a=t.charCodeAt(o);if(a!==34&&a!==39&&a!==40)return s;e++,o++,a===40&&(a=41),s.marker=a}for(;o"+pa(o.content)+""};So.code_block=function(t,e,n,r,i){const o=t[e];return""+pa(t[e].content)+` +`,textSerializers:s={}}=n||{};let a="";return t.nodesBetween(r,i,(l,u,c,f)=>{var d;l.isBlock&&u>r&&(a+=o);const h=s==null?void 0:s[l.type.name];if(h)return c&&(a+=h({node:l,pos:u,parent:c,index:f,range:e})),!1;l.isText&&(a+=(d=l==null?void 0:l.text)===null||d===void 0?void 0:d.slice(Math.max(r,u)-u,i-u))}),a}function OK(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}is.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new ns({key:new rs("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,{ranges:o}=i,s=Math.min(...o.map(c=>c.$from.pos)),a=Math.max(...o.map(c=>c.$to.pos)),l=OK(n);return MK(r,{from:s,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}});const DK=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),NK=(t=!1)=>({commands:e})=>e.setContent("",t),$K=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:s})=>{t.doc.nodesBetween(o.pos,s.pos,(a,l)=>{if(a.type.isText)return;const{doc:u,mapping:c}=e,f=u.resolve(c.map(l)),d=u.resolve(c.map(l+a.nodeSize)),h=f.blockRange(d);if(!h)return;const p=Ic(h);if(a.type.isTextblock){const{defaultType:m}=f.parent.contentMatchAt(f.index());e.setNodeMarkup(h.start,m)}(p||p===0)&&e.lift(h,p)})}),!0},IK=t=>e=>t(e),RK=()=>({state:t,dispatch:e})=>cK(t,e),FK=(t,e)=>({editor:n,tr:r})=>{const{state:i}=n,o=i.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const s=r.mapping.map(e);return r.insert(s,o.content),r.setSelection(new gn(r.doc.resolve(s-1))),!0},LK=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const i=t.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(e){const a=i.before(o),l=i.after(o);t.delete(a,l).scrollIntoView()}return!0}return!1},BK=t=>({tr:e,state:n,dispatch:r})=>{const i=Nn(t,n.schema),o=e.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===i){if(r){const l=o.before(s),u=o.after(s);e.delete(l,u).scrollIntoView()}return!0}return!1},PK=t=>({tr:e,dispatch:n})=>{const{from:r,to:i}=t;return n&&e.delete(r,i),!0},zK=()=>({state:t,dispatch:e})=>QJ(t,e),jK=()=>({commands:t})=>t.keyboardShortcut("Enter"),qK=()=>({state:t,dispatch:e})=>uK(t,e);function wm(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:_K(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function kw(t,e,n={}){return t.find(r=>r.type===e&&wm(r.attrs,n))}function UK(t,e,n={}){return!!kw(t,e,n)}function t3(t,e,n={}){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if(t.parentOffset===r.offset&&r.offset!==0&&(r=t.parent.childBefore(t.parentOffset)),!r.node)return;const i=kw([...r.node.marks],e,n);if(!i)return;let o=r.index,s=t.start()+r.offset,a=o+1,l=s+r.node.nodeSize;for(kw([...r.node.marks],e,n);o>0&&i.isInSet(t.parent.child(o-1).marks);)o-=1,s-=t.parent.child(o).nodeSize;for(;a({tr:n,state:r,dispatch:i})=>{const o=Aa(t,r.schema),{doc:s,selection:a}=n,{$from:l,from:u,to:c}=a;if(i){const f=t3(l,o,e);if(f&&f.from<=u&&f.to>=c){const d=gn.create(s,f.from,f.to);n.setSelection(d)}}return!0},HK=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r({editor:n,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const s=()=>{n3()&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&t===null||t===!1)return!0;if(o&&t===null&&!MD(n.state.selection))return s(),!0;const a=WK(i.doc,t)||n.state.selection,l=n.state.selection.eq(a);return o&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},KK=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),GK=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),OD=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&OD(r)}return t};function i4(t){const e=`${t}`,n=new window.DOMParser().parseFromString(e,"text/html").body;return OD(n)}function km(t,e,n){n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,i=typeof t=="string";if(r)try{return Array.isArray(t)&&t.length>0?ce.fromArray(t.map(s=>e.nodeFromJSON(s))):e.nodeFromJSON(t)}catch(o){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",o),km("",e,n)}if(i){let o=e,s=!1,a="";n.errorOnInvalidContent&&(o=new XO({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(s=!0,a=typeof c=="string"?c:c.outerHTML,null)}]}})}));const l=vJ.fromSchema(o),u=n.slice?l.parseSlice(i4(t),n.parseOptions).content:l.parse(i4(t),n.parseOptions);if(n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)});return u}return km("",e,n)}function ZK(t,e,n){const r=t.steps.length-1;if(r{s===0&&(s=c)}),t.setSelection(ht.near(t.doc.resolve(s),n))}const YK=t=>!("type"in t),QK=(t,e,n)=>({tr:r,dispatch:i,editor:o})=>{var s;if(i){n={parseOptions:{},updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let a;try{a=km(e,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:(s=n.errorOnInvalidContent)!==null&&s!==void 0?s:o.options.enableContentCheck})}catch{return!1}let{from:l,to:u}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},c=!0,f=!0;if((YK(a)?a:[a]).forEach(p=>{p.check(),c=c?p.isText&&p.marks.length===0:!1,f=f?p.isBlock:!1}),l===u&&f){const{parent:p}=r.doc.resolve(l);p.isTextblock&&!p.type.spec.code&&!p.childCount&&(l-=1,u+=1)}let h;c?(Array.isArray(e)?h=e.map(p=>p.text||"").join(""):typeof e=="object"&&e&&e.text?h=e.text:h=e,r.insertText(h,l,u)):(h=a,r.replaceWith(l,u,h)),n.updateSelection&&ZK(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:l,text:h}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:l,text:h})}return!0},XK=()=>({state:t,dispatch:e})=>oK(t,e),eG=()=>({state:t,dispatch:e})=>sK(t,e),tG=()=>({state:t,dispatch:e})=>XJ(t,e),nG=()=>({state:t,dispatch:e})=>rK(t,e),rG=()=>({state:t,dispatch:e,tr:n})=>{try{const r=fg(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},iG=()=>({state:t,dispatch:e,tr:n})=>{try{const r=fg(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},oG=()=>({state:t,dispatch:e})=>eK(t,e),sG=()=>({state:t,dispatch:e})=>tK(t,e);function DD(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function aG(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,i,o,s;for(let a=0;a({editor:e,view:n,tr:r,dispatch:i})=>{const o=aG(t).split(/-(?!$)/),s=o.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),a=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{n.someProp("handleKeyDown",u=>u(n,a))});return l==null||l.steps.forEach(u=>{const c=u.map(r.mapping);c&&i&&r.maybeStep(c)}),!0};function r3(t,e,n={}){const{from:r,to:i,empty:o}=t.selection,s=e?Nn(e,t.schema):null,a=[];t.doc.nodesBetween(r,i,(f,d)=>{if(f.isText)return;const h=Math.max(r,d),p=Math.min(i,d+f.nodeSize);a.push({node:f,from:h,to:p})});const l=i-r,u=a.filter(f=>s?s.name===f.node.type.name:!0).filter(f=>wm(f.node.attrs,n,{strict:!1}));return o?!!u.length:u.reduce((f,d)=>f+d.to-d.from,0)>=l}const uG=(t,e={})=>({state:n,dispatch:r})=>{const i=Nn(t,n.schema);return r3(n,i,e)?aK(n,r):!1},cG=()=>({state:t,dispatch:e})=>fK(t,e),fG=t=>({state:e,dispatch:n})=>{const r=Nn(t,e.schema);return vK(r)(e,n)},dG=()=>({state:t,dispatch:e})=>lK(t,e);function i3(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function o4(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,i)=>(n.includes(i)||(r[i]=t[i]),r),{})}const hG=(t,e)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=i3(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(o=Nn(t,r.schema)),a==="mark"&&(s=Aa(t,r.schema)),i&&n.selection.ranges.forEach(l=>{r.doc.nodesBetween(l.$from.pos,l.$to.pos,(u,c)=>{o&&o===u.type&&n.setNodeMarkup(c,void 0,o4(u.attrs,e)),s&&u.marks.length&&u.marks.forEach(f=>{s===f.type&&n.addMark(c,c+u.nodeSize,s.create(o4(f.attrs,e)))})})}),!0):!1},pG=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),mG=()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size}),gG=()=>({state:t,dispatch:e})=>nK(t,e),yG=()=>({state:t,dispatch:e})=>iK(t,e),bG=()=>({state:t,dispatch:e})=>dK(t,e),vG=()=>({state:t,dispatch:e})=>mK(t,e),wG=()=>({state:t,dispatch:e})=>pK(t,e);function kG(t,e,n={},r={}){return km(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const xG=(t,e=!1,n={},r={})=>({editor:i,tr:o,dispatch:s,commands:a})=>{var l,u;const{doc:c}=o;if(n.preserveWhitespace!=="full"){const f=kG(t,i.schema,n,{errorOnInvalidContent:(l=r.errorOnInvalidContent)!==null&&l!==void 0?l:i.options.enableContentCheck});return s&&o.replaceWith(0,c.content.size,f).setMeta("preventUpdate",!e),!0}return s&&o.setMeta("preventUpdate",!e),a.insertContentAt({from:0,to:c.content.size},t,{parseOptions:n,errorOnInvalidContent:(u=r.errorOnInvalidContent)!==null&&u!==void 0?u:i.options.enableContentCheck})};function ND(t,e){const n=Aa(e,t.schema),{from:r,to:i,empty:o}=t.selection,s=[];o?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,i,l=>{s.push(...l.marks)});const a=s.find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function EG(t,e){const n=new KJ(t);return e.forEach(r=>{r.steps.forEach(i=>{n.step(i)})}),n}function SG(t){for(let e=0;e{n(i)&&r.push({node:i,pos:o})}),r}function _G(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function o3(t){return e=>_G(e.$from,t)}function AG(t,e){const n=Nn(e,t.schema),{from:r,to:i}=t.selection,o=[];t.doc.nodesBetween(r,i,a=>{o.push(a)});const s=o.reverse().find(a=>a.type.name===n.name);return s?{...s.attrs}:{}}function TG(t,e){const n=i3(typeof e=="string"?e:e.name,t.schema);return n==="node"?AG(t,e):n==="mark"?ND(t,e):{}}function MG(t,e=JSON.stringify){const n={};return t.filter(r=>{const i=e(r);return Object.prototype.hasOwnProperty.call(n,i)?!1:n[i]=!0})}function OG(t){const e=MG(t);return e.length===1?e:e.filter((n,r)=>!e.filter((o,s)=>s!==r).some(o=>n.oldRange.from>=o.oldRange.from&&n.oldRange.to<=o.oldRange.to&&n.newRange.from>=o.newRange.from&&n.newRange.to<=o.newRange.to))}function DG(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((i,o)=>{const s=[];if(i.ranges.length)i.forEach((a,l)=>{s.push({from:a,to:l})});else{const{from:a,to:l}=n[o];if(a===void 0||l===void 0)return;s.push({from:a,to:l})}s.forEach(({from:a,to:l})=>{const u=e.slice(o).map(a,-1),c=e.slice(o).map(l),f=e.invert().map(u,-1),d=e.invert().map(c);r.push({oldRange:{from:f,to:d},newRange:{from:u,to:c}})})}),OG(r)}function $D(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(i=>{const o=n.resolve(t-1),s=t3(o,i.type);s&&r.push({mark:i,...s})}):n.nodesBetween(t,e,(i,o)=>{!i||(i==null?void 0:i.nodeSize)===void 0||r.push(...i.marks.map(s=>({from:o,to:o+i.nodeSize,mark:s})))}),r}function b0(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=t.find(o=>o.type===e&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function NG(t,e,n={}){const{empty:r,ranges:i}=t.selection,o=e?Aa(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(f=>o?o.name===f.type.name:!0).find(f=>wm(f.attrs,n,{strict:!1}));let s=0;const a=[];if(i.forEach(({$from:f,$to:d})=>{const h=f.pos,p=d.pos;t.doc.nodesBetween(h,p,(m,b)=>{if(!m.isText&&!m.marks.length)return;const y=Math.max(h,b),v=Math.min(p,b+m.nodeSize),w=v-y;s+=w,a.push(...m.marks.map(g=>({mark:g,from:y,to:v})))})}),s===0)return!1;const l=a.filter(f=>o?o.name===f.mark.type.name:!0).filter(f=>wm(f.mark.attrs,n,{strict:!1})).reduce((f,d)=>f+d.to-d.from,0),u=a.filter(f=>o?f.mark.type!==o&&f.mark.type.excludes(o):!0).reduce((f,d)=>f+d.to-d.from,0);return(l>0?l+u:l)>=s}function s4(t,e){const{nodeExtensions:n}=SK(e),r=n.find(s=>s.name===t);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=qn(nr(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function $G(t,e,n){var r;const{selection:i}=e;let o=null;if(MD(i)&&(o=i.$cursor),o){const a=(r=t.storedMarks)!==null&&r!==void 0?r:o.marks();return!!n.isInSet(a)||!a.some(l=>l.type.excludes(n))}const{ranges:s}=i;return s.some(({$from:a,$to:l})=>{let u=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.pos,l.pos,(c,f,d)=>{if(u)return!1;if(c.isInline){const h=!d||d.type.allowsMarkType(n),p=!!n.isInSet(c.marks)||!c.marks.some(m=>m.type.excludes(n));u=h&&p}return!u}),u})}const IG=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:s,ranges:a}=o,l=Aa(t,r.schema);if(i)if(s){const u=ND(r,l);n.addStoredMark(l.create({...u,...e}))}else a.forEach(u=>{const c=u.$from.pos,f=u.$to.pos;r.doc.nodesBetween(c,f,(d,h)=>{const p=Math.max(h,c),m=Math.min(h+d.nodeSize,f);d.marks.find(y=>y.type===l)?d.marks.forEach(y=>{l===y.type&&n.addMark(p,m,l.create({...y.attrs,...e}))}):n.addMark(p,m,l.create(e))})});return $G(r,n,l)},RG=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),FG=(t,e={})=>({state:n,dispatch:r,chain:i})=>{const o=Nn(t,n.schema);return o.isTextblock?i().command(({commands:s})=>r4(o,e)(n)?!0:s.clearNodes()).command(({state:s})=>r4(o,e)(s,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},LG=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,i=Qa(t,0,r.content.size),o=Yt.create(r,i);e.setSelection(o)}return!0},BG=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:i,to:o}=typeof t=="number"?{from:t,to:t}:t,s=gn.atStart(r).from,a=gn.atEnd(r).to,l=Qa(i,s,a),u=Qa(o,s,a),c=gn.create(r,l,u);e.setSelection(c)}return!0},PG=t=>({state:e,dispatch:n})=>{const r=Nn(t,e.schema);return xK(r)(e,n)};function a4(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(i=>e==null?void 0:e.includes(i.type.name));t.tr.ensureMarks(r)}}const zG=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{const{selection:o,doc:s}=e,{$from:a,$to:l}=o,u=i.extensionManager.attributes,c=b0(u,a.node().type.name,a.node().attrs);if(o instanceof Yt&&o.node.isBlock)return!a.parentOffset||!zu(s,a.pos)?!1:(r&&(t&&a4(n,i.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;if(r){const f=l.parentOffset===l.parent.content.size;o instanceof gn&&e.deleteSelection();const d=a.depth===0?void 0:SG(a.node(-1).contentMatchAt(a.indexAfter(-1)));let h=f&&d?[{type:d,attrs:c}]:void 0,p=zu(e.doc,e.mapping.map(a.pos),1,h);if(!h&&!p&&zu(e.doc,e.mapping.map(a.pos),1,d?[{type:d}]:void 0)&&(p=!0,h=d?[{type:d,attrs:c}]:void 0),p&&(e.split(e.mapping.map(a.pos),1,h),d&&!f&&!a.parentOffset&&a.parent.type!==d)){const m=e.mapping.map(a.before()),b=e.doc.resolve(m);a.node(-1).canReplaceWith(b.index(),b.index()+1,d)&&e.setNodeMarkup(e.mapping.map(a.before()),d)}t&&a4(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},jG=t=>({tr:e,state:n,dispatch:r,editor:i})=>{var o;const s=Nn(t,n.schema),{$from:a,$to:l}=n.selection,u=n.selection.node;if(u&&u.isBlock||a.depth<2||!a.sameParent(l))return!1;const c=a.node(-1);if(c.type!==s)return!1;const f=i.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==s||a.index(-2)!==a.node(-2).childCount-1)return!1;if(r){let b=ce.empty;const y=a.index(-1)?1:a.index(-2)?2:3;for(let E=a.depth-y;E>=a.depth-3;E-=1)b=ce.from(a.node(E).copy(b));const v=a.indexAfter(-1){if(k>-1)return!1;E.isTextblock&&E.content.size===0&&(k=D+1)}),k>-1&&e.setSelection(gn.near(e.doc.resolve(k))),e.scrollIntoView()}return!0}const d=l.pos===a.end()?c.contentMatchAt(0).defaultType:null,h=b0(f,c.type.name,c.attrs),p=b0(f,a.node().type.name,a.node().attrs);e.delete(a.pos,l.pos);const m=d?[{type:s,attrs:h},{type:d,attrs:p}]:[{type:s,attrs:h}];if(!zu(e.doc,a.pos,2))return!1;if(r){const{selection:b,storedMarks:y}=n,{splittableMarks:v}=i.extensionManager,w=y||b.$to.parentOffset&&b.$from.marks();if(e.split(a.pos,2,m).scrollIntoView(),!w||!r)return!0;const g=w.filter(x=>v.includes(x.type.name));e.ensureMarks(g)}return!0},gb=(t,e)=>{const n=o3(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&Bl(t.doc,n.pos)&&t.join(n.pos),!0},yb=(t,e)=>{const n=o3(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&Bl(t.doc,r)&&t.join(r),!0},qG=(t,e,n,r={})=>({editor:i,tr:o,state:s,dispatch:a,chain:l,commands:u,can:c})=>{const{extensions:f,splittableMarks:d}=i.extensionManager,h=Nn(t,s.schema),p=Nn(e,s.schema),{selection:m,storedMarks:b}=s,{$from:y,$to:v}=m,w=y.blockRange(v),g=b||m.$to.parentOffset&&m.$from.marks();if(!w)return!1;const x=o3(k=>s4(k.type.name,f))(m);if(w.depth>=1&&x&&w.depth-x.depth<=1){if(x.node.type===h)return u.liftListItem(p);if(s4(x.node.type.name,f)&&h.validContent(x.node.content)&&a)return l().command(()=>(o.setNodeMarkup(x.pos,h),!0)).command(()=>gb(o,h)).command(()=>yb(o,h)).run()}return!n||!g||!a?l().command(()=>c().wrapInList(h,r)?!0:u.clearNodes()).wrapInList(h,r).command(()=>gb(o,h)).command(()=>yb(o,h)).run():l().command(()=>{const k=c().wrapInList(h,r),E=g.filter(D=>d.includes(D.type.name));return o.ensureMarks(E),k?!0:u.clearNodes()}).wrapInList(h,r).command(()=>gb(o,h)).command(()=>yb(o,h)).run()},UG=(t,e={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,s=Aa(t,r.schema);return NG(r,s,e)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,e)},VG=(t,e,n={})=>({state:r,commands:i})=>{const o=Nn(t,r.schema),s=Nn(e,r.schema);return r3(r,o,n)?i.setNode(s):i.setNode(o,n)},HG=(t,e={})=>({state:n,commands:r})=>{const i=Nn(t,n.schema);return r3(n,i,e)?r.lift(i):r.wrapIn(i,e)},WG=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r=0;l-=1)s.step(a.steps[l].invert(a.docs[l]));if(o.text){const l=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,t.schema.text(o.text,l))}else s.delete(o.from,o.to)}return!0}}return!1},JG=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:i}=n;return r||e&&i.forEach(o=>{t.removeMark(o.$from.pos,o.$to.pos)}),!0},KG=(t,e={})=>({tr:n,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:s=!1}=e,{selection:a}=n,l=Aa(t,r.schema),{$from:u,empty:c,ranges:f}=a;if(!i)return!0;if(c&&s){let{from:d,to:h}=a;const p=(o=u.marks().find(b=>b.type===l))===null||o===void 0?void 0:o.attrs,m=t3(u,l,p);m&&(d=m.from,h=m.to),n.removeMark(d,h,l)}else f.forEach(d=>{n.removeMark(d.$from.pos,d.$to.pos,l)});return n.removeStoredMark(l),!0},GG=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=i3(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(o=Nn(t,r.schema)),a==="mark"&&(s=Aa(t,r.schema)),i&&n.selection.ranges.forEach(l=>{const u=l.$from.pos,c=l.$to.pos;r.doc.nodesBetween(u,c,(f,d)=>{o&&o===f.type&&n.setNodeMarkup(d,void 0,{...f.attrs,...e}),s&&f.marks.length&&f.marks.forEach(h=>{if(s===h.type){const p=Math.max(d,u),m=Math.min(d+f.nodeSize,c);n.addMark(p,m,s.create({...h.attrs,...e}))}})})}),!0):!1},ZG=(t,e={})=>({state:n,dispatch:r})=>{const i=Nn(t,n.schema);return gK(i,e)(n,r)},YG=(t,e={})=>({state:n,dispatch:r})=>{const i=Nn(t,n.schema);return yK(i,e)(n,r)};var QG=Object.freeze({__proto__:null,blur:DK,clearContent:NK,clearNodes:$K,command:IK,createParagraphNear:RK,cut:FK,deleteCurrentNode:LK,deleteNode:BK,deleteRange:PK,deleteSelection:zK,enter:jK,exitCode:qK,extendMarkRange:VK,first:HK,focus:JK,forEach:KK,insertContent:GK,insertContentAt:QK,joinBackward:tG,joinDown:eG,joinForward:nG,joinItemBackward:rG,joinItemForward:iG,joinTextblockBackward:oG,joinTextblockForward:sG,joinUp:XK,keyboardShortcut:lG,lift:uG,liftEmptyBlock:cG,liftListItem:fG,newlineInCode:dG,resetAttributes:hG,scrollIntoView:pG,selectAll:mG,selectNodeBackward:gG,selectNodeForward:yG,selectParentNode:bG,selectTextblockEnd:vG,selectTextblockStart:wG,setContent:xG,setMark:IG,setMeta:RG,setNode:FG,setNodeSelection:LG,setTextSelection:BG,sinkListItem:PG,splitBlock:zG,splitListItem:jG,toggleList:qG,toggleMark:UG,toggleNode:VG,toggleWrap:HG,undoInputRule:WG,unsetAllMarks:JG,unsetMark:KG,updateAttributes:GG,wrapIn:ZG,wrapInList:YG});is.create({name:"commands",addCommands(){return{...QG}}});is.create({name:"editable",addProseMirrorPlugins(){return[new ns({key:new rs("editable"),props:{editable:()=>this.editor.options.editable}})]}});is.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new ns({key:new rs("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}});is.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:a})=>{const{selection:l,doc:u}=a,{empty:c,$anchor:f}=l,{pos:d,parent:h}=f,p=f.parent.isTextblock&&d>0?a.doc.resolve(d-1):f,m=p.parent.type.spec.isolating,b=f.pos-f.parentOffset,y=m&&p.parent.childCount===1?b===f.pos:ht.atStart(u).from===d;return!c||!h.type.isTextblock||h.textContent.length||!y||y&&f.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return n3()||DD()?o:i},addProseMirrorPlugins(){return[new ns({key:new rs("clearDocument"),appendTransaction:(t,e,n)=>{if(!(t.some(p=>p.docChanged)&&!e.doc.eq(n.doc)))return;const{empty:i,from:o,to:s}=e.selection,a=ht.atStart(e.doc).from,l=ht.atEnd(e.doc).to;if(i||!(o===a&&s===l)||!(n.doc.textBetween(0,n.doc.content.size," "," ").length===0))return;const f=n.tr,d=AD({state:n,transaction:f}),{commands:h}=new EK({editor:this.editor,state:d});if(h.clearNodes(),!!f.steps.length)return f}})]}});is.create({name:"tabindex",addProseMirrorPlugins(){return[new ns({key:new rs("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});function XG(t){return new AK({find:t.find,handler:({state:e,range:n,match:r})=>{const i=qn(t.getAttributes,void 0,r)||{},{tr:o}=e,s=n.from;let a=n.to;const l=t.type.create(i);if(r[1]){const u=r[0].lastIndexOf(r[1]);let c=s+u;c>a?c=a:a=c+r[1].length;const f=r[0][r[0].length-1];o.insertText(f,s+r[0].length-1),o.replaceWith(c,a,l)}else if(r[0]){const u=t.type.isInline?s:s-1;o.insert(u,t.type.create(i)).delete(o.mapping.map(s),o.mapping.map(a))}o.scrollIntoView()}})}class Ud{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=qn(nr(this,"addOptions",{name:this.name}))),this.storage=qn(nr(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ud(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>hg(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Ud(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=qn(nr(n,"addOptions",{name:n.name})),n.storage=qn(nr(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const s=i.marks();if(!!!s.find(u=>(u==null?void 0:u.type.name)===n.name))return!1;const l=s.find(u=>(u==null?void 0:u.type.name)===n.name);return l&&r.removeStoredMark(l),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}}class Ri{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=qn(nr(this,"addOptions",{name:this.name}))),this.storage=qn(nr(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ri(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>hg(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Ri(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=qn(nr(n,"addOptions",{name:n.name})),n.storage=qn(nr(n,"addStorage",{name:n.name,options:n.options})),n}}function ID(t){return new TD({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{const o=qn(t.getAttributes,void 0,r,i);if(o===!1||o===null)return null;const{tr:s}=e,a=r[r.length-1],l=r[0];let u=n.to;if(a){const c=l.search(/\S/),f=n.from+l.indexOf(a),d=f+a.length;if($D(n.from,n.to,e.doc).filter(p=>p.mark.type.excluded.find(b=>b===t.type&&b!==p.mark.type)).filter(p=>p.to>f).length)return null;dn.from&&s.delete(n.from+c,f),u=n.from+c+a.length,s.addMark(n.from+c,u,t.type.create(o||{})),s.removeStoredMark(t.type)}}})}function Sh(t){return new TD({find:t.find,handler({match:e,chain:n,range:r,pasteEvent:i}){const o=qn(t.getAttributes,void 0,e,i);if(o===!1||o===null)return null;e.input&&n().deleteRange(r).insertContentAt(r.from,{type:t.type.name,attrs:o})}})}var RD={};(function(t){/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(t,"__esModule",{value:!0}),t.bytes=t.stringToBytes=t.str=t.bytesToString=t.hex=t.utf8=t.bech32m=t.bech32=t.base58check=t.base58xmr=t.base58xrp=t.base58flickr=t.base58=t.base64url=t.base64=t.base32crockford=t.base32hex=t.base32=t.base16=t.utils=t.assertNumber=void 0;function e(C){if(!Number.isSafeInteger(C))throw new Error(`Wrong integer: ${C}`)}t.assertNumber=e;function n(...C){const R=(A,S)=>P=>A(S(P)),T=Array.from(C).reverse().reduce((A,S)=>A?R(A,S.encode):S.encode,void 0),q=C.reduce((A,S)=>A?R(A,S.decode):S.decode,void 0);return{encode:T,decode:q}}function r(C){return{encode:R=>{if(!Array.isArray(R)||R.length&&typeof R[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return R.map(T=>{if(e(T),T<0||T>=C.length)throw new Error(`Digit index outside alphabet: ${T} (alphabet: ${C.length})`);return C[T]})},decode:R=>{if(!Array.isArray(R)||R.length&&typeof R[0]!="string")throw new Error("alphabet.decode input should be array of strings");return R.map(T=>{if(typeof T!="string")throw new Error(`alphabet.decode: not string element=${T}`);const q=C.indexOf(T);if(q===-1)throw new Error(`Unknown letter: "${T}". Allowed: ${C}`);return q})}}}function i(C=""){if(typeof C!="string")throw new Error("join separator should be string");return{encode:R=>{if(!Array.isArray(R)||R.length&&typeof R[0]!="string")throw new Error("join.encode input should be array of strings");for(let T of R)if(typeof T!="string")throw new Error(`join.encode: non-string input=${T}`);return R.join(C)},decode:R=>{if(typeof R!="string")throw new Error("join.decode input should be string");return R.split(C)}}}function o(C,R="="){if(e(C),typeof R!="string")throw new Error("padding chr should be string");return{encode(T){if(!Array.isArray(T)||T.length&&typeof T[0]!="string")throw new Error("padding.encode input should be array of strings");for(let q of T)if(typeof q!="string")throw new Error(`padding.encode: non-string input=${q}`);for(;T.length*C%8;)T.push(R);return T},decode(T){if(!Array.isArray(T)||T.length&&typeof T[0]!="string")throw new Error("padding.encode input should be array of strings");for(let A of T)if(typeof A!="string")throw new Error(`padding.decode: non-string input=${A}`);let q=T.length;if(q*C%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;q>0&&T[q-1]===R;q--)if(!((q-1)*C%8))throw new Error("Invalid padding: string has too much padding");return T.slice(0,q)}}}function s(C){if(typeof C!="function")throw new Error("normalize fn should be function");return{encode:R=>R,decode:R=>C(R)}}function a(C,R,T){if(R<2)throw new Error(`convertRadix: wrong from=${R}, base cannot be less than 2`);if(T<2)throw new Error(`convertRadix: wrong to=${T}, base cannot be less than 2`);if(!Array.isArray(C))throw new Error("convertRadix: data should be array");if(!C.length)return[];let q=0;const A=[],S=Array.from(C);for(S.forEach(P=>{if(e(P),P<0||P>=R)throw new Error(`Wrong integer: ${P}`)});;){let P=0,B=!0;for(let j=q;jR?l(R,C%R):C,u=(C,R)=>C+(R-l(C,R));function c(C,R,T,q){if(!Array.isArray(C))throw new Error("convertRadix2: data should be array");if(R<=0||R>32)throw new Error(`convertRadix2: wrong from=${R}`);if(T<=0||T>32)throw new Error(`convertRadix2: wrong to=${T}`);if(u(R,T)>32)throw new Error(`convertRadix2: carry overflow from=${R} to=${T} carryBits=${u(R,T)}`);let A=0,S=0;const P=2**T-1,B=[];for(const j of C){if(e(j),j>=2**R)throw new Error(`convertRadix2: invalid data word=${j} from=${R}`);if(A=A<32)throw new Error(`convertRadix2: carry overflow pos=${S} from=${R}`);for(S+=R;S>=T;S-=T)B.push((A>>S-T&P)>>>0);A&=2**S-1}if(A=A<=R)throw new Error("Excess padding");if(!q&&A)throw new Error(`Non-zero padding: ${A}`);return q&&S>0&&B.push(A>>>0),B}function f(C){return e(C),{encode:R=>{if(!(R instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return a(Array.from(R),2**8,C)},decode:R=>{if(!Array.isArray(R)||R.length&&typeof R[0]!="number")throw new Error("radix.decode input should be array of strings");return Uint8Array.from(a(R,C,2**8))}}}function d(C,R=!1){if(e(C),C<=0||C>32)throw new Error("radix2: bits should be in (0..32]");if(u(8,C)>32||u(C,8)>32)throw new Error("radix2: carry overflow");return{encode:T=>{if(!(T instanceof Uint8Array))throw new Error("radix2.encode input should be Uint8Array");return c(Array.from(T),8,C,!R)},decode:T=>{if(!Array.isArray(T)||T.length&&typeof T[0]!="number")throw new Error("radix2.decode input should be array of strings");return Uint8Array.from(c(T,C,8,R))}}}function h(C){if(typeof C!="function")throw new Error("unsafeWrapper fn should be function");return function(...R){try{return C.apply(null,R)}catch{}}}function p(C,R){if(e(C),typeof R!="function")throw new Error("checksum fn should be function");return{encode(T){if(!(T instanceof Uint8Array))throw new Error("checksum.encode: input should be Uint8Array");const q=R(T).slice(0,C),A=new Uint8Array(T.length+C);return A.set(T),A.set(q,T.length),A},decode(T){if(!(T instanceof Uint8Array))throw new Error("checksum.decode: input should be Uint8Array");const q=T.slice(0,-C),A=R(q).slice(0,C),S=T.slice(-C);for(let P=0;PC.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1"))),t.base64=n(d(6),r("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),o(6),i("")),t.base64url=n(d(6),r("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),o(6),i(""));const m=C=>n(f(58),r(C),i(""));t.base58=m("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),t.base58flickr=m("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),t.base58xrp=m("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");const b=[0,2,3,5,6,7,9,10,11];t.base58xmr={encode(C){let R="";for(let T=0;Tn(p(4,R=>C(C(R))),t.base58);t.base58check=y;const v=n(r("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),i("")),w=[996825010,642813549,513874426,1027748829,705979059];function g(C){const R=C>>25;let T=(C&33554431)<<5;for(let q=0;q>q&1)===1&&(T^=w[q]);return T}function x(C,R,T=1){const q=C.length;let A=1;for(let S=0;S126)throw new Error(`Invalid prefix (${C})`);A=g(A)^P>>5}A=g(A);for(let S=0;Sae)throw new TypeError(`Length ${fe} exceeds limit ${ae}`);return J=J.toLowerCase(),`${J}1${v.encode(K)}${x(J,K,R)}`}function B(J,K=90){if(typeof J!="string")throw new Error(`bech32.decode input should be string, not ${typeof J}`);if(J.length<8||K!==!1&&J.length>K)throw new TypeError(`Wrong string length: ${J.length} (${J}). Expected (8..${K})`);const ae=J.toLowerCase();if(J!==ae&&J!==J.toUpperCase())throw new Error("String must be lowercase or uppercase");J=ae;const fe=J.lastIndexOf("1");if(fe===0||fe===-1)throw new Error('Letter "1" must be present between prefix and data only');const ke=J.slice(0,fe),ve=J.slice(fe+1);if(ve.length<6)throw new Error("Data must be at least 6 characters long");const xe=v.decode(ve).slice(0,-6),Se=x(ke,xe,R);if(!ve.endsWith(Se))throw new Error(`Invalid checksum in ${J}: expected "${Se}"`);return{prefix:ke,words:xe}}const j=h(B);function z(J){const{prefix:K,words:ae}=B(J,!1);return{prefix:K,words:ae,bytes:q(ae)}}return{encode:P,decode:B,decodeToBytes:z,decodeUnsafe:j,fromWords:q,fromWordsUnsafe:S,toWords:A}}t.bech32=k("bech32"),t.bech32m=k("bech32m"),t.utf8={encode:C=>new TextDecoder().decode(C),decode:C=>new TextEncoder().encode(C)},t.hex=n(d(4),r("0123456789abcdef"),i(""),s(C=>{if(typeof C!="string"||C.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof C} with length ${C.length}`);return C.toLowerCase()}));const E={utf8:t.utf8,hex:t.hex,base16:t.base16,base32:t.base32,base64:t.base64,base64url:t.base64url,base58:t.base58,base58xmr:t.base58xmr},D=`Invalid encoding type. Available types: ${Object.keys(E).join(", ")}`,O=(C,R)=>{if(typeof C!="string"||!E.hasOwnProperty(C))throw new TypeError(D);if(!(R instanceof Uint8Array))throw new TypeError("bytesToString() expects Uint8Array");return E[C].encode(R)};t.bytesToString=O,t.str=t.bytesToString;const N=(C,R)=>{if(!E.hasOwnProperty(C))throw new TypeError(D);if(typeof R!="string")throw new TypeError("stringToBytes() expects string");return E[C].decode(R)};t.stringToBytes=N,t.bytes=t.stringToBytes})(RD);const{bech32:Yi,hex:_i,utf8:eZ}=RD,l4={bech32:"bc",pubKeyHash:0,scriptHash:5,validWitnessVersions:[0]},u4={bech32:"tb",pubKeyHash:111,scriptHash:196,validWitnessVersions:[0]},c4={bech32:"tbs",pubKeyHash:111,scriptHash:196,validWitnessVersions:[0]},f4={bech32:"bcrt",pubKeyHash:111,scriptHash:196,validWitnessVersions:[0]},d4={bech32:"sb",pubKeyHash:63,scriptHash:123,validWitnessVersions:[0]},wp=["option_data_loss_protect","initial_routing_sync","option_upfront_shutdown_script","gossip_queries","var_onion_optin","gossip_queries_ex","option_static_remotekey","payment_secret","basic_mpp","option_support_large_channel"],tZ={m:BigInt(1e3),u:BigInt(1e6),n:BigInt(1e9),p:BigInt(1e12)},nZ=BigInt("2100000000000000000"),h4=BigInt(1e11),xw={payment_hash:1,payment_secret:16,description:13,payee:19,description_hash:23,expiry:6,min_final_cltv_expiry:24,fallback_address:9,route_hint:3,feature_bits:5,metadata:27},FD={};for(let t=0,e=Object.keys(xw);t_i.encode(Yi.fromWordsUnsafe(t)),16:t=>_i.encode(Yi.fromWordsUnsafe(t)),13:t=>eZ.encode(Yi.fromWordsUnsafe(t)),19:t=>_i.encode(Yi.fromWordsUnsafe(t)),23:t=>_i.encode(Yi.fromWordsUnsafe(t)),27:t=>_i.encode(Yi.fromWordsUnsafe(t)),6:xm,24:xm,3:oZ,5:sZ};function iZ(t){return e=>({tagCode:parseInt(t),words:Yi.encode("unknown",e,Number.MAX_SAFE_INTEGER)})}function xm(t){return t.reverse().reduce((e,n,r)=>e+n*Math.pow(32,r),0)}function oZ(t){const e=[];let n,r,i,o,s,a=Yi.fromWordsUnsafe(t);for(;a.length>0;)n=_i.encode(a.slice(0,33)),r=_i.encode(a.slice(33,41)),i=parseInt(_i.encode(a.slice(41,45)),16),o=parseInt(_i.encode(a.slice(45,49)),16),s=parseInt(_i.encode(a.slice(49,51)),16),a=a.slice(51),e.push({pubkey:n,short_channel_id:r,fee_base_msat:i,fee_proportional_millionths:o,cltv_expiry_delta:s});return e}function sZ(t){const e=t.slice().reverse().map(i=>[!!(i&1),!!(i&2),!!(i&4),!!(i&8),!!(i&16)]).reduce((i,o)=>i.concat(o),[]);for(;e.length{let s;e[o*2]?s="required":e[o*2+1]?s="supported":s="unsupported",n[i]=s});const r=e.slice(wp.length*2);return n.extra_bits={start_bit:wp.length*2,bits:r,has_required:r.reduce((i,o,s)=>s%2!==0?i||!1:i||o,!1)},n}function LD(t,e){let n,r;if(t.slice(-1).match(/^[munp]$/))n=t.slice(-1),r=t.slice(0,-1);else{if(t.slice(-1).match(/^[^munp0-9]$/))throw new Error("Not a valid multiplier for the amount");r=t}if(!r.match(/^\d+$/))throw new Error("Not a valid human readable amount");const i=BigInt(r),o=n?i*h4/tZ[n]:i*h4;if(n==="p"&&i%BigInt(10)!==BigInt(0)||o>nZ)throw new Error("Amount is outside of valid range");return e?o.toString():o}function aZ(t,e){if(typeof t!="string")throw new Error("Lightning Payment Request must be string");if(t.slice(0,2).toLowerCase()!=="ln")throw new Error("Not a proper lightning payment request");const n=[],r=Yi.decode(t,Number.MAX_SAFE_INTEGER);t=t.toLowerCase();const i=r.prefix;let o=r.words,s=t.slice(i.length+1),a=o.slice(-104);o=o.slice(0,-104);let l=i.match(/^ln(\S+?)(\d*)([a-zA-Z]?)$/);if(l&&!l[2]&&(l=i.match(/^ln(\S+)$/)),!l)throw new Error("Not a proper lightning payment request");n.push({name:"lightning_network",letters:"ln"});const u=l[1];let c;if(e){if(e.bech32===void 0||e.pubKeyHash===void 0||e.scriptHash===void 0||!Array.isArray(e.validWitnessVersions))throw new Error("Invalid network");c=e}else switch(u){case l4.bech32:c=l4;break;case u4.bech32:c=u4;break;case c4.bech32:c=c4;break;case f4.bech32:c=f4;break;case d4.bech32:c=d4;break}if(!c||c.bech32!==u)throw new Error("Unknown coin bech32 prefix");n.push({name:"coin_network",letters:u,value:c});const f=l[2];let d;if(f){const g=l[3];d=LD(f+g,!0),n.push({name:"amount",letters:l[2]+l[3],value:d})}else d=null;n.push({name:"separator",letters:"1"});const h=xm(o.slice(0,7));o=o.slice(7),n.push({name:"timestamp",letters:s.slice(0,7),value:h}),s=s.slice(7);let p,m,b,y;for(;o.length>0;){const g=o[0].toString();p=FD[g]||"unknown_tag",m=rZ[g]||iZ(g),o=o.slice(1),b=xm(o.slice(0,2)),o=o.slice(2),y=o.slice(0,b),o=o.slice(b),n.push({name:p,tag:s[0],letters:s.slice(0,3+b),value:m(y)}),s=s.slice(3+b)}n.push({name:"signature",letters:s.slice(0,104),value:_i.encode(Yi.fromWordsUnsafe(a))}),s=s.slice(104),n.push({name:"checksum",letters:s});let v={paymentRequest:t,sections:n,get expiry(){let g=n.find(x=>x.name==="expiry");if(g)return w("timestamp")+g.value},get route_hints(){return n.filter(g=>g.name==="route_hint").map(g=>g.value)}};for(let g in xw)g!=="route_hint"&&Object.defineProperty(v,g,{get(){return w(g)}});return v;function w(g){let x=n.find(k=>k.name===g);return x?x.value:void 0}}var p4={decode:aZ,hrpToMillisat:LD},lZ=["/",":","?","#"],uZ=[".","/","@"];function m4(t,e){for(var n,r=0,i=0,o=0,s=t.length,a=0;s--&&++a&&!(r&&lZ.indexOf(t[a])>-1);)t[a]==="."&&(++r,i=a);for(n=a,a=i;a--;)if(uZ.indexOf(t[a])!==-1){o=a+1;break}if(o===0&&n>3)return t;if(o>0&&o<2)return"";if(e.tld){for(var l=0,u=["/","@"],c=i;c--;)if(u.indexOf(t[c])>-1){l=c+1;break}return YW(()=>import("./index-C18jlTme-DjJJTT2G.js"),[]).then(f=>f.i).then(function(f){return Promise.resolve(f.get(t.slice(l,n)))}).catch(function(f){throw console.error(f),Error("You must install psl library (https://www.npmjs.com/package/psl) to use `tld` option")})}return t.slice(o,n)}function cZ(t,e){if(e===void 0&&(e={}),typeof t=="string")return m4(t,e);if(Array.isArray(t)){for(var n=[],r=t.length,i=0;i({index:t.index,replaceWith:t[2],text:t[0],match:t,data:e}),hZ=/.(jpg|jpeg|gif|png|bmp|svg|webp)$/,pZ=/.(webm|mp4|ogg|mov)$/;function mZ(t,e,n){var r,i,o,s;const a=(s=(o=(i=(r=n==null?void 0:n[t])==null?void 0:r.m)==null?void 0:i.split)==null?void 0:o.call(i,"/"))==null?void 0:s[0];if(a==="image")return"image";if(a==="video")return"video";if(/youtube|youtu.be/.test(t))return"youtube";if(/^https?:\/\/(twitter|x)\.com\/(?:#!\/)?(\w+)\/status(es)?\/(\d+)/.test(t))return"tweet";try{const{pathname:l}=new URL(e);return hZ.test(l)?"image":pZ.test(l)?"video":"text"}catch(l){return console.log("url parser error",l),"text"}}const gZ=/(lnbc[0-9a-z]{10,})/g,yZ=Ri.create({name:"bolt11",group:"block",atom:!0,selectable:!0,draggable:!0,addAttributes(){return{lnbc:{default:null},bolt11:{default:null}}},addStorage(){return{markdown:{serialize(t,e){t.write(e.attrs.lnbc)},parse:{}}}},addCommands(){return{insertBolt11:({lnbc:t})=>({commands:e})=>{const n=p4.decode(t);return e.insertContent({type:this.name,attrs:{bolt11:n,lnbc:t}},{updateSelection:!1})}}},renderHTML(){return["div",{}]},renderText(t){return t.node.attrs.lnbc},addPasteRules(){return[Sh({type:this.type,getAttributes:t=>t.data,find:t=>{const e=[];for(const n of t.matchAll(gZ)){const r=p4.decode(n[0]);e.push(dc(n,{bolt11:r,lnbc:n[0]}))}return e}})]}});async function bZ(t){if(!t.hash)throw new Error("No hash function provided");if(!t.sign)throw new Error("No signer provided");const e=Date.now()/1e3,n=await t.hash(t.file),r=await t.sign({kind:24242,content:`Upload ${t.file.name}`,created_at:e,tags:[["t","upload"],["x",n],["expiration",(e+(t.expiration||6e4)).toString()]]});await new Promise(u=>setTimeout(()=>u(),1e3));const i=JSON.stringify(r),s=`Nostr ${btoa(i)}`,a=await fetch(t.serverUrl+"/upload",{method:"PUT",body:t.file,headers:{authorization:s}}),l=await a.json();if(a.status===200)return l;throw new Error(l.message)}function Ew(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function vZ(t){if(typeof t!="boolean")throw new Error(`Expected boolean, not ${t}`)}function BD(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function wZ(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Ew(t.outputLen),Ew(t.blockLen)}function kZ(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function xZ(t,e){BD(t);const n=e.outputLen;if(t.lengtht instanceof Uint8Array,vb=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),qi=(t,e)=>t<<32-e|t>>>e,EZ=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!EZ)throw new Error("Non little-endian hardware is not supported");const SZ=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function ln(t){if(!s3(t))throw new Error("Uint8Array expected");let e="";for(let n=0;nr+i.length,0));let n=0;return t.forEach(r=>{if(!s3(r))throw new Error("Uint8Array expected");e.set(r,n),n+=r.length}),e}let PD=class{clone(){return this._cloneInto()}};function zD(t){const e=r=>t().update(Vd(r)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function jD(t=32){if(bb&&typeof bb.getRandomValues=="function")return bb.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}function _Z(t,e,n,r){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,n,r);const i=BigInt(32),o=BigInt(4294967295),s=Number(n>>i&o),a=Number(n&o),l=r?4:0,u=r?0:4;t.setUint32(e+l,s,r),t.setUint32(e+u,a,r)}let AZ=class extends PD{constructor(e,n,r,i){super(),this.blockLen=e,this.outputLen=n,this.padOffset=r,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=vb(this.buffer)}update(e){oo.exists(this);const{view:n,buffer:r,blockLen:i}=this;e=Vd(e);const o=e.length;for(let s=0;si-s&&(this.process(r,0),s=0);for(let f=s;fc.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;ft&e^~t&n,MZ=(t,e,n)=>t&e^t&n^e&n,OZ=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ms=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),gs=new Uint32Array(64);let qD=class extends AZ{constructor(){super(64,32,8,!1),this.A=ms[0]|0,this.B=ms[1]|0,this.C=ms[2]|0,this.D=ms[3]|0,this.E=ms[4]|0,this.F=ms[5]|0,this.G=ms[6]|0,this.H=ms[7]|0}get(){const{A:e,B:n,C:r,D:i,E:o,F:s,G:a,H:l}=this;return[e,n,r,i,o,s,a,l]}set(e,n,r,i,o,s,a,l){this.A=e|0,this.B=n|0,this.C=r|0,this.D=i|0,this.E=o|0,this.F=s|0,this.G=a|0,this.H=l|0}process(e,n){for(let f=0;f<16;f++,n+=4)gs[f]=e.getUint32(n,!1);for(let f=16;f<64;f++){const d=gs[f-15],h=gs[f-2],p=qi(d,7)^qi(d,18)^d>>>3,m=qi(h,17)^qi(h,19)^h>>>10;gs[f]=m+gs[f-7]+p+gs[f-16]|0}let{A:r,B:i,C:o,D:s,E:a,F:l,G:u,H:c}=this;for(let f=0;f<64;f++){const d=qi(a,6)^qi(a,11)^qi(a,25),h=c+d+TZ(a,l,u)+OZ[f]+gs[f]|0,m=(qi(r,2)^qi(r,13)^qi(r,22))+MZ(r,i,o)|0;c=u,u=l,l=a,a=s+h|0,s=o,o=i,i=r,r=h+m|0}r=r+this.A|0,i=i+this.B|0,o=o+this.C|0,s=s+this.D|0,a=a+this.E|0,l=l+this.F|0,u=u+this.G|0,c=c+this.H|0,this.set(r,i,o,s,a,l,u,c)}roundClean(){gs.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}},DZ=class extends qD{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}};const Rc=zD(()=>new qD);zD(()=>new DZ);function NZ(t){return!(!t.api_url||t.delegated_to_url&&t.api_url)}async function $Z(t){const e="/.well-known/nostr/nip96.json";let n="";try{const{origin:r}=new URL(t);n=r+e}catch{throw new Error("Invalid URL")}try{const r=await fetch(n);if(!r.ok)throw new Error(`Error fetching ${n}: ${r.statusText}`);const i=await r.json();if(!i)throw new Error("No data");if(!NZ(i))throw new Error("Invalid configuration data");return i}catch{throw new Error("Error fetching.")}}function IZ(t){if(typeof t!="object"||t===null||!t.status||!t.message||t.status!=="success"&&t.status!=="error"&&t.status!=="processing"||typeof t.message!="string"||t.status==="processing"&&!t.processing_url||t.processing_url&&typeof t.processing_url!="string"||t.status==="success"&&!t.nip94_event)return!1;if(t.nip94_event){if(!t.nip94_event.tags||!Array.isArray(t.nip94_event.tags)||t.nip94_event.tags.length===0)return!1;for(const e of t.nip94_event.tags)if(!Array.isArray(e)||e.length!==2||typeof e[0]!="string"||typeof e[1]!="string")return!1;if(!t.nip94_event.tags.find(e=>e[0]==="url")||!t.nip94_event.tags.find(e=>e[0]==="ox"))return!1}return!0}async function RZ(t,e,n,r){const i=new FormData;r&&Object.entries(r).forEach(([s,a])=>{a&&i.append(s,a)}),i.append("file",t);const o=await fetch(e,{method:"POST",headers:{Authorization:n},body:i});if(o.ok===!1)throw o.status===413?new Error("File too large!"):o.status===400?new Error("Bad request! Some fields are missing or invalid!"):o.status===403?new Error("Forbidden! Payload tag does not match the requested file!"):o.status===402?new Error("Payment required!"):new Error("Unknown error in uploading file!");try{const s=await o.json();if(!IZ(s))throw new Error("Invalid response from the server!");return s}catch{throw new Error("Error parsing JSON response!")}}/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Fc(t){if(!Number.isSafeInteger(t))throw new Error(`Wrong integer: ${t}`)}function ss(...t){const e=(i,o)=>s=>i(o(s)),n=Array.from(t).reverse().reduce((i,o)=>i?e(i,o.encode):o.encode,void 0),r=t.reduce((i,o)=>i?e(i,o.decode):o.decode,void 0);return{encode:n,decode:r}}function as(t){return{encode:e=>{if(!Array.isArray(e)||e.length&&typeof e[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return e.map(n=>{if(Fc(n),n<0||n>=t.length)throw new Error(`Digit index outside alphabet: ${n} (alphabet: ${t.length})`);return t[n]})},decode:e=>{if(!Array.isArray(e)||e.length&&typeof e[0]!="string")throw new Error("alphabet.decode input should be array of strings");return e.map(n=>{if(typeof n!="string")throw new Error(`alphabet.decode: not string element=${n}`);const r=t.indexOf(n);if(r===-1)throw new Error(`Unknown letter: "${n}". Allowed: ${t}`);return r})}}}function ls(t=""){if(typeof t!="string")throw new Error("join separator should be string");return{encode:e=>{if(!Array.isArray(e)||e.length&&typeof e[0]!="string")throw new Error("join.encode input should be array of strings");for(let n of e)if(typeof n!="string")throw new Error(`join.encode: non-string input=${n}`);return e.join(t)},decode:e=>{if(typeof e!="string")throw new Error("join.decode input should be string");return e.split(t)}}}function mg(t,e="="){if(Fc(t),typeof e!="string")throw new Error("padding chr should be string");return{encode(n){if(!Array.isArray(n)||n.length&&typeof n[0]!="string")throw new Error("padding.encode input should be array of strings");for(let r of n)if(typeof r!="string")throw new Error(`padding.encode: non-string input=${r}`);for(;n.length*t%8;)n.push(e);return n},decode(n){if(!Array.isArray(n)||n.length&&typeof n[0]!="string")throw new Error("padding.encode input should be array of strings");for(let i of n)if(typeof i!="string")throw new Error(`padding.decode: non-string input=${i}`);let r=n.length;if(r*t%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;r>0&&n[r-1]===e;r--)if(!((r-1)*t%8))throw new Error("Invalid padding: string has too much padding");return n.slice(0,r)}}}function UD(t){if(typeof t!="function")throw new Error("normalize fn should be function");return{encode:e=>e,decode:e=>t(e)}}function g4(t,e,n){if(e<2)throw new Error(`convertRadix: wrong from=${e}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: wrong to=${n}, base cannot be less than 2`);if(!Array.isArray(t))throw new Error("convertRadix: data should be array");if(!t.length)return[];let r=0;const i=[],o=Array.from(t);for(o.forEach(s=>{if(Fc(s),s<0||s>=e)throw new Error(`Wrong integer: ${s}`)});;){let s=0,a=!0;for(let l=r;le?VD(e,t%e):t,Em=(t,e)=>t+(e-VD(t,e));function Sw(t,e,n,r){if(!Array.isArray(t))throw new Error("convertRadix2: data should be array");if(e<=0||e>32)throw new Error(`convertRadix2: wrong from=${e}`);if(n<=0||n>32)throw new Error(`convertRadix2: wrong to=${n}`);if(Em(e,n)>32)throw new Error(`convertRadix2: carry overflow from=${e} to=${n} carryBits=${Em(e,n)}`);let i=0,o=0;const s=2**n-1,a=[];for(const l of t){if(Fc(l),l>=2**e)throw new Error(`convertRadix2: invalid data word=${l} from=${e}`);if(i=i<32)throw new Error(`convertRadix2: carry overflow pos=${o} from=${e}`);for(o+=e;o>=n;o-=n)a.push((i>>o-n&s)>>>0);i&=2**o-1}if(i=i<=e)throw new Error("Excess padding");if(!r&&i)throw new Error(`Non-zero padding: ${i}`);return r&&o>0&&a.push(i>>>0),a}function FZ(t){return Fc(t),{encode:e=>{if(!(e instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return g4(Array.from(e),2**8,t)},decode:e=>{if(!Array.isArray(e)||e.length&&typeof e[0]!="number")throw new Error("radix.decode input should be array of strings");return Uint8Array.from(g4(e,t,2**8))}}}function Ta(t,e=!1){if(Fc(t),t<=0||t>32)throw new Error("radix2: bits should be in (0..32]");if(Em(8,t)>32||Em(t,8)>32)throw new Error("radix2: carry overflow");return{encode:n=>{if(!(n instanceof Uint8Array))throw new Error("radix2.encode input should be Uint8Array");return Sw(Array.from(n),8,t,!e)},decode:n=>{if(!Array.isArray(n)||n.length&&typeof n[0]!="number")throw new Error("radix2.decode input should be array of strings");return Uint8Array.from(Sw(n,t,8,e))}}}function y4(t){if(typeof t!="function")throw new Error("unsafeWrapper fn should be function");return function(...e){try{return t.apply(null,e)}catch{}}}const LZ=ss(Ta(4),as("0123456789ABCDEF"),ls("")),BZ=ss(Ta(5),as("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),mg(5),ls(""));ss(Ta(5),as("0123456789ABCDEFGHIJKLMNOPQRSTUV"),mg(5),ls(""));ss(Ta(5),as("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),ls(""),UD(t=>t.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")));const ko=ss(Ta(6),as("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),mg(6),ls("")),PZ=ss(Ta(6),as("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),mg(6),ls("")),a3=t=>ss(FZ(58),as(t),ls("")),Cw=a3("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");a3("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ");a3("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");const b4=[0,2,3,5,6,7,9,10,11],zZ={encode(t){let e="";for(let n=0;n>25;let n=(t&33554431)<<5;for(let r=0;r>r&1)===1&&(n^=v4[r]);return n}function w4(t,e,n=1){const r=t.length;let i=1;for(let o=0;o126)throw new Error(`Invalid prefix (${t})`);i=uf(i)^s>>5}i=uf(i);for(let o=0;od)throw new TypeError(`Length ${h} exceeds limit ${d}`);return c=c.toLowerCase(),`${c}1${_w.encode(f)}${w4(c,f,e)}`}function a(c,f=90){if(typeof c!="string")throw new Error(`bech32.decode input should be string, not ${typeof c}`);if(c.length<8||f!==!1&&c.length>f)throw new TypeError(`Wrong string length: ${c.length} (${c}). Expected (8..${f})`);const d=c.toLowerCase();if(c!==d&&c!==c.toUpperCase())throw new Error("String must be lowercase or uppercase");c=d;const h=c.lastIndexOf("1");if(h===0||h===-1)throw new Error('Letter "1" must be present between prefix and data only');const p=c.slice(0,h),m=c.slice(h+1);if(m.length<6)throw new Error("Data must be at least 6 characters long");const b=_w.decode(m).slice(0,-6),y=w4(p,b,e);if(!m.endsWith(y))throw new Error(`Invalid checksum in ${c}: expected "${y}"`);return{prefix:p,words:b}}const l=y4(a);function u(c){const{prefix:f,words:d}=a(c,!1);return{prefix:f,words:d,bytes:r(d)}}return{encode:s,decode:a,decodeToBytes:u,decodeUnsafe:l,fromWords:r,fromWordsUnsafe:o,toWords:i}}const pc=HD("bech32");HD("bech32m");const jZ={encode:t=>new TextDecoder().decode(t),decode:t=>new TextEncoder().encode(t)},qZ=ss(Ta(4),as("0123456789abcdef"),ls(""),UD(t=>{if(typeof t!="string"||t.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof t} with length ${t.length}`);return t.toLowerCase()})),UZ={utf8:jZ,hex:qZ,base16:LZ,base32:BZ,base64:ko,base64url:PZ,base58:Cw,base58xmr:zZ};`${Object.keys(UZ).join(", ")}`;function k4(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function WD(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function VZ(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");k4(t.outputLen),k4(t.blockLen)}function Sm(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function HZ(t,e){WD(t);const n=e.outputLen;if(t.lengtht instanceof Uint8Array,kb=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),Ui=(t,e)=>t<<32-e|t>>>e,WZ=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!WZ)throw new Error("Non little-endian hardware is not supported");function JZ(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function l3(t){if(typeof t=="string"&&(t=JZ(t)),!JD(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}function KZ(...t){const e=new Uint8Array(t.reduce((r,i)=>r+i.length,0));let n=0;return t.forEach(r=>{if(!JD(r))throw new Error("Uint8Array expected");e.set(r,n),n+=r.length}),e}class KD{clone(){return this._cloneInto()}}function GZ(t){const e=r=>t().update(l3(r)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function GD(t=32){if(wb&&typeof wb.getRandomValues=="function")return wb.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}function ZZ(t,e,n,r){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,n,r);const i=BigInt(32),o=BigInt(4294967295),s=Number(n>>i&o),a=Number(n&o),l=r?4:0,u=r?0:4;t.setUint32(e+l,s,r),t.setUint32(e+u,a,r)}class YZ extends KD{constructor(e,n,r,i){super(),this.blockLen=e,this.outputLen=n,this.padOffset=r,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=kb(this.buffer)}update(e){Sm(this);const{view:n,buffer:r,blockLen:i}=this;e=l3(e);const o=e.length;for(let s=0;si-s&&(this.process(r,0),s=0);for(let f=s;fc.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;ft&e^~t&n,XZ=(t,e,n)=>t&e^t&n^e&n,eY=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ys=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),bs=new Uint32Array(64);class tY extends YZ{constructor(){super(64,32,8,!1),this.A=ys[0]|0,this.B=ys[1]|0,this.C=ys[2]|0,this.D=ys[3]|0,this.E=ys[4]|0,this.F=ys[5]|0,this.G=ys[6]|0,this.H=ys[7]|0}get(){const{A:e,B:n,C:r,D:i,E:o,F:s,G:a,H:l}=this;return[e,n,r,i,o,s,a,l]}set(e,n,r,i,o,s,a,l){this.A=e|0,this.B=n|0,this.C=r|0,this.D=i|0,this.E=o|0,this.F=s|0,this.G=a|0,this.H=l|0}process(e,n){for(let f=0;f<16;f++,n+=4)bs[f]=e.getUint32(n,!1);for(let f=16;f<64;f++){const d=bs[f-15],h=bs[f-2],p=Ui(d,7)^Ui(d,18)^d>>>3,m=Ui(h,17)^Ui(h,19)^h>>>10;bs[f]=m+bs[f-7]+p+bs[f-16]|0}let{A:r,B:i,C:o,D:s,E:a,F:l,G:u,H:c}=this;for(let f=0;f<64;f++){const d=Ui(a,6)^Ui(a,11)^Ui(a,25),h=c+d+QZ(a,l,u)+eY[f]+bs[f]|0,m=(Ui(r,2)^Ui(r,13)^Ui(r,22))+XZ(r,i,o)|0;c=u,u=l,l=a,a=s+h|0,s=o,o=i,i=r,r=h+m|0}r=r+this.A|0,i=i+this.B|0,o=o+this.C|0,s=s+this.D|0,a=a+this.E|0,l=l+this.F|0,u=u+this.G|0,c=c+this.H|0,this.set(r,i,o,s,a,l,u,c)}roundClean(){bs.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Aw=GZ(()=>new tY);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ZD=BigInt(0),gg=BigInt(1),nY=BigInt(2),yg=t=>t instanceof Uint8Array,rY=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function mc(t){if(!yg(t))throw new Error("Uint8Array expected");let e="";for(let n=0;nr+i.length,0));let n=0;return t.forEach(r=>{if(!yg(r))throw new Error("Uint8Array expected");e.set(r,n),n+=r.length}),e}function oY(t,e){if(t.length!==e.length)return!1;for(let n=0;nZD;t>>=gg,e+=1);return e}function lY(t,e){return t>>BigInt(e)&gg}const uY=(t,e,n)=>t|(n?gg:ZD)<(nY<new Uint8Array(t),x4=t=>Uint8Array.from(t);function QD(t,e,n){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=xb(t),i=xb(t),o=0;const s=()=>{r.fill(1),i.fill(0),o=0},a=(...f)=>n(i,r,...f),l=(f=xb())=>{i=a(x4([0]),f),r=a(),f.length!==0&&(i=a(x4([1]),f),r=a())},u=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const d=[];for(;f{s(),l(f);let h;for(;!(h=d(u()));)l();return s(),h}}const cY={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||t instanceof Uint8Array,isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function Ch(t,e,n={}){const r=(i,o,s)=>{const a=cY[o];if(typeof a!="function")throw new Error(`Invalid validator "${o}", expected function`);const l=t[i];if(!(s&&l===void 0)&&!a(l,t))throw new Error(`Invalid param ${String(i)}=${l} (${typeof l}), expected ${o}`)};for(const[i,o]of Object.entries(e))r(i,o,!1);for(const[i,o]of Object.entries(n))r(i,o,!0);return t}const fY=Object.freeze(Object.defineProperty({__proto__:null,bitGet:lY,bitLen:aY,bitMask:d3,bitSet:uY,bytesToHex:mc,bytesToNumberBE:Er,bytesToNumberLE:c3,concatBytes:Nl,createHmacDrbg:QD,ensureBytes:Bn,equalBytes:oY,hexToBytes:gc,hexToNumber:u3,numberToBytesBE:ha,numberToBytesLE:f3,numberToHexUnpadded:YD,numberToVarBytesBE:iY,utf8ToBytes:sY,validateObject:Ch},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const dn=BigInt(0),qt=BigInt(1),Va=BigInt(2),dY=BigInt(3),Tw=BigInt(4),E4=BigInt(5),S4=BigInt(8);BigInt(9);BigInt(16);function _n(t,e){const n=t%e;return n>=dn?n:e+n}function hY(t,e,n){if(n<=dn||e 0");if(n===qt)return dn;let r=qt;for(;e>dn;)e&qt&&(r=r*t%n),t=t*t%n,e>>=qt;return r}function Zr(t,e,n){let r=t;for(;e-- >dn;)r*=r,r%=n;return r}function Mw(t,e){if(t===dn||e<=dn)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let n=_n(t,e),r=e,i=dn,o=qt;for(;n!==dn;){const a=r/n,l=r%n,u=i-o*a;r=n,n=l,i=o,o=u}if(r!==qt)throw new Error("invert: does not exist");return _n(i,e)}function pY(t){const e=(t-qt)/Va;let n,r,i;for(n=t-qt,r=0;n%Va===dn;n/=Va,r++);for(i=Va;i(r[i]="function",r),e);return Ch(t,n)}function bY(t,e,n){if(n 0");if(n===dn)return t.ONE;if(n===qt)return e;let r=t.ONE,i=e;for(;n>dn;)n&qt&&(r=t.mul(r,i)),i=t.sqr(i),n>>=qt;return r}function vY(t,e){const n=new Array(e.length),r=e.reduce((o,s,a)=>t.is0(s)?o:(n[a]=o,t.mul(o,s)),t.ONE),i=t.inv(r);return e.reduceRight((o,s,a)=>t.is0(s)?o:(n[a]=t.mul(o,n[a]),t.mul(o,s)),i),n}function XD(t,e){const n=e!==void 0?e:t.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function wY(t,e,n=!1,r={}){if(t<=dn)throw new Error(`Expected Field ORDER > 0, got ${t}`);const{nBitLength:i,nByteLength:o}=XD(t,e);if(o>2048)throw new Error("Field lengths over 2048 bytes are not supported");const s=mY(t),a=Object.freeze({ORDER:t,BITS:i,BYTES:o,MASK:d3(i),ZERO:dn,ONE:qt,create:l=>_n(l,t),isValid:l=>{if(typeof l!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof l}`);return dn<=l&&ll===dn,isOdd:l=>(l&qt)===qt,neg:l=>_n(-l,t),eql:(l,u)=>l===u,sqr:l=>_n(l*l,t),add:(l,u)=>_n(l+u,t),sub:(l,u)=>_n(l-u,t),mul:(l,u)=>_n(l*u,t),pow:(l,u)=>bY(a,l,u),div:(l,u)=>_n(l*Mw(u,t),t),sqrN:l=>l*l,addN:(l,u)=>l+u,subN:(l,u)=>l-u,mulN:(l,u)=>l*u,inv:l=>Mw(l,t),sqrt:r.sqrt||(l=>s(a,l)),invertBatch:l=>vY(a,l),cmov:(l,u,c)=>c?u:l,toBytes:l=>n?f3(l,o):ha(l,o),fromBytes:l=>{if(l.length!==o)throw new Error(`Fp.fromBytes: expected ${o}, got ${l.length}`);return n?c3(l):Er(l)}});return Object.freeze(a)}function eN(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function tN(t){const e=eN(t);return e+Math.ceil(e/2)}function kY(t,e,n=!1){const r=t.length,i=eN(e),o=tN(e);if(r<16||r1024)throw new Error(`expected ${o}-1024 bytes of input, got ${r}`);const s=n?Er(t):c3(t),a=_n(s,e-qt)+qt;return n?f3(a,i):ha(a,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const xY=BigInt(0),Eb=BigInt(1);function EY(t,e){const n=(i,o)=>{const s=o.negate();return i?s:o},r=i=>{const o=Math.ceil(e/i)+1,s=2**(i-1);return{windows:o,windowSize:s}};return{constTimeNegate:n,unsafeLadder(i,o){let s=t.ZERO,a=i;for(;o>xY;)o&Eb&&(s=s.add(a)),a=a.double(),o>>=Eb;return s},precomputeWindow(i,o){const{windows:s,windowSize:a}=r(o),l=[];let u=i,c=u;for(let f=0;f>=h,b>l&&(b-=d,s+=Eb);const y=m,v=m+Math.abs(b)-1,w=p%2!==0,g=b<0;b===0?c=c.add(n(w,o[y])):u=u.add(n(g,o[v]))}return{p:u,f:c}},wNAFCached(i,o,s,a){const l=i._WINDOW_SIZE||1;let u=o.get(i);return u||(u=this.precomputeWindow(i,l),l!==1&&o.set(i,a(u))),this.wNAF(l,u,s)}}}function nN(t){return yY(t.Fp),Ch(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...XD(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function SY(t){const e=nN(t);Ch(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:i}=e;if(n){if(!r.eql(i,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:CY,hexToBytes:_Y}=fY,Xa={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(t){const{Err:e}=Xa;if(t.length<2||t[0]!==2)throw new e("Invalid signature integer tag");const n=t[1],r=t.subarray(2,n+2);if(!n||r.length!==n)throw new e("Invalid signature integer: wrong length");if(r[0]&128)throw new e("Invalid signature integer: negative");if(r[0]===0&&!(r[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:CY(r),l:t.subarray(n+2)}},toSig(t){const{Err:e}=Xa,n=typeof t=="string"?_Y(t):t;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let r=n.length;if(r<2||n[0]!=48)throw new e("Invalid signature tag");if(n[1]!==r-2)throw new e("Invalid signature: incorrect length");const{d:i,l:o}=Xa._parseInt(n.subarray(2)),{d:s,l:a}=Xa._parseInt(o);if(a.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s}},hexFromSig(t){const e=u=>Number.parseInt(u[0],16)&8?"00"+u:u,n=u=>{const c=u.toString(16);return c.length&1?`0${c}`:c},r=e(n(t.s)),i=e(n(t.r)),o=r.length/2,s=i.length/2,a=n(o),l=n(s);return`30${n(s+o+4)}02${l}${i}02${a}${r}`}},Lo=BigInt(0),ti=BigInt(1);BigInt(2);const C4=BigInt(3);BigInt(4);function AY(t){const e=SY(t),{Fp:n}=e,r=e.toBytes||((p,m,b)=>{const y=m.toAffine();return Nl(Uint8Array.from([4]),n.toBytes(y.x),n.toBytes(y.y))}),i=e.fromBytes||(p=>{const m=p.subarray(1),b=n.fromBytes(m.subarray(0,n.BYTES)),y=n.fromBytes(m.subarray(n.BYTES,2*n.BYTES));return{x:b,y}});function o(p){const{a:m,b}=e,y=n.sqr(p),v=n.mul(y,p);return n.add(n.add(v,n.mul(p,m)),b)}if(!n.eql(n.sqr(e.Gy),o(e.Gx)))throw new Error("bad generator point: equation left != right");function s(p){return typeof p=="bigint"&&Lon.eql(w,n.ZERO);return v(b)&&v(y)?f.ZERO:new f(b,y,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(m){const b=n.invertBatch(m.map(y=>y.pz));return m.map((y,v)=>y.toAffine(b[v])).map(f.fromAffine)}static fromHex(m){const b=f.fromAffine(i(Bn("pointHex",m)));return b.assertValidity(),b}static fromPrivateKey(m){return f.BASE.multiply(l(m))}_setWindowSize(m){this._WINDOW_SIZE=m,u.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!n.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:m,y:b}=this.toAffine();if(!n.isValid(m)||!n.isValid(b))throw new Error("bad point: x or y not FE");const y=n.sqr(b),v=o(m);if(!n.eql(y,v))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:m}=this.toAffine();if(n.isOdd)return!n.isOdd(m);throw new Error("Field doesn't support isOdd")}equals(m){c(m);const{px:b,py:y,pz:v}=this,{px:w,py:g,pz:x}=m,k=n.eql(n.mul(b,x),n.mul(w,v)),E=n.eql(n.mul(y,x),n.mul(g,v));return k&&E}negate(){return new f(this.px,n.neg(this.py),this.pz)}double(){const{a:m,b}=e,y=n.mul(b,C4),{px:v,py:w,pz:g}=this;let x=n.ZERO,k=n.ZERO,E=n.ZERO,D=n.mul(v,v),O=n.mul(w,w),N=n.mul(g,g),C=n.mul(v,w);return C=n.add(C,C),E=n.mul(v,g),E=n.add(E,E),x=n.mul(m,E),k=n.mul(y,N),k=n.add(x,k),x=n.sub(O,k),k=n.add(O,k),k=n.mul(x,k),x=n.mul(C,x),E=n.mul(y,E),N=n.mul(m,N),C=n.sub(D,N),C=n.mul(m,C),C=n.add(C,E),E=n.add(D,D),D=n.add(E,D),D=n.add(D,N),D=n.mul(D,C),k=n.add(k,D),N=n.mul(w,g),N=n.add(N,N),D=n.mul(N,C),x=n.sub(x,D),E=n.mul(N,O),E=n.add(E,E),E=n.add(E,E),new f(x,k,E)}add(m){c(m);const{px:b,py:y,pz:v}=this,{px:w,py:g,pz:x}=m;let k=n.ZERO,E=n.ZERO,D=n.ZERO;const O=e.a,N=n.mul(e.b,C4);let C=n.mul(b,w),R=n.mul(y,g),T=n.mul(v,x),q=n.add(b,y),A=n.add(w,g);q=n.mul(q,A),A=n.add(C,R),q=n.sub(q,A),A=n.add(b,v);let S=n.add(w,x);return A=n.mul(A,S),S=n.add(C,T),A=n.sub(A,S),S=n.add(y,v),k=n.add(g,x),S=n.mul(S,k),k=n.add(R,T),S=n.sub(S,k),D=n.mul(O,A),k=n.mul(N,T),D=n.add(k,D),k=n.sub(R,D),D=n.add(R,D),E=n.mul(k,D),R=n.add(C,C),R=n.add(R,C),T=n.mul(O,T),A=n.mul(N,A),R=n.add(R,T),T=n.sub(C,T),T=n.mul(O,T),A=n.add(A,T),C=n.mul(R,A),E=n.add(E,C),C=n.mul(S,A),k=n.mul(q,k),k=n.sub(k,C),C=n.mul(q,R),D=n.mul(S,D),D=n.add(D,C),new f(k,E,D)}subtract(m){return this.add(m.negate())}is0(){return this.equals(f.ZERO)}wNAF(m){return h.wNAFCached(this,u,m,b=>{const y=n.invertBatch(b.map(v=>v.pz));return b.map((v,w)=>v.toAffine(y[w])).map(f.fromAffine)})}multiplyUnsafe(m){const b=f.ZERO;if(m===Lo)return b;if(a(m),m===ti)return this;const{endo:y}=e;if(!y)return h.unsafeLadder(this,m);let{k1neg:v,k1:w,k2neg:g,k2:x}=y.splitScalar(m),k=b,E=b,D=this;for(;w>Lo||x>Lo;)w&ti&&(k=k.add(D)),x&ti&&(E=E.add(D)),D=D.double(),w>>=ti,x>>=ti;return v&&(k=k.negate()),g&&(E=E.negate()),E=new f(n.mul(E.px,y.beta),E.py,E.pz),k.add(E)}multiply(m){a(m);let b=m,y,v;const{endo:w}=e;if(w){const{k1neg:g,k1:x,k2neg:k,k2:E}=w.splitScalar(b);let{p:D,f:O}=this.wNAF(x),{p:N,f:C}=this.wNAF(E);D=h.constTimeNegate(g,D),N=h.constTimeNegate(k,N),N=new f(n.mul(N.px,w.beta),N.py,N.pz),y=D.add(N),v=O.add(C)}else{const{p:g,f:x}=this.wNAF(b);y=g,v=x}return f.normalizeZ([y,v])[0]}multiplyAndAddUnsafe(m,b,y){const v=f.BASE,w=(x,k)=>k===Lo||k===ti||!x.equals(v)?x.multiplyUnsafe(k):x.multiply(k),g=w(this,b).add(w(m,y));return g.is0()?void 0:g}toAffine(m){const{px:b,py:y,pz:v}=this,w=this.is0();m==null&&(m=w?n.ONE:n.inv(v));const g=n.mul(b,m),x=n.mul(y,m),k=n.mul(v,m);if(w)return{x:n.ZERO,y:n.ZERO};if(!n.eql(k,n.ONE))throw new Error("invZ was invalid");return{x:g,y:x}}isTorsionFree(){const{h:m,isTorsionFree:b}=e;if(m===ti)return!0;if(b)return b(f,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:m,clearCofactor:b}=e;return m===ti?this:b?b(f,this):this.multiplyUnsafe(e.h)}toRawBytes(m=!0){return this.assertValidity(),r(f,this,m)}toHex(m=!0){return mc(this.toRawBytes(m))}}f.BASE=new f(e.Gx,e.Gy,n.ONE),f.ZERO=new f(n.ZERO,n.ONE,n.ZERO);const d=e.nBitLength,h=EY(f,e.endo?Math.ceil(d/2):d);return{CURVE:e,ProjectivePoint:f,normPrivateKeyToScalar:l,weierstrassEquation:o,isWithinCurveOrder:s}}function TY(t){const e=nN(t);return Ch(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function MY(t){const e=TY(t),{Fp:n,n:r}=e,i=n.BYTES+1,o=2*n.BYTES+1;function s(A){return Lomc(ha(A,e.nByteLength));function p(A){const S=r>>ti;return A>S}function m(A){return p(A)?a(-A):A}const b=(A,S,P)=>Er(A.slice(S,P));class y{constructor(S,P,B){this.r=S,this.s=P,this.recovery=B,this.assertValidity()}static fromCompact(S){const P=e.nByteLength;return S=Bn("compactSignature",S,P*2),new y(b(S,0,P),b(S,P,2*P))}static fromDER(S){const{r:P,s:B}=Xa.toSig(Bn("DER",S));return new y(P,B)}assertValidity(){if(!d(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!d(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(S){return new y(this.r,this.s,S)}recoverPublicKey(S){const{r:P,s:B,recovery:j}=this,z=E(Bn("msgHash",S));if(j==null||![0,1,2,3].includes(j))throw new Error("recovery id invalid");const J=j===2||j===3?P+e.n:P;if(J>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const K=j&1?"03":"02",ae=u.fromHex(K+h(J)),fe=l(J),ke=a(-z*fe),ve=a(B*fe),xe=u.BASE.multiplyAndAddUnsafe(ae,ke,ve);if(!xe)throw new Error("point at infinify");return xe.assertValidity(),xe}hasHighS(){return p(this.s)}normalizeS(){return this.hasHighS()?new y(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return gc(this.toDERHex())}toDERHex(){return Xa.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return gc(this.toCompactHex())}toCompactHex(){return h(this.r)+h(this.s)}}const v={isValidPrivateKey(A){try{return c(A),!0}catch{return!1}},normPrivateKeyToScalar:c,randomPrivateKey:()=>{const A=tN(e.n);return kY(e.randomBytes(A),e.n)},precompute(A=8,S=u.BASE){return S._setWindowSize(A),S.multiply(BigInt(3)),S}};function w(A,S=!0){return u.fromPrivateKey(A).toRawBytes(S)}function g(A){const S=A instanceof Uint8Array,P=typeof A=="string",B=(S||P)&&A.length;return S?B===i||B===o:P?B===2*i||B===2*o:A instanceof u}function x(A,S,P=!0){if(g(A))throw new Error("first arg must be private key");if(!g(S))throw new Error("second arg must be public key");return u.fromHex(S).multiply(c(A)).toRawBytes(P)}const k=e.bits2int||function(A){const S=Er(A),P=A.length*8-e.nBitLength;return P>0?S>>BigInt(P):S},E=e.bits2int_modN||function(A){return a(k(A))},D=d3(e.nBitLength);function O(A){if(typeof A!="bigint")throw new Error("bigint expected");if(!(Lo<=A&&AOe in P))throw new Error("sign() legacy options not supported");const{hash:B,randomBytes:j}=e;let{lowS:z,prehash:J,extraEntropy:K}=P;z==null&&(z=!0),A=Bn("msgHash",A),J&&(A=Bn("prehashed msgHash",B(A)));const ae=E(A),fe=c(S),ke=[O(fe),O(ae)];if(K!=null){const Oe=K===!0?j(n.BYTES):K;ke.push(Bn("extraEntropy",Oe))}const ve=Nl(...ke),xe=ae;function Se(Oe){const Fe=k(Oe);if(!d(Fe))return;const mt=l(Fe),Ce=u.BASE.multiply(Fe).toAffine(),pe=a(Ce.x);if(pe===Lo)return;const De=a(mt*a(xe+pe*fe));if(De===Lo)return;let Le=(Ce.x===pe?0:2)|Number(Ce.y&ti),Ge=De;return z&&p(De)&&(Ge=m(De),Le^=1),new y(pe,Ge,Le)}return{seed:ve,k2sig:Se}}const C={lowS:e.lowS,prehash:!1},R={lowS:e.lowS,prehash:!1};function T(A,S,P=C){const{seed:B,k2sig:j}=N(A,S,P),z=e;return QD(z.hash.outputLen,z.nByteLength,z.hmac)(B,j)}u.BASE._setWindowSize(8);function q(A,S,P,B=R){var j;const z=A;if(S=Bn("msgHash",S),P=Bn("publicKey",P),"strict"in B)throw new Error("options.strict was renamed to lowS");const{lowS:J,prehash:K}=B;let ae,fe;try{if(typeof z=="string"||z instanceof Uint8Array)try{ae=y.fromDER(z)}catch(pe){if(!(pe instanceof Xa.Err))throw pe;ae=y.fromCompact(z)}else if(typeof z=="object"&&typeof z.r=="bigint"&&typeof z.s=="bigint"){const{r:pe,s:De}=z;ae=new y(pe,De)}else throw new Error("PARSE");fe=u.fromHex(P)}catch(pe){if(pe.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(J&&ae.hasHighS())return!1;K&&(S=e.hash(S));const{r:ke,s:ve}=ae,xe=E(S),Se=l(ve),Oe=a(xe*Se),Fe=a(ke*Se),mt=(j=u.BASE.multiplyAndAddUnsafe(fe,Oe,Fe))==null?void 0:j.toAffine();return mt?a(mt.x)===ke:!1}return{CURVE:e,getPublicKey:w,getSharedSecret:x,sign:T,verify:q,ProjectivePoint:u,Signature:y,utils:v}}let rN=class extends KD{constructor(e,n){super(),this.finished=!1,this.destroyed=!1,VZ(e);const r=l3(n);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,o=new Uint8Array(i);o.set(r.length>i?e.create().update(r).digest():r);for(let s=0;snew rN(t,e).update(n).digest();iN.create=(t,e)=>new rN(t,e);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function OY(t){return{hash:t,hmac:(e,...n)=>iN(t,e,KZ(...n)),randomBytes:GD}}function DY(t,e){const n=r=>MY({...t,...OY(r)});return Object.freeze({...n(e),create:n})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const bg=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Cm=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),oN=BigInt(1),_m=BigInt(2),_4=(t,e)=>(t+e/_m)/e;function sN(t){const e=bg,n=BigInt(3),r=BigInt(6),i=BigInt(11),o=BigInt(22),s=BigInt(23),a=BigInt(44),l=BigInt(88),u=t*t*t%e,c=u*u*t%e,f=Zr(c,n,e)*c%e,d=Zr(f,n,e)*c%e,h=Zr(d,_m,e)*u%e,p=Zr(h,i,e)*h%e,m=Zr(p,o,e)*p%e,b=Zr(m,a,e)*m%e,y=Zr(b,l,e)*b%e,v=Zr(y,a,e)*m%e,w=Zr(v,n,e)*c%e,g=Zr(w,s,e)*p%e,x=Zr(g,r,e)*u%e,k=Zr(x,_m,e);if(!Ow.eql(Ow.sqr(k),t))throw new Error("Cannot find square root");return k}const Ow=wY(bg,void 0,void 0,{sqrt:sN}),Lc=DY({a:BigInt(0),b:BigInt(7),Fp:Ow,n:Cm,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=Cm,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-oN*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=n,s=BigInt("0x100000000000000000000000000000000"),a=_4(o*t,e),l=_4(-r*t,e);let u=_n(t-a*n-l*i,e),c=_n(-a*r-l*o,e);const f=u>s,d=c>s;if(f&&(u=e-u),d&&(c=e-c),u>s||c>s)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:f,k1:u,k2neg:d,k2:c}}}},Aw),vg=BigInt(0),aN=t=>typeof t=="bigint"&&vgtypeof t=="bigint"&&vgi.charCodeAt(0)));n=Nl(r,r),A4[t]=n}return Aw(Nl(n,...e))}const h3=t=>t.toRawBytes(!0).slice(1),Dw=t=>ha(t,32),Sb=t=>_n(t,bg),Hd=t=>_n(t,Cm),p3=Lc.ProjectivePoint,$Y=(t,e,n)=>p3.BASE.multiplyAndAddUnsafe(t,e,n);function Nw(t){let e=Lc.utils.normPrivateKeyToScalar(t),n=p3.fromPrivateKey(e);return{scalar:n.hasEvenY()?e:Hd(-e),bytes:h3(n)}}function lN(t){if(!aN(t))throw new Error("bad x: need 0 < x < p");const e=Sb(t*t),n=Sb(e*t+BigInt(7));let r=sN(n);r%_m!==vg&&(r=Sb(-r));const i=new p3(t,r,oN);return i.assertValidity(),i}function uN(...t){return Hd(Er(Am("BIP0340/challenge",...t)))}function IY(t){return Nw(t).bytes}function RY(t,e,n=GD(32)){const r=Bn("message",t),{bytes:i,scalar:o}=Nw(e),s=Bn("auxRand",n,32),a=Dw(o^Er(Am("BIP0340/aux",s))),l=Am("BIP0340/nonce",a,i,r),u=Hd(Er(l));if(u===vg)throw new Error("sign failed: k is zero");const{bytes:c,scalar:f}=Nw(u),d=uN(c,i,r),h=new Uint8Array(64);if(h.set(c,0),h.set(Dw(Hd(f+d*o)),32),!cN(h,r,i))throw new Error("sign: Invalid signature produced");return h}function cN(t,e,n){const r=Bn("signature",t,64),i=Bn("message",e),o=Bn("publicKey",n,32);try{const s=lN(Er(o)),a=Er(r.subarray(0,32));if(!aN(a))return!1;const l=Er(r.subarray(32,64));if(!NY(l))return!1;const u=uN(Dw(a),h3(s),i),c=$Y(s,l,Hd(-u));return!(!c||!c.hasEvenY()||c.toAffine().x!==a)}catch{return!1}}const eo={getPublicKey:IY,sign:RY,verify:cN,utils:{randomPrivateKey:Lc.utils.randomPrivateKey,lift_x:lN,pointToBytes:h3,numberToBytesBE:ha,bytesToNumberBE:Er,taggedHash:Am,mod:_n}};var FY=27235,Gl=Symbol("verified"),LY=t=>t instanceof Object;function BY(t){if(!LY(t)||typeof t.kind!="number"||typeof t.content!="string"||typeof t.created_at!="number"||typeof t.pubkey!="string"||!t.pubkey.match(/^[a-f0-9]{64}$/)||!Array.isArray(t.tags))return!1;for(let e=0;ef[0]==="url"))==null?void 0:r[1])||"",c=((o=(i=l.nip94_event)==null?void 0:i.tags.find(f=>f[0]==="x"))==null?void 0:o[1])||"";return{url:u,sha256:c}}catch(s){throw new Error(s)}}function VY(t){return Array.from(new Uint8Array(t)).map(e=>e.toString(16).padStart(2,"0")).join("")}const HY=is.create({name:"fileUpload",addOptions(){return{allowedMimeTypes:["image/jpeg","image/png","image/gif","video/mp4","video/mpeg","video/webm"],immediateUpload:!1,expiration:6e4,async hash(t){return VY(await crypto.subtle.digest("SHA-256",await t.arrayBuffer()))},onDrop(){},onComplete(){}}},addCommands(){return{selectFiles:()=>t=>(t.tr.setMeta("selectFiles",!0),!0),uploadFiles:()=>t=>(t.tr.setMeta("uploadFiles",!0),!0)}},addProseMirrorPlugins(){const t=new WY(this.editor,this.options);return[new ns({key:new rs("fileUploadPlugin"),state:{init(){return{}},apply(e){return setTimeout(()=>{e.getMeta("selectFiles")?(t.selectFile(),e.setMeta("selectFiles",null)):e.getMeta("uploadFiles")&&(t.uploadFiles(),e.setMeta("uploadFiles",null))}),{}}},props:{handleDrop:(e,n)=>t.handleDrop(n)}})]}});class WY{constructor(e,n){this.editor=e,this.options=n}get view(){return this.editor.view}addFile(e,n){if(!this.options.allowedMimeTypes.includes(e.type))return!1;const{tr:r}=this.view.state,[i]=e.type.split("/"),o=this.view.state.schema.nodes[i].create({file:e,src:URL.createObjectURL(e),alt:""});return r.insert(n,o),this.view.dispatch(r),this.options.immediateUpload&&this.upload(o,n),this.options.onDrop(this.editor,e,n),!0}findNodes(e){const n=[];return this.view.state.doc.descendants((r,i)=>{(r.type.name==="image"||r.type.name==="video")&&(r.attrs.sha256||(r.attrs.uploading||!1)===e&&n.push([r,i]))}),n}updateNodeAttributes(e,n){const{tr:r}=this.view.state;Object.entries(n).forEach(([i,o])=>o!==void 0&&r.setNodeAttribute(e,i,o)),this.view.dispatch(r)}onUploadDone(e,n){this.findNodes(!0).forEach(([r,i])=>{r.attrs.src===e.attrs.src&&this.updateNodeAttributes(i,{uploading:!1,src:n.url,sha256:n.sha256,uploadError:n.error})})}async upload(e,n){const{sign:r,hash:i,expiration:o}=this.options,{file:s,alt:a,uploadType:l,uploadUrl:u}=e.attrs;this.updateNodeAttributes(n,{uploading:!0,uploadError:null});try{if(l==="nip96"){const c=await UY({file:s,alt:a,sign:r,serverUrl:u});this.onUploadDone(e,c)}else{const c=await bZ({file:s,serverUrl:u,hash:i,sign:r,expiration:o});this.onUploadDone(e,c)}}catch(c){const f=c;throw this.onUploadDone(e,{error:f}),new Error(f)}}async uploadFiles(){const e=this.findNodes(!1).map(([n,r])=>this.upload(n,r));try{await Promise.all(e),this.options.onComplete(this.editor)}catch(n){console.error(n)}}selectFile(){const e=document.createElement("input");e.type="file",e.multiple=!0,e.accept=this.options.allowedMimeTypes.join(","),e.onchange=n=>{const r=n.target.files;r&&Array.from(r).forEach(i=>{if(i){const o=this.view.state.selection.from+1;this.addFile(i,o)}})},e.click()}handleDrop(e){var n,r,i;e.preventDefault();const o=(n=this.view.posAtCoords({left:e.clientX,top:e.clientY}))==null?void 0:n.pos;if(o===void 0)return!1;const s=(i=(r=e.dataTransfer)==null?void 0:r.files)==null?void 0:i[0];s&&this.addFile(s,o)}}const JY=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,KY=Ri.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",qd(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[XG({find:JY,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}}),T4={};function GY(t){let e=T4[t];if(e)return e;e=T4[t]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);e.push(r)}for(let n=0;n=55296&&c<=57343?i+="���":i+=String.fromCharCode(c),o+=6;continue}}if((a&248)===240&&o+91114111?i+="����":(f-=65536,i+=String.fromCharCode(55296+(f>>10),56320+(f&1023))),o+=9;continue}}i+="�"}return i})}yc.defaultChars=";/?:@&=+$,#";yc.componentChars="";const M4={};function ZY(t){let e=M4[t];if(e)return e;e=M4[t]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);/^[0-9a-z]$/i.test(r)?e.push(r):e.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n"u"&&(n=!0);const r=ZY(e);let i="";for(let o=0,s=t.length;o=55296&&a<=57343){if(a>=55296&&a<=56319&&o+1=56320&&l<=57343){i+=encodeURIComponent(t[o]+t[o+1]),o++;continue}}i+="%EF%BF%BD";continue}i+=encodeURIComponent(t[o])}return i}_h.defaultChars=";/?:@&=+$,-_.!~*'()#";_h.componentChars="-_.!~*'()";function m3(t){let e="";return e+=t.protocol||"",e+=t.slashes?"//":"",e+=t.auth?t.auth+"@":"",t.hostname&&t.hostname.indexOf(":")!==-1?e+="["+t.hostname+"]":e+=t.hostname||"",e+=t.port?":"+t.port:"",e+=t.pathname||"",e+=t.search||"",e+=t.hash||"",e}function Tm(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const YY=/^([a-z0-9.+-]+:)/i,QY=/:[0-9]*$/,XY=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,eQ=["<",">",'"',"`"," ","\r",` +`," "],tQ=["{","}","|","\\","^","`"].concat(eQ),nQ=["'"].concat(tQ),O4=["%","/","?",";","#"].concat(nQ),D4=["/","?","#"],rQ=255,N4=/^[+a-z0-9A-Z_-]{0,63}$/,iQ=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,$4={javascript:!0,"javascript:":!0},I4={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function g3(t,e){if(t&&t instanceof Tm)return t;const n=new Tm;return n.parse(t,e),n}Tm.prototype.parse=function(t,e){let n,r,i,o=t;if(o=o.trim(),!e&&t.split("#").length===1){const u=XY.exec(o);if(u)return this.pathname=u[1],u[2]&&(this.search=u[2]),this}let s=YY.exec(o);if(s&&(s=s[0],n=s.toLowerCase(),this.protocol=s,o=o.substr(s.length)),(e||s||o.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i=o.substr(0,2)==="//",i&&!(s&&$4[s])&&(o=o.substr(2),this.slashes=!0)),!$4[s]&&(i||s&&!I4[s])){let u=-1;for(let p=0;p127?v+="x":v+=y[w];if(!v.match(N4)){const w=p.slice(0,m),g=p.slice(m+1),x=y.match(iQ);x&&(w.push(x[1]),g.unshift(x[2])),g.length&&(o=g.join(".")+o),this.hostname=w.join(".");break}}}}this.hostname.length>rQ&&(this.hostname=""),h&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const a=o.indexOf("#");a!==-1&&(this.hash=o.substr(a),o=o.slice(0,a));const l=o.indexOf("?");return l!==-1&&(this.search=o.substr(l),o=o.slice(0,l)),o&&(this.pathname=o),I4[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};Tm.prototype.parseHost=function(t){let e=QY.exec(t);e&&(e=e[0],e!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};const oQ=Object.freeze(Object.defineProperty({__proto__:null,decode:yc,encode:_h,format:m3,parse:g3},Symbol.toStringTag,{value:"Module"})),dN=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,hN=/[\0-\x1F\x7F-\x9F]/,sQ=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,y3=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,pN=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,mN=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,aQ=Object.freeze(Object.defineProperty({__proto__:null,Any:dN,Cc:hN,Cf:sQ,P:y3,S:pN,Z:mN},Symbol.toStringTag,{value:"Module"})),lQ=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(t=>t.charCodeAt(0))),uQ=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(t=>t.charCodeAt(0)));var _b;const cQ=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),fQ=(_b=String.fromCodePoint)!==null&&_b!==void 0?_b:function(t){let e="";return t>65535&&(t-=65536,e+=String.fromCharCode(t>>>10&1023|55296),t=56320|t&1023),e+=String.fromCharCode(t),e};function dQ(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=cQ.get(t))!==null&&e!==void 0?e:t}var cn;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(cn||(cn={}));const hQ=32;var Hs;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(Hs||(Hs={}));function $w(t){return t>=cn.ZERO&&t<=cn.NINE}function pQ(t){return t>=cn.UPPER_A&&t<=cn.UPPER_F||t>=cn.LOWER_A&&t<=cn.LOWER_F}function mQ(t){return t>=cn.UPPER_A&&t<=cn.UPPER_Z||t>=cn.LOWER_A&&t<=cn.LOWER_Z||$w(t)}function gQ(t){return t===cn.EQUALS||mQ(t)}var on;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(on||(on={}));var Bs;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(Bs||(Bs={}));let yQ=class{constructor(e,n,r){this.decodeTree=e,this.emitCodePoint=n,this.errors=r,this.state=on.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Bs.Strict}startEntity(e){this.decodeMode=e,this.state=on.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case on.EntityStart:return e.charCodeAt(n)===cn.NUM?(this.state=on.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=on.NamedEntity,this.stateNamedEntity(e,n));case on.NumericStart:return this.stateNumericStart(e,n);case on.NumericDecimal:return this.stateNumericDecimal(e,n);case on.NumericHex:return this.stateNumericHex(e,n);case on.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|hQ)===cn.LOWER_X?(this.state=on.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=on.NumericDecimal,this.stateNumericDecimal(e,n))}addToNumericResult(e,n,r,i){if(n!==r){const o=r-n;this.result=this.result*Math.pow(i,o)+parseInt(e.substr(n,o),i),this.consumed+=o}}stateNumericHex(e,n){const r=n;for(;n>14;for(;n>14,o!==0){if(s===cn.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==Bs.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:n,decodeTree:r}=this,i=(r[n]&Hs.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[e]&~Hs.VALUE_LENGTH:i[e+1],r),n===3&&this.emitCodePoint(i[e+2],r),r}end(){var e;switch(this.state){case on.NamedEntity:return this.result!==0&&(this.decodeMode!==Bs.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case on.NumericDecimal:return this.emitNumericEntity(0,2);case on.NumericHex:return this.emitNumericEntity(0,3);case on.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case on.EntityStart:return 0}}};function gN(t){let e="";const n=new yQ(t,r=>e+=fQ(r));return function(i,o){let s=0,a=0;for(;(a=i.indexOf("&",a))>=0;){e+=i.slice(s,a),n.startEntity(o);const u=n.write(i,a+1);if(u<0){s=a+n.end();break}s=a+u,a=u===0?s+1:s}const l=e+i.slice(s);return e="",l}}function bQ(t,e,n,r){const i=(e&Hs.BRANCH_LENGTH)>>7,o=e&Hs.JUMP_TABLE;if(i===0)return o!==0&&r===o?n:-1;if(o){const l=r-o;return l<0||l>=i?-1:t[n+l]-1}let s=n,a=s+i-1;for(;s<=a;){const l=s+a>>>1,u=t[l];if(ur)a=l-1;else return t[l+i]}return-1}const vQ=gN(lQ);gN(uQ);function yN(t,e=Bs.Legacy){return vQ(t,e)}function wQ(t){return Object.prototype.toString.call(t)}function b3(t){return wQ(t)==="[object String]"}const kQ=Object.prototype.hasOwnProperty;function xQ(t,e){return kQ.call(t,e)}function kg(t){return Array.prototype.slice.call(arguments,1).forEach(function(n){if(n){if(typeof n!="object")throw new TypeError(n+"must be object");Object.keys(n).forEach(function(r){t[r]=n[r]})}}),t}function bN(t,e,n){return[].concat(t.slice(0,e),n,t.slice(e+1))}function v3(t){return!(t>=55296&&t<=57343||t>=64976&&t<=65007||(t&65535)===65535||(t&65535)===65534||t>=0&&t<=8||t===11||t>=14&&t<=31||t>=127&&t<=159||t>1114111)}function Mm(t){if(t>65535){t-=65536;const e=55296+(t>>10),n=56320+(t&1023);return String.fromCharCode(e,n)}return String.fromCharCode(t)}const vN=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,EQ=/&([a-z#][a-z0-9]{1,31});/gi,SQ=new RegExp(vN.source+"|"+EQ.source,"gi"),CQ=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function _Q(t,e){if(e.charCodeAt(0)===35&&CQ.test(e)){const r=e[1].toLowerCase()==="x"?parseInt(e.slice(2),16):parseInt(e.slice(1),10);return v3(r)?Mm(r):t}const n=yN(t);return n!==t?n:t}function AQ(t){return t.indexOf("\\")<0?t:t.replace(vN,"$1")}function bc(t){return t.indexOf("\\")<0&&t.indexOf("&")<0?t:t.replace(SQ,function(e,n,r){return n||_Q(e,r)})}const TQ=/[&<>"]/,MQ=/[&<>"]/g,OQ={"&":"&","<":"<",">":">",'"':"""};function DQ(t){return OQ[t]}function pa(t){return TQ.test(t)?t.replace(MQ,DQ):t}const NQ=/[.?*+^$[\]\\(){}|-]/g;function $Q(t){return t.replace(NQ,"\\$&")}function wt(t){switch(t){case 9:case 32:return!0}return!1}function Wd(t){if(t>=8192&&t<=8202)return!0;switch(t){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function Jd(t){return y3.test(t)||pN.test(t)}function Kd(t){switch(t){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function xg(t){return t=t.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(t=t.replace(/ẞ/g,"ß")),t.toLowerCase().toUpperCase()}const IQ={mdurl:oQ,ucmicro:aQ},RQ=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:bN,assign:kg,escapeHtml:pa,escapeRE:$Q,fromCodePoint:Mm,has:xQ,isMdAsciiPunct:Kd,isPunctChar:Jd,isSpace:wt,isString:b3,isValidEntityCode:v3,isWhiteSpace:Wd,lib:IQ,normalizeReference:xg,unescapeAll:bc,unescapeMd:AQ},Symbol.toStringTag,{value:"Module"}));function FQ(t,e,n){let r,i,o,s;const a=t.posMax,l=t.pos;for(t.pos=e+1,r=1;t.pos32))return o;if(r===41){if(s===0)break;s--}i++}return e===i||s!==0||(o.str=bc(t.slice(e,i)),o.pos=i,o.ok=!0),o}function BQ(t,e,n,r){let i,o=e;const s={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(r)s.str=r.str,s.marker=r.marker;else{if(o>=n)return s;let a=t.charCodeAt(o);if(a!==34&&a!==39&&a!==40)return s;e++,o++,a===40&&(a=41),s.marker=a}for(;o"+pa(o.content)+""};So.code_block=function(t,e,n,r,i){const o=t[e];return""+pa(t[e].content)+` `};So.fence=function(t,e,n,r,i){const o=t[e],s=o.info?bc(o.info).trim():"";let a="",l="";if(s){const c=s.split(/(\s+)/g);a=c[0],l=c.slice(2).join("")}let u;if(n.highlight?u=n.highlight(o.content,a,l)||pa(o.content):u=pa(o.content),u.indexOf("${u} `}return`
${u}
@@ -215,24 +215,24 @@ img.ProseMirror-separator { `};So.text=function(t,e){return pa(t[e].content)};So.html_block=function(t,e){return t[e].content};So.html_inline=function(t,e){return t[e].content};function Bc(){this.rules=kg({},So)}Bc.prototype.renderAttrs=function(e){let n,r,i;if(!e.attrs)return"";for(i="",n=0,r=e.attrs.length;n `:">",o};Bc.prototype.renderInline=function(t,e,n){let r="";const i=this.rules;for(let o=0,s=t.length;o=0&&(r=this.attrs[n][1]),r};Pi.prototype.attrJoin=function(e,n){const r=this.attrIndex(e);r<0?this.attrPush([e,n]):this.attrs[r][1]=this.attrs[r][1]+" "+n};function wN(t,e,n){this.src=t,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=e}wN.prototype.Token=Pi;const FQ=/\r\n?|\n/g,LQ=/\0/g;function BQ(t){let e;e=t.src.replace(FQ,` -`),e=e.replace(LQ,"�"),t.src=e}function PQ(t){let e;t.inlineMode?(e=new t.Token("inline","",0),e.content=t.src,e.map=[0,1],e.children=[],t.tokens.push(e)):t.md.block.parse(t.src,t.md,t.env,t.tokens)}function zQ(t){const e=t.tokens;for(let n=0,r=e.length;n\s]/i.test(t)}function qQ(t){return/^<\/a\s*>/i.test(t)}function VQ(t){const e=t.tokens;if(t.md.options.linkify)for(let n=0,r=e.length;n=0;s--){const a=i[s];if(a.type==="link_close"){for(s--;i[s].level!==a.level&&i[s].type!=="link_open";)s--;continue}if(a.type==="html_inline"&&(jQ(a.content)&&o>0&&o--,qQ(a.content)&&o++),!(o>0)&&a.type==="text"&&t.md.linkify.test(a.content)){const l=a.content;let u=t.md.linkify.match(l);const c=[];let f=a.level,d=0;u.length>0&&u[0].index===0&&s>0&&i[s-1].type==="text_special"&&(u=u.slice(1));for(let h=0;hd){const x=new t.Token("text","",0);x.content=l.slice(d,y),x.level=f,c.push(x)}const v=new t.Token("link_open","a",1);v.attrs=[["href",m]],v.level=f++,v.markup="linkify",v.info="auto",c.push(v);const w=new t.Token("text","",0);w.content=b,w.level=f,c.push(w);const g=new t.Token("link_close","a",-1);g.level=--f,g.markup="linkify",g.info="auto",c.push(g),d=u[h].lastIndex}if(d=0;n--){const r=t[n];r.type==="text"&&!e&&(r.content=r.content.replace(HQ,JQ)),r.type==="link_open"&&r.info==="auto"&&e--,r.type==="link_close"&&r.info==="auto"&&e++}}function GQ(t){let e=0;for(let n=t.length-1;n>=0;n--){const r=t[n];r.type==="text"&&!e&&kN.test(r.content)&&(r.content=r.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),r.type==="link_open"&&r.info==="auto"&&e--,r.type==="link_close"&&r.info==="auto"&&e++}}function ZQ(t){let e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)t.tokens[e].type==="inline"&&(UQ.test(t.tokens[e].content)&&KQ(t.tokens[e].children),kN.test(t.tokens[e].content)&&GQ(t.tokens[e].children))}const YQ=/['"]/,R4=/['"]/g,F4="’";function wp(t,e,n){return t.slice(0,e)+n+t.slice(e+1)}function QQ(t,e){let n;const r=[];for(let i=0;i=0&&!(r[n].level<=s);n--);if(r.length=n+1,o.type!=="text")continue;let a=o.content,l=0,u=a.length;e:for(;l=0)p=a.charCodeAt(c.index-1);else for(n=i-1;n>=0&&!(t[n].type==="softbreak"||t[n].type==="hardbreak");n--)if(t[n].content){p=t[n].content.charCodeAt(t[n].content.length-1);break}let m=32;if(l=48&&p<=57&&(d=f=!1),f&&d&&(f=b,d=y),!f&&!d){h&&(o.content=wp(o.content,c.index,F4));continue}if(d)for(n=r.length-1;n>=0;n--){let g=r[n];if(r[n].level=0;e--)t.tokens[e].type!=="inline"||!YQ.test(t.tokens[e].content)||QQ(t.tokens[e].children,t)}function eX(t){let e,n;const r=t.tokens,i=r.length;for(let o=0;o0&&this.level++,this.tokens.push(r),r};Co.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]};Co.prototype.skipEmptyLines=function(e){for(let n=this.lineMax;en;)if(!wt(this.src.charCodeAt(--e)))return e+1;return e};Co.prototype.skipChars=function(e,n){for(let r=this.src.length;er;)if(n!==this.src.charCodeAt(--e))return e+1;return e};Co.prototype.getLines=function(e,n,r,i){if(e>=n)return"";const o=new Array(n-e);for(let s=0,a=e;ar?o[s]=new Array(l-r+1).join(" ")+this.src.slice(c,f):o[s]=this.src.slice(c,f)}return o.join("")};Co.prototype.Token=Pi;const tX=65536;function Tb(t,e){const n=t.bMarks[e]+t.tShift[e],r=t.eMarks[e];return t.src.slice(n,r)}function L4(t){const e=[],n=t.length;let r=0,i=t.charCodeAt(r),o=!1,s=0,a="";for(;rn)return!1;let i=e+1;if(t.sCount[i]=4)return!1;let o=t.bMarks[i]+t.tShift[i];if(o>=t.eMarks[i])return!1;const s=t.src.charCodeAt(o++);if(s!==124&&s!==45&&s!==58||o>=t.eMarks[i])return!1;const a=t.src.charCodeAt(o++);if(a!==124&&a!==45&&a!==58&&!wt(a)||s===45&&wt(a))return!1;for(;o=4)return!1;u=L4(l),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop();const f=u.length;if(f===0||f!==c.length)return!1;if(r)return!0;const d=t.parentType;t.parentType="table";const h=t.md.block.ruler.getRules("blockquote"),p=t.push("table_open","table",1),m=[e,0];p.map=m;const b=t.push("thead_open","thead",1);b.map=[e,e+1];const y=t.push("tr_open","tr",1);y.map=[e,e+1];for(let g=0;g=4||(u=L4(l),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop(),w+=f-u.length,w>tX))break;if(i===e+2){const k=t.push("tbody_open","tbody",1);k.map=v=[e+2,0]}const x=t.push("tr_open","tr",1);x.map=[i,i+1];for(let k=0;k=4){r++,i=r;continue}break}t.line=i;const o=t.push("code_block","code",0);return o.content=t.getLines(e,i,4+t.blkIndent,!1)+` -`,o.map=[e,t.line],!0}function iX(t,e,n,r){let i=t.bMarks[e]+t.tShift[e],o=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||i+3>o)return!1;const s=t.src.charCodeAt(i);if(s!==126&&s!==96)return!1;let a=i;i=t.skipChars(i,s);let l=i-a;if(l<3)return!1;const u=t.src.slice(a,i),c=t.src.slice(i,o);if(s===96&&c.indexOf(String.fromCharCode(s))>=0)return!1;if(r)return!0;let f=e,d=!1;for(;f++,!(f>=n||(i=a=t.bMarks[f]+t.tShift[f],o=t.eMarks[f],i=4)&&(i=t.skipChars(i,s),!(i-a=4||t.src.charCodeAt(i)!==62)return!1;if(r)return!0;const a=[],l=[],u=[],c=[],f=t.md.block.ruler.getRules("blockquote"),d=t.parentType;t.parentType="blockquote";let h=!1,p;for(p=e;p=o)break;if(t.src.charCodeAt(i++)===62&&!w){let x=t.sCount[p]+1,k,E;t.src.charCodeAt(i)===32?(i++,x++,E=!1,k=!0):t.src.charCodeAt(i)===9?(k=!0,(t.bsCount[p]+x)%4===3?(i++,x++,E=!1):E=!0):k=!1;let D=x;for(a.push(t.bMarks[p]),t.bMarks[p]=i;i=o,l.push(t.bsCount[p]),t.bsCount[p]=t.sCount[p]+1+(k?1:0),u.push(t.sCount[p]),t.sCount[p]=D-x,c.push(t.tShift[p]),t.tShift[p]=i-t.bMarks[p];continue}if(h)break;let g=!1;for(let x=0,k=f.length;x";const y=[e,0];b.map=y,t.md.block.tokenize(t,e,p);const v=t.push("blockquote_close","blockquote",-1);v.markup=">",t.lineMax=s,t.parentType=d,y[1]=t.line;for(let w=0;w=4)return!1;let o=t.bMarks[e]+t.tShift[e];const s=t.src.charCodeAt(o++);if(s!==42&&s!==45&&s!==95)return!1;let a=1;for(;o=r)return-1;let o=t.src.charCodeAt(i++);if(o<48||o>57)return-1;for(;;){if(i>=r)return-1;if(o=t.src.charCodeAt(i++),o>=48&&o<=57){if(i-n>=10)return-1;continue}if(o===41||o===46)break;return-1}return i=4||t.listIndent>=0&&t.sCount[l]-t.listIndent>=4&&t.sCount[l]=t.blkIndent&&(c=!0);let f,d,h;if((h=P4(t,l))>=0){if(f=!0,s=t.bMarks[l]+t.tShift[l],d=Number(t.src.slice(s,h-1)),c&&d!==1)return!1}else if((h=B4(t,l))>=0)f=!1;else return!1;if(c&&t.skipSpaces(h)>=t.eMarks[l])return!1;if(r)return!0;const p=t.src.charCodeAt(h-1),m=t.tokens.length;f?(a=t.push("ordered_list_open","ol",1),d!==1&&(a.attrs=[["start",d]])):a=t.push("bullet_list_open","ul",1);const b=[l,0];a.map=b,a.markup=String.fromCharCode(p);let y=!1;const v=t.md.block.ruler.getRules("list"),w=t.parentType;for(t.parentType="list";l=i?E=1:E=x-g,E>4&&(E=1);const D=g+E;a=t.push("list_item_open","li",1),a.markup=String.fromCharCode(p);const O=[l,0];a.map=O,f&&(a.info=t.src.slice(s,h-1));const N=t.tight,C=t.tShift[l],R=t.sCount[l],T=t.listIndent;if(t.listIndent=t.blkIndent,t.blkIndent=D,t.tight=!0,t.tShift[l]=k-t.bMarks[l],t.sCount[l]=x,k>=i&&t.isEmpty(l+1)?t.line=Math.min(t.line+2,n):t.md.block.tokenize(t,l,n,!0),(!t.tight||y)&&(u=!1),y=t.line-l>1&&t.isEmpty(t.line-1),t.blkIndent=t.listIndent,t.listIndent=T,t.tShift[l]=C,t.sCount[l]=R,t.tight=N,a=t.push("list_item_close","li",-1),a.markup=String.fromCharCode(p),l=t.line,O[1]=l,l>=n||t.sCount[l]=4)break;let q=!1;for(let A=0,S=v.length;A=4||t.src.charCodeAt(i)!==91)return!1;function a(v){const w=t.lineMax;if(v>=w||t.isEmpty(v))return null;let g=!1;if(t.sCount[v]-t.blkIndent>3&&(g=!0),t.sCount[v]<0&&(g=!0),!g){const E=t.md.block.ruler.getRules("reference"),D=t.parentType;t.parentType="reference";let O=!1;for(let N=0,C=E.length;N"u"&&(t.env.references={}),typeof t.env.references[y]>"u"&&(t.env.references[y]={title:b,href:f}),t.line=s),!0):!1}const cX=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],fX="[a-zA-Z_:][a-zA-Z0-9:._-]*",dX="[^\"'=<>`\\x00-\\x20]+",hX="'[^']*'",pX='"[^"]*"',mX="(?:"+dX+"|"+hX+"|"+pX+")",gX="(?:\\s+"+fX+"(?:\\s*=\\s*"+mX+")?)",xN="<[A-Za-z][A-Za-z0-9\\-]*"+gX+"*\\s*\\/?>",EN="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",yX="",bX="<[?][\\s\\S]*?[?]>",vX="]*>",wX="",kX=new RegExp("^(?:"+xN+"|"+EN+"|"+yX+"|"+bX+"|"+vX+"|"+wX+")"),xX=new RegExp("^(?:"+xN+"|"+EN+")"),Zl=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(xX.source+"\\s*$"),/^$/,!1]];function EX(t,e,n,r){let i=t.bMarks[e]+t.tShift[e],o=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||!t.md.options.html||t.src.charCodeAt(i)!==60)return!1;let s=t.src.slice(i,o),a=0;for(;a=4)return!1;let s=t.src.charCodeAt(i);if(s!==35||i>=o)return!1;let a=1;for(s=t.src.charCodeAt(++i);s===35&&i6||ii&&wt(t.src.charCodeAt(l-1))&&(o=l),t.line=e+1;const u=t.push("heading_open","h"+String(a),1);u.markup="########".slice(0,a),u.map=[e,t.line];const c=t.push("inline","",0);c.content=t.src.slice(i,o).trim(),c.map=[e,t.line],c.children=[];const f=t.push("heading_close","h"+String(a),-1);return f.markup="########".slice(0,a),!0}function CX(t,e,n){const r=t.md.block.ruler.getRules("paragraph");if(t.sCount[e]-t.blkIndent>=4)return!1;const i=t.parentType;t.parentType="paragraph";let o=0,s,a=e+1;for(;a3)continue;if(t.sCount[a]>=t.blkIndent){let h=t.bMarks[a]+t.tShift[a];const p=t.eMarks[a];if(h=p))){o=s===61?1:2;break}}if(t.sCount[a]<0)continue;let d=!1;for(let h=0,p=r.length;h3||t.sCount[o]<0)continue;let u=!1;for(let c=0,f=r.length;c=n||t.sCount[s]=o){t.line=n;break}const l=t.line;let u=!1;for(let c=0;c=t.line)throw new Error("block rule didn't increment state.line");break}if(!u)throw new Error("none of the block rules matched");t.tight=!a,t.isEmpty(t.line-1)&&(a=!0),s=t.line,s0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(i),r};_h.prototype.scanDelims=function(t,e){const n=this.posMax,r=this.src.charCodeAt(t),i=t>0?this.src.charCodeAt(t-1):32;let o=t;for(;o0)return!1;const n=t.pos,r=t.posMax;if(n+3>r||t.src.charCodeAt(n)!==58||t.src.charCodeAt(n+1)!==47||t.src.charCodeAt(n+2)!==47)return!1;const i=t.pending.match(MX);if(!i)return!1;const o=i[1],s=t.md.linkify.matchAtStart(t.src.slice(n-o.length));if(!s)return!1;let a=s.url;if(a.length<=o.length)return!1;a=a.replace(/\*+$/,"");const l=t.md.normalizeLink(a);if(!t.md.validateLink(l))return!1;if(!e){t.pending=t.pending.slice(0,-o.length);const u=t.push("link_open","a",1);u.attrs=[["href",l]],u.markup="linkify",u.info="auto";const c=t.push("text","",0);c.content=t.md.normalizeLinkText(a);const f=t.push("link_close","a",-1);f.markup="linkify",f.info="auto"}return t.pos+=a.length-o.length,!0}function DX(t,e){let n=t.pos;if(t.src.charCodeAt(n)!==10)return!1;const r=t.pending.length-1,i=t.posMax;if(!e)if(r>=0&&t.pending.charCodeAt(r)===32)if(r>=1&&t.pending.charCodeAt(r-1)===32){let o=r-1;for(;o>=1&&t.pending.charCodeAt(o-1)===32;)o--;t.pending=t.pending.slice(0,o),t.push("hardbreak","br",0)}else t.pending=t.pending.slice(0,-1),t.push("softbreak","br",0);else t.push("softbreak","br",0);for(n++;n?@[]^_`{|}~-".split("").forEach(function(t){k3[t.charCodeAt(0)]=1});function NX(t,e){let n=t.pos;const r=t.posMax;if(t.src.charCodeAt(n)!==92||(n++,n>=r))return!1;let i=t.src.charCodeAt(n);if(i===10){for(e||t.push("hardbreak","br",0),n++;n=55296&&i<=56319&&n+1=56320&&a<=57343&&(o+=t.src[n+1],n++)}const s="\\"+o;if(!e){const a=t.push("text_special","",0);i<256&&k3[i]!==0?a.content=o:a.content=s,a.markup=s,a.info="escape"}return t.pos=n+1,!0}function $X(t,e){let n=t.pos;if(t.src.charCodeAt(n)!==96)return!1;const i=n;n++;const o=t.posMax;for(;n=0;r--){const i=e[r];if(i.marker!==95&&i.marker!==42||i.end===-1)continue;const o=e[i.end],s=r>0&&e[r-1].end===i.end+1&&e[r-1].marker===i.marker&&e[r-1].token===i.token-1&&e[i.end+1].token===o.token+1,a=String.fromCharCode(i.marker),l=t.tokens[i.token];l.type=s?"strong_open":"em_open",l.tag=s?"strong":"em",l.nesting=1,l.markup=s?a+a:a,l.content="";const u=t.tokens[o.token];u.type=s?"strong_close":"em_close",u.tag=s?"strong":"em",u.nesting=-1,u.markup=s?a+a:a,u.content="",s&&(t.tokens[e[r-1].token].content="",t.tokens[e[i.end+1].token].content="",r--)}}function LX(t){const e=t.tokens_meta,n=t.tokens_meta.length;j4(t,t.delimiters);for(let r=0;r=f)return!1;if(l=p,i=t.md.helpers.parseLinkDestination(t.src,p,t.posMax),i.ok){for(s=t.md.normalizeLink(i.str),t.md.validateLink(s)?p=i.pos:s="",l=p;p=f||t.src.charCodeAt(p)!==41)&&(u=!0),p++}if(u){if(typeof t.env.references>"u")return!1;if(p=0?r=t.src.slice(l,p++):p=h+1):p=h+1,r||(r=t.src.slice(d,h)),o=t.env.references[xg(r)],!o)return t.pos=c,!1;s=o.href,a=o.title}if(!e){t.pos=d,t.posMax=h;const m=t.push("link_open","a",1),b=[["href",s]];m.attrs=b,a&&b.push(["title",a]),t.linkLevel++,t.md.inline.tokenize(t),t.linkLevel--,t.push("link_close","a",-1)}return t.pos=p,t.posMax=f,!0}function PX(t,e){let n,r,i,o,s,a,l,u,c="";const f=t.pos,d=t.posMax;if(t.src.charCodeAt(t.pos)!==33||t.src.charCodeAt(t.pos+1)!==91)return!1;const h=t.pos+2,p=t.md.helpers.parseLinkLabel(t,t.pos+1,!1);if(p<0)return!1;if(o=p+1,o=d)return!1;for(u=o,a=t.md.helpers.parseLinkDestination(t.src,o,t.posMax),a.ok&&(c=t.md.normalizeLink(a.str),t.md.validateLink(c)?o=a.pos:c=""),u=o;o=d||t.src.charCodeAt(o)!==41)return t.pos=f,!1;o++}else{if(typeof t.env.references>"u")return!1;if(o=0?i=t.src.slice(u,o++):o=p+1):o=p+1,i||(i=t.src.slice(h,p)),s=t.env.references[xg(i)],!s)return t.pos=f,!1;c=s.href,l=s.title}if(!e){r=t.src.slice(h,p);const m=[];t.md.inline.parse(r,t.md,t.env,m);const b=t.push("image","img",0),y=[["src",c],["alt",""]];b.attrs=y,b.children=m,b.content=r,l&&y.push(["title",l])}return t.pos=o,t.posMax=d,!0}const zX=/^([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])?)*)$/,jX=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function qX(t,e){let n=t.pos;if(t.src.charCodeAt(n)!==60)return!1;const r=t.pos,i=t.posMax;for(;;){if(++n>=i)return!1;const s=t.src.charCodeAt(n);if(s===60)return!1;if(s===62)break}const o=t.src.slice(r+1,n);if(jX.test(o)){const s=t.md.normalizeLink(o);if(!t.md.validateLink(s))return!1;if(!e){const a=t.push("link_open","a",1);a.attrs=[["href",s]],a.markup="autolink",a.info="auto";const l=t.push("text","",0);l.content=t.md.normalizeLinkText(o);const u=t.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return t.pos+=o.length+2,!0}if(zX.test(o)){const s=t.md.normalizeLink("mailto:"+o);if(!t.md.validateLink(s))return!1;if(!e){const a=t.push("link_open","a",1);a.attrs=[["href",s]],a.markup="autolink",a.info="auto";const l=t.push("text","",0);l.content=t.md.normalizeLinkText(o);const u=t.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return t.pos+=o.length+2,!0}return!1}function VX(t){return/^\s]/i.test(t)}function UX(t){return/^<\/a\s*>/i.test(t)}function HX(t){const e=t|32;return e>=97&&e<=122}function WX(t,e){if(!t.md.options.html)return!1;const n=t.posMax,r=t.pos;if(t.src.charCodeAt(r)!==60||r+2>=n)return!1;const i=t.src.charCodeAt(r+1);if(i!==33&&i!==63&&i!==47&&!HX(i))return!1;const o=t.src.slice(r).match(kX);if(!o)return!1;if(!e){const s=t.push("html_inline","",0);s.content=o[0],VX(s.content)&&t.linkLevel++,UX(s.content)&&t.linkLevel--}return t.pos+=o[0].length,!0}const JX=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,KX=/^&([a-z][a-z0-9]{1,31});/i;function GX(t,e){const n=t.pos,r=t.posMax;if(t.src.charCodeAt(n)!==38||n+1>=r)return!1;if(t.src.charCodeAt(n+1)===35){const o=t.src.slice(n).match(JX);if(o){if(!e){const s=o[1][0].toLowerCase()==="x"?parseInt(o[1].slice(1),16):parseInt(o[1],10),a=t.push("text_special","",0);a.content=v3(s)?Mm(s):Mm(65533),a.markup=o[0],a.info="entity"}return t.pos+=o[0].length,!0}}else{const o=t.src.slice(n).match(KX);if(o){const s=yN(o[0]);if(s!==o[0]){if(!e){const a=t.push("text_special","",0);a.content=s,a.markup=o[0],a.info="entity"}return t.pos+=o[0].length,!0}}}return!1}function q4(t){const e={},n=t.length;if(!n)return;let r=0,i=-2;const o=[];for(let s=0;sl;u-=o[u]+1){const f=t[u];if(f.marker===a.marker&&f.open&&f.end<0){let d=!1;if((f.close||a.open)&&(f.length+a.length)%3===0&&(f.length%3!==0||a.length%3!==0)&&(d=!0),!d){const h=u>0&&!t[u-1].open?o[u-1]+1:0;o[s]=s-u+h,o[u]=h,a.open=!1,f.end=s,f.close=!1,c=-1,i=-2;break}}}c!==-1&&(e[a.marker][(a.open?3:0)+(a.length||0)%3]=c)}}function ZX(t){const e=t.tokens_meta,n=t.tokens_meta.length;q4(t.delimiters);for(let r=0;r0&&r++,i[e].type==="text"&&e+1=t.pos)throw new Error("inline rule didn't increment state.pos");break}}else t.pos=t.posMax;s||t.pos++,o[e]=t.pos};Ah.prototype.tokenize=function(t){const e=this.ruler.getRules(""),n=e.length,r=t.posMax,i=t.md.options.maxNesting;for(;t.pos=t.pos)throw new Error("inline rule didn't increment state.pos");break}}if(s){if(t.pos>=r)break;continue}t.pending+=t.src[t.pos++]}t.pending&&t.pushPending()};Ah.prototype.parse=function(t,e,n,r){const i=new this.State(t,e,n,r);this.tokenize(i);const o=this.ruler2.getRules(""),s=o.length;for(let a=0;a|$))",e.tpl_email_fuzzy="(^|"+n+'|"|\\(|'+e.src_ZCc+")("+e.src_email_name+"@"+e.tpl_host_fuzzy_strict+")",e.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_fuzzy_strict+e.src_path+")",e.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_no_ip_fuzzy_strict+e.src_path+")",e}function Iw(t){return Array.prototype.slice.call(arguments,1).forEach(function(n){n&&Object.keys(n).forEach(function(r){t[r]=n[r]})}),t}function Sg(t){return Object.prototype.toString.call(t)}function XX(t){return Sg(t)==="[object String]"}function eee(t){return Sg(t)==="[object Object]"}function tee(t){return Sg(t)==="[object RegExp]"}function V4(t){return Sg(t)==="[object Function]"}function nee(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const _N={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function ree(t){return Object.keys(t||{}).reduce(function(e,n){return e||_N.hasOwnProperty(n)},!1)}const iee={"http:":{validate:function(t,e,n){const r=t.slice(e);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(t,e,n){const r=t.slice(e);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(r)?e>=3&&t[e-3]===":"||e>=3&&t[e-3]==="/"?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(t,e,n){const r=t.slice(e);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},oee="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",see="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function aee(t){t.__index__=-1,t.__text_cache__=""}function lee(t){return function(e,n){const r=e.slice(n);return t.test(r)?r.match(t)[0].length:0}}function U4(){return function(t,e){e.normalize(t)}}function Om(t){const e=t.re=QX(t.__opts__),n=t.__tlds__.slice();t.onCompile(),t.__tlds_replaced__||n.push(oee),n.push(e.src_xn),e.src_tlds=n.join("|");function r(a){return a.replace("%TLDS%",e.src_tlds)}e.email_fuzzy=RegExp(r(e.tpl_email_fuzzy),"i"),e.link_fuzzy=RegExp(r(e.tpl_link_fuzzy),"i"),e.link_no_ip_fuzzy=RegExp(r(e.tpl_link_no_ip_fuzzy),"i"),e.host_fuzzy_test=RegExp(r(e.tpl_host_fuzzy_test),"i");const i=[];t.__compiled__={};function o(a,l){throw new Error('(LinkifyIt) Invalid schema "'+a+'": '+l)}Object.keys(t.__schemas__).forEach(function(a){const l=t.__schemas__[a];if(l===null)return;const u={validate:null,link:null};if(t.__compiled__[a]=u,eee(l)){tee(l.validate)?u.validate=lee(l.validate):V4(l.validate)?u.validate=l.validate:o(a,l),V4(l.normalize)?u.normalize=l.normalize:l.normalize?o(a,l):u.normalize=U4();return}if(XX(l)){i.push(a);return}o(a,l)}),i.forEach(function(a){t.__compiled__[t.__schemas__[a]]&&(t.__compiled__[a].validate=t.__compiled__[t.__schemas__[a]].validate,t.__compiled__[a].normalize=t.__compiled__[t.__schemas__[a]].normalize)}),t.__compiled__[""]={validate:null,normalize:U4()};const s=Object.keys(t.__compiled__).filter(function(a){return a.length>0&&t.__compiled__[a]}).map(nee).join("|");t.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+s+")","i"),t.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+s+")","ig"),t.re.schema_at_start=RegExp("^"+t.re.schema_search.source,"i"),t.re.pretest=RegExp("("+t.re.schema_test.source+")|("+t.re.host_fuzzy_test.source+")|@","i"),aee(t)}function uee(t,e){const n=t.__index__,r=t.__last_index__,i=t.__text_cache__.slice(n,r);this.schema=t.__schema__.toLowerCase(),this.index=n+e,this.lastIndex=r+e,this.raw=i,this.text=i,this.url=i}function Rw(t,e){const n=new uee(t,e);return t.__compiled__[n.schema].normalize(n,t),n}function Ur(t,e){if(!(this instanceof Ur))return new Ur(t,e);e||ree(t)&&(e=t,t={}),this.__opts__=Iw({},_N,e),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=Iw({},iee,t),this.__compiled__={},this.__tlds__=see,this.__tlds_replaced__=!1,this.re={},Om(this)}Ur.prototype.add=function(e,n){return this.__schemas__[e]=n,Om(this),this};Ur.prototype.set=function(e){return this.__opts__=Iw(this.__opts__,e),this};Ur.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;let n,r,i,o,s,a,l,u,c;if(this.re.schema_test.test(e)){for(l=this.re.schema_search,l.lastIndex=0;(n=l.exec(e))!==null;)if(o=this.testSchemaAt(e,n[2],l.lastIndex),o){this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+o;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(u=e.search(this.re.host_fuzzy_test),u>=0&&(this.__index__<0||u=0&&(i=e.match(this.re.email_fuzzy))!==null&&(s=i.index+i[1].length,a=i.index+i[0].length,(this.__index__<0||sthis.__last_index__)&&(this.__schema__="mailto:",this.__index__=s,this.__last_index__=a))),this.__index__>=0};Ur.prototype.pretest=function(e){return this.re.pretest.test(e)};Ur.prototype.testSchemaAt=function(e,n,r){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(e,r,this):0};Ur.prototype.match=function(e){const n=[];let r=0;this.__index__>=0&&this.__text_cache__===e&&(n.push(Rw(this,r)),r=this.__last_index__);let i=r?e.slice(r):e;for(;this.test(i);)n.push(Rw(this,r)),i=i.slice(this.__last_index__),r+=this.__last_index__;return n.length?n:null};Ur.prototype.matchAtStart=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return null;const n=this.re.schema_at_start.exec(e);if(!n)return null;const r=this.testSchemaAt(e,n[2],n[0].length);return r?(this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+r,Rw(this,0)):null};Ur.prototype.tlds=function(e,n){return e=Array.isArray(e)?e:[e],n?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(r,i,o){return r!==o[i-1]}).reverse(),Om(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,Om(this),this)};Ur.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url="mailto:"+e.url)};Ur.prototype.onCompile=function(){};const qu=2147483647,so=36,x3=1,Kd=26,cee=38,fee=700,AN=72,TN=128,MN="-",dee=/^xn--/,hee=/[^\0-\x7F]/,pee=/[\x2E\u3002\uFF0E\uFF61]/g,mee={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Db=so-x3,ao=Math.floor,Nb=String.fromCharCode;function Ds(t){throw new RangeError(mee[t])}function gee(t,e){const n=[];let r=t.length;for(;r--;)n[r]=e(t[r]);return n}function ON(t,e){const n=t.split("@");let r="";n.length>1&&(r=n[0]+"@",t=n[1]),t=t.replace(pee,".");const i=t.split("."),o=gee(i,e).join(".");return r+o}function DN(t){const e=[];let n=0;const r=t.length;for(;n=55296&&i<=56319&&nString.fromCodePoint(...t),bee=function(t){return t>=48&&t<58?26+(t-48):t>=65&&t<91?t-65:t>=97&&t<123?t-97:so},H4=function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},NN=function(t,e,n){let r=0;for(t=n?ao(t/fee):t>>1,t+=ao(t/e);t>Db*Kd>>1;r+=so)t=ao(t/Db);return ao(r+(Db+1)*t/(t+cee))},$N=function(t){const e=[],n=t.length;let r=0,i=TN,o=AN,s=t.lastIndexOf(MN);s<0&&(s=0);for(let a=0;a=128&&Ds("not-basic"),e.push(t.charCodeAt(a));for(let a=s>0?s+1:0;a=n&&Ds("invalid-input");const d=bee(t.charCodeAt(a++));d>=so&&Ds("invalid-input"),d>ao((qu-r)/c)&&Ds("overflow"),r+=d*c;const h=f<=o?x3:f>=o+Kd?Kd:f-o;if(dao(qu/p)&&Ds("overflow"),c*=p}const u=e.length+1;o=NN(r-l,u,l==0),ao(r/u)>qu-i&&Ds("overflow"),i+=ao(r/u),r%=u,e.splice(r++,0,i)}return String.fromCodePoint(...e)},IN=function(t){const e=[];t=DN(t);const n=t.length;let r=TN,i=0,o=AN;for(const l of t)l<128&&e.push(Nb(l));const s=e.length;let a=s;for(s&&e.push(MN);a=r&&cao((qu-i)/u)&&Ds("overflow"),i+=(l-r)*u,r=l;for(const c of t)if(cqu&&Ds("overflow"),c===r){let f=i;for(let d=so;;d+=so){const h=d<=o?x3:d>=o+Kd?Kd:d-o;if(f=0))try{e.hostname=RN.toASCII(e.hostname)}catch{}return Ch(m3(e))}function Mee(t){const e=g3(t,!0);if(e.hostname&&(!e.protocol||FN.indexOf(e.protocol)>=0))try{e.hostname=RN.toUnicode(e.hostname)}catch{}return yc(m3(e),yc.defaultChars+"%")}function gi(t,e){if(!(this instanceof gi))return new gi(t,e);e||b3(t)||(e=t||{},t="default"),this.inline=new Ah,this.block=new Eg,this.core=new w3,this.renderer=new Bc,this.linkify=new Ur,this.validateLink=Aee,this.normalizeLink=Tee,this.normalizeLinkText=Mee,this.utils=DQ,this.helpers=kg({},RQ),this.options={},this.configure(t),e&&this.set(e)}gi.prototype.set=function(t){return kg(this.options,t),this};gi.prototype.configure=function(t){const e=this;if(b3(t)){const n=t;if(t=See[n],!t)throw new Error('Wrong `markdown-it` preset "'+n+'", check name')}if(!t)throw new Error("Wrong `markdown-it` preset, can't be empty");return t.options&&e.set(t.options),t.components&&Object.keys(t.components).forEach(function(n){t.components[n].rules&&e[n].ruler.enableOnly(t.components[n].rules),t.components[n].rules2&&e[n].ruler2.enableOnly(t.components[n].rules2)}),this};gi.prototype.enable=function(t,e){let n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(i){n=n.concat(this[i].ruler.enable(t,!0))},this),n=n.concat(this.inline.ruler2.enable(t,!0));const r=t.filter(function(i){return n.indexOf(i)<0});if(r.length&&!e)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this};gi.prototype.disable=function(t,e){let n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(i){n=n.concat(this[i].ruler.disable(t,!0))},this),n=n.concat(this.inline.ruler2.disable(t,!0));const r=t.filter(function(i){return n.indexOf(i)<0});if(r.length&&!e)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this};gi.prototype.use=function(t){const e=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,e),this};gi.prototype.parse=function(t,e){if(typeof t!="string")throw new Error("Input data should be a String");const n=new this.core.State(t,this,e);return this.core.process(n),n.tokens};gi.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)};gi.prototype.parseInline=function(t,e){const n=new this.core.State(t,this,e);return n.inlineMode=!0,this.core.process(n),n.tokens};gi.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)};const Oee=new XO({nodes:{doc:{content:"block+"},paragraph:{content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM(){return["p",0]}},blockquote:{content:"block+",group:"block",parseDOM:[{tag:"blockquote"}],toDOM(){return["blockquote",0]}},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM(){return["div",["hr"]]}},heading:{attrs:{level:{default:1}},content:"(text | image)*",group:"block",defining:!0,parseDOM:[{tag:"h1",attrs:{level:1}},{tag:"h2",attrs:{level:2}},{tag:"h3",attrs:{level:3}},{tag:"h4",attrs:{level:4}},{tag:"h5",attrs:{level:5}},{tag:"h6",attrs:{level:6}}],toDOM(t){return["h"+t.attrs.level,0]}},code_block:{content:"text*",group:"block",code:!0,defining:!0,marks:"",attrs:{params:{default:""}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:t=>({params:t.getAttribute("data-params")||""})}],toDOM(t){return["pre",t.attrs.params?{"data-params":t.attrs.params}:{},["code",0]]}},ordered_list:{content:"list_item+",group:"block",attrs:{order:{default:1},tight:{default:!1}},parseDOM:[{tag:"ol",getAttrs(t){return{order:t.hasAttribute("start")?+t.getAttribute("start"):1,tight:t.hasAttribute("data-tight")}}}],toDOM(t){return["ol",{start:t.attrs.order==1?null:t.attrs.order,"data-tight":t.attrs.tight?"true":null},0]}},bullet_list:{content:"list_item+",group:"block",attrs:{tight:{default:!1}},parseDOM:[{tag:"ul",getAttrs:t=>({tight:t.hasAttribute("data-tight")})}],toDOM(t){return["ul",{"data-tight":t.attrs.tight?"true":null},0]}},list_item:{content:"block+",defining:!0,parseDOM:[{tag:"li"}],toDOM(){return["li",0]}},text:{group:"inline"},image:{inline:!0,attrs:{src:{},alt:{default:null},title:{default:null}},group:"inline",draggable:!0,parseDOM:[{tag:"img[src]",getAttrs(t){return{src:t.getAttribute("src"),title:t.getAttribute("title"),alt:t.getAttribute("alt")}}}],toDOM(t){return["img",t.attrs]}},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM(){return["br"]}}},marks:{em:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"},{style:"font-style=normal",clearMark:t=>t.type.name=="em"}],toDOM(){return["em"]}},strong:{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name=="strong"},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}],toDOM(){return["strong"]}},link:{attrs:{href:{},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs(t){return{href:t.getAttribute("href"),title:t.getAttribute("title")}}}],toDOM(t){return["a",t.attrs]}},code:{parseDOM:[{tag:"code"}],toDOM(){return["code"]}}}});function Dee(t,e){if(t.isText&&e.isText&&dt.sameSet(t.marks,e.marks))return t.withText(t.text+e.text)}let Nee=class{constructor(e,n){this.schema=e,this.tokenHandlers=n,this.stack=[{type:e.topNodeType,attrs:null,content:[],marks:dt.none}]}top(){return this.stack[this.stack.length-1]}push(e){this.stack.length&&this.top().content.push(e)}addText(e){if(!e)return;let n=this.top(),r=n.content,i=r[r.length-1],o=this.schema.text(e,n.marks),s;i&&(s=Dee(i,o))?r[r.length-1]=s:r.push(o)}openMark(e){let n=this.top();n.marks=e.addToSet(n.marks)}closeMark(e){let n=this.top();n.marks=e.removeFromSet(n.marks)}parseTokens(e){for(let n=0;n{s.openNode(o,cf(i,a,l,u)),s.addText(W4(a.content)),s.closeNode()}:(n[r+"_open"]=(s,a,l,u)=>s.openNode(o,cf(i,a,l,u)),n[r+"_close"]=s=>s.closeNode())}else if(i.node){let o=t.nodeType(i.node);n[r]=(s,a,l,u)=>s.addNode(o,cf(i,a,l,u))}else if(i.mark){let o=t.marks[i.mark];$b(i,r)?n[r]=(s,a,l,u)=>{s.openMark(o.create(cf(i,a,l,u))),s.addText(W4(a.content)),s.closeMark(o)}:(n[r+"_open"]=(s,a,l,u)=>s.openMark(o.create(cf(i,a,l,u))),n[r+"_close"]=s=>s.closeMark(o))}else if(i.ignore)$b(i,r)?n[r]=Ib:(n[r+"_open"]=Ib,n[r+"_close"]=Ib);else throw new RangeError("Unrecognized parsing spec "+JSON.stringify(i))}return n.text=(r,i)=>r.addText(i.content),n.inline=(r,i)=>r.parseTokens(i.children),n.softbreak=n.softbreak||(r=>r.addText(" ")),n}let Iee=class{constructor(e,n,r){this.schema=e,this.tokenizer=n,this.tokens=r,this.tokenHandlers=$ee(e,r)}parse(e,n={}){let r=new Nee(this.schema,this.tokenHandlers),i;r.parseTokens(this.tokenizer.parse(e,n));do i=r.closeNode();while(r.stack.length);return i||this.schema.topNodeType.createAndFill()}};function J4(t,e){for(;++e({tight:J4(e,n)})},ordered_list:{block:"ordered_list",getAttrs:(t,e,n)=>({order:+t.attrGet("start")||1,tight:J4(e,n)})},heading:{block:"heading",getAttrs:t=>({level:+t.tag.slice(1)})},code_block:{block:"code_block",noCloseToken:!0},fence:{block:"code_block",getAttrs:t=>({params:t.info||""}),noCloseToken:!0},hr:{node:"horizontal_rule"},image:{node:"image",getAttrs:t=>({src:t.attrGet("src"),title:t.attrGet("title")||null,alt:t.children[0]&&t.children[0].content||null})},hardbreak:{node:"hard_break"},em:{mark:"em"},strong:{mark:"strong"},link:{mark:"link",getAttrs:t=>({href:t.attrGet("href"),title:t.attrGet("title")||null})},code_inline:{mark:"code",noCloseToken:!0}});const Ree={open:"",close:"",mixable:!0};let Fee=class{constructor(e,n,r={}){this.nodes=e,this.marks=n,this.options=r}serialize(e,n={}){n=Object.assign({},this.options,n);let r=new Bee(this.nodes,this.marks,n);return r.renderContent(e),r.out}};const LN=new Fee({blockquote(t,e){t.wrapBlock("> ",null,e,()=>t.renderContent(e))},code_block(t,e){const n=e.textContent.match(/`{3,}/gm),r=n?n.sort().slice(-1)[0]+"`":"```";t.write(r+(e.attrs.params||"")+` +`;break}return r};Bc.prototype.render=function(t,e,n){let r="";const i=this.rules;for(let o=0,s=t.length;o=0&&(r=this.attrs[n][1]),r};Pi.prototype.attrJoin=function(e,n){const r=this.attrIndex(e);r<0?this.attrPush([e,n]):this.attrs[r][1]=this.attrs[r][1]+" "+n};function wN(t,e,n){this.src=t,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=e}wN.prototype.Token=Pi;const zQ=/\r\n?|\n/g,jQ=/\0/g;function qQ(t){let e;e=t.src.replace(zQ,` +`),e=e.replace(jQ,"�"),t.src=e}function UQ(t){let e;t.inlineMode?(e=new t.Token("inline","",0),e.content=t.src,e.map=[0,1],e.children=[],t.tokens.push(e)):t.md.block.parse(t.src,t.md,t.env,t.tokens)}function VQ(t){const e=t.tokens;for(let n=0,r=e.length;n\s]/i.test(t)}function WQ(t){return/^<\/a\s*>/i.test(t)}function JQ(t){const e=t.tokens;if(t.md.options.linkify)for(let n=0,r=e.length;n=0;s--){const a=i[s];if(a.type==="link_close"){for(s--;i[s].level!==a.level&&i[s].type!=="link_open";)s--;continue}if(a.type==="html_inline"&&(HQ(a.content)&&o>0&&o--,WQ(a.content)&&o++),!(o>0)&&a.type==="text"&&t.md.linkify.test(a.content)){const l=a.content;let u=t.md.linkify.match(l);const c=[];let f=a.level,d=0;u.length>0&&u[0].index===0&&s>0&&i[s-1].type==="text_special"&&(u=u.slice(1));for(let h=0;hd){const x=new t.Token("text","",0);x.content=l.slice(d,y),x.level=f,c.push(x)}const v=new t.Token("link_open","a",1);v.attrs=[["href",m]],v.level=f++,v.markup="linkify",v.info="auto",c.push(v);const w=new t.Token("text","",0);w.content=b,w.level=f,c.push(w);const g=new t.Token("link_close","a",-1);g.level=--f,g.markup="linkify",g.info="auto",c.push(g),d=u[h].lastIndex}if(d=0;n--){const r=t[n];r.type==="text"&&!e&&(r.content=r.content.replace(GQ,YQ)),r.type==="link_open"&&r.info==="auto"&&e--,r.type==="link_close"&&r.info==="auto"&&e++}}function XQ(t){let e=0;for(let n=t.length-1;n>=0;n--){const r=t[n];r.type==="text"&&!e&&kN.test(r.content)&&(r.content=r.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),r.type==="link_open"&&r.info==="auto"&&e--,r.type==="link_close"&&r.info==="auto"&&e++}}function eX(t){let e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)t.tokens[e].type==="inline"&&(KQ.test(t.tokens[e].content)&&QQ(t.tokens[e].children),kN.test(t.tokens[e].content)&&XQ(t.tokens[e].children))}const tX=/['"]/,R4=/['"]/g,F4="’";function kp(t,e,n){return t.slice(0,e)+n+t.slice(e+1)}function nX(t,e){let n;const r=[];for(let i=0;i=0&&!(r[n].level<=s);n--);if(r.length=n+1,o.type!=="text")continue;let a=o.content,l=0,u=a.length;e:for(;l=0)p=a.charCodeAt(c.index-1);else for(n=i-1;n>=0&&!(t[n].type==="softbreak"||t[n].type==="hardbreak");n--)if(t[n].content){p=t[n].content.charCodeAt(t[n].content.length-1);break}let m=32;if(l=48&&p<=57&&(d=f=!1),f&&d&&(f=b,d=y),!f&&!d){h&&(o.content=kp(o.content,c.index,F4));continue}if(d)for(n=r.length-1;n>=0;n--){let g=r[n];if(r[n].level=0;e--)t.tokens[e].type!=="inline"||!tX.test(t.tokens[e].content)||nX(t.tokens[e].children,t)}function iX(t){let e,n;const r=t.tokens,i=r.length;for(let o=0;o0&&this.level++,this.tokens.push(r),r};Co.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]};Co.prototype.skipEmptyLines=function(e){for(let n=this.lineMax;en;)if(!wt(this.src.charCodeAt(--e)))return e+1;return e};Co.prototype.skipChars=function(e,n){for(let r=this.src.length;er;)if(n!==this.src.charCodeAt(--e))return e+1;return e};Co.prototype.getLines=function(e,n,r,i){if(e>=n)return"";const o=new Array(n-e);for(let s=0,a=e;ar?o[s]=new Array(l-r+1).join(" ")+this.src.slice(c,f):o[s]=this.src.slice(c,f)}return o.join("")};Co.prototype.Token=Pi;const oX=65536;function Tb(t,e){const n=t.bMarks[e]+t.tShift[e],r=t.eMarks[e];return t.src.slice(n,r)}function L4(t){const e=[],n=t.length;let r=0,i=t.charCodeAt(r),o=!1,s=0,a="";for(;rn)return!1;let i=e+1;if(t.sCount[i]=4)return!1;let o=t.bMarks[i]+t.tShift[i];if(o>=t.eMarks[i])return!1;const s=t.src.charCodeAt(o++);if(s!==124&&s!==45&&s!==58||o>=t.eMarks[i])return!1;const a=t.src.charCodeAt(o++);if(a!==124&&a!==45&&a!==58&&!wt(a)||s===45&&wt(a))return!1;for(;o=4)return!1;u=L4(l),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop();const f=u.length;if(f===0||f!==c.length)return!1;if(r)return!0;const d=t.parentType;t.parentType="table";const h=t.md.block.ruler.getRules("blockquote"),p=t.push("table_open","table",1),m=[e,0];p.map=m;const b=t.push("thead_open","thead",1);b.map=[e,e+1];const y=t.push("tr_open","tr",1);y.map=[e,e+1];for(let g=0;g=4||(u=L4(l),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop(),w+=f-u.length,w>oX))break;if(i===e+2){const k=t.push("tbody_open","tbody",1);k.map=v=[e+2,0]}const x=t.push("tr_open","tr",1);x.map=[i,i+1];for(let k=0;k=4){r++,i=r;continue}break}t.line=i;const o=t.push("code_block","code",0);return o.content=t.getLines(e,i,4+t.blkIndent,!1)+` +`,o.map=[e,t.line],!0}function lX(t,e,n,r){let i=t.bMarks[e]+t.tShift[e],o=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||i+3>o)return!1;const s=t.src.charCodeAt(i);if(s!==126&&s!==96)return!1;let a=i;i=t.skipChars(i,s);let l=i-a;if(l<3)return!1;const u=t.src.slice(a,i),c=t.src.slice(i,o);if(s===96&&c.indexOf(String.fromCharCode(s))>=0)return!1;if(r)return!0;let f=e,d=!1;for(;f++,!(f>=n||(i=a=t.bMarks[f]+t.tShift[f],o=t.eMarks[f],i=4)&&(i=t.skipChars(i,s),!(i-a=4||t.src.charCodeAt(i)!==62)return!1;if(r)return!0;const a=[],l=[],u=[],c=[],f=t.md.block.ruler.getRules("blockquote"),d=t.parentType;t.parentType="blockquote";let h=!1,p;for(p=e;p=o)break;if(t.src.charCodeAt(i++)===62&&!w){let x=t.sCount[p]+1,k,E;t.src.charCodeAt(i)===32?(i++,x++,E=!1,k=!0):t.src.charCodeAt(i)===9?(k=!0,(t.bsCount[p]+x)%4===3?(i++,x++,E=!1):E=!0):k=!1;let D=x;for(a.push(t.bMarks[p]),t.bMarks[p]=i;i=o,l.push(t.bsCount[p]),t.bsCount[p]=t.sCount[p]+1+(k?1:0),u.push(t.sCount[p]),t.sCount[p]=D-x,c.push(t.tShift[p]),t.tShift[p]=i-t.bMarks[p];continue}if(h)break;let g=!1;for(let x=0,k=f.length;x";const y=[e,0];b.map=y,t.md.block.tokenize(t,e,p);const v=t.push("blockquote_close","blockquote",-1);v.markup=">",t.lineMax=s,t.parentType=d,y[1]=t.line;for(let w=0;w=4)return!1;let o=t.bMarks[e]+t.tShift[e];const s=t.src.charCodeAt(o++);if(s!==42&&s!==45&&s!==95)return!1;let a=1;for(;o=r)return-1;let o=t.src.charCodeAt(i++);if(o<48||o>57)return-1;for(;;){if(i>=r)return-1;if(o=t.src.charCodeAt(i++),o>=48&&o<=57){if(i-n>=10)return-1;continue}if(o===41||o===46)break;return-1}return i=4||t.listIndent>=0&&t.sCount[l]-t.listIndent>=4&&t.sCount[l]=t.blkIndent&&(c=!0);let f,d,h;if((h=P4(t,l))>=0){if(f=!0,s=t.bMarks[l]+t.tShift[l],d=Number(t.src.slice(s,h-1)),c&&d!==1)return!1}else if((h=B4(t,l))>=0)f=!1;else return!1;if(c&&t.skipSpaces(h)>=t.eMarks[l])return!1;if(r)return!0;const p=t.src.charCodeAt(h-1),m=t.tokens.length;f?(a=t.push("ordered_list_open","ol",1),d!==1&&(a.attrs=[["start",d]])):a=t.push("bullet_list_open","ul",1);const b=[l,0];a.map=b,a.markup=String.fromCharCode(p);let y=!1;const v=t.md.block.ruler.getRules("list"),w=t.parentType;for(t.parentType="list";l=i?E=1:E=x-g,E>4&&(E=1);const D=g+E;a=t.push("list_item_open","li",1),a.markup=String.fromCharCode(p);const O=[l,0];a.map=O,f&&(a.info=t.src.slice(s,h-1));const N=t.tight,C=t.tShift[l],R=t.sCount[l],T=t.listIndent;if(t.listIndent=t.blkIndent,t.blkIndent=D,t.tight=!0,t.tShift[l]=k-t.bMarks[l],t.sCount[l]=x,k>=i&&t.isEmpty(l+1)?t.line=Math.min(t.line+2,n):t.md.block.tokenize(t,l,n,!0),(!t.tight||y)&&(u=!1),y=t.line-l>1&&t.isEmpty(t.line-1),t.blkIndent=t.listIndent,t.listIndent=T,t.tShift[l]=C,t.sCount[l]=R,t.tight=N,a=t.push("list_item_close","li",-1),a.markup=String.fromCharCode(p),l=t.line,O[1]=l,l>=n||t.sCount[l]=4)break;let q=!1;for(let A=0,S=v.length;A=4||t.src.charCodeAt(i)!==91)return!1;function a(v){const w=t.lineMax;if(v>=w||t.isEmpty(v))return null;let g=!1;if(t.sCount[v]-t.blkIndent>3&&(g=!0),t.sCount[v]<0&&(g=!0),!g){const E=t.md.block.ruler.getRules("reference"),D=t.parentType;t.parentType="reference";let O=!1;for(let N=0,C=E.length;N"u"&&(t.env.references={}),typeof t.env.references[y]>"u"&&(t.env.references[y]={title:b,href:f}),t.line=s),!0):!1}const pX=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],mX="[a-zA-Z_:][a-zA-Z0-9:._-]*",gX="[^\"'=<>`\\x00-\\x20]+",yX="'[^']*'",bX='"[^"]*"',vX="(?:"+gX+"|"+yX+"|"+bX+")",wX="(?:\\s+"+mX+"(?:\\s*=\\s*"+vX+")?)",xN="<[A-Za-z][A-Za-z0-9\\-]*"+wX+"*\\s*\\/?>",EN="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",kX="",xX="<[?][\\s\\S]*?[?]>",EX="]*>",SX="",CX=new RegExp("^(?:"+xN+"|"+EN+"|"+kX+"|"+xX+"|"+EX+"|"+SX+")"),_X=new RegExp("^(?:"+xN+"|"+EN+")"),Zl=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(_X.source+"\\s*$"),/^$/,!1]];function AX(t,e,n,r){let i=t.bMarks[e]+t.tShift[e],o=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||!t.md.options.html||t.src.charCodeAt(i)!==60)return!1;let s=t.src.slice(i,o),a=0;for(;a=4)return!1;let s=t.src.charCodeAt(i);if(s!==35||i>=o)return!1;let a=1;for(s=t.src.charCodeAt(++i);s===35&&i6||ii&&wt(t.src.charCodeAt(l-1))&&(o=l),t.line=e+1;const u=t.push("heading_open","h"+String(a),1);u.markup="########".slice(0,a),u.map=[e,t.line];const c=t.push("inline","",0);c.content=t.src.slice(i,o).trim(),c.map=[e,t.line],c.children=[];const f=t.push("heading_close","h"+String(a),-1);return f.markup="########".slice(0,a),!0}function MX(t,e,n){const r=t.md.block.ruler.getRules("paragraph");if(t.sCount[e]-t.blkIndent>=4)return!1;const i=t.parentType;t.parentType="paragraph";let o=0,s,a=e+1;for(;a3)continue;if(t.sCount[a]>=t.blkIndent){let h=t.bMarks[a]+t.tShift[a];const p=t.eMarks[a];if(h=p))){o=s===61?1:2;break}}if(t.sCount[a]<0)continue;let d=!1;for(let h=0,p=r.length;h3||t.sCount[o]<0)continue;let u=!1;for(let c=0,f=r.length;c=n||t.sCount[s]=o){t.line=n;break}const l=t.line;let u=!1;for(let c=0;c=t.line)throw new Error("block rule didn't increment state.line");break}if(!u)throw new Error("none of the block rules matched");t.tight=!a,t.isEmpty(t.line-1)&&(a=!0),s=t.line,s0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(i),r};Ah.prototype.scanDelims=function(t,e){const n=this.posMax,r=this.src.charCodeAt(t),i=t>0?this.src.charCodeAt(t-1):32;let o=t;for(;o0)return!1;const n=t.pos,r=t.posMax;if(n+3>r||t.src.charCodeAt(n)!==58||t.src.charCodeAt(n+1)!==47||t.src.charCodeAt(n+2)!==47)return!1;const i=t.pending.match($X);if(!i)return!1;const o=i[1],s=t.md.linkify.matchAtStart(t.src.slice(n-o.length));if(!s)return!1;let a=s.url;if(a.length<=o.length)return!1;a=a.replace(/\*+$/,"");const l=t.md.normalizeLink(a);if(!t.md.validateLink(l))return!1;if(!e){t.pending=t.pending.slice(0,-o.length);const u=t.push("link_open","a",1);u.attrs=[["href",l]],u.markup="linkify",u.info="auto";const c=t.push("text","",0);c.content=t.md.normalizeLinkText(a);const f=t.push("link_close","a",-1);f.markup="linkify",f.info="auto"}return t.pos+=a.length-o.length,!0}function RX(t,e){let n=t.pos;if(t.src.charCodeAt(n)!==10)return!1;const r=t.pending.length-1,i=t.posMax;if(!e)if(r>=0&&t.pending.charCodeAt(r)===32)if(r>=1&&t.pending.charCodeAt(r-1)===32){let o=r-1;for(;o>=1&&t.pending.charCodeAt(o-1)===32;)o--;t.pending=t.pending.slice(0,o),t.push("hardbreak","br",0)}else t.pending=t.pending.slice(0,-1),t.push("softbreak","br",0);else t.push("softbreak","br",0);for(n++;n?@[]^_`{|}~-".split("").forEach(function(t){k3[t.charCodeAt(0)]=1});function FX(t,e){let n=t.pos;const r=t.posMax;if(t.src.charCodeAt(n)!==92||(n++,n>=r))return!1;let i=t.src.charCodeAt(n);if(i===10){for(e||t.push("hardbreak","br",0),n++;n=55296&&i<=56319&&n+1=56320&&a<=57343&&(o+=t.src[n+1],n++)}const s="\\"+o;if(!e){const a=t.push("text_special","",0);i<256&&k3[i]!==0?a.content=o:a.content=s,a.markup=s,a.info="escape"}return t.pos=n+1,!0}function LX(t,e){let n=t.pos;if(t.src.charCodeAt(n)!==96)return!1;const i=n;n++;const o=t.posMax;for(;n=0;r--){const i=e[r];if(i.marker!==95&&i.marker!==42||i.end===-1)continue;const o=e[i.end],s=r>0&&e[r-1].end===i.end+1&&e[r-1].marker===i.marker&&e[r-1].token===i.token-1&&e[i.end+1].token===o.token+1,a=String.fromCharCode(i.marker),l=t.tokens[i.token];l.type=s?"strong_open":"em_open",l.tag=s?"strong":"em",l.nesting=1,l.markup=s?a+a:a,l.content="";const u=t.tokens[o.token];u.type=s?"strong_close":"em_close",u.tag=s?"strong":"em",u.nesting=-1,u.markup=s?a+a:a,u.content="",s&&(t.tokens[e[r-1].token].content="",t.tokens[e[i.end+1].token].content="",r--)}}function jX(t){const e=t.tokens_meta,n=t.tokens_meta.length;j4(t,t.delimiters);for(let r=0;r=f)return!1;if(l=p,i=t.md.helpers.parseLinkDestination(t.src,p,t.posMax),i.ok){for(s=t.md.normalizeLink(i.str),t.md.validateLink(s)?p=i.pos:s="",l=p;p=f||t.src.charCodeAt(p)!==41)&&(u=!0),p++}if(u){if(typeof t.env.references>"u")return!1;if(p=0?r=t.src.slice(l,p++):p=h+1):p=h+1,r||(r=t.src.slice(d,h)),o=t.env.references[xg(r)],!o)return t.pos=c,!1;s=o.href,a=o.title}if(!e){t.pos=d,t.posMax=h;const m=t.push("link_open","a",1),b=[["href",s]];m.attrs=b,a&&b.push(["title",a]),t.linkLevel++,t.md.inline.tokenize(t),t.linkLevel--,t.push("link_close","a",-1)}return t.pos=p,t.posMax=f,!0}function UX(t,e){let n,r,i,o,s,a,l,u,c="";const f=t.pos,d=t.posMax;if(t.src.charCodeAt(t.pos)!==33||t.src.charCodeAt(t.pos+1)!==91)return!1;const h=t.pos+2,p=t.md.helpers.parseLinkLabel(t,t.pos+1,!1);if(p<0)return!1;if(o=p+1,o=d)return!1;for(u=o,a=t.md.helpers.parseLinkDestination(t.src,o,t.posMax),a.ok&&(c=t.md.normalizeLink(a.str),t.md.validateLink(c)?o=a.pos:c=""),u=o;o=d||t.src.charCodeAt(o)!==41)return t.pos=f,!1;o++}else{if(typeof t.env.references>"u")return!1;if(o=0?i=t.src.slice(u,o++):o=p+1):o=p+1,i||(i=t.src.slice(h,p)),s=t.env.references[xg(i)],!s)return t.pos=f,!1;c=s.href,l=s.title}if(!e){r=t.src.slice(h,p);const m=[];t.md.inline.parse(r,t.md,t.env,m);const b=t.push("image","img",0),y=[["src",c],["alt",""]];b.attrs=y,b.children=m,b.content=r,l&&y.push(["title",l])}return t.pos=o,t.posMax=d,!0}const VX=/^([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])?)*)$/,HX=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function WX(t,e){let n=t.pos;if(t.src.charCodeAt(n)!==60)return!1;const r=t.pos,i=t.posMax;for(;;){if(++n>=i)return!1;const s=t.src.charCodeAt(n);if(s===60)return!1;if(s===62)break}const o=t.src.slice(r+1,n);if(HX.test(o)){const s=t.md.normalizeLink(o);if(!t.md.validateLink(s))return!1;if(!e){const a=t.push("link_open","a",1);a.attrs=[["href",s]],a.markup="autolink",a.info="auto";const l=t.push("text","",0);l.content=t.md.normalizeLinkText(o);const u=t.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return t.pos+=o.length+2,!0}if(VX.test(o)){const s=t.md.normalizeLink("mailto:"+o);if(!t.md.validateLink(s))return!1;if(!e){const a=t.push("link_open","a",1);a.attrs=[["href",s]],a.markup="autolink",a.info="auto";const l=t.push("text","",0);l.content=t.md.normalizeLinkText(o);const u=t.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return t.pos+=o.length+2,!0}return!1}function JX(t){return/^\s]/i.test(t)}function KX(t){return/^<\/a\s*>/i.test(t)}function GX(t){const e=t|32;return e>=97&&e<=122}function ZX(t,e){if(!t.md.options.html)return!1;const n=t.posMax,r=t.pos;if(t.src.charCodeAt(r)!==60||r+2>=n)return!1;const i=t.src.charCodeAt(r+1);if(i!==33&&i!==63&&i!==47&&!GX(i))return!1;const o=t.src.slice(r).match(CX);if(!o)return!1;if(!e){const s=t.push("html_inline","",0);s.content=o[0],JX(s.content)&&t.linkLevel++,KX(s.content)&&t.linkLevel--}return t.pos+=o[0].length,!0}const YX=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,QX=/^&([a-z][a-z0-9]{1,31});/i;function XX(t,e){const n=t.pos,r=t.posMax;if(t.src.charCodeAt(n)!==38||n+1>=r)return!1;if(t.src.charCodeAt(n+1)===35){const o=t.src.slice(n).match(YX);if(o){if(!e){const s=o[1][0].toLowerCase()==="x"?parseInt(o[1].slice(1),16):parseInt(o[1],10),a=t.push("text_special","",0);a.content=v3(s)?Mm(s):Mm(65533),a.markup=o[0],a.info="entity"}return t.pos+=o[0].length,!0}}else{const o=t.src.slice(n).match(QX);if(o){const s=yN(o[0]);if(s!==o[0]){if(!e){const a=t.push("text_special","",0);a.content=s,a.markup=o[0],a.info="entity"}return t.pos+=o[0].length,!0}}}return!1}function q4(t){const e={},n=t.length;if(!n)return;let r=0,i=-2;const o=[];for(let s=0;sl;u-=o[u]+1){const f=t[u];if(f.marker===a.marker&&f.open&&f.end<0){let d=!1;if((f.close||a.open)&&(f.length+a.length)%3===0&&(f.length%3!==0||a.length%3!==0)&&(d=!0),!d){const h=u>0&&!t[u-1].open?o[u-1]+1:0;o[s]=s-u+h,o[u]=h,a.open=!1,f.end=s,f.close=!1,c=-1,i=-2;break}}}c!==-1&&(e[a.marker][(a.open?3:0)+(a.length||0)%3]=c)}}function eee(t){const e=t.tokens_meta,n=t.tokens_meta.length;q4(t.delimiters);for(let r=0;r0&&r++,i[e].type==="text"&&e+1=t.pos)throw new Error("inline rule didn't increment state.pos");break}}else t.pos=t.posMax;s||t.pos++,o[e]=t.pos};Th.prototype.tokenize=function(t){const e=this.ruler.getRules(""),n=e.length,r=t.posMax,i=t.md.options.maxNesting;for(;t.pos=t.pos)throw new Error("inline rule didn't increment state.pos");break}}if(s){if(t.pos>=r)break;continue}t.pending+=t.src[t.pos++]}t.pending&&t.pushPending()};Th.prototype.parse=function(t,e,n,r){const i=new this.State(t,e,n,r);this.tokenize(i);const o=this.ruler2.getRules(""),s=o.length;for(let a=0;a|$))",e.tpl_email_fuzzy="(^|"+n+'|"|\\(|'+e.src_ZCc+")("+e.src_email_name+"@"+e.tpl_host_fuzzy_strict+")",e.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_fuzzy_strict+e.src_path+")",e.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_no_ip_fuzzy_strict+e.src_path+")",e}function Iw(t){return Array.prototype.slice.call(arguments,1).forEach(function(n){n&&Object.keys(n).forEach(function(r){t[r]=n[r]})}),t}function Sg(t){return Object.prototype.toString.call(t)}function ree(t){return Sg(t)==="[object String]"}function iee(t){return Sg(t)==="[object Object]"}function oee(t){return Sg(t)==="[object RegExp]"}function U4(t){return Sg(t)==="[object Function]"}function see(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const _N={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function aee(t){return Object.keys(t||{}).reduce(function(e,n){return e||_N.hasOwnProperty(n)},!1)}const lee={"http:":{validate:function(t,e,n){const r=t.slice(e);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(t,e,n){const r=t.slice(e);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(r)?e>=3&&t[e-3]===":"||e>=3&&t[e-3]==="/"?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(t,e,n){const r=t.slice(e);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},uee="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",cee="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function fee(t){t.__index__=-1,t.__text_cache__=""}function dee(t){return function(e,n){const r=e.slice(n);return t.test(r)?r.match(t)[0].length:0}}function V4(){return function(t,e){e.normalize(t)}}function Om(t){const e=t.re=nee(t.__opts__),n=t.__tlds__.slice();t.onCompile(),t.__tlds_replaced__||n.push(uee),n.push(e.src_xn),e.src_tlds=n.join("|");function r(a){return a.replace("%TLDS%",e.src_tlds)}e.email_fuzzy=RegExp(r(e.tpl_email_fuzzy),"i"),e.link_fuzzy=RegExp(r(e.tpl_link_fuzzy),"i"),e.link_no_ip_fuzzy=RegExp(r(e.tpl_link_no_ip_fuzzy),"i"),e.host_fuzzy_test=RegExp(r(e.tpl_host_fuzzy_test),"i");const i=[];t.__compiled__={};function o(a,l){throw new Error('(LinkifyIt) Invalid schema "'+a+'": '+l)}Object.keys(t.__schemas__).forEach(function(a){const l=t.__schemas__[a];if(l===null)return;const u={validate:null,link:null};if(t.__compiled__[a]=u,iee(l)){oee(l.validate)?u.validate=dee(l.validate):U4(l.validate)?u.validate=l.validate:o(a,l),U4(l.normalize)?u.normalize=l.normalize:l.normalize?o(a,l):u.normalize=V4();return}if(ree(l)){i.push(a);return}o(a,l)}),i.forEach(function(a){t.__compiled__[t.__schemas__[a]]&&(t.__compiled__[a].validate=t.__compiled__[t.__schemas__[a]].validate,t.__compiled__[a].normalize=t.__compiled__[t.__schemas__[a]].normalize)}),t.__compiled__[""]={validate:null,normalize:V4()};const s=Object.keys(t.__compiled__).filter(function(a){return a.length>0&&t.__compiled__[a]}).map(see).join("|");t.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+s+")","i"),t.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+s+")","ig"),t.re.schema_at_start=RegExp("^"+t.re.schema_search.source,"i"),t.re.pretest=RegExp("("+t.re.schema_test.source+")|("+t.re.host_fuzzy_test.source+")|@","i"),fee(t)}function hee(t,e){const n=t.__index__,r=t.__last_index__,i=t.__text_cache__.slice(n,r);this.schema=t.__schema__.toLowerCase(),this.index=n+e,this.lastIndex=r+e,this.raw=i,this.text=i,this.url=i}function Rw(t,e){const n=new hee(t,e);return t.__compiled__[n.schema].normalize(n,t),n}function Vr(t,e){if(!(this instanceof Vr))return new Vr(t,e);e||aee(t)&&(e=t,t={}),this.__opts__=Iw({},_N,e),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=Iw({},lee,t),this.__compiled__={},this.__tlds__=cee,this.__tlds_replaced__=!1,this.re={},Om(this)}Vr.prototype.add=function(e,n){return this.__schemas__[e]=n,Om(this),this};Vr.prototype.set=function(e){return this.__opts__=Iw(this.__opts__,e),this};Vr.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;let n,r,i,o,s,a,l,u,c;if(this.re.schema_test.test(e)){for(l=this.re.schema_search,l.lastIndex=0;(n=l.exec(e))!==null;)if(o=this.testSchemaAt(e,n[2],l.lastIndex),o){this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+o;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(u=e.search(this.re.host_fuzzy_test),u>=0&&(this.__index__<0||u=0&&(i=e.match(this.re.email_fuzzy))!==null&&(s=i.index+i[1].length,a=i.index+i[0].length,(this.__index__<0||sthis.__last_index__)&&(this.__schema__="mailto:",this.__index__=s,this.__last_index__=a))),this.__index__>=0};Vr.prototype.pretest=function(e){return this.re.pretest.test(e)};Vr.prototype.testSchemaAt=function(e,n,r){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(e,r,this):0};Vr.prototype.match=function(e){const n=[];let r=0;this.__index__>=0&&this.__text_cache__===e&&(n.push(Rw(this,r)),r=this.__last_index__);let i=r?e.slice(r):e;for(;this.test(i);)n.push(Rw(this,r)),i=i.slice(this.__last_index__),r+=this.__last_index__;return n.length?n:null};Vr.prototype.matchAtStart=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return null;const n=this.re.schema_at_start.exec(e);if(!n)return null;const r=this.testSchemaAt(e,n[2],n[0].length);return r?(this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+r,Rw(this,0)):null};Vr.prototype.tlds=function(e,n){return e=Array.isArray(e)?e:[e],n?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(r,i,o){return r!==o[i-1]}).reverse(),Om(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,Om(this),this)};Vr.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url="mailto:"+e.url)};Vr.prototype.onCompile=function(){};const qu=2147483647,so=36,x3=1,Gd=26,pee=38,mee=700,AN=72,TN=128,MN="-",gee=/^xn--/,yee=/[^\0-\x7F]/,bee=/[\x2E\u3002\uFF0E\uFF61]/g,vee={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Db=so-x3,ao=Math.floor,Nb=String.fromCharCode;function Ds(t){throw new RangeError(vee[t])}function wee(t,e){const n=[];let r=t.length;for(;r--;)n[r]=e(t[r]);return n}function ON(t,e){const n=t.split("@");let r="";n.length>1&&(r=n[0]+"@",t=n[1]),t=t.replace(bee,".");const i=t.split("."),o=wee(i,e).join(".");return r+o}function DN(t){const e=[];let n=0;const r=t.length;for(;n=55296&&i<=56319&&nString.fromCodePoint(...t),xee=function(t){return t>=48&&t<58?26+(t-48):t>=65&&t<91?t-65:t>=97&&t<123?t-97:so},H4=function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},NN=function(t,e,n){let r=0;for(t=n?ao(t/mee):t>>1,t+=ao(t/e);t>Db*Gd>>1;r+=so)t=ao(t/Db);return ao(r+(Db+1)*t/(t+pee))},$N=function(t){const e=[],n=t.length;let r=0,i=TN,o=AN,s=t.lastIndexOf(MN);s<0&&(s=0);for(let a=0;a=128&&Ds("not-basic"),e.push(t.charCodeAt(a));for(let a=s>0?s+1:0;a=n&&Ds("invalid-input");const d=xee(t.charCodeAt(a++));d>=so&&Ds("invalid-input"),d>ao((qu-r)/c)&&Ds("overflow"),r+=d*c;const h=f<=o?x3:f>=o+Gd?Gd:f-o;if(dao(qu/p)&&Ds("overflow"),c*=p}const u=e.length+1;o=NN(r-l,u,l==0),ao(r/u)>qu-i&&Ds("overflow"),i+=ao(r/u),r%=u,e.splice(r++,0,i)}return String.fromCodePoint(...e)},IN=function(t){const e=[];t=DN(t);const n=t.length;let r=TN,i=0,o=AN;for(const l of t)l<128&&e.push(Nb(l));const s=e.length;let a=s;for(s&&e.push(MN);a=r&&cao((qu-i)/u)&&Ds("overflow"),i+=(l-r)*u,r=l;for(const c of t)if(cqu&&Ds("overflow"),c===r){let f=i;for(let d=so;;d+=so){const h=d<=o?x3:d>=o+Gd?Gd:d-o;if(f=0))try{e.hostname=RN.toASCII(e.hostname)}catch{}return _h(m3(e))}function $ee(t){const e=g3(t,!0);if(e.hostname&&(!e.protocol||FN.indexOf(e.protocol)>=0))try{e.hostname=RN.toUnicode(e.hostname)}catch{}return yc(m3(e),yc.defaultChars+"%")}function gi(t,e){if(!(this instanceof gi))return new gi(t,e);e||b3(t)||(e=t||{},t="default"),this.inline=new Th,this.block=new Eg,this.core=new w3,this.renderer=new Bc,this.linkify=new Vr,this.validateLink=Dee,this.normalizeLink=Nee,this.normalizeLinkText=$ee,this.utils=RQ,this.helpers=kg({},PQ),this.options={},this.configure(t),e&&this.set(e)}gi.prototype.set=function(t){return kg(this.options,t),this};gi.prototype.configure=function(t){const e=this;if(b3(t)){const n=t;if(t=Tee[n],!t)throw new Error('Wrong `markdown-it` preset "'+n+'", check name')}if(!t)throw new Error("Wrong `markdown-it` preset, can't be empty");return t.options&&e.set(t.options),t.components&&Object.keys(t.components).forEach(function(n){t.components[n].rules&&e[n].ruler.enableOnly(t.components[n].rules),t.components[n].rules2&&e[n].ruler2.enableOnly(t.components[n].rules2)}),this};gi.prototype.enable=function(t,e){let n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(i){n=n.concat(this[i].ruler.enable(t,!0))},this),n=n.concat(this.inline.ruler2.enable(t,!0));const r=t.filter(function(i){return n.indexOf(i)<0});if(r.length&&!e)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this};gi.prototype.disable=function(t,e){let n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(i){n=n.concat(this[i].ruler.disable(t,!0))},this),n=n.concat(this.inline.ruler2.disable(t,!0));const r=t.filter(function(i){return n.indexOf(i)<0});if(r.length&&!e)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this};gi.prototype.use=function(t){const e=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,e),this};gi.prototype.parse=function(t,e){if(typeof t!="string")throw new Error("Input data should be a String");const n=new this.core.State(t,this,e);return this.core.process(n),n.tokens};gi.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)};gi.prototype.parseInline=function(t,e){const n=new this.core.State(t,this,e);return n.inlineMode=!0,this.core.process(n),n.tokens};gi.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)};const Iee=new XO({nodes:{doc:{content:"block+"},paragraph:{content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM(){return["p",0]}},blockquote:{content:"block+",group:"block",parseDOM:[{tag:"blockquote"}],toDOM(){return["blockquote",0]}},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM(){return["div",["hr"]]}},heading:{attrs:{level:{default:1}},content:"(text | image)*",group:"block",defining:!0,parseDOM:[{tag:"h1",attrs:{level:1}},{tag:"h2",attrs:{level:2}},{tag:"h3",attrs:{level:3}},{tag:"h4",attrs:{level:4}},{tag:"h5",attrs:{level:5}},{tag:"h6",attrs:{level:6}}],toDOM(t){return["h"+t.attrs.level,0]}},code_block:{content:"text*",group:"block",code:!0,defining:!0,marks:"",attrs:{params:{default:""}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:t=>({params:t.getAttribute("data-params")||""})}],toDOM(t){return["pre",t.attrs.params?{"data-params":t.attrs.params}:{},["code",0]]}},ordered_list:{content:"list_item+",group:"block",attrs:{order:{default:1},tight:{default:!1}},parseDOM:[{tag:"ol",getAttrs(t){return{order:t.hasAttribute("start")?+t.getAttribute("start"):1,tight:t.hasAttribute("data-tight")}}}],toDOM(t){return["ol",{start:t.attrs.order==1?null:t.attrs.order,"data-tight":t.attrs.tight?"true":null},0]}},bullet_list:{content:"list_item+",group:"block",attrs:{tight:{default:!1}},parseDOM:[{tag:"ul",getAttrs:t=>({tight:t.hasAttribute("data-tight")})}],toDOM(t){return["ul",{"data-tight":t.attrs.tight?"true":null},0]}},list_item:{content:"block+",defining:!0,parseDOM:[{tag:"li"}],toDOM(){return["li",0]}},text:{group:"inline"},image:{inline:!0,attrs:{src:{},alt:{default:null},title:{default:null}},group:"inline",draggable:!0,parseDOM:[{tag:"img[src]",getAttrs(t){return{src:t.getAttribute("src"),title:t.getAttribute("title"),alt:t.getAttribute("alt")}}}],toDOM(t){return["img",t.attrs]}},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM(){return["br"]}}},marks:{em:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"},{style:"font-style=normal",clearMark:t=>t.type.name=="em"}],toDOM(){return["em"]}},strong:{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name=="strong"},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}],toDOM(){return["strong"]}},link:{attrs:{href:{},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs(t){return{href:t.getAttribute("href"),title:t.getAttribute("title")}}}],toDOM(t){return["a",t.attrs]}},code:{parseDOM:[{tag:"code"}],toDOM(){return["code"]}}}});function Ree(t,e){if(t.isText&&e.isText&&dt.sameSet(t.marks,e.marks))return t.withText(t.text+e.text)}let Fee=class{constructor(e,n){this.schema=e,this.tokenHandlers=n,this.stack=[{type:e.topNodeType,attrs:null,content:[],marks:dt.none}]}top(){return this.stack[this.stack.length-1]}push(e){this.stack.length&&this.top().content.push(e)}addText(e){if(!e)return;let n=this.top(),r=n.content,i=r[r.length-1],o=this.schema.text(e,n.marks),s;i&&(s=Ree(i,o))?r[r.length-1]=s:r.push(o)}openMark(e){let n=this.top();n.marks=e.addToSet(n.marks)}closeMark(e){let n=this.top();n.marks=e.removeFromSet(n.marks)}parseTokens(e){for(let n=0;n{s.openNode(o,cf(i,a,l,u)),s.addText(W4(a.content)),s.closeNode()}:(n[r+"_open"]=(s,a,l,u)=>s.openNode(o,cf(i,a,l,u)),n[r+"_close"]=s=>s.closeNode())}else if(i.node){let o=t.nodeType(i.node);n[r]=(s,a,l,u)=>s.addNode(o,cf(i,a,l,u))}else if(i.mark){let o=t.marks[i.mark];$b(i,r)?n[r]=(s,a,l,u)=>{s.openMark(o.create(cf(i,a,l,u))),s.addText(W4(a.content)),s.closeMark(o)}:(n[r+"_open"]=(s,a,l,u)=>s.openMark(o.create(cf(i,a,l,u))),n[r+"_close"]=s=>s.closeMark(o))}else if(i.ignore)$b(i,r)?n[r]=Ib:(n[r+"_open"]=Ib,n[r+"_close"]=Ib);else throw new RangeError("Unrecognized parsing spec "+JSON.stringify(i))}return n.text=(r,i)=>r.addText(i.content),n.inline=(r,i)=>r.parseTokens(i.children),n.softbreak=n.softbreak||(r=>r.addText(" ")),n}let Bee=class{constructor(e,n,r){this.schema=e,this.tokenizer=n,this.tokens=r,this.tokenHandlers=Lee(e,r)}parse(e,n={}){let r=new Fee(this.schema,this.tokenHandlers),i;r.parseTokens(this.tokenizer.parse(e,n));do i=r.closeNode();while(r.stack.length);return i||this.schema.topNodeType.createAndFill()}};function J4(t,e){for(;++e({tight:J4(e,n)})},ordered_list:{block:"ordered_list",getAttrs:(t,e,n)=>({order:+t.attrGet("start")||1,tight:J4(e,n)})},heading:{block:"heading",getAttrs:t=>({level:+t.tag.slice(1)})},code_block:{block:"code_block",noCloseToken:!0},fence:{block:"code_block",getAttrs:t=>({params:t.info||""}),noCloseToken:!0},hr:{node:"horizontal_rule"},image:{node:"image",getAttrs:t=>({src:t.attrGet("src"),title:t.attrGet("title")||null,alt:t.children[0]&&t.children[0].content||null})},hardbreak:{node:"hard_break"},em:{mark:"em"},strong:{mark:"strong"},link:{mark:"link",getAttrs:t=>({href:t.attrGet("href"),title:t.attrGet("title")||null})},code_inline:{mark:"code",noCloseToken:!0}});const Pee={open:"",close:"",mixable:!0};let zee=class{constructor(e,n,r={}){this.nodes=e,this.marks=n,this.options=r}serialize(e,n={}){n=Object.assign({},this.options,n);let r=new qee(this.nodes,this.marks,n);return r.renderContent(e),r.out}};const LN=new zee({blockquote(t,e){t.wrapBlock("> ",null,e,()=>t.renderContent(e))},code_block(t,e){const n=e.textContent.match(/`{3,}/gm),r=n?n.sort().slice(-1)[0]+"`":"```";t.write(r+(e.attrs.params||"")+` `),t.text(e.textContent,!1),t.write(` `),t.write(r),t.closeBlock(e)},heading(t,e){t.write(t.repeat("#",e.attrs.level)+" "),t.renderInline(e,!1),t.closeBlock(e)},horizontal_rule(t,e){t.write(e.attrs.markup||"---"),t.closeBlock(e)},bullet_list(t,e){t.renderList(e," ",()=>(e.attrs.bullet||"*")+" ")},ordered_list(t,e){let n=e.attrs.order||1,r=String(n+e.childCount-1).length,i=t.repeat(" ",r+2);t.renderList(e,i,o=>{let s=String(n+o);return t.repeat(" ",r-s.length)+s+". "})},list_item(t,e){t.renderContent(e)},paragraph(t,e){t.renderInline(e),t.closeBlock(e)},image(t,e){t.write("!["+t.esc(e.attrs.alt||"")+"]("+e.attrs.src.replace(/[\(\)]/g,"\\$&")+(e.attrs.title?' "'+e.attrs.title.replace(/"/g,'\\"')+'"':"")+")")},hard_break(t,e,n,r){for(let i=r+1;i":"]("+e.attrs.href.replace(/[\(\)"]/g,"\\$&")+(e.attrs.title?` "${e.attrs.title.replace(/"/g,'\\"')}"`:"")+")"},mixable:!0},code:{open(t,e,n,r){return K4(n.child(r),-1)},close(t,e,n,r){return K4(n.child(r-1),1)},escape:!1}});function K4(t,e){let n=/`+/g,r,i=0;if(t.isText)for(;r=n.exec(t.text);)i=Math.max(i,r[0].length);let o=i>0&&e>0?" `":"`";for(let s=0;s0&&e<0&&(o+=" "),o}function Lee(t,e,n){if(t.attrs.title||!/^\w+:/.test(t.attrs.href))return!1;let r=e.child(n);return!r.isText||r.text!=t.attrs.href||r.marks[r.marks.length-1]!=t?!1:n==e.childCount-1||!t.isInSet(e.child(n+1).marks)}let Bee=class{constructor(e,n,r){this.nodes=e,this.marks=n,this.options=r,this.delim="",this.out="",this.closed=null,this.inAutolink=void 0,this.atBlockStart=!1,this.inTightList=!1,typeof this.options.tightLists>"u"&&(this.options.tightLists=!1),typeof this.options.hardBreakNodeName>"u"&&(this.options.hardBreakNodeName="hard_break")}flushClose(e=2){if(this.closed){if(this.atBlank()||(this.out+=` +`);return}},text(t,e){t.text(e.text,!t.inAutolink)}},{em:{open:"*",close:"*",mixable:!0,expelEnclosingWhitespace:!0},strong:{open:"**",close:"**",mixable:!0,expelEnclosingWhitespace:!0},link:{open(t,e,n,r){return t.inAutolink=jee(e,n,r),t.inAutolink?"<":"["},close(t,e,n,r){let{inAutolink:i}=t;return t.inAutolink=void 0,i?">":"]("+e.attrs.href.replace(/[\(\)"]/g,"\\$&")+(e.attrs.title?` "${e.attrs.title.replace(/"/g,'\\"')}"`:"")+")"},mixable:!0},code:{open(t,e,n,r){return K4(n.child(r),-1)},close(t,e,n,r){return K4(n.child(r-1),1)},escape:!1}});function K4(t,e){let n=/`+/g,r,i=0;if(t.isText)for(;r=n.exec(t.text);)i=Math.max(i,r[0].length);let o=i>0&&e>0?" `":"`";for(let s=0;s0&&e<0&&(o+=" "),o}function jee(t,e,n){if(t.attrs.title||!/^\w+:/.test(t.attrs.href))return!1;let r=e.child(n);return!r.isText||r.text!=t.attrs.href||r.marks[r.marks.length-1]!=t?!1:n==e.childCount-1||!t.isInSet(e.child(n+1).marks)}let qee=class{constructor(e,n,r){this.nodes=e,this.marks=n,this.options=r,this.delim="",this.out="",this.closed=null,this.inAutolink=void 0,this.atBlockStart=!1,this.inTightList=!1,typeof this.options.tightLists>"u"&&(this.options.tightLists=!1),typeof this.options.hardBreakNodeName>"u"&&(this.options.hardBreakNodeName="hard_break")}flushClose(e=2){if(this.closed){if(this.atBlank()||(this.out+=` `),e>1){let n=this.delim,r=/\s+$/.exec(n);r&&(n=n.slice(0,n.length-r[0].length));for(let i=1;ithis.render(n,e,i))}renderInline(e,n=!0){this.atBlockStart=n;let r=[],i="",o=(s,a,l)=>{let u=s?s.marks:[];s&&s.type.name===this.options.hardBreakNodeName&&(u=u.filter(m=>{if(l+1==e.childCount)return!1;let b=e.child(l+1);return m.isInSet(b.marks)&&(!b.isText||/\S/.test(b.text))}));let c=i;if(i="",s&&s.isText&&u.some(m=>{let b=this.getMark(m.type.name);return b&&b.expelEnclosingWhitespace&&!m.isInSet(r)})){let[m,b,y]=/^(\s*)(.*)$/m.exec(s.text);b&&(c+=b,s=y?s.withText(y):null,s||(u=r))}if(s&&s.isText&&u.some(m=>{let b=this.getMark(m.type.name);return b&&b.expelEnclosingWhitespace&&(l==e.childCount-1||!m.isInSet(e.child(l+1).marks))})){let[m,b,y]=/^(.*?)(\s*)$/m.exec(s.text);y&&(i=y,s=b?s.withText(b):null,s||(u=r))}let f=u.length?u[u.length-1]:null,d=f&&this.getMark(f.type.name).escape===!1,h=u.length-(d?1:0);e:for(let m=0;my?u=u.slice(0,y).concat(b).concat(u.slice(y,m)).concat(u.slice(m+1,h)):y>m&&(u=u.slice(0,m).concat(u.slice(m+1,y)).concat(b).concat(u.slice(y,h)));continue e}}}let p=0;for(;p0&&(this.atBlockStart=!1)};e.forEach(o),o(null,0,e.childCount),this.atBlockStart=!1}renderList(e,n,r){this.closed&&this.closed.type==e.type?this.flushClose(3):this.inTightList&&this.flushClose(1);let i=typeof e.attrs.tight<"u"?e.attrs.tight:this.options.tightLists,o=this.inTightList;this.inTightList=i,e.forEach((s,a,l)=>{l&&i&&this.flushClose(1),this.wrapBlock(n,r(l),e,()=>this.render(s,e,l))}),this.inTightList=o}esc(e,n=!1){return e=e.replace(/[`*\\~\[\]_]/g,(r,i)=>r=="_"&&i>0&&i+1])/,"\\$&").replace(/^(\s*)(#{1,6})(\s|$)/,"$1\\$2$3").replace(/^(\s*\d+)\.\s/,"$1\\. ")),this.options.escapeExtraCharacters&&(e=e.replace(this.options.escapeExtraCharacters,"\\$&")),e}quote(e){let n=e.indexOf('"')==-1?'""':e.indexOf("'")==-1?"''":"()";return n[0]+e+n[1]}repeat(e,n){let r="";for(let i=0;i({commands:e})=>e.insertContent({type:this.name,attrs:t})}}}),zee="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",jee="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",vc=(t,e)=>{for(const n in e)t[n]=e[n];return t},Fw="numeric",Lw="ascii",Bw="alpha",b0="asciinumeric",xp="alphanumeric",Pw="domain",BN="emoji",qee="scheme",Vee="slashscheme",G4="whitespace";function Uee(t,e){return t in e||(e[t]=[]),e[t]}function el(t,e,n){e[Fw]&&(e[b0]=!0,e[xp]=!0),e[Lw]&&(e[b0]=!0,e[Bw]=!0),e[b0]&&(e[xp]=!0),e[Bw]&&(e[xp]=!0),e[xp]&&(e[Pw]=!0),e[BN]&&(e[Pw]=!0);for(const r in e){const i=Uee(r,n);i.indexOf(t)<0&&i.push(t)}}function Hee(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function hr(t){t===void 0&&(t=null),this.j={},this.jr=[],this.jd=null,this.t=t}hr.groups={};hr.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let r=0;rt.ta(e,n,r,i),Yr=(t,e,n,r,i)=>t.tr(e,n,r,i),Z4=(t,e,n,r,i)=>t.ts(e,n,r,i),ie=(t,e,n,r,i)=>t.tt(e,n,r,i),$o="WORD",zw="UWORD",Gd="LOCALHOST",jw="TLD",qw="UTLD",v0="SCHEME",du="SLASH_SCHEME",E3="NUM",PN="WS",S3="NL",ld="OPENBRACE",ud="CLOSEBRACE",Dm="OPENBRACKET",Nm="CLOSEBRACKET",$m="OPENPAREN",Im="CLOSEPAREN",Rm="OPENANGLEBRACKET",Fm="CLOSEANGLEBRACKET",Lm="FULLWIDTHLEFTPAREN",Bm="FULLWIDTHRIGHTPAREN",Pm="LEFTCORNERBRACKET",zm="RIGHTCORNERBRACKET",jm="LEFTWHITECORNERBRACKET",qm="RIGHTWHITECORNERBRACKET",Vm="FULLWIDTHLESSTHAN",Um="FULLWIDTHGREATERTHAN",Hm="AMPERSAND",Wm="APOSTROPHE",Jm="ASTERISK",Ns="AT",Km="BACKSLASH",Gm="BACKTICK",Zm="CARET",Ps="COLON",C3="COMMA",Ym="DOLLAR",Ji="DOT",Qm="EQUALS",_3="EXCLAMATION",Ki="HYPHEN",Xm="PERCENT",e1="PIPE",t1="PLUS",n1="POUND",r1="QUERY",A3="QUOTE",T3="SEMI",Gi="SLASH",cd="TILDE",i1="UNDERSCORE",zN="EMOJI",o1="SYM";var jN=Object.freeze({__proto__:null,WORD:$o,UWORD:zw,LOCALHOST:Gd,TLD:jw,UTLD:qw,SCHEME:v0,SLASH_SCHEME:du,NUM:E3,WS:PN,NL:S3,OPENBRACE:ld,CLOSEBRACE:ud,OPENBRACKET:Dm,CLOSEBRACKET:Nm,OPENPAREN:$m,CLOSEPAREN:Im,OPENANGLEBRACKET:Rm,CLOSEANGLEBRACKET:Fm,FULLWIDTHLEFTPAREN:Lm,FULLWIDTHRIGHTPAREN:Bm,LEFTCORNERBRACKET:Pm,RIGHTCORNERBRACKET:zm,LEFTWHITECORNERBRACKET:jm,RIGHTWHITECORNERBRACKET:qm,FULLWIDTHLESSTHAN:Vm,FULLWIDTHGREATERTHAN:Um,AMPERSAND:Hm,APOSTROPHE:Wm,ASTERISK:Jm,AT:Ns,BACKSLASH:Km,BACKTICK:Gm,CARET:Zm,COLON:Ps,COMMA:C3,DOLLAR:Ym,DOT:Ji,EQUALS:Qm,EXCLAMATION:_3,HYPHEN:Ki,PERCENT:Xm,PIPE:e1,PLUS:t1,POUND:n1,QUERY:r1,QUOTE:A3,SEMI:T3,SLASH:Gi,TILDE:cd,UNDERSCORE:i1,EMOJI:zN,SYM:o1});const Yl=/[a-z]/,Rb=new RegExp("\\p{L}","u"),Fb=new RegExp("\\p{Emoji}","u"),Lb=/\d/,Y4=/\s/,Q4=` -`,Wee="️",Jee="‍";let Ep=null,Sp=null;function Kee(t){t===void 0&&(t=[]);const e={};hr.groups=e;const n=new hr;Ep==null&&(Ep=X4(zee)),Sp==null&&(Sp=X4(jee)),ie(n,"'",Wm),ie(n,"{",ld),ie(n,"}",ud),ie(n,"[",Dm),ie(n,"]",Nm),ie(n,"(",$m),ie(n,")",Im),ie(n,"<",Rm),ie(n,">",Fm),ie(n,"(",Lm),ie(n,")",Bm),ie(n,"「",Pm),ie(n,"」",zm),ie(n,"『",jm),ie(n,"』",qm),ie(n,"<",Vm),ie(n,">",Um),ie(n,"&",Hm),ie(n,"*",Jm),ie(n,"@",Ns),ie(n,"`",Gm),ie(n,"^",Zm),ie(n,":",Ps),ie(n,",",C3),ie(n,"$",Ym),ie(n,".",Ji),ie(n,"=",Qm),ie(n,"!",_3),ie(n,"-",Ki),ie(n,"%",Xm),ie(n,"|",e1),ie(n,"+",t1),ie(n,"#",n1),ie(n,"?",r1),ie(n,'"',A3),ie(n,"/",Gi),ie(n,";",T3),ie(n,"~",cd),ie(n,"_",i1),ie(n,"\\",Km);const r=Yr(n,Lb,E3,{[Fw]:!0});Yr(r,Lb,r);const i=Yr(n,Yl,$o,{[Lw]:!0});Yr(i,Yl,i);const o=Yr(n,Rb,zw,{[Bw]:!0});Yr(o,Yl),Yr(o,Rb,o);const s=Yr(n,Y4,PN,{[G4]:!0});ie(n,Q4,S3,{[G4]:!0}),ie(s,Q4),Yr(s,Y4,s);const a=Yr(n,Fb,zN,{[BN]:!0});Yr(a,Fb,a),ie(a,Wee,a);const l=ie(a,Jee);Yr(l,Fb,a);const u=[[Yl,i]],c=[[Yl,null],[Rb,o]];for(let f=0;ff[0]>d[0]?1:-1);for(let f=0;f=0?p[Pw]=!0:Yl.test(d)?Lb.test(d)?p[b0]=!0:p[Lw]=!0:p[Fw]=!0,Z4(n,d,d,p)}return Z4(n,"localhost",Gd,{ascii:!0}),n.jd=new hr(o1),{start:n,tokens:vc({groups:e},jN)}}function Gee(t,e){const n=Zee(e.replace(/[A-Z]/g,a=>a.toLowerCase())),r=n.length,i=[];let o=0,s=0;for(;s=0&&(f+=n[s].length,d++),u+=n[s].length,o+=n[s].length,s++;o-=f,s-=d,u-=f,i.push({t:c.t,v:e.slice(o-u,o),s:o-u,e:o})}return i}function Zee(t){const e=[],n=t.length;let r=0;for(;r56319||r+1===n||(o=t.charCodeAt(r+1))<56320||o>57343?t[r]:t.slice(r,r+2);e.push(s),r+=s.length}return e}function vs(t,e,n,r,i){let o;const s=e.length;for(let a=0;a=0;)o++;if(o>0){e.push(n.join(""));for(let s=parseInt(t.substring(r,r+o),10);s>0;s--)n.pop();r+=o}else n.push(t[r]),r++}return e}const Zd={defaultProtocol:"http",events:null,format:e_,formatHref:e_,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function M3(t,e){e===void 0&&(e=null);let n=vc({},Zd);t&&(n=vc(n,t instanceof M3?t.o:t));const r=n.ignoreTags,i=[];for(let o=0;on?r.substring(0,n)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t){return t===void 0&&(t=Zd.defaultProtocol),{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),i=t.get("tagName",n,e),o=this.toFormattedString(t),s={},a=t.get("className",n,e),l=t.get("target",n,e),u=t.get("rel",n,e),c=t.getObj("attributes",n,e),f=t.getObj("events",n,e);return s.href=r,a&&(s.class=a),l&&(s.target=l),u&&(s.rel=u),c&&vc(s,c),{tagName:i,attributes:s,content:o,eventListeners:f}}};function Cg(t,e){class n extends qN{constructor(i,o){super(i,o),this.t=t}}for(const r in e)n.prototype[r]=e[r];return n.t=t,n}const t_=Cg("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),n_=Cg("text"),Yee=Cg("nl"),Cp=Cg("url",{isLink:!0,toHref(t){return t===void 0&&(t=Zd.defaultProtocol),this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==Gd&&t[1].t===Ps}}),Qr=t=>new hr(t);function Qee(t){let{groups:e}=t;const n=e.domain.concat([Hm,Jm,Ns,Km,Gm,Zm,Ym,Qm,Ki,E3,Xm,e1,t1,n1,Gi,o1,cd,i1]),r=[Wm,Ps,C3,Ji,_3,r1,A3,T3,Rm,Fm,ld,ud,Nm,Dm,$m,Im,Lm,Bm,Pm,zm,jm,qm,Vm,Um],i=[Hm,Wm,Jm,Km,Gm,Zm,Ym,Qm,Ki,ld,ud,Xm,e1,t1,n1,r1,Gi,o1,cd,i1],o=Qr(),s=ie(o,cd);ze(s,i,s),ze(s,e.domain,s);const a=Qr(),l=Qr(),u=Qr();ze(o,e.domain,a),ze(o,e.scheme,l),ze(o,e.slashscheme,u),ze(a,i,s),ze(a,e.domain,a);const c=ie(a,Ns);ie(s,Ns,c),ie(l,Ns,c),ie(u,Ns,c);const f=ie(s,Ji);ze(f,i,s),ze(f,e.domain,s);const d=Qr();ze(c,e.domain,d),ze(d,e.domain,d);const h=ie(d,Ji);ze(h,e.domain,d);const p=Qr(t_);ze(h,e.tld,p),ze(h,e.utld,p),ie(c,Gd,p);const m=ie(d,Ki);ze(m,e.domain,d),ze(p,e.domain,d),ie(p,Ji,h),ie(p,Ki,m);const b=ie(p,Ps);ze(b,e.numeric,t_);const y=ie(a,Ki),v=ie(a,Ji);ze(y,e.domain,a),ze(v,i,s),ze(v,e.domain,a);const w=Qr(Cp);ze(v,e.tld,w),ze(v,e.utld,w),ze(w,e.domain,a),ze(w,i,s),ie(w,Ji,v),ie(w,Ki,y),ie(w,Ns,c);const g=ie(w,Ps),x=Qr(Cp);ze(g,e.numeric,x);const k=Qr(Cp),E=Qr();ze(k,n,k),ze(k,r,E),ze(E,n,k),ze(E,r,E),ie(w,Gi,k),ie(x,Gi,k);const D=ie(l,Ps),O=ie(u,Ps),N=ie(O,Gi),C=ie(N,Gi);ze(l,e.domain,a),ie(l,Ji,v),ie(l,Ki,y),ze(u,e.domain,a),ie(u,Ji,v),ie(u,Ki,y),ze(D,e.domain,k),ie(D,Gi,k),ze(C,e.domain,k),ze(C,n,k),ie(C,Gi,k);const R=[[ld,ud],[Dm,Nm],[$m,Im],[Rm,Fm],[Lm,Bm],[Pm,zm],[jm,qm],[Vm,Um]];for(let T=0;T=0&&d++,i++,c++;if(d<0)i-=c,i0&&(o.push(Bb(n_,e,s)),s=[]),i-=d,c-=d;const h=f.t,p=n.slice(i-c,i);o.push(Bb(h,e,p))}}return s.length>0&&o.push(Bb(n_,e,s)),o}function Bb(t,e,n){const r=n[0].s,i=n[n.length-1].e,o=e.slice(r,i);return new t(o,n)}const ete=typeof console<"u"&&console&&console.warn||(()=>{}),tte="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",At={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function nte(){hr.groups={},At.scanner=null,At.parser=null,At.tokenQueue=[],At.pluginQueue=[],At.customSchemes=[],At.initialized=!1}function r_(t,e){if(e===void 0&&(e=!1),At.initialized&&ete(`linkifyjs: already initialized - will not register custom scheme "${t}" ${tte}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format. +`)}render(e,n,r){if(this.nodes[e.type.name])this.nodes[e.type.name](this,e,n,r);else{if(this.options.strict!==!1)throw new Error("Token type `"+e.type.name+"` not supported by Markdown renderer");e.type.isLeaf||(e.type.inlineContent?this.renderInline(e):this.renderContent(e),e.isBlock&&this.closeBlock(e))}}renderContent(e){e.forEach((n,r,i)=>this.render(n,e,i))}renderInline(e,n=!0){this.atBlockStart=n;let r=[],i="",o=(s,a,l)=>{let u=s?s.marks:[];s&&s.type.name===this.options.hardBreakNodeName&&(u=u.filter(m=>{if(l+1==e.childCount)return!1;let b=e.child(l+1);return m.isInSet(b.marks)&&(!b.isText||/\S/.test(b.text))}));let c=i;if(i="",s&&s.isText&&u.some(m=>{let b=this.getMark(m.type.name);return b&&b.expelEnclosingWhitespace&&!m.isInSet(r)})){let[m,b,y]=/^(\s*)(.*)$/m.exec(s.text);b&&(c+=b,s=y?s.withText(y):null,s||(u=r))}if(s&&s.isText&&u.some(m=>{let b=this.getMark(m.type.name);return b&&b.expelEnclosingWhitespace&&(l==e.childCount-1||!m.isInSet(e.child(l+1).marks))})){let[m,b,y]=/^(.*?)(\s*)$/m.exec(s.text);y&&(i=y,s=b?s.withText(b):null,s||(u=r))}let f=u.length?u[u.length-1]:null,d=f&&this.getMark(f.type.name).escape===!1,h=u.length-(d?1:0);e:for(let m=0;my?u=u.slice(0,y).concat(b).concat(u.slice(y,m)).concat(u.slice(m+1,h)):y>m&&(u=u.slice(0,m).concat(u.slice(m+1,y)).concat(b).concat(u.slice(y,h)));continue e}}}let p=0;for(;p0&&(this.atBlockStart=!1)};e.forEach(o),o(null,0,e.childCount),this.atBlockStart=!1}renderList(e,n,r){this.closed&&this.closed.type==e.type?this.flushClose(3):this.inTightList&&this.flushClose(1);let i=typeof e.attrs.tight<"u"?e.attrs.tight:this.options.tightLists,o=this.inTightList;this.inTightList=i,e.forEach((s,a,l)=>{l&&i&&this.flushClose(1),this.wrapBlock(n,r(l),e,()=>this.render(s,e,l))}),this.inTightList=o}esc(e,n=!1){return e=e.replace(/[`*\\~\[\]_]/g,(r,i)=>r=="_"&&i>0&&i+1])/,"\\$&").replace(/^(\s*)(#{1,6})(\s|$)/,"$1\\$2$3").replace(/^(\s*\d+)\.\s/,"$1\\. ")),this.options.escapeExtraCharacters&&(e=e.replace(this.options.escapeExtraCharacters,"\\$&")),e}quote(e){let n=e.indexOf('"')==-1?'""':e.indexOf("'")==-1?"''":"()";return n[0]+e+n[1]}repeat(e,n){let r="";for(let i=0;i{for(const n in e)t[n]=e[n];return t},Fw="numeric",Lw="ascii",Bw="alpha",v0="asciinumeric",Ep="alphanumeric",Pw="domain",BN="emoji",Wee="scheme",Jee="slashscheme",G4="whitespace";function Kee(t,e){return t in e||(e[t]=[]),e[t]}function el(t,e,n){e[Fw]&&(e[v0]=!0,e[Ep]=!0),e[Lw]&&(e[v0]=!0,e[Bw]=!0),e[v0]&&(e[Ep]=!0),e[Bw]&&(e[Ep]=!0),e[Ep]&&(e[Pw]=!0),e[BN]&&(e[Pw]=!0);for(const r in e){const i=Kee(r,n);i.indexOf(t)<0&&i.push(t)}}function Gee(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function hr(t){t===void 0&&(t=null),this.j={},this.jr=[],this.jd=null,this.t=t}hr.groups={};hr.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let r=0;rt.ta(e,n,r,i),Yr=(t,e,n,r,i)=>t.tr(e,n,r,i),Z4=(t,e,n,r,i)=>t.ts(e,n,r,i),ie=(t,e,n,r,i)=>t.tt(e,n,r,i),$o="WORD",zw="UWORD",Zd="LOCALHOST",jw="TLD",qw="UTLD",w0="SCHEME",du="SLASH_SCHEME",E3="NUM",PN="WS",S3="NL",ld="OPENBRACE",ud="CLOSEBRACE",Dm="OPENBRACKET",Nm="CLOSEBRACKET",$m="OPENPAREN",Im="CLOSEPAREN",Rm="OPENANGLEBRACKET",Fm="CLOSEANGLEBRACKET",Lm="FULLWIDTHLEFTPAREN",Bm="FULLWIDTHRIGHTPAREN",Pm="LEFTCORNERBRACKET",zm="RIGHTCORNERBRACKET",jm="LEFTWHITECORNERBRACKET",qm="RIGHTWHITECORNERBRACKET",Um="FULLWIDTHLESSTHAN",Vm="FULLWIDTHGREATERTHAN",Hm="AMPERSAND",Wm="APOSTROPHE",Jm="ASTERISK",Ns="AT",Km="BACKSLASH",Gm="BACKTICK",Zm="CARET",Ps="COLON",C3="COMMA",Ym="DOLLAR",Ji="DOT",Qm="EQUALS",_3="EXCLAMATION",Ki="HYPHEN",Xm="PERCENT",e1="PIPE",t1="PLUS",n1="POUND",r1="QUERY",A3="QUOTE",T3="SEMI",Gi="SLASH",cd="TILDE",i1="UNDERSCORE",zN="EMOJI",o1="SYM";var jN=Object.freeze({__proto__:null,WORD:$o,UWORD:zw,LOCALHOST:Zd,TLD:jw,UTLD:qw,SCHEME:w0,SLASH_SCHEME:du,NUM:E3,WS:PN,NL:S3,OPENBRACE:ld,CLOSEBRACE:ud,OPENBRACKET:Dm,CLOSEBRACKET:Nm,OPENPAREN:$m,CLOSEPAREN:Im,OPENANGLEBRACKET:Rm,CLOSEANGLEBRACKET:Fm,FULLWIDTHLEFTPAREN:Lm,FULLWIDTHRIGHTPAREN:Bm,LEFTCORNERBRACKET:Pm,RIGHTCORNERBRACKET:zm,LEFTWHITECORNERBRACKET:jm,RIGHTWHITECORNERBRACKET:qm,FULLWIDTHLESSTHAN:Um,FULLWIDTHGREATERTHAN:Vm,AMPERSAND:Hm,APOSTROPHE:Wm,ASTERISK:Jm,AT:Ns,BACKSLASH:Km,BACKTICK:Gm,CARET:Zm,COLON:Ps,COMMA:C3,DOLLAR:Ym,DOT:Ji,EQUALS:Qm,EXCLAMATION:_3,HYPHEN:Ki,PERCENT:Xm,PIPE:e1,PLUS:t1,POUND:n1,QUERY:r1,QUOTE:A3,SEMI:T3,SLASH:Gi,TILDE:cd,UNDERSCORE:i1,EMOJI:zN,SYM:o1});const Yl=/[a-z]/,Rb=new RegExp("\\p{L}","u"),Fb=new RegExp("\\p{Emoji}","u"),Lb=/\d/,Y4=/\s/,Q4=` +`,Zee="️",Yee="‍";let Sp=null,Cp=null;function Qee(t){t===void 0&&(t=[]);const e={};hr.groups=e;const n=new hr;Sp==null&&(Sp=X4(Vee)),Cp==null&&(Cp=X4(Hee)),ie(n,"'",Wm),ie(n,"{",ld),ie(n,"}",ud),ie(n,"[",Dm),ie(n,"]",Nm),ie(n,"(",$m),ie(n,")",Im),ie(n,"<",Rm),ie(n,">",Fm),ie(n,"(",Lm),ie(n,")",Bm),ie(n,"「",Pm),ie(n,"」",zm),ie(n,"『",jm),ie(n,"』",qm),ie(n,"<",Um),ie(n,">",Vm),ie(n,"&",Hm),ie(n,"*",Jm),ie(n,"@",Ns),ie(n,"`",Gm),ie(n,"^",Zm),ie(n,":",Ps),ie(n,",",C3),ie(n,"$",Ym),ie(n,".",Ji),ie(n,"=",Qm),ie(n,"!",_3),ie(n,"-",Ki),ie(n,"%",Xm),ie(n,"|",e1),ie(n,"+",t1),ie(n,"#",n1),ie(n,"?",r1),ie(n,'"',A3),ie(n,"/",Gi),ie(n,";",T3),ie(n,"~",cd),ie(n,"_",i1),ie(n,"\\",Km);const r=Yr(n,Lb,E3,{[Fw]:!0});Yr(r,Lb,r);const i=Yr(n,Yl,$o,{[Lw]:!0});Yr(i,Yl,i);const o=Yr(n,Rb,zw,{[Bw]:!0});Yr(o,Yl),Yr(o,Rb,o);const s=Yr(n,Y4,PN,{[G4]:!0});ie(n,Q4,S3,{[G4]:!0}),ie(s,Q4),Yr(s,Y4,s);const a=Yr(n,Fb,zN,{[BN]:!0});Yr(a,Fb,a),ie(a,Zee,a);const l=ie(a,Yee);Yr(l,Fb,a);const u=[[Yl,i]],c=[[Yl,null],[Rb,o]];for(let f=0;ff[0]>d[0]?1:-1);for(let f=0;f=0?p[Pw]=!0:Yl.test(d)?Lb.test(d)?p[v0]=!0:p[Lw]=!0:p[Fw]=!0,Z4(n,d,d,p)}return Z4(n,"localhost",Zd,{ascii:!0}),n.jd=new hr(o1),{start:n,tokens:vc({groups:e},jN)}}function Xee(t,e){const n=ete(e.replace(/[A-Z]/g,a=>a.toLowerCase())),r=n.length,i=[];let o=0,s=0;for(;s=0&&(f+=n[s].length,d++),u+=n[s].length,o+=n[s].length,s++;o-=f,s-=d,u-=f,i.push({t:c.t,v:e.slice(o-u,o),s:o-u,e:o})}return i}function ete(t){const e=[],n=t.length;let r=0;for(;r56319||r+1===n||(o=t.charCodeAt(r+1))<56320||o>57343?t[r]:t.slice(r,r+2);e.push(s),r+=s.length}return e}function vs(t,e,n,r,i){let o;const s=e.length;for(let a=0;a=0;)o++;if(o>0){e.push(n.join(""));for(let s=parseInt(t.substring(r,r+o),10);s>0;s--)n.pop();r+=o}else n.push(t[r]),r++}return e}const Yd={defaultProtocol:"http",events:null,format:e_,formatHref:e_,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function M3(t,e){e===void 0&&(e=null);let n=vc({},Yd);t&&(n=vc(n,t instanceof M3?t.o:t));const r=n.ignoreTags,i=[];for(let o=0;on?r.substring(0,n)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t){return t===void 0&&(t=Yd.defaultProtocol),{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),i=t.get("tagName",n,e),o=this.toFormattedString(t),s={},a=t.get("className",n,e),l=t.get("target",n,e),u=t.get("rel",n,e),c=t.getObj("attributes",n,e),f=t.getObj("events",n,e);return s.href=r,a&&(s.class=a),l&&(s.target=l),u&&(s.rel=u),c&&vc(s,c),{tagName:i,attributes:s,content:o,eventListeners:f}}};function Cg(t,e){class n extends qN{constructor(i,o){super(i,o),this.t=t}}for(const r in e)n.prototype[r]=e[r];return n.t=t,n}const t_=Cg("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),n_=Cg("text"),tte=Cg("nl"),_p=Cg("url",{isLink:!0,toHref(t){return t===void 0&&(t=Yd.defaultProtocol),this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==Zd&&t[1].t===Ps}}),Qr=t=>new hr(t);function nte(t){let{groups:e}=t;const n=e.domain.concat([Hm,Jm,Ns,Km,Gm,Zm,Ym,Qm,Ki,E3,Xm,e1,t1,n1,Gi,o1,cd,i1]),r=[Wm,Ps,C3,Ji,_3,r1,A3,T3,Rm,Fm,ld,ud,Nm,Dm,$m,Im,Lm,Bm,Pm,zm,jm,qm,Um,Vm],i=[Hm,Wm,Jm,Km,Gm,Zm,Ym,Qm,Ki,ld,ud,Xm,e1,t1,n1,r1,Gi,o1,cd,i1],o=Qr(),s=ie(o,cd);ze(s,i,s),ze(s,e.domain,s);const a=Qr(),l=Qr(),u=Qr();ze(o,e.domain,a),ze(o,e.scheme,l),ze(o,e.slashscheme,u),ze(a,i,s),ze(a,e.domain,a);const c=ie(a,Ns);ie(s,Ns,c),ie(l,Ns,c),ie(u,Ns,c);const f=ie(s,Ji);ze(f,i,s),ze(f,e.domain,s);const d=Qr();ze(c,e.domain,d),ze(d,e.domain,d);const h=ie(d,Ji);ze(h,e.domain,d);const p=Qr(t_);ze(h,e.tld,p),ze(h,e.utld,p),ie(c,Zd,p);const m=ie(d,Ki);ze(m,e.domain,d),ze(p,e.domain,d),ie(p,Ji,h),ie(p,Ki,m);const b=ie(p,Ps);ze(b,e.numeric,t_);const y=ie(a,Ki),v=ie(a,Ji);ze(y,e.domain,a),ze(v,i,s),ze(v,e.domain,a);const w=Qr(_p);ze(v,e.tld,w),ze(v,e.utld,w),ze(w,e.domain,a),ze(w,i,s),ie(w,Ji,v),ie(w,Ki,y),ie(w,Ns,c);const g=ie(w,Ps),x=Qr(_p);ze(g,e.numeric,x);const k=Qr(_p),E=Qr();ze(k,n,k),ze(k,r,E),ze(E,n,k),ze(E,r,E),ie(w,Gi,k),ie(x,Gi,k);const D=ie(l,Ps),O=ie(u,Ps),N=ie(O,Gi),C=ie(N,Gi);ze(l,e.domain,a),ie(l,Ji,v),ie(l,Ki,y),ze(u,e.domain,a),ie(u,Ji,v),ie(u,Ki,y),ze(D,e.domain,k),ie(D,Gi,k),ze(C,e.domain,k),ze(C,n,k),ie(C,Gi,k);const R=[[ld,ud],[Dm,Nm],[$m,Im],[Rm,Fm],[Lm,Bm],[Pm,zm],[jm,qm],[Um,Vm]];for(let T=0;T=0&&d++,i++,c++;if(d<0)i-=c,i0&&(o.push(Bb(n_,e,s)),s=[]),i-=d,c-=d;const h=f.t,p=n.slice(i-c,i);o.push(Bb(h,e,p))}}return s.length>0&&o.push(Bb(n_,e,s)),o}function Bb(t,e,n){const r=n[0].s,i=n[n.length-1].e,o=e.slice(r,i);return new t(o,n)}const ite=typeof console<"u"&&console&&console.warn||(()=>{}),ote="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",At={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function ste(){hr.groups={},At.scanner=null,At.parser=null,At.tokenQueue=[],At.pluginQueue=[],At.customSchemes=[],At.initialized=!1}function r_(t,e){if(e===void 0&&(e=!1),At.initialized&&ite(`linkifyjs: already initialized - will not register custom scheme "${t}" ${ote}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format. 1. Must only contain digits, lowercase ASCII letters or "-" 2. Cannot start or end with "-" -3. "-" cannot repeat`);At.customSchemes.push([t,e])}function rte(){At.scanner=Kee(At.customSchemes);for(let t=0;t{const i=e.some(u=>u.docChanged)&&!n.doc.eq(r.doc),o=e.some(u=>u.getMeta("preventAutolink"));if(!i||o)return;const{tr:s}=r,a=xG(n.doc,[...e]);if(OG(a).forEach(({newRange:u})=>{const c=SG(r.doc,u,h=>h.isTextblock);let f,d;if(c.length>1?(f=c[0],d=r.doc.textBetween(f.pos,f.pos+f.node.nodeSize,void 0," ")):c.length&&r.doc.textBetween(u.from,u.to," "," ").endsWith(" ")&&(f=c[0],d=r.doc.textBetween(f.pos,u.to,void 0," ")),f&&d){const h=d.split(" ").filter(y=>y!=="");if(h.length<=0)return!1;const p=h[h.length-1],m=f.pos+d.lastIndexOf(p);if(!p)return!1;const b=VN(p).map(y=>y.toObject(t.defaultProtocol));if(!ite(b))return!1;b.filter(y=>y.isLink).map(y=>({...y,from:m+y.start+1,to:m+y.end+1})).filter(y=>r.schema.marks.code?!r.doc.rangeHasMark(y.from,y.to,r.schema.marks.code):!0).filter(y=>t.validate(y.value)).forEach(y=>{$D(y.from,y.to,r.doc).some(v=>v.mark.type===t.type)||s.addMark(y.from,y.to,t.type.create({href:y.href}))})}}),!!s.steps.length)return s}})}function ste(t){return new ns({key:new rs("handleClickLink"),props:{handleClick:(e,n,r)=>{var i,o;if(r.button!==0||!e.editable)return!1;let s=r.target;const a=[];for(;s.nodeName!=="DIV";)a.push(s),s=s.parentNode;if(!a.find(d=>d.nodeName==="A"))return!1;const l=AG(e.state,t.type.name),u=r.target,c=(i=u==null?void 0:u.href)!==null&&i!==void 0?i:l.href,f=(o=u==null?void 0:u.target)!==null&&o!==void 0?o:l.target;return u&&c?(window.open(c,f),!0):!1}}})}function ate(t){return new ns({key:new rs("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{state:i}=e,{selection:o}=i,{empty:s}=o;if(s)return!1;let a="";r.content.forEach(u=>{a+=u.textContent});const l=O3(a,{defaultProtocol:t.defaultProtocol}).find(u=>u.isLink&&u.value===a);return!a||!l?!1:(t.editor.commands.setMark(t.type,{href:l.href}),!0)}}})}const lte=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function i_(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const i=typeof r=="string"?r:r.scheme;i&&n.push(i)}),!t||t.replace(lte,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z+.-]+(?:[^a-z+.-:]|$))`,"i"))}const ute=qd.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.protocols.forEach(t=>{if(typeof t=="string"){r_(t);return}r_(t.scheme,t.optionalSlashes)})},onDestroy(){nte()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:t=>!!t}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!i_(e,this.options.protocols)?!1:null}}]},renderHTML({HTMLAttributes:t}){return i_(t.href,this.options.protocols)?["a",vm(this.options.HTMLAttributes,t),0]:["a",vm(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:e})=>e().setMark(this.name,t).setMeta("preventAutolink",!0).run(),toggleLink:t=>({chain:e})=>e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[ID({find:t=>{const e=[];if(t){const{validate:n}=this.options,r=O3(t).filter(i=>i.isLink&&n(i.value));r.length&&r.forEach(i=>e.push({text:i.value,data:{href:i.href},index:i.start}))}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[];return this.options.autolink&&t.push(ote({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:this.options.validate})),this.options.openOnClick===!0&&t.push(ste({type:this.type})),this.options.linkOnPaste&&t.push(ate({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}}),cte=ute.configure({autolink:!1}).extend({addPasteRules(){return[{find:t=>{const e=[];for(const{start:n,value:r,href:i}of O3(t.replace(/\ufffc/g," "))||[])!cZ(i)&&!i.startsWith("tel:")||e.push({index:n,text:r,data:{href:i}});return e},handler:t=>{var e;const{range:n,state:r,match:i}=t,{from:o,to:s}=n,{nodes:a,marks:l}=r.schema,u=this.editor.storage.nostr.imeta,c=(e=i.data)==null?void 0:e.href,f=hZ(c,c,u);if(f!=="text"&&a[f]){r.tr.replaceWith(o,s,a[f].create({src:c}));return}r.tr.addMark(o,s,l.link.create({href:c}))}}]}});function Pb(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`positive integer expected, not ${t}`)}function o_(t){if(typeof t!="boolean")throw new Error(`boolean expected, not ${t}`)}function fte(t){return t instanceof Uint8Array||t!=null&&typeof t=="object"&&t.constructor.name==="Uint8Array"}function qo(t,...e){if(!fte(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error(`Uint8Array expected of length ${e}, not of length=${t.length}`)}/*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */const qn=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),dte=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!dte)throw new Error("Non little-endian hardware is not supported");function hte(t,e){if(e==null||typeof e!="object")throw new Error("options must be defined");return Object.assign(t,e)}function pte(t,e){if(t.length!==e.length)return!1;let n=0;for(let r=0;r(Object.assign(e,t),e),aa=16,gte=283;function D3(t){return t<<1^gte&-(t>>7)}function Tu(t,e){let n=0;for(;e>0;e>>=1)n^=t&-(e&1),t=D3(t);return n}const Vw=(()=>{let t=new Uint8Array(256);for(let n=0,r=1;n<256;n++,r^=D3(r))t[n]=r;const e=new Uint8Array(256);e[0]=99;for(let n=0;n<255;n++){let r=t[255-n];r|=r<<8,e[t[n]]=(r^r>>4^r>>5^r>>6^r>>7^99)&255}return e})(),yte=Vw.map((t,e)=>Vw.indexOf(e)),bte=t=>t<<24|t>>>8,zb=t=>t<<8|t>>>24;function UN(t,e){if(t.length!==256)throw new Error("Wrong sbox length");const n=new Uint32Array(256).map((u,c)=>e(t[c])),r=n.map(zb),i=r.map(zb),o=i.map(zb),s=new Uint32Array(256*256),a=new Uint32Array(256*256),l=new Uint16Array(256*256);for(let u=0;u<256;u++)for(let c=0;c<256;c++){const f=u*256+c;s[f]=n[u]^r[c],a[f]=i[u]^o[c],l[f]=t[u]<<8|t[c]}return{sbox:t,sbox2:l,T0:n,T1:r,T2:i,T3:o,T01:s,T23:a}}const N3=UN(Vw,t=>Tu(t,3)<<24|t<<16|t<<8|Tu(t,2)),HN=UN(yte,t=>Tu(t,11)<<24|Tu(t,13)<<16|Tu(t,9)<<8|Tu(t,14)),vte=(()=>{const t=new Uint8Array(16);for(let e=0,n=1;e<16;e++,n=D3(n))t[e]=n;return t})();function WN(t){qo(t);const e=t.length;if(![16,24,32].includes(e))throw new Error(`aes: wrong key size: should be 16, 24 or 32, got: ${e}`);const{sbox2:n}=N3,r=qn(t),i=r.length,o=a=>lo(n,a,a,a,a),s=new Uint32Array(e+28);s.set(r);for(let a=i;a6&&a%i===4&&(l=o(l)),s[a]=s[a-i]^l}return s}function wte(t){const e=WN(t),n=e.slice(),r=e.length,{sbox2:i}=N3,{T0:o,T1:s,T2:a,T3:l}=HN;for(let u=0;u>>8&255]^a[f>>>16&255]^l[f>>>24]}return n}function Ws(t,e,n,r,i,o){return t[n<<8&65280|r>>>8&255]^e[i>>>8&65280|o>>>24&255]}function lo(t,e,n,r,i){return t[e&255|n&65280]|t[r>>>16&255|i>>>16&65280]<<16}function s_(t,e,n,r,i){const{sbox2:o,T01:s,T23:a}=N3;let l=0;e^=t[l++],n^=t[l++],r^=t[l++],i^=t[l++];const u=t.length/4-2;for(let p=0;p16)throw new Error(`aes/pcks5: wrong padding byte: ${r}`);const i=t.subarray(0,-r);for(let o=0;o{const a=WN(e),{b:l,o:u,out:c}=Ete(o,i,s),f=qn(n);let d=f[0],h=f[1],p=f[2],m=f[3],b=0;for(;b+4<=l.length;)d^=l[b+0],h^=l[b+1],p^=l[b+2],m^=l[b+3],{s0:d,s1:h,s2:p,s3:m}=s_(a,d,h,p,m),u[b++]=d,u[b++]=h,u[b++]=p,u[b++]=m;if(i){const y=Cte(o.subarray(b*4));d^=y[0],h^=y[1],p^=y[2],m^=y[3],{s0:d,s1:h,s2:p,s3:m}=s_(a,d,h,p,m),u[b++]=d,u[b++]=h,u[b++]=p,u[b++]=m}return a.fill(0),c},decrypt:(o,s)=>{xte(o);const a=wte(e),l=qn(n),u=JN(o.length,s),c=qn(o),f=qn(u);let d=l[0],h=l[1],p=l[2],m=l[3];for(let b=0;b+4<=c.length;){const y=d,v=h,w=p,g=m;d=c[b+0],h=c[b+1],p=c[b+2],m=c[b+3];const{s0:x,s1:k,s2:E,s3:D}=kte(a,d,h,p,m);f[b++]=x^y,f[b++]=k^v,f[b++]=E^w,f[b++]=D^g}return a.fill(0),Ste(u,i)}}}),GN=t=>Uint8Array.from(t.split("").map(e=>e.charCodeAt(0))),_te=GN("expand 16-byte k"),Ate=GN("expand 32-byte k"),Tte=qn(_te),ZN=qn(Ate);ZN.slice();function Ye(t,e){return t<>>32-e}function Uw(t){return t.byteOffset%4===0}const _p=64,Mte=16,YN=2**32-1,a_=new Uint32Array;function Ote(t,e,n,r,i,o,s,a){const l=i.length,u=new Uint8Array(_p),c=qn(u),f=Uw(i)&&Uw(o),d=f?qn(i):a_,h=f?qn(o):a_;for(let p=0;p=YN)throw new Error("arx: counter overflow");const m=Math.min(_p,l-p);if(f&&m===_p){const b=p/4;if(p%4!==0)throw new Error("arx: invalid block position");for(let y=0,v;y{qo(a),qo(l),qo(u);const d=u.length;if(c||(c=new Uint8Array(d)),qo(c),Pb(f),f<0||f>=YN)throw new Error("arx: counter overflow");if(c.length0;)h.pop().fill(0);return c}}function Nte(t,e,n,r,i,o=20){let s=t[0],a=t[1],l=t[2],u=t[3],c=e[0],f=e[1],d=e[2],h=e[3],p=e[4],m=e[5],b=e[6],y=e[7],v=i,w=n[0],g=n[1],x=n[2],k=s,E=a,D=l,O=u,N=c,C=f,R=d,T=h,q=p,A=m,S=b,P=y,B=v,j=w,z=g,J=x;for(let ae=0;aei?e.create().update(r).digest():r);for(let s=0;snew XN(t,e).update(n).digest();_g.create=(t,e)=>new XN(t,e);function $te(t,e,n){return oo.hash(t),_g(t,Vd(n),Vd(e))}const jb=new Uint8Array([0]),l_=new Uint8Array;function Ite(t,e,n,r=32){if(oo.hash(t),oo.number(r),r>255*t.outputLen)throw new Error("Length should be <= 255*HashLen");const i=Math.ceil(r/t.outputLen);n===void 0&&(n=l_);const o=new Uint8Array(i*t.outputLen),s=_g.create(t,e),a=s._cloneInto(),l=new Uint8Array(s.outputLen);for(let u=0;u{for(var n in e)Rte(t,n,{get:e[n],enumerable:!0})},Ql=Symbol("verified"),Fte=t=>t instanceof Object;function e$(t){if(!Fte(t)||typeof t.kind!="number"||typeof t.content!="string"||typeof t.created_at!="number"||typeof t.pubkey!="string"||!t.pubkey.match(/^[a-f0-9]{64}$/)||!Array.isArray(t.tags))return!1;for(let e=0;ejte,QueueNode:()=>t$,binarySearch:()=>$3,insertEventIntoAscendingList:()=>zte,insertEventIntoDescendingList:()=>Pte,normalizeURL:()=>Bte,utf8Decoder:()=>to,utf8Encoder:()=>Fi});var to=new TextDecoder("utf-8"),Fi=new TextEncoder;function Bte(t){t.indexOf("://")===-1&&(t="wss://"+t);let e=new URL(t);return e.pathname=e.pathname.replace(/\/+/g,"/"),e.pathname.endsWith("/")&&(e.pathname=e.pathname.slice(0,-1)),(e.port==="80"&&e.protocol==="ws:"||e.port==="443"&&e.protocol==="wss:")&&(e.port=""),e.searchParams.sort(),e.hash="",e.toString()}function Pte(t,e){const[n,r]=$3(t,i=>e.id===i.id?0:e.created_at===i.created_at?-1:i.created_at-e.created_at);return r||t.splice(n,0,e),t}function zte(t,e){const[n,r]=$3(t,i=>e.id===i.id?0:e.created_at===i.created_at?-1:e.created_at-i.created_at);return r||t.splice(n,0,e),t}function $3(t,e){let n=0,r=t.length-1;for(;n<=r;){const i=Math.floor((n+r)/2),o=e(t[i]);if(o===0)return[i,!0];o<0?r=i-1:n=i+1}return[n,!1]}var t$=class{constructor(e){id(this,"value"),id(this,"next",null),id(this,"prev",null),this.value=e}},jte=class{constructor(){id(this,"first"),id(this,"last"),this.first=null,this.last=null}enqueue(e){const n=new t$(e);return this.last?this.last===this.first?(this.last=n,this.last.prev=this.first,this.first.next=n):(n.prev=this.last,this.last.next=n,this.last=n):(this.first=n,this.last=n),!0}dequeue(){if(!this.first)return null;if(this.first===this.last){const n=this.first;return this.first=null,this.last=null,n.value}const e=this.first;return this.first=e.next,e.value}},qte=class{generateSecretKey(){return eo.utils.randomPrivateKey()}getPublicKey(t){return ln(eo.getPublicKey(t))}finalizeEvent(t,e){const n=t;return n.pubkey=ln(eo.getPublicKey(e)),n.id=w0(n),n.sig=ln(eo.sign(w0(n),e)),n[Ql]=!0,n}verifyEvent(t){if(typeof t[Ql]=="boolean")return t[Ql];const e=w0(t);if(e!==t.id)return t[Ql]=!1,!1;try{const n=eo.verify(t.sig,e,t.pubkey);return t[Ql]=n,n}catch{return t[Ql]=!1,!1}}};function Vte(t){if(!e$(t))throw new Error("can't serialize event with wrong or missing properties");return JSON.stringify([0,t.pubkey,t.created_at,t.kind,t.tags,t.content])}function w0(t){let e=Rc(Fi.encode(Vte(t)));return ln(e)}var Ag=new qte;Ag.generateSecretKey;Ag.getPublicKey;var Ma=Ag.finalizeEvent,I3=Ag.verifyEvent,Ute={};Ut(Ute,{Application:()=>Une,BadgeAward:()=>Xte,BadgeDefinition:()=>Lne,BlockedRelaysList:()=>xne,BookmarkList:()=>vne,Bookmarksets:()=>Ine,Calendar:()=>Yne,CalendarEventRSVP:()=>Qne,ChannelCreation:()=>s$,ChannelHideMessage:()=>u$,ChannelMessage:()=>l$,ChannelMetadata:()=>a$,ChannelMuteUser:()=>c$,ClassifiedListing:()=>Jne,ClientAuth:()=>f$,CommunitiesList:()=>wne,CommunityDefinition:()=>tre,CommunityPostApproval:()=>lne,Contacts:()=>Gte,CreateOrUpdateProduct:()=>zne,CreateOrUpdateStall:()=>Pne,Curationsets:()=>Rne,Date:()=>Gne,DraftClassifiedListing:()=>Kne,DraftLong:()=>qne,Emojisets:()=>Vne,EncryptedDirectMessage:()=>Zte,EncryptedDirectMessages:()=>Yte,EventDeletion:()=>Qte,FileMetadata:()=>nne,FileServerPreference:()=>_ne,Followsets:()=>Dne,GenericRepost:()=>ene,Genericlists:()=>Nne,HTTPAuth:()=>L3,Handlerinformation:()=>ere,Handlerrecommendation:()=>Xne,Highlights:()=>mne,InterestsList:()=>Sne,Interestsets:()=>Bne,JobFeedback:()=>fne,JobRequest:()=>une,JobResult:()=>cne,Label:()=>ane,LightningPubRPC:()=>Tne,LiveChatMessage:()=>rne,LiveEvent:()=>Hne,LongFormArticle:()=>jne,Metadata:()=>Wte,Mutelist:()=>gne,NWCWalletInfo:()=>Ane,NWCWalletRequest:()=>d$,NWCWalletResponse:()=>Mne,NostrConnect:()=>One,OpenTimestamps:()=>tne,Pinlist:()=>yne,ProblemTracker:()=>ine,ProfileBadges:()=>Fne,PublicChatsList:()=>kne,Reaction:()=>F3,RecommendRelay:()=>Kte,RelayList:()=>bne,Relaysets:()=>$ne,Report:()=>one,Reporting:()=>sne,Repost:()=>R3,SearchRelaysList:()=>Ene,ShortTextNote:()=>Jte,Time:()=>Zne,UserEmojiList:()=>Cne,UserStatuses:()=>Wne,Zap:()=>pne,ZapGoal:()=>dne,ZapRequest:()=>hne,classifyKind:()=>Hte,isEphemeralKind:()=>i$,isParameterizedReplaceableKind:()=>o$,isRegularKind:()=>n$,isReplaceableKind:()=>r$});function n$(t){return 1e3<=t&&t<1e4||[1,2,4,5,6,7,8,16,40,41,42,43,44].includes(t)}function r$(t){return[0,3].includes(t)||1e4<=t&&t<2e4}function i$(t){return 2e4<=t&&t<3e4}function o$(t){return 3e4<=t&&t<4e4}function Hte(t){return n$(t)?"regular":r$(t)?"replaceable":i$(t)?"ephemeral":o$(t)?"parameterized":"unknown"}var Wte=0,Jte=1,Kte=2,Gte=3,Zte=4,Yte=4,Qte=5,R3=6,F3=7,Xte=8,ene=16,s$=40,a$=41,l$=42,u$=43,c$=44,tne=1040,nne=1063,rne=1311,ine=1971,one=1984,sne=1984,ane=1985,lne=4550,une=5999,cne=6999,fne=7e3,dne=9041,hne=9734,pne=9735,mne=9802,gne=1e4,yne=10001,bne=10002,vne=10003,wne=10004,kne=10005,xne=10006,Ene=10007,Sne=10015,Cne=10030,_ne=10096,Ane=13194,Tne=21e3,f$=22242,d$=23194,Mne=23195,One=24133,L3=27235,Dne=3e4,Nne=30001,$ne=30002,Ine=30003,Rne=30004,Fne=30008,Lne=30009,Bne=30015,Pne=30017,zne=30018,jne=30023,qne=30024,Vne=30030,Une=30078,Hne=30311,Wne=30315,Jne=30402,Kne=30403,Gne=31922,Zne=31923,Yne=31924,Qne=31925,Xne=31989,ere=31990,tre=34550,nre={};Ut(nre,{getHex64:()=>B3,getInt:()=>h$,getSubscriptionId:()=>rre,matchEventId:()=>ire,matchEventKind:()=>sre,matchEventPubkey:()=>ore});function B3(t,e){let n=e.length+3,r=t.indexOf(`"${e}":`)+n,i=t.slice(r).indexOf('"')+r+1;return t.slice(i,i+64)}function h$(t,e){let n=e.length,r=t.indexOf(`"${e}":`)+n+3,i=t.slice(r),o=Math.min(i.indexOf(","),i.indexOf("}"));return parseInt(i.slice(0,o),10)}function rre(t){let e=t.slice(0,22).indexOf('"EVENT"');if(e===-1)return null;let n=t.slice(e+7+1).indexOf('"');if(n===-1)return null;let r=e+7+1+n,i=t.slice(r+1,80).indexOf('"');if(i===-1)return null;let o=r+1+i;return t.slice(r+1,o)}function ire(t,e){return e===B3(t,"id")}function ore(t,e){return e===B3(t,"pubkey")}function sre(t,e){return e===h$(t,"kind")}var are={};Ut(are,{makeAuthEvent:()=>lre});function lre(t,e){return{kind:f$,created_at:Math.floor(Date.now()/1e3),tags:[["relay",t],["challenge",e]],content:""}}var ure;try{ure=WebSocket}catch{}var cre;try{cre=WebSocket}catch{}var Wo={};Ut(Wo,{BECH32_REGEX:()=>p$,Bech32MaxSize:()=>P3,decode:()=>Tg,encodeBytes:()=>Mg,naddrEncode:()=>yre,neventEncode:()=>gre,noteEncode:()=>pre,nprofileEncode:()=>mre,npubEncode:()=>hre,nrelayEncode:()=>bre,nsecEncode:()=>dre});var P3=5e3,p$=/[\x21-\x7E]{1,83}1[023456789acdefghjklmnpqrstuvwxyz]{6,}/;function fre(t){const e=new Uint8Array(4);return e[0]=t>>24&255,e[1]=t>>16&255,e[2]=t>>8&255,e[3]=t&255,e}function Tg(t){var e,n,r,i,o,s,a,l;let{prefix:u,words:c}=pc.decode(t,P3),f=new Uint8Array(pc.fromWords(c));switch(u){case"nprofile":{let d=Ap(f);if(!((e=d[0])!=null&&e[0]))throw new Error("missing TLV 0 for nprofile");if(d[0][0].length!==32)throw new Error("TLV 0 should be 32 bytes");return{type:"nprofile",data:{pubkey:ln(d[0][0]),relays:d[1]?d[1].map(h=>to.decode(h)):[]}}}case"nevent":{let d=Ap(f);if(!((n=d[0])!=null&&n[0]))throw new Error("missing TLV 0 for nevent");if(d[0][0].length!==32)throw new Error("TLV 0 should be 32 bytes");if(d[2]&&d[2][0].length!==32)throw new Error("TLV 2 should be 32 bytes");if(d[3]&&d[3][0].length!==4)throw new Error("TLV 3 should be 4 bytes");return{type:"nevent",data:{id:ln(d[0][0]),relays:d[1]?d[1].map(h=>to.decode(h)):[],author:(r=d[2])!=null&&r[0]?ln(d[2][0]):void 0,kind:(i=d[3])!=null&&i[0]?parseInt(ln(d[3][0]),16):void 0}}}case"naddr":{let d=Ap(f);if(!((o=d[0])!=null&&o[0]))throw new Error("missing TLV 0 for naddr");if(!((s=d[2])!=null&&s[0]))throw new Error("missing TLV 2 for naddr");if(d[2][0].length!==32)throw new Error("TLV 2 should be 32 bytes");if(!((a=d[3])!=null&&a[0]))throw new Error("missing TLV 3 for naddr");if(d[3][0].length!==4)throw new Error("TLV 3 should be 4 bytes");return{type:"naddr",data:{identifier:to.decode(d[0][0]),pubkey:ln(d[2][0]),kind:parseInt(ln(d[3][0]),16),relays:d[1]?d[1].map(h=>to.decode(h)):[]}}}case"nrelay":{let d=Ap(f);if(!((l=d[0])!=null&&l[0]))throw new Error("missing TLV 0 for nrelay");return{type:"nrelay",data:to.decode(d[0][0])}}case"nsec":return{type:u,data:f};case"npub":case"note":return{type:u,data:ln(f)};default:throw new Error(`unknown prefix ${u}`)}}function Ap(t){let e={},n=t;for(;n.length>0;){let r=n[0],i=n[1],o=n.slice(2,2+i);if(n=n.slice(2+i),o.lengthFi.encode(n))});return Th("nprofile",e)}function gre(t){let e;t.kind!==void 0&&(e=fre(t.kind));let n=Og({0:[hc(t.id)],1:(t.relays||[]).map(r=>Fi.encode(r)),2:t.author?[hc(t.author)]:[],3:e?[new Uint8Array(e)]:[]});return Th("nevent",n)}function yre(t){let e=new ArrayBuffer(4);new DataView(e).setUint32(0,t.kind,!1);let n=Og({0:[Fi.encode(t.identifier)],1:(t.relays||[]).map(r=>Fi.encode(r)),2:[hc(t.pubkey)],3:[new Uint8Array(e)]});return Th("naddr",n)}function bre(t){let e=Og({0:[Fi.encode(t)]});return Th("nrelay",e)}function Og(t){let e=[];return Object.entries(t).reverse().forEach(([n,r])=>{r.forEach(i=>{let o=new Uint8Array(i.length+2);o.set([parseInt(n)],0),o.set([i.length],1),o.set(i,2),e.push(o)})}),pg(...e)}var vre={};Ut(vre,{decrypt:()=>wre,encrypt:()=>m$});async function m$(t,e,n){const r=t instanceof Uint8Array?ln(t):t,i=Lc.getSharedSecret(r,"02"+e),o=g$(i);let s=Uint8Array.from(jD(16)),a=Fi.encode(n),l=KN(o,s).encrypt(a),u=ko.encode(new Uint8Array(l)),c=ko.encode(new Uint8Array(s.buffer));return`${u}?iv=${c}`}async function wre(t,e,n){const r=t instanceof Uint8Array?ln(t):t;let[i,o]=n.split("?iv="),s=Lc.getSharedSecret(r,"02"+e),a=g$(s),l=ko.decode(o),u=ko.decode(i),c=KN(a,l).decrypt(u);return to.decode(c)}function g$(t){return t.slice(1,33)}var kre={};Ut(kre,{NIP05_REGEX:()=>y$,isValid:()=>Sre,queryProfile:()=>b$,searchDomain:()=>Ere,useFetchImplementation:()=>xre});var y$=/^(?:([\w.+-]+)@)?([\w_-]+(\.[\w_-]+)+)$/,Dg;try{Dg=fetch}catch{}function xre(t){Dg=t}async function Ere(t,e=""){try{const n=`https://${t}/.well-known/nostr.json?name=${e}`;return(await(await Dg(n,{redirect:"error"})).json()).names}catch{return{}}}async function b$(t){var e;const n=t.match(y$);if(!n)return null;const[r,i="_",o]=n;try{const s=`https://${o}/.well-known/nostr.json?name=${i}`,a=await(await Dg(s,{redirect:"error"})).json();let l=a.names[i];return l?{pubkey:l,relays:(e=a.relays)==null?void 0:e[l]}:null}catch{return null}}async function Sre(t,e){let n=await b$(e);return n?n.pubkey===t:!1}var Cre={};Ut(Cre,{parse:()=>_re});function _re(t){const e={reply:void 0,root:void 0,mentions:[],profiles:[]},n=[];for(const r of t.tags)r[0]==="e"&&r[1]&&n.push(r),r[0]==="p"&&r[1]&&e.profiles.push({pubkey:r[1],relays:r[2]?[r[2]]:[]});for(let r=0;rMre,useFetchImplementation:()=>Tre});var v$;try{v$=fetch}catch{}function Tre(t){v$=t}async function Mre(t){return await(await fetch(t.replace("ws://","http://").replace("wss://","https://"),{headers:{Accept:"application/nostr+json"}})).json()}var Ore={};Ut(Ore,{getPow:()=>w$,minePow:()=>Dre});function w$(t){let e=0;for(let n=0;n=e)break}return r}var Nre={};Ut(Nre,{finishRepostEvent:()=>$re,getRepostedEvent:()=>Ire,getRepostedEventPointer:()=>k$});function $re(t,e,n,r){return Ma({kind:R3,tags:[...t.tags??[],["e",e.id,n],["p",e.pubkey]],content:t.content===""?"":JSON.stringify(e),created_at:t.created_at},r)}function k$(t){if(t.kind!==R3)return;let e,n;for(let r=t.tags.length-1;r>=0&&(e===void 0||n===void 0);r--){const i=t.tags[r];i.length>=2&&(i[0]==="e"&&e===void 0?e=i:i[0]==="p"&&n===void 0&&(n=i))}if(e!==void 0)return{id:e[1],relays:[e[2],n==null?void 0:n[2]].filter(r=>typeof r=="string"),author:n==null?void 0:n[1]}}function Ire(t,{skipVerification:e}={}){const n=k$(t);if(n===void 0||t.content==="")return;let r;try{r=JSON.parse(t.content)}catch{return}if(r.id===n.id&&!(!e&&!I3(r)))return r}var Rre={};Ut(Rre,{NOSTR_URI_REGEX:()=>Ng,parse:()=>Lre,test:()=>Fre});var Ng=new RegExp(`nostr:(${p$.source})`);function Fre(t){return typeof t=="string"&&new RegExp(`^${Ng.source}$`).test(t)}function Lre(t){const e=t.match(new RegExp(`^${Ng.source}$`));if(!e)throw new Error(`Invalid Nostr URI: ${t}`);return{uri:e[0],value:e[1],decoded:Tg(e[1])}}var Bre={};Ut(Bre,{finishReactionEvent:()=>Pre,getReactedEventPointer:()=>zre});function Pre(t,e,n){const r=e.tags.filter(i=>i.length>=2&&(i[0]==="e"||i[0]==="p"));return Ma({...t,kind:F3,tags:[...t.tags??[],...r,["e",e.id],["p",e.pubkey]],content:t.content??"+"},n)}function zre(t){if(t.kind!==F3)return;let e,n;for(let r=t.tags.length-1;r>=0&&(e===void 0||n===void 0);r--){const i=t.tags[r];i.length>=2&&(i[0]==="e"&&e===void 0?e=i:i[0]==="p"&&n===void 0&&(n=i))}if(!(e===void 0||n===void 0))return{id:e[1],relays:[e[2],n[2]].filter(r=>r!==void 0),author:n[1]}}var jre={};Ut(jre,{matchAll:()=>qre,regex:()=>z3,replaceAll:()=>Vre});var z3=()=>new RegExp(`\\b${Ng.source}\\b`,"g");function*qre(t){const e=t.matchAll(z3());for(const n of e)try{const[r,i]=n;yield{uri:r,value:i,decoded:Tg(i),start:n.index,end:n.index+r.length}}catch{}}function Vre(t,e){return t.replaceAll(z3(),(n,r)=>e({uri:n,value:r,decoded:Tg(r)}))}var Ure={};Ut(Ure,{channelCreateEvent:()=>Hre,channelHideMessageEvent:()=>Kre,channelMessageEvent:()=>Jre,channelMetadataEvent:()=>Wre,channelMuteUserEvent:()=>Gre});var Hre=(t,e)=>{let n;if(typeof t.content=="object")n=JSON.stringify(t.content);else if(typeof t.content=="string")n=t.content;else return;return Ma({kind:s$,tags:[...t.tags??[]],content:n,created_at:t.created_at},e)},Wre=(t,e)=>{let n;if(typeof t.content=="object")n=JSON.stringify(t.content);else if(typeof t.content=="string")n=t.content;else return;return Ma({kind:a$,tags:[["e",t.channel_create_event_id],...t.tags??[]],content:n,created_at:t.created_at},e)},Jre=(t,e)=>{const n=[["e",t.channel_create_event_id,t.relay_url,"root"]];return t.reply_to_channel_message_event_id&&n.push(["e",t.reply_to_channel_message_event_id,t.relay_url,"reply"]),Ma({kind:l$,tags:[...n,...t.tags??[]],content:t.content,created_at:t.created_at},e)},Kre=(t,e)=>{let n;if(typeof t.content=="object")n=JSON.stringify(t.content);else if(typeof t.content=="string")n=t.content;else return;return Ma({kind:u$,tags:[["e",t.channel_message_event_id],...t.tags??[]],content:n,created_at:t.created_at},e)},Gre=(t,e)=>{let n;if(typeof t.content=="object")n=JSON.stringify(t.content);else if(typeof t.content=="string")n=t.content;else return;return Ma({kind:c$,tags:[["p",t.pubkey_to_mute],...t.tags??[]],content:n,created_at:t.created_at},e)},Zre={};Ut(Zre,{EMOJI_SHORTCODE_REGEX:()=>x$,matchAll:()=>Yre,regex:()=>j3,replaceAll:()=>Qre});var x$=/:(\w+):/,j3=()=>new RegExp(`\\B${x$.source}\\B`,"g");function*Yre(t){const e=t.matchAll(j3());for(const n of e)try{const[r,i]=n;yield{shortcode:r,name:i,start:n.index,end:n.index+r.length}}catch{}}function Qre(t,e){return t.replaceAll(j3(),(n,r)=>e({shortcode:n,name:r}))}var Xre={};Ut(Xre,{useFetchImplementation:()=>eie,validateGithub:()=>tie});var q3;try{q3=fetch}catch{}function eie(t){q3=t}async function tie(t,e,n){try{return await(await q3(`https://gist.github.com/${e}/${n}/raw`)).text()===`Verifying that I control the following Nostr public key: ${t}`}catch{return!1}}var nie={};Ut(nie,{decrypt:()=>M$,encrypt:()=>T$,getConversationKey:()=>C$,v2:()=>aie});var E$=1,S$=65535;function C$(t,e){const n=Lc.getSharedSecret(t,"02"+e).subarray(1,33);return $te(Rc,n,"nip44-v2")}function _$(t,e){const n=Ite(Rc,t,e,76);return{chacha_key:n.subarray(0,32),chacha_nonce:n.subarray(32,44),hmac_key:n.subarray(44,76)}}function V3(t){if(!Number.isSafeInteger(t)||t<1)throw new Error("expected positive integer");if(t<=32)return 32;const e=1<S$)throw new Error("invalid plaintext size: must be between 1 and 65535 bytes");const e=new Uint8Array(2);return new DataView(e.buffer).setUint16(0,t,!1),e}function iie(t){const e=Fi.encode(t),n=e.length,r=rie(n),i=new Uint8Array(V3(n)-n);return pg(r,e,i)}function oie(t){const e=new DataView(t.buffer).getUint16(0),n=t.subarray(2,2+e);if(eS$||n.length!==e||t.length!==2+V3(e))throw new Error("invalid padding");return to.decode(n)}function A$(t,e,n){if(n.length!==32)throw new Error("AAD associated data must be 32 bytes");const r=pg(n,e);return _g(Rc,t,r)}function sie(t){if(typeof t!="string")throw new Error("payload must be a valid string");const e=t.length;if(e<132||e>87472)throw new Error("invalid payload length: "+e);if(t[0]==="#")throw new Error("unknown encryption version");let n;try{n=ko.decode(t)}catch(o){throw new Error("invalid base64: "+o.message)}const r=n.length;if(r<99||r>65603)throw new Error("invalid data length: "+r);const i=n[0];if(i!==2)throw new Error("unknown encryption version "+i);return{nonce:n.subarray(1,33),ciphertext:n.subarray(33,-32),mac:n.subarray(-32)}}function T$(t,e,n=jD(32)){const{chacha_key:r,chacha_nonce:i,hmac_key:o}=_$(e,n),s=iie(t),a=QN(r,i,s),l=A$(o,a,n);return ko.encode(pg(new Uint8Array([2]),n,a,l))}function M$(t,e){const{nonce:n,ciphertext:r,mac:i}=sie(t),{chacha_key:o,chacha_nonce:s,hmac_key:a}=_$(e,n),l=A$(a,r,n);if(!pte(l,i))throw new Error("invalid MAC");const u=QN(o,s,r);return oie(u)}var aie={utils:{getConversationKey:C$,calcPaddedLen:V3},encrypt:T$,decrypt:M$},lie={};Ut(lie,{makeNwcRequestEvent:()=>cie,parseConnectionString:()=>uie});function uie(t){const{pathname:e,searchParams:n}=new URL(t),r=e,i=n.get("relay"),o=n.get("secret");if(!r||!i||!o)throw new Error("invalid connection string");return{pubkey:r,relay:i,secret:o}}async function cie(t,e,n){const i=await m$(e,t,JSON.stringify({method:"pay_invoice",params:{invoice:n}})),o={kind:d$,created_at:Math.round(Date.now()/1e3),content:i,tags:[["p",t]]};return Ma(o,e)}var fie={};Ut(fie,{getZapEndpoint:()=>hie,makeZapReceipt:()=>gie,makeZapRequest:()=>pie,useFetchImplementation:()=>die,validateZapRequest:()=>mie});var U3;try{U3=fetch}catch{}function die(t){U3=t}async function hie(t){try{let e="",{lud06:n,lud16:r}=JSON.parse(t.content);if(n){let{words:s}=pc.decode(n,1e3),a=pc.fromWords(s);e=to.decode(a)}else if(r){let[s,a]=r.split("@");e=new URL(`/.well-known/lnurlp/${s}`,`https://${a}`).toString()}else return null;let o=await(await U3(e)).json();if(o.allowsNostr&&o.nostrPubkey)return o.callback}catch{}return null}function pie({profile:t,event:e,amount:n,relays:r,comment:i=""}){if(!n)throw new Error("amount not given");if(!t)throw new Error("profile not given");let o={kind:9734,created_at:Math.round(Date.now()/1e3),content:i,tags:[["p",t],["amount",n.toString()],["relays",...r]]};return e&&o.tags.push(["e",e]),o}function mie(t){let e;try{e=JSON.parse(t)}catch{return"Invalid zap request JSON."}if(!e$(e))return"Zap request is not a valid Nostr event.";if(!I3(e))return"Invalid signature on zap request.";let n=e.tags.find(([o,s])=>o==="p"&&s);if(!n)return"Zap request doesn't have a 'p' tag.";if(!n[1].match(/^[a-f0-9]{64}$/))return"Zap request 'p' tag is not valid hex.";let r=e.tags.find(([o,s])=>o==="e"&&s);return r&&!r[1].match(/^[a-f0-9]{64}$/)?"Zap request 'e' tag is not valid hex.":e.tags.find(([o,s])=>o==="relays"&&s)?null:"Zap request doesn't have a 'relays' tag."}function gie({zapRequest:t,preimage:e,bolt11:n,paidAt:r}){let i=JSON.parse(t),o=i.tags.filter(([a])=>a==="e"||a==="p"||a==="a"),s={kind:9735,created_at:Math.round(r.getTime()/1e3),content:"",tags:[...o,["P",i.pubkey],["bolt11",n],["description",t]]};return e&&s.tags.push(["preimage",e]),s}var yie={};Ut(yie,{getToken:()=>bie,hashPayload:()=>H3,unpackEventFromToken:()=>D$,validateEvent:()=>L$,validateEventKind:()=>$$,validateEventMethodTag:()=>R$,validateEventPayloadTag:()=>F$,validateEventTimestamp:()=>N$,validateEventUrlTag:()=>I$,validateToken:()=>vie});var O$="Nostr ";async function bie(t,e,n,r=!1,i){const o={kind:L3,tags:[["u",t],["method",e]],created_at:Math.round(new Date().getTime()/1e3),content:""};i&&o.tags.push(["payload",H3(i)]);const s=await n(o);return(r?O$:"")+ko.encode(Fi.encode(JSON.stringify(s)))}async function vie(t,e,n){const r=await D$(t).catch(o=>{throw o});return await L$(r,e,n).catch(o=>{throw o})}async function D$(t){if(!t)throw new Error("Missing token");t=t.replace(O$,"");const e=to.decode(ko.decode(t));if(!e||e.length===0||!e.startsWith("{"))throw new Error("Invalid token");return JSON.parse(e)}function N$(t){return t.created_at?Math.round(new Date().getTime()/1e3)-t.created_at<60:!1}function $$(t){return t.kind===L3}function I$(t,e){const n=t.tags.find(r=>r[0]==="u");return n?n.length>0&&n[1]===e:!1}function R$(t,e){const n=t.tags.find(r=>r[0]==="method");return n?n.length>0&&n[1].toLowerCase()===e.toLowerCase():!1}function H3(t){const e=Rc(Fi.encode(JSON.stringify(t)));return ln(e)}function F$(t,e){const n=t.tags.find(i=>i[0]==="payload");if(!n)return!1;const r=H3(e);return n.length>0&&n[1]===r}async function L$(t,e,n,r){if(!I3(t))throw new Error("Invalid nostr event, signature invalid");if(!$$(t))throw new Error("Invalid nostr event, kind invalid");if(!N$(t))throw new Error("Invalid nostr event, created_at timestamp invalid");if(!I$(t,e))throw new Error("Invalid nostr event, url tag invalid");if(!R$(t,n))throw new Error("Invalid nostr event, method tag invalid");if(r&&typeof r=="object"&&Object.keys(r).length>0&&!F$(t,r))throw new Error("Invalid nostr event, payload tag does not match request body hash");return!0}const wie=/(nostr:)?(naddr1[0-9a-z]+)/g,kie=Ri.create({name:"naddr",group:"block",atom:!0,selectable:!0,draggable:!0,priority:1e3,addAttributes(){return{naddr:{default:null},identifier:{default:null},pubkey:{default:null},kind:{default:null},relays:{default:[]}}},renderHTML(t){return["div",{"data-naddr":t.node.attrs.naddr}]},renderText(t){return t.node.attrs.naddr},addStorage(){return{markdown:{serialize(t,e){t.write(e.attrs.naddr)},parse:{}}}},addCommands(){return{insertNAddr:({naddr:t})=>({commands:e})=>{var n;const r=t.split(":"),i=(n=Wo.decode(r[r.length-1]))==null?void 0:n.data;return e.insertContent({type:this.name,attrs:{...i,naddr:t}},{updateSelection:!1})}}},addPasteRules(){return[Eh({type:this.type,getAttributes:t=>t.data,find:t=>{const e=[];for(const n of t.matchAll(wie))try{const r=n[0],i=Wo.decode(n[2]).data;e.push(dc(n,{...i,naddr:r}))}catch{continue}return e}})]}}),xie=/(nostr:)?(note1[0-9a-z]+)/g,Eie=/(nostr:)?(nevent1[0-9a-z]+)/g,Sie=Ri.create({name:"nevent",group:"block",selectable:!0,draggable:!0,priority:1e3,addAttributes(){return{id:{default:null},kind:{default:null},author:{default:null},relays:{default:[]},nevent:{default:null}}},renderHTML(t){return["div",{"data-nevent":t.node.attrs.nevent}]},renderText(t){return t.node.attrs.nevent},parseHTML(){return[{tag:"div[data-nevent]"}]},addStorage(){return{markdown:{serialize(t,e){t.write(e.attrs.nevent)},parse:{}}}},addCommands(){return{insertNEvent:({nevent:t})=>({commands:e})=>{var n;const r=t.split(":"),i=(n=Wo.decode(r[r.length-1]))==null?void 0:n.data;return e.insertContent({type:this.name,attrs:{...i,nevent:t}},{updateSelection:!1})}}},addPasteRules(){return[Eh({type:this.type,getAttributes:t=>t.data,find:t=>{const e=[];for(const n of t.matchAll(xie))try{const r=Wo.decode(n[2]).data,i=n[0];e.push(dc(n,{id:r,nevent:i}))}catch{continue}for(const n of t.matchAll(Eie))try{const r=Wo.decode(n[2]).data,i=n[0];e.push(dc(n,{...r,nevent:i}))}catch{continue}return e}})]}}),Cie=/^(https?:\/\/)?(www\.|music\.)?(youtube\.com|youtu\.be|youtube-nocookie\.com)\/(?!channel\/)(?!@)(.+)?$/,_ie=/^(https?:\/\/)?(www\.|music\.)?(youtube\.com|youtu\.be)\/(?!channel\/)(?!@)(.+)?$/g,B$=t=>t.match(Cie),u_=t=>t?"https://www.youtube-nocookie.com/embed/":"https://www.youtube.com/embed/",Aie=t=>{const{url:e,allowFullscreen:n,autoplay:r,ccLanguage:i,ccLoadPolicy:o,controls:s,disableKBcontrols:a,enableIFrameApi:l,endTime:u,interfaceLanguage:c,ivLoadPolicy:f,loop:d,modestBranding:h,nocookie:p,origin:m,playlist:b,progressBarColor:y,startAt:v}=t;if(!B$(e))return null;if(e.includes("/embed/"))return e;if(e.includes("youtu.be")){const E=e.split("/").pop();return E?`${u_(p)}${E}`:null}const g=/(?:v=|shorts\/)([-\w]+)/gm.exec(e);if(!g||!g[1])return null;let x=`${u_(p)}${g[1]}`;const k=[];return n===!1&&k.push("fs=0"),r&&k.push("autoplay=1"),i&&k.push(`cc_lang_pref=${i}`),o&&k.push("cc_load_policy=1"),s||k.push("controls=0"),a&&k.push("disablekb=1"),l&&k.push("enablejsapi=1"),u&&k.push(`end=${u}`),c&&k.push(`hl=${c}`),f&&k.push(`iv_load_policy=${f}`),d&&k.push("loop=1"),h&&k.push("modestbranding=1"),m&&k.push(`origin=${m}`),b&&k.push(`playlist=${b}`),v&&k.push(`start=${v}`),y&&k.push(`color=${y}`),k.length&&(x+=`?${k.join("&")}`),x},Tie=Ri.create({name:"youtube",addOptions(){return{addPasteHandler:!0,allowFullscreen:!0,autoplay:!1,ccLanguage:void 0,ccLoadPolicy:void 0,controls:!0,disableKBcontrols:!1,enableIFrameApi:!1,endTime:0,height:480,interfaceLanguage:void 0,ivLoadPolicy:0,loop:!1,modestBranding:!1,HTMLAttributes:{},inline:!1,nocookie:!1,origin:"",playlist:"",progressBarColor:void 0,width:640}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},start:{default:0},width:{default:this.options.width},height:{default:this.options.height}}},parseHTML(){return[{tag:"div[data-youtube-video] iframe"}]},addCommands(){return{setYoutubeVideo:t=>({commands:e})=>B$(t.src)?e.insertContent({type:this.name,attrs:t}):!1}},addPasteRules(){return this.options.addPasteHandler?[Eh({find:_ie,type:this.type,getAttributes:t=>({src:t.input})})]:[]},renderHTML({HTMLAttributes:t}){const e=Aie({url:t.src,allowFullscreen:this.options.allowFullscreen,autoplay:this.options.autoplay,ccLanguage:this.options.ccLanguage,ccLoadPolicy:this.options.ccLoadPolicy,controls:this.options.controls,disableKBcontrols:this.options.disableKBcontrols,enableIFrameApi:this.options.enableIFrameApi,endTime:this.options.endTime,interfaceLanguage:this.options.interfaceLanguage,ivLoadPolicy:this.options.ivLoadPolicy,loop:this.options.loop,modestBranding:this.options.modestBranding,nocookie:this.options.nocookie,origin:this.options.origin,playlist:this.options.playlist,progressBarColor:this.options.progressBarColor,startAt:t.start||0});return t.src=e,["div",{"data-youtube-video":""},["iframe",vm(this.options.HTMLAttributes,{width:this.options.width,height:this.options.height,allowfullscreen:this.options.allowFullscreen,autoplay:this.options.autoplay,ccLanguage:this.options.ccLanguage,ccLoadPolicy:this.options.ccLoadPolicy,disableKBcontrols:this.options.disableKBcontrols,enableIFrameApi:this.options.enableIFrameApi,endTime:this.options.endTime,interfaceLanguage:this.options.interfaceLanguage,ivLoadPolicy:this.options.ivLoadPolicy,loop:this.options.loop,modestBranding:this.options.modestBranding,origin:this.options.origin,playlist:this.options.playlist,progressBarColor:this.options.progressBarColor},t)]]}}),Mie={bh:"blurhash"};function Oie(t){const e={};for(const n of t)if(n[0]==="imeta"){let r;for(const[i,o]of n.map(s=>s.split(/ (.+)/))){const s=Mie[i]||i;if(s==="url"&&(r=o,e[r]??(e[r]={})),o&&r)switch(s){case"fallback":{e[r].fallback=[...e[r].fallback||[],o];break}case"dim":{const a=o.split("x");e[r].dim={width:parseInt(a[0]),height:parseInt(a[1])};break}default:{e[r][s]=o;break}}}}return e}const Die=/(nostr:)?(npub1[0-9a-z]+)/g,Nie=/(nostr:)?(nprofile1[0-9a-z]+)/g,$ie=Ri.create({name:"nprofile",inline:!0,group:"inline",atom:!0,priority:1e3,addAttributes(){return{nprofile:{default:null},pubkey:{default:null},relays:{default:[]}}},renderHTML({HTMLAttributes:t}){return["span",vm(t,{"data-type":"nprofile"}),"@"]},renderText(t){return t.node.attrs.nprofile},addStorage(){return{markdown:{serialize(t,e){t.write(e.attrs.nprofile)},parse:{}}}},addCommands(){return{insertNProfile:({nprofile:t})=>({chain:e})=>{var n;const r=t.split(":"),i=(n=Wo.decode(r[r.length-1]))==null?void 0:n.data;return e().insertContent({type:this.name,attrs:{...i,nprofile:t}}).insertContent(" ").run()}}},addPasteRules(){return[Eh({type:this.type,getAttributes:t=>t.data,find:t=>{const e=[];for(const n of t.matchAll(Die))try{const r=n[0],i=Wo.decode(n[2]).data;e.push(dc(n,{pubkey:i,nprofile:r}))}catch{continue}for(const n of t.matchAll(Nie))try{const r=n[0],i=Wo.decode(n[2]).data;e.push(dc(n,{...i,nprofile:r}))}catch{continue}return e}})]}}),Iie=/(nsec1[0-9a-z]+)/g,Rie=is.create({name:"nsecReject",addOptions(){return{}},addPasteRules(){return[{find:Iie,handler:t=>{if(t.chain().deleteRange(t.range).insertContentAt(t.range.from,{text:"*NSEC_DELETED*",type:"text"}).run(),this.options.onError){this.options.onError(t);return}window.alert("DO NOT PASTE YOUR NSEC INTO THE EDITOR")}}]}}),Fie=/(#[^\s]+)/g,Lie=/(#[^\s]+)$/g,Bie=qd.create({name:"tag",inline:!0,selectable:!0,inclusive:!1,group:"inline",priority:100,addStorage(){return{markdown:{serialize:{open:"",close:"",mixable:!1,expelEnclosingWhitespace:!0},parse:{}}}},renderHTML(t){return["a",{...t.mark.attrs},0]},addAttributes(){return{tag:{default:null}}},addPasteRules(){return[ID({find:Fie,getAttributes:t=>({tag:t[0]}),type:this.type})]},addInputRules(){return[{find:Lie,handler:({state:t,range:e,match:n})=>{t.tr.delete(e.from,e.to).insertText(n[0]).addMark(e.from,e.to+1,this.type.create({tag:n[0]}))}}]}}),Pie=Ri.create({name:"tweet",group:"block",selectable:!0,draggable:!0,addAttributes(){return{src:{default:null}}},addStorage(){return{markdown:{serialize(t,e){t.write(e.attrs.src)},parse:{}}}},renderText(t){return t.node.attrs.src},renderHTML(){return["div",{}]}}),zie=Ri.create({name:"video",inline:!1,group:"block",atom:!0,selectable:!0,draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},file:{default:null},sha256:{default:null},uploading:{default:!1},uploadError:{default:null},uploadType:{default:"nip96"},uploadUrl:{default:"https://nostr.build"}}},renderText(t){return t.node.attrs.src},renderHTML(){return["video",{}]},addStorage(){return{markdown:{serialize:LN.nodes.image,parse:{}}}}}),Hw=is.create({name:"nostr",addExtensions(){const{extend:t={}}=this.options,e=[];return this.options.nprofile!==!1&&e.push($ie.extend(t.nprofile)),this.options.nevent!==!1&&e.push(Sie.extend(t.nevent)),this.options.naddr!==!1&&e.push(kie.extend(t.naddr)),this.options.link!==!1&&e.push(cte.extend(t.link).configure(this.options.link)),this.options.tag!==!1&&e.push(Bie.extend(t.tag)),this.options.youtube!==!1&&e.push(Tie.extend({renderText:n=>n.node.attrs.src,...t.youtube})),this.options.image!==!1&&e.push(Pee.configure(this.options.image).extend(t.image)),this.options.video!==!1&&e.push(zie.extend(t.video)),this.options.tweet!==!1&&e.push(Pie.extend(t.tweet)),this.options.bolt11!==!1&&e.push(mZ.extend(t.bolt11)),this.options.nsecReject!==!1&&e.push(Rie),this.options.fileUpload!==!1&&e.push(VY.configure(this.options.fileUpload)),e},addStorage(){return{imeta:null,pending:!1,setImeta:()=>{},getNprofiles:()=>[],getNevents:()=>[]}},onBeforeCreate(){this.storage.setImeta=t=>{this.storage.imeta=t},this.storage.getNprofiles=()=>{const t=[];return this.editor.state.doc.descendants(e=>{e.type.name==="nprofile"&&t.push(e.attrs)}),t},this.storage.getNevents=()=>{const t=[];return this.editor.state.doc.descendants(e=>{e.type.name==="nevents"&&t.push(e.attrs)}),t}},addCommands(){return{parseNote:(t,e)=>n=>(this.storage.setImeta(e||Oie(t.tags)),n.chain().setMeta("parse",!0).setMeta("uiEvent","paste").setContent(t.kind===1?t.content.replace(/(\n)+/g,"
"):t.content),!0),parseUserAbout:t=>e=>{if(t.kind!==0)return!1;let n;try{n=JSON.parse(t.content)}catch{return!1}return e.chain().setMeta("parse",!0).setMeta("uiEvent","paste").setContent(n.about,!0),!0}}}});function c_(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function P$(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function jie(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");c_(t.outputLen),c_(t.blockLen)}function s1(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function qie(t,e){P$(t);const n=e.outputLen;if(t.lengtht instanceof Uint8Array,Vb=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),Ui=(t,e)=>t<<32-e|t>>>e,Vie=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Vie)throw new Error("Non little-endian hardware is not supported");function Uie(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function W3(t){if(typeof t=="string"&&(t=Uie(t)),!z$(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}function Hie(...t){const e=new Uint8Array(t.reduce((r,i)=>r+i.length,0));let n=0;return t.forEach(r=>{if(!z$(r))throw new Error("Uint8Array expected");e.set(r,n),n+=r.length}),e}let j$=class{clone(){return this._cloneInto()}};function Wie(t){const e=r=>t().update(W3(r)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function q$(t=32){if(qb&&typeof qb.getRandomValues=="function")return qb.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}function Jie(t,e,n,r){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,n,r);const i=BigInt(32),o=BigInt(4294967295),s=Number(n>>i&o),a=Number(n&o),l=r?4:0,u=r?0:4;t.setUint32(e+l,s,r),t.setUint32(e+u,a,r)}let Kie=class extends j${constructor(e,n,r,i){super(),this.blockLen=e,this.outputLen=n,this.padOffset=r,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Vb(this.buffer)}update(e){s1(this);const{view:n,buffer:r,blockLen:i}=this;e=W3(e);const o=e.length;for(let s=0;si-s&&(this.process(r,0),s=0);for(let f=s;fc.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;ft&e^~t&n,Zie=(t,e,n)=>t&e^t&n^e&n,Yie=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ws=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ks=new Uint32Array(64);let Qie=class extends Kie{constructor(){super(64,32,8,!1),this.A=ws[0]|0,this.B=ws[1]|0,this.C=ws[2]|0,this.D=ws[3]|0,this.E=ws[4]|0,this.F=ws[5]|0,this.G=ws[6]|0,this.H=ws[7]|0}get(){const{A:e,B:n,C:r,D:i,E:o,F:s,G:a,H:l}=this;return[e,n,r,i,o,s,a,l]}set(e,n,r,i,o,s,a,l){this.A=e|0,this.B=n|0,this.C=r|0,this.D=i|0,this.E=o|0,this.F=s|0,this.G=a|0,this.H=l|0}process(e,n){for(let f=0;f<16;f++,n+=4)ks[f]=e.getUint32(n,!1);for(let f=16;f<64;f++){const d=ks[f-15],h=ks[f-2],p=Ui(d,7)^Ui(d,18)^d>>>3,m=Ui(h,17)^Ui(h,19)^h>>>10;ks[f]=m+ks[f-7]+p+ks[f-16]|0}let{A:r,B:i,C:o,D:s,E:a,F:l,G:u,H:c}=this;for(let f=0;f<64;f++){const d=Ui(a,6)^Ui(a,11)^Ui(a,25),h=c+d+Gie(a,l,u)+Yie[f]+ks[f]|0,m=(Ui(r,2)^Ui(r,13)^Ui(r,22))+Zie(r,i,o)|0;c=u,u=l,l=a,a=s+h|0,s=o,o=i,i=r,r=h+m|0}r=r+this.A|0,i=i+this.B|0,o=o+this.C|0,s=s+this.D|0,a=a+this.E|0,l=l+this.F|0,u=u+this.G|0,c=c+this.H|0,this.set(r,i,o,s,a,l,u,c)}roundClean(){ks.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};const Ww=Wie(()=>new Qie);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const V$=BigInt(0),$g=BigInt(1),Xie=BigInt(2),Ig=t=>t instanceof Uint8Array,eoe=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function wc(t){if(!Ig(t))throw new Error("Uint8Array expected");let e="";for(let n=0;nr+i.length,0));let n=0;return t.forEach(r=>{if(!Ig(r))throw new Error("Uint8Array expected");e.set(r,n),n+=r.length}),e}function noe(t,e){if(t.length!==e.length)return!1;for(let n=0;nV$;t>>=$g,e+=1);return e}function ooe(t,e){return t>>BigInt(e)&$g}const soe=(t,e,n)=>t|(n?$g:V$)<(Xie<new Uint8Array(t),f_=t=>Uint8Array.from(t);function H$(t,e,n){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=Ub(t),i=Ub(t),o=0;const s=()=>{r.fill(1),i.fill(0),o=0},a=(...f)=>n(i,r,...f),l=(f=Ub())=>{i=a(f_([0]),f),r=a(),f.length!==0&&(i=a(f_([1]),f),r=a())},u=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const d=[];for(;f{s(),l(f);let h;for(;!(h=d(u()));)l();return s(),h}}const aoe={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||t instanceof Uint8Array,isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function Mh(t,e,n={}){const r=(i,o,s)=>{const a=aoe[o];if(typeof a!="function")throw new Error(`Invalid validator "${o}", expected function`);const l=t[i];if(!(s&&l===void 0)&&!a(l,t))throw new Error(`Invalid param ${String(i)}=${l} (${typeof l}), expected ${o}`)};for(const[i,o]of Object.entries(e))r(i,o,!1);for(const[i,o]of Object.entries(n))r(i,o,!0);return t}const loe=Object.freeze(Object.defineProperty({__proto__:null,bitGet:ooe,bitLen:ioe,bitMask:Z3,bitSet:soe,bytesToHex:wc,bytesToNumberBE:Sr,bytesToNumberLE:K3,concatBytes:$l,createHmacDrbg:H$,ensureBytes:Pn,equalBytes:noe,hexToBytes:kc,hexToNumber:J3,numberToBytesBE:ma,numberToBytesLE:G3,numberToHexUnpadded:U$,numberToVarBytesBE:toe,utf8ToBytes:roe,validateObject:Mh},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const hn=BigInt(0),Vt=BigInt(1),Ha=BigInt(2),uoe=BigInt(3),Jw=BigInt(4),d_=BigInt(5),h_=BigInt(8);BigInt(9);BigInt(16);function An(t,e){const n=t%e;return n>=hn?n:e+n}function coe(t,e,n){if(n<=hn||e 0");if(n===Vt)return hn;let r=Vt;for(;e>hn;)e&Vt&&(r=r*t%n),t=t*t%n,e>>=Vt;return r}function Xr(t,e,n){let r=t;for(;e-- >hn;)r*=r,r%=n;return r}function Kw(t,e){if(t===hn||e<=hn)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let n=An(t,e),r=e,i=hn,o=Vt;for(;n!==hn;){const a=r/n,l=r%n,u=i-o*a;r=n,n=l,i=o,o=u}if(r!==Vt)throw new Error("invert: does not exist");return An(i,e)}function foe(t){const e=(t-Vt)/Ha;let n,r,i;for(n=t-Vt,r=0;n%Ha===hn;n/=Ha,r++);for(i=Ha;i(r[i]="function",r),e);return Mh(t,n)}function moe(t,e,n){if(n 0");if(n===hn)return t.ONE;if(n===Vt)return e;let r=t.ONE,i=e;for(;n>hn;)n&Vt&&(r=t.mul(r,i)),i=t.sqr(i),n>>=Vt;return r}function goe(t,e){const n=new Array(e.length),r=e.reduce((o,s,a)=>t.is0(s)?o:(n[a]=o,t.mul(o,s)),t.ONE),i=t.inv(r);return e.reduceRight((o,s,a)=>t.is0(s)?o:(n[a]=t.mul(o,n[a]),t.mul(o,s)),i),n}function W$(t,e){const n=e!==void 0?e:t.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function yoe(t,e,n=!1,r={}){if(t<=hn)throw new Error(`Expected Field ORDER > 0, got ${t}`);const{nBitLength:i,nByteLength:o}=W$(t,e);if(o>2048)throw new Error("Field lengths over 2048 bytes are not supported");const s=doe(t),a=Object.freeze({ORDER:t,BITS:i,BYTES:o,MASK:Z3(i),ZERO:hn,ONE:Vt,create:l=>An(l,t),isValid:l=>{if(typeof l!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof l}`);return hn<=l&&ll===hn,isOdd:l=>(l&Vt)===Vt,neg:l=>An(-l,t),eql:(l,u)=>l===u,sqr:l=>An(l*l,t),add:(l,u)=>An(l+u,t),sub:(l,u)=>An(l-u,t),mul:(l,u)=>An(l*u,t),pow:(l,u)=>moe(a,l,u),div:(l,u)=>An(l*Kw(u,t),t),sqrN:l=>l*l,addN:(l,u)=>l+u,subN:(l,u)=>l-u,mulN:(l,u)=>l*u,inv:l=>Kw(l,t),sqrt:r.sqrt||(l=>s(a,l)),invertBatch:l=>goe(a,l),cmov:(l,u,c)=>c?u:l,toBytes:l=>n?G3(l,o):ma(l,o),fromBytes:l=>{if(l.length!==o)throw new Error(`Fp.fromBytes: expected ${o}, got ${l.length}`);return n?K3(l):Sr(l)}});return Object.freeze(a)}function J$(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function K$(t){const e=J$(t);return e+Math.ceil(e/2)}function boe(t,e,n=!1){const r=t.length,i=J$(e),o=K$(e);if(r<16||r1024)throw new Error(`expected ${o}-1024 bytes of input, got ${r}`);const s=n?Sr(t):K3(t),a=An(s,e-Vt)+Vt;return n?G3(a,i):ma(a,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const voe=BigInt(0),Hb=BigInt(1);function woe(t,e){const n=(i,o)=>{const s=o.negate();return i?s:o},r=i=>{const o=Math.ceil(e/i)+1,s=2**(i-1);return{windows:o,windowSize:s}};return{constTimeNegate:n,unsafeLadder(i,o){let s=t.ZERO,a=i;for(;o>voe;)o&Hb&&(s=s.add(a)),a=a.double(),o>>=Hb;return s},precomputeWindow(i,o){const{windows:s,windowSize:a}=r(o),l=[];let u=i,c=u;for(let f=0;f>=h,b>l&&(b-=d,s+=Hb);const y=m,v=m+Math.abs(b)-1,w=p%2!==0,g=b<0;b===0?c=c.add(n(w,o[y])):u=u.add(n(g,o[v]))}return{p:u,f:c}},wNAFCached(i,o,s,a){const l=i._WINDOW_SIZE||1;let u=o.get(i);return u||(u=this.precomputeWindow(i,l),l!==1&&o.set(i,a(u))),this.wNAF(l,u,s)}}}function G$(t){return poe(t.Fp),Mh(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...W$(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function koe(t){const e=G$(t);Mh(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:i}=e;if(n){if(!r.eql(i,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:xoe,hexToBytes:Eoe}=loe,tl={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(t){const{Err:e}=tl;if(t.length<2||t[0]!==2)throw new e("Invalid signature integer tag");const n=t[1],r=t.subarray(2,n+2);if(!n||r.length!==n)throw new e("Invalid signature integer: wrong length");if(r[0]&128)throw new e("Invalid signature integer: negative");if(r[0]===0&&!(r[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:xoe(r),l:t.subarray(n+2)}},toSig(t){const{Err:e}=tl,n=typeof t=="string"?Eoe(t):t;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let r=n.length;if(r<2||n[0]!=48)throw new e("Invalid signature tag");if(n[1]!==r-2)throw new e("Invalid signature: incorrect length");const{d:i,l:o}=tl._parseInt(n.subarray(2)),{d:s,l:a}=tl._parseInt(o);if(a.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s}},hexFromSig(t){const e=u=>Number.parseInt(u[0],16)&8?"00"+u:u,n=u=>{const c=u.toString(16);return c.length&1?`0${c}`:c},r=e(n(t.s)),i=e(n(t.r)),o=r.length/2,s=i.length/2,a=n(o),l=n(s);return`30${n(s+o+4)}02${l}${i}02${a}${r}`}},Bo=BigInt(0),ni=BigInt(1);BigInt(2);const p_=BigInt(3);BigInt(4);function Soe(t){const e=koe(t),{Fp:n}=e,r=e.toBytes||((p,m,b)=>{const y=m.toAffine();return $l(Uint8Array.from([4]),n.toBytes(y.x),n.toBytes(y.y))}),i=e.fromBytes||(p=>{const m=p.subarray(1),b=n.fromBytes(m.subarray(0,n.BYTES)),y=n.fromBytes(m.subarray(n.BYTES,2*n.BYTES));return{x:b,y}});function o(p){const{a:m,b}=e,y=n.sqr(p),v=n.mul(y,p);return n.add(n.add(v,n.mul(p,m)),b)}if(!n.eql(n.sqr(e.Gy),o(e.Gx)))throw new Error("bad generator point: equation left != right");function s(p){return typeof p=="bigint"&&Bon.eql(w,n.ZERO);return v(b)&&v(y)?f.ZERO:new f(b,y,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(m){const b=n.invertBatch(m.map(y=>y.pz));return m.map((y,v)=>y.toAffine(b[v])).map(f.fromAffine)}static fromHex(m){const b=f.fromAffine(i(Pn("pointHex",m)));return b.assertValidity(),b}static fromPrivateKey(m){return f.BASE.multiply(l(m))}_setWindowSize(m){this._WINDOW_SIZE=m,u.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!n.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:m,y:b}=this.toAffine();if(!n.isValid(m)||!n.isValid(b))throw new Error("bad point: x or y not FE");const y=n.sqr(b),v=o(m);if(!n.eql(y,v))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:m}=this.toAffine();if(n.isOdd)return!n.isOdd(m);throw new Error("Field doesn't support isOdd")}equals(m){c(m);const{px:b,py:y,pz:v}=this,{px:w,py:g,pz:x}=m,k=n.eql(n.mul(b,x),n.mul(w,v)),E=n.eql(n.mul(y,x),n.mul(g,v));return k&&E}negate(){return new f(this.px,n.neg(this.py),this.pz)}double(){const{a:m,b}=e,y=n.mul(b,p_),{px:v,py:w,pz:g}=this;let x=n.ZERO,k=n.ZERO,E=n.ZERO,D=n.mul(v,v),O=n.mul(w,w),N=n.mul(g,g),C=n.mul(v,w);return C=n.add(C,C),E=n.mul(v,g),E=n.add(E,E),x=n.mul(m,E),k=n.mul(y,N),k=n.add(x,k),x=n.sub(O,k),k=n.add(O,k),k=n.mul(x,k),x=n.mul(C,x),E=n.mul(y,E),N=n.mul(m,N),C=n.sub(D,N),C=n.mul(m,C),C=n.add(C,E),E=n.add(D,D),D=n.add(E,D),D=n.add(D,N),D=n.mul(D,C),k=n.add(k,D),N=n.mul(w,g),N=n.add(N,N),D=n.mul(N,C),x=n.sub(x,D),E=n.mul(N,O),E=n.add(E,E),E=n.add(E,E),new f(x,k,E)}add(m){c(m);const{px:b,py:y,pz:v}=this,{px:w,py:g,pz:x}=m;let k=n.ZERO,E=n.ZERO,D=n.ZERO;const O=e.a,N=n.mul(e.b,p_);let C=n.mul(b,w),R=n.mul(y,g),T=n.mul(v,x),q=n.add(b,y),A=n.add(w,g);q=n.mul(q,A),A=n.add(C,R),q=n.sub(q,A),A=n.add(b,v);let S=n.add(w,x);return A=n.mul(A,S),S=n.add(C,T),A=n.sub(A,S),S=n.add(y,v),k=n.add(g,x),S=n.mul(S,k),k=n.add(R,T),S=n.sub(S,k),D=n.mul(O,A),k=n.mul(N,T),D=n.add(k,D),k=n.sub(R,D),D=n.add(R,D),E=n.mul(k,D),R=n.add(C,C),R=n.add(R,C),T=n.mul(O,T),A=n.mul(N,A),R=n.add(R,T),T=n.sub(C,T),T=n.mul(O,T),A=n.add(A,T),C=n.mul(R,A),E=n.add(E,C),C=n.mul(S,A),k=n.mul(q,k),k=n.sub(k,C),C=n.mul(q,R),D=n.mul(S,D),D=n.add(D,C),new f(k,E,D)}subtract(m){return this.add(m.negate())}is0(){return this.equals(f.ZERO)}wNAF(m){return h.wNAFCached(this,u,m,b=>{const y=n.invertBatch(b.map(v=>v.pz));return b.map((v,w)=>v.toAffine(y[w])).map(f.fromAffine)})}multiplyUnsafe(m){const b=f.ZERO;if(m===Bo)return b;if(a(m),m===ni)return this;const{endo:y}=e;if(!y)return h.unsafeLadder(this,m);let{k1neg:v,k1:w,k2neg:g,k2:x}=y.splitScalar(m),k=b,E=b,D=this;for(;w>Bo||x>Bo;)w&ni&&(k=k.add(D)),x&ni&&(E=E.add(D)),D=D.double(),w>>=ni,x>>=ni;return v&&(k=k.negate()),g&&(E=E.negate()),E=new f(n.mul(E.px,y.beta),E.py,E.pz),k.add(E)}multiply(m){a(m);let b=m,y,v;const{endo:w}=e;if(w){const{k1neg:g,k1:x,k2neg:k,k2:E}=w.splitScalar(b);let{p:D,f:O}=this.wNAF(x),{p:N,f:C}=this.wNAF(E);D=h.constTimeNegate(g,D),N=h.constTimeNegate(k,N),N=new f(n.mul(N.px,w.beta),N.py,N.pz),y=D.add(N),v=O.add(C)}else{const{p:g,f:x}=this.wNAF(b);y=g,v=x}return f.normalizeZ([y,v])[0]}multiplyAndAddUnsafe(m,b,y){const v=f.BASE,w=(x,k)=>k===Bo||k===ni||!x.equals(v)?x.multiplyUnsafe(k):x.multiply(k),g=w(this,b).add(w(m,y));return g.is0()?void 0:g}toAffine(m){const{px:b,py:y,pz:v}=this,w=this.is0();m==null&&(m=w?n.ONE:n.inv(v));const g=n.mul(b,m),x=n.mul(y,m),k=n.mul(v,m);if(w)return{x:n.ZERO,y:n.ZERO};if(!n.eql(k,n.ONE))throw new Error("invZ was invalid");return{x:g,y:x}}isTorsionFree(){const{h:m,isTorsionFree:b}=e;if(m===ni)return!0;if(b)return b(f,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:m,clearCofactor:b}=e;return m===ni?this:b?b(f,this):this.multiplyUnsafe(e.h)}toRawBytes(m=!0){return this.assertValidity(),r(f,this,m)}toHex(m=!0){return wc(this.toRawBytes(m))}}f.BASE=new f(e.Gx,e.Gy,n.ONE),f.ZERO=new f(n.ZERO,n.ONE,n.ZERO);const d=e.nBitLength,h=woe(f,e.endo?Math.ceil(d/2):d);return{CURVE:e,ProjectivePoint:f,normPrivateKeyToScalar:l,weierstrassEquation:o,isWithinCurveOrder:s}}function Coe(t){const e=G$(t);return Mh(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function _oe(t){const e=Coe(t),{Fp:n,n:r}=e,i=n.BYTES+1,o=2*n.BYTES+1;function s(A){return Bowc(ma(A,e.nByteLength));function p(A){const S=r>>ni;return A>S}function m(A){return p(A)?a(-A):A}const b=(A,S,P)=>Sr(A.slice(S,P));class y{constructor(S,P,B){this.r=S,this.s=P,this.recovery=B,this.assertValidity()}static fromCompact(S){const P=e.nByteLength;return S=Pn("compactSignature",S,P*2),new y(b(S,0,P),b(S,P,2*P))}static fromDER(S){const{r:P,s:B}=tl.toSig(Pn("DER",S));return new y(P,B)}assertValidity(){if(!d(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!d(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(S){return new y(this.r,this.s,S)}recoverPublicKey(S){const{r:P,s:B,recovery:j}=this,z=E(Pn("msgHash",S));if(j==null||![0,1,2,3].includes(j))throw new Error("recovery id invalid");const J=j===2||j===3?P+e.n:P;if(J>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const K=j&1?"03":"02",ae=u.fromHex(K+h(J)),fe=l(J),ke=a(-z*fe),ve=a(B*fe),xe=u.BASE.multiplyAndAddUnsafe(ae,ke,ve);if(!xe)throw new Error("point at infinify");return xe.assertValidity(),xe}hasHighS(){return p(this.s)}normalizeS(){return this.hasHighS()?new y(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return kc(this.toDERHex())}toDERHex(){return tl.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return kc(this.toCompactHex())}toCompactHex(){return h(this.r)+h(this.s)}}const v={isValidPrivateKey(A){try{return c(A),!0}catch{return!1}},normPrivateKeyToScalar:c,randomPrivateKey:()=>{const A=K$(e.n);return boe(e.randomBytes(A),e.n)},precompute(A=8,S=u.BASE){return S._setWindowSize(A),S.multiply(BigInt(3)),S}};function w(A,S=!0){return u.fromPrivateKey(A).toRawBytes(S)}function g(A){const S=A instanceof Uint8Array,P=typeof A=="string",B=(S||P)&&A.length;return S?B===i||B===o:P?B===2*i||B===2*o:A instanceof u}function x(A,S,P=!0){if(g(A))throw new Error("first arg must be private key");if(!g(S))throw new Error("second arg must be public key");return u.fromHex(S).multiply(c(A)).toRawBytes(P)}const k=e.bits2int||function(A){const S=Sr(A),P=A.length*8-e.nBitLength;return P>0?S>>BigInt(P):S},E=e.bits2int_modN||function(A){return a(k(A))},D=Z3(e.nBitLength);function O(A){if(typeof A!="bigint")throw new Error("bigint expected");if(!(Bo<=A&&AOe in P))throw new Error("sign() legacy options not supported");const{hash:B,randomBytes:j}=e;let{lowS:z,prehash:J,extraEntropy:K}=P;z==null&&(z=!0),A=Pn("msgHash",A),J&&(A=Pn("prehashed msgHash",B(A)));const ae=E(A),fe=c(S),ke=[O(fe),O(ae)];if(K!=null){const Oe=K===!0?j(n.BYTES):K;ke.push(Pn("extraEntropy",Oe))}const ve=$l(...ke),xe=ae;function Se(Oe){const Fe=k(Oe);if(!d(Fe))return;const mt=l(Fe),Ce=u.BASE.multiply(Fe).toAffine(),pe=a(Ce.x);if(pe===Bo)return;const De=a(mt*a(xe+pe*fe));if(De===Bo)return;let Le=(Ce.x===pe?0:2)|Number(Ce.y&ni),Ge=De;return z&&p(De)&&(Ge=m(De),Le^=1),new y(pe,Ge,Le)}return{seed:ve,k2sig:Se}}const C={lowS:e.lowS,prehash:!1},R={lowS:e.lowS,prehash:!1};function T(A,S,P=C){const{seed:B,k2sig:j}=N(A,S,P),z=e;return H$(z.hash.outputLen,z.nByteLength,z.hmac)(B,j)}u.BASE._setWindowSize(8);function q(A,S,P,B=R){var Ce;const j=A;if(S=Pn("msgHash",S),P=Pn("publicKey",P),"strict"in B)throw new Error("options.strict was renamed to lowS");const{lowS:z,prehash:J}=B;let K,ae;try{if(typeof j=="string"||j instanceof Uint8Array)try{K=y.fromDER(j)}catch(pe){if(!(pe instanceof tl.Err))throw pe;K=y.fromCompact(j)}else if(typeof j=="object"&&typeof j.r=="bigint"&&typeof j.s=="bigint"){const{r:pe,s:De}=j;K=new y(pe,De)}else throw new Error("PARSE");ae=u.fromHex(P)}catch(pe){if(pe.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(z&&K.hasHighS())return!1;J&&(S=e.hash(S));const{r:fe,s:ke}=K,ve=E(S),xe=l(ke),Se=a(ve*xe),Oe=a(fe*xe),Fe=(Ce=u.BASE.multiplyAndAddUnsafe(ae,Se,Oe))==null?void 0:Ce.toAffine();return Fe?a(Fe.x)===fe:!1}return{CURVE:e,getPublicKey:w,getSharedSecret:x,sign:T,verify:q,ProjectivePoint:u,Signature:y,utils:v}}let Z$=class extends j${constructor(e,n){super(),this.finished=!1,this.destroyed=!1,jie(e);const r=W3(n);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,o=new Uint8Array(i);o.set(r.length>i?e.create().update(r).digest():r);for(let s=0;snew Z$(t,e).update(n).digest();Y$.create=(t,e)=>new Z$(t,e);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Aoe(t){return{hash:t,hmac:(e,...n)=>Y$(t,e,Hie(...n)),randomBytes:q$}}function Toe(t,e){const n=r=>_oe({...t,...Aoe(r)});return Object.freeze({...n(e),create:n})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Rg=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),a1=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Q$=BigInt(1),l1=BigInt(2),m_=(t,e)=>(t+e/l1)/e;function X$(t){const e=Rg,n=BigInt(3),r=BigInt(6),i=BigInt(11),o=BigInt(22),s=BigInt(23),a=BigInt(44),l=BigInt(88),u=t*t*t%e,c=u*u*t%e,f=Xr(c,n,e)*c%e,d=Xr(f,n,e)*c%e,h=Xr(d,l1,e)*u%e,p=Xr(h,i,e)*h%e,m=Xr(p,o,e)*p%e,b=Xr(m,a,e)*m%e,y=Xr(b,l,e)*b%e,v=Xr(y,a,e)*m%e,w=Xr(v,n,e)*c%e,g=Xr(w,s,e)*p%e,x=Xr(g,r,e)*u%e,k=Xr(x,l1,e);if(!Gw.eql(Gw.sqr(k),t))throw new Error("Cannot find square root");return k}const Gw=yoe(Rg,void 0,void 0,{sqrt:X$}),Pc=Toe({a:BigInt(0),b:BigInt(7),Fp:Gw,n:a1,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=a1,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-Q$*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=n,s=BigInt("0x100000000000000000000000000000000"),a=m_(o*t,e),l=m_(-r*t,e);let u=An(t-a*n-l*i,e),c=An(-a*r-l*o,e);const f=u>s,d=c>s;if(f&&(u=e-u),d&&(c=e-c),u>s||c>s)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:f,k1:u,k2neg:d,k2:c}}}},Ww),Fg=BigInt(0),e9=t=>typeof t=="bigint"&&Fgtypeof t=="bigint"&&Fgi.charCodeAt(0)));n=$l(r,r),g_[t]=n}return Ww($l(n,...e))}const Y3=t=>t.toRawBytes(!0).slice(1),Zw=t=>ma(t,32),Wb=t=>An(t,Rg),Yd=t=>An(t,a1),Q3=Pc.ProjectivePoint,Ooe=(t,e,n)=>Q3.BASE.multiplyAndAddUnsafe(t,e,n);function Yw(t){let e=Pc.utils.normPrivateKeyToScalar(t),n=Q3.fromPrivateKey(e);return{scalar:n.hasEvenY()?e:Yd(-e),bytes:Y3(n)}}function t9(t){if(!e9(t))throw new Error("bad x: need 0 < x < p");const e=Wb(t*t),n=Wb(e*t+BigInt(7));let r=X$(n);r%l1!==Fg&&(r=Wb(-r));const i=new Q3(t,r,Q$);return i.assertValidity(),i}function n9(...t){return Yd(Sr(u1("BIP0340/challenge",...t)))}function Doe(t){return Yw(t).bytes}function Noe(t,e,n=q$(32)){const r=Pn("message",t),{bytes:i,scalar:o}=Yw(e),s=Pn("auxRand",n,32),a=Zw(o^Sr(u1("BIP0340/aux",s))),l=u1("BIP0340/nonce",a,i,r),u=Yd(Sr(l));if(u===Fg)throw new Error("sign failed: k is zero");const{bytes:c,scalar:f}=Yw(u),d=n9(c,i,r),h=new Uint8Array(64);if(h.set(c,0),h.set(Zw(Yd(f+d*o)),32),!r9(h,r,i))throw new Error("sign: Invalid signature produced");return h}function r9(t,e,n){const r=Pn("signature",t,64),i=Pn("message",e),o=Pn("publicKey",n,32);try{const s=t9(Sr(o)),a=Sr(r.subarray(0,32));if(!e9(a))return!1;const l=Sr(r.subarray(32,64));if(!Moe(l))return!1;const u=n9(Zw(a),Y3(s),i),c=Ooe(s,l,Yd(-u));return!(!c||!c.hasEvenY()||c.toAffine().x!==a)}catch{return!1}}const no={getPublicKey:Doe,sign:Noe,verify:r9,utils:{randomPrivateKey:Pc.utils.randomPrivateKey,lift_x:t9,pointToBytes:Y3,numberToBytesBE:ma,bytesToNumberBE:Sr,taggedHash:u1,mod:An}},Jb=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const X3=t=>t instanceof Uint8Array,Kb=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),Hi=(t,e)=>t<<32-e|t>>>e,$oe=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!$oe)throw new Error("Non little-endian hardware is not supported");const Ioe=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function un(t){if(!X3(t))throw new Error("Uint8Array expected");let e="";for(let n=0;nr+i.length,0));let n=0;return t.forEach(r=>{if(!X3(r))throw new Error("Uint8Array expected");e.set(r,n),n+=r.length}),e}class i9{clone(){return this._cloneInto()}}function o9(t){const e=r=>t().update(Qd(r)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function s9(t=32){if(Jb&&typeof Jb.getRandomValues=="function")return Jb.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}function Qw(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function Foe(t){if(typeof t!="boolean")throw new Error(`Expected boolean, not ${t}`)}function a9(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function Loe(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Qw(t.outputLen),Qw(t.blockLen)}function Boe(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function Poe(t,e){a9(t);const n=e.outputLen;if(t.length>i&o),a=Number(n&o),l=r?4:0,u=r?0:4;t.setUint32(e+l,s,r),t.setUint32(e+u,a,r)}class joe extends i9{constructor(e,n,r,i){super(),this.blockLen=e,this.outputLen=n,this.padOffset=r,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Kb(this.buffer)}update(e){uo.exists(this);const{view:n,buffer:r,blockLen:i}=this;e=Qd(e);const o=e.length;for(let s=0;si-s&&(this.process(r,0),s=0);for(let f=s;fc.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;ft&e^~t&n,Voe=(t,e,n)=>t&e^t&n^e&n,Uoe=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),xs=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Es=new Uint32Array(64);class l9 extends joe{constructor(){super(64,32,8,!1),this.A=xs[0]|0,this.B=xs[1]|0,this.C=xs[2]|0,this.D=xs[3]|0,this.E=xs[4]|0,this.F=xs[5]|0,this.G=xs[6]|0,this.H=xs[7]|0}get(){const{A:e,B:n,C:r,D:i,E:o,F:s,G:a,H:l}=this;return[e,n,r,i,o,s,a,l]}set(e,n,r,i,o,s,a,l){this.A=e|0,this.B=n|0,this.C=r|0,this.D=i|0,this.E=o|0,this.F=s|0,this.G=a|0,this.H=l|0}process(e,n){for(let f=0;f<16;f++,n+=4)Es[f]=e.getUint32(n,!1);for(let f=16;f<64;f++){const d=Es[f-15],h=Es[f-2],p=Hi(d,7)^Hi(d,18)^d>>>3,m=Hi(h,17)^Hi(h,19)^h>>>10;Es[f]=m+Es[f-7]+p+Es[f-16]|0}let{A:r,B:i,C:o,D:s,E:a,F:l,G:u,H:c}=this;for(let f=0;f<64;f++){const d=Hi(a,6)^Hi(a,11)^Hi(a,25),h=c+d+qoe(a,l,u)+Uoe[f]+Es[f]|0,m=(Hi(r,2)^Hi(r,13)^Hi(r,22))+Voe(r,i,o)|0;c=u,u=l,l=a,a=s+h|0,s=o,o=i,i=r,r=h+m|0}r=r+this.A|0,i=i+this.B|0,o=o+this.C|0,s=s+this.D|0,a=a+this.E|0,l=l+this.F|0,u=u+this.G|0,c=c+this.H|0,this.set(r,i,o,s,a,l,u,c)}roundClean(){Es.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class Hoe extends l9{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}const zc=o9(()=>new l9);o9(()=>new Hoe);/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */function jc(t){if(!Number.isSafeInteger(t))throw new Error(`Wrong integer: ${t}`)}function us(...t){const e=(i,o)=>s=>i(o(s)),n=Array.from(t).reverse().reduce((i,o)=>i?e(i,o.encode):o.encode,void 0),r=t.reduce((i,o)=>i?e(i,o.decode):o.decode,void 0);return{encode:n,decode:r}}function cs(t){return{encode:e=>{if(!Array.isArray(e)||e.length&&typeof e[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return e.map(n=>{if(jc(n),n<0||n>=t.length)throw new Error(`Digit index outside alphabet: ${n} (alphabet: ${t.length})`);return t[n]})},decode:e=>{if(!Array.isArray(e)||e.length&&typeof e[0]!="string")throw new Error("alphabet.decode input should be array of strings");return e.map(n=>{if(typeof n!="string")throw new Error(`alphabet.decode: not string element=${n}`);const r=t.indexOf(n);if(r===-1)throw new Error(`Unknown letter: "${n}". Allowed: ${t}`);return r})}}}function fs(t=""){if(typeof t!="string")throw new Error("join separator should be string");return{encode:e=>{if(!Array.isArray(e)||e.length&&typeof e[0]!="string")throw new Error("join.encode input should be array of strings");for(let n of e)if(typeof n!="string")throw new Error(`join.encode: non-string input=${n}`);return e.join(t)},decode:e=>{if(typeof e!="string")throw new Error("join.decode input should be string");return e.split(t)}}}function Bg(t,e="="){if(jc(t),typeof e!="string")throw new Error("padding chr should be string");return{encode(n){if(!Array.isArray(n)||n.length&&typeof n[0]!="string")throw new Error("padding.encode input should be array of strings");for(let r of n)if(typeof r!="string")throw new Error(`padding.encode: non-string input=${r}`);for(;n.length*t%8;)n.push(e);return n},decode(n){if(!Array.isArray(n)||n.length&&typeof n[0]!="string")throw new Error("padding.encode input should be array of strings");for(let i of n)if(typeof i!="string")throw new Error(`padding.decode: non-string input=${i}`);let r=n.length;if(r*t%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;r>0&&n[r-1]===e;r--)if(!((r-1)*t%8))throw new Error("Invalid padding: string has too much padding");return n.slice(0,r)}}}function u9(t){if(typeof t!="function")throw new Error("normalize fn should be function");return{encode:e=>e,decode:e=>t(e)}}function y_(t,e,n){if(e<2)throw new Error(`convertRadix: wrong from=${e}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: wrong to=${n}, base cannot be less than 2`);if(!Array.isArray(t))throw new Error("convertRadix: data should be array");if(!t.length)return[];let r=0;const i=[],o=Array.from(t);for(o.forEach(s=>{if(jc(s),s<0||s>=e)throw new Error(`Wrong integer: ${s}`)});;){let s=0,a=!0;for(let l=r;le?c9(e,t%e):t,c1=(t,e)=>t+(e-c9(t,e));function Xw(t,e,n,r){if(!Array.isArray(t))throw new Error("convertRadix2: data should be array");if(e<=0||e>32)throw new Error(`convertRadix2: wrong from=${e}`);if(n<=0||n>32)throw new Error(`convertRadix2: wrong to=${n}`);if(c1(e,n)>32)throw new Error(`convertRadix2: carry overflow from=${e} to=${n} carryBits=${c1(e,n)}`);let i=0,o=0;const s=2**n-1,a=[];for(const l of t){if(jc(l),l>=2**e)throw new Error(`convertRadix2: invalid data word=${l} from=${e}`);if(i=i<32)throw new Error(`convertRadix2: carry overflow pos=${o} from=${e}`);for(o+=e;o>=n;o-=n)a.push((i>>o-n&s)>>>0);i&=2**o-1}if(i=i<=e)throw new Error("Excess padding");if(!r&&i)throw new Error(`Non-zero padding: ${i}`);return r&&o>0&&a.push(i>>>0),a}function Woe(t){return jc(t),{encode:e=>{if(!(e instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return y_(Array.from(e),2**8,t)},decode:e=>{if(!Array.isArray(e)||e.length&&typeof e[0]!="number")throw new Error("radix.decode input should be array of strings");return Uint8Array.from(y_(e,t,2**8))}}}function Oa(t,e=!1){if(jc(t),t<=0||t>32)throw new Error("radix2: bits should be in (0..32]");if(c1(8,t)>32||c1(t,8)>32)throw new Error("radix2: carry overflow");return{encode:n=>{if(!(n instanceof Uint8Array))throw new Error("radix2.encode input should be Uint8Array");return Xw(Array.from(n),8,t,!e)},decode:n=>{if(!Array.isArray(n)||n.length&&typeof n[0]!="number")throw new Error("radix2.decode input should be array of strings");return Uint8Array.from(Xw(n,t,8,e))}}}function b_(t){if(typeof t!="function")throw new Error("unsafeWrapper fn should be function");return function(...e){try{return t.apply(null,e)}catch{}}}const Joe=us(Oa(4),cs("0123456789ABCDEF"),fs("")),Koe=us(Oa(5),cs("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),Bg(5),fs(""));us(Oa(5),cs("0123456789ABCDEFGHIJKLMNOPQRSTUV"),Bg(5),fs(""));us(Oa(5),cs("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),fs(""),u9(t=>t.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")));const Qo=us(Oa(6),cs("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),Bg(6),fs("")),Goe=us(Oa(6),cs("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),Bg(6),fs("")),eE=t=>us(Woe(58),cs(t),fs("")),ek=eE("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");eE("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ");eE("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");const v_=[0,2,3,5,6,7,9,10,11],Zoe={encode(t){let e="";for(let n=0;n>25;let n=(t&33554431)<<5;for(let r=0;r>r&1)===1&&(n^=w_[r]);return n}function k_(t,e,n=1){const r=t.length;let i=1;for(let o=0;o126)throw new Error(`Invalid prefix (${t})`);i=ff(i)^s>>5}i=ff(i);for(let o=0;od)throw new TypeError(`Length ${h} exceeds limit ${d}`);return c=c.toLowerCase(),`${c}1${tk.encode(f)}${k_(c,f,e)}`}function a(c,f=90){if(typeof c!="string")throw new Error(`bech32.decode input should be string, not ${typeof c}`);if(c.length<8||f!==!1&&c.length>f)throw new TypeError(`Wrong string length: ${c.length} (${c}). Expected (8..${f})`);const d=c.toLowerCase();if(c!==d&&c!==c.toUpperCase())throw new Error("String must be lowercase or uppercase");c=d;const h=c.lastIndexOf("1");if(h===0||h===-1)throw new Error('Letter "1" must be present between prefix and data only');const p=c.slice(0,h),m=c.slice(h+1);if(m.length<6)throw new Error("Data must be at least 6 characters long");const b=tk.decode(m).slice(0,-6),y=k_(p,b,e);if(!m.endsWith(y))throw new Error(`Invalid checksum in ${c}: expected "${y}"`);return{prefix:p,words:b}}const l=b_(a);function u(c){const{prefix:f,words:d}=a(c,!1);return{prefix:f,words:d,bytes:r(d)}}return{encode:s,decode:a,decodeToBytes:u,decodeUnsafe:l,fromWords:r,fromWordsUnsafe:o,toWords:i}}const Ec=f9("bech32");f9("bech32m");const Yoe={encode:t=>new TextDecoder().decode(t),decode:t=>new TextEncoder().encode(t)},Qoe=us(Oa(4),cs("0123456789abcdef"),fs(""),u9(t=>{if(typeof t!="string"||t.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof t} with length ${t.length}`);return t.toLowerCase()})),Xoe={utf8:Yoe,hex:Qoe,base16:Joe,base32:Koe,base64:Qo,base64url:Goe,base58:ek,base58xmr:Zoe};`${Object.keys(Xoe).join(", ")}`;function Gb(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`positive integer expected, not ${t}`)}function x_(t){if(typeof t!="boolean")throw new Error(`boolean expected, not ${t}`)}function ese(t){return t instanceof Uint8Array||t!=null&&typeof t=="object"&&t.constructor.name==="Uint8Array"}function Vo(t,...e){if(!ese(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error(`Uint8Array expected of length ${e}, not of length=${t.length}`)}/*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */const Vn=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),tse=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!tse)throw new Error("Non little-endian hardware is not supported");function nse(t,e){if(e==null||typeof e!="object")throw new Error("options must be defined");return Object.assign(t,e)}function rse(t,e){if(t.length!==e.length)return!1;let n=0;for(let r=0;r(Object.assign(e,t),e),la=16,ose=283;function tE(t){return t<<1^ose&-(t>>7)}function Mu(t,e){let n=0;for(;e>0;e>>=1)n^=t&-(e&1),t=tE(t);return n}const nk=(()=>{let t=new Uint8Array(256);for(let n=0,r=1;n<256;n++,r^=tE(r))t[n]=r;const e=new Uint8Array(256);e[0]=99;for(let n=0;n<255;n++){let r=t[255-n];r|=r<<8,e[t[n]]=(r^r>>4^r>>5^r>>6^r>>7^99)&255}return e})(),sse=nk.map((t,e)=>nk.indexOf(e)),ase=t=>t<<24|t>>>8,Zb=t=>t<<8|t>>>24;function d9(t,e){if(t.length!==256)throw new Error("Wrong sbox length");const n=new Uint32Array(256).map((u,c)=>e(t[c])),r=n.map(Zb),i=r.map(Zb),o=i.map(Zb),s=new Uint32Array(256*256),a=new Uint32Array(256*256),l=new Uint16Array(256*256);for(let u=0;u<256;u++)for(let c=0;c<256;c++){const f=u*256+c;s[f]=n[u]^r[c],a[f]=i[u]^o[c],l[f]=t[u]<<8|t[c]}return{sbox:t,sbox2:l,T0:n,T1:r,T2:i,T3:o,T01:s,T23:a}}const nE=d9(nk,t=>Mu(t,3)<<24|t<<16|t<<8|Mu(t,2)),h9=d9(sse,t=>Mu(t,11)<<24|Mu(t,13)<<16|Mu(t,9)<<8|Mu(t,14)),lse=(()=>{const t=new Uint8Array(16);for(let e=0,n=1;e<16;e++,n=tE(n))t[e]=n;return t})();function p9(t){Vo(t);const e=t.length;if(![16,24,32].includes(e))throw new Error(`aes: wrong key size: should be 16, 24 or 32, got: ${e}`);const{sbox2:n}=nE,r=Vn(t),i=r.length,o=a=>co(n,a,a,a,a),s=new Uint32Array(e+28);s.set(r);for(let a=i;a6&&a%i===4&&(l=o(l)),s[a]=s[a-i]^l}return s}function use(t){const e=p9(t),n=e.slice(),r=e.length,{sbox2:i}=nE,{T0:o,T1:s,T2:a,T3:l}=h9;for(let u=0;u>>8&255]^a[f>>>16&255]^l[f>>>24]}return n}function Js(t,e,n,r,i,o){return t[n<<8&65280|r>>>8&255]^e[i>>>8&65280|o>>>24&255]}function co(t,e,n,r,i){return t[e&255|n&65280]|t[r>>>16&255|i>>>16&65280]<<16}function E_(t,e,n,r,i){const{sbox2:o,T01:s,T23:a}=nE;let l=0;e^=t[l++],n^=t[l++],r^=t[l++],i^=t[l++];const u=t.length/4-2;for(let p=0;p16)throw new Error(`aes/pcks5: wrong padding byte: ${r}`);const i=t.subarray(0,-r);for(let o=0;o{const a=p9(e),{b:l,o:u,out:c}=dse(o,i,s),f=Vn(n);let d=f[0],h=f[1],p=f[2],m=f[3],b=0;for(;b+4<=l.length;)d^=l[b+0],h^=l[b+1],p^=l[b+2],m^=l[b+3],{s0:d,s1:h,s2:p,s3:m}=E_(a,d,h,p,m),u[b++]=d,u[b++]=h,u[b++]=p,u[b++]=m;if(i){const y=pse(o.subarray(b*4));d^=y[0],h^=y[1],p^=y[2],m^=y[3],{s0:d,s1:h,s2:p,s3:m}=E_(a,d,h,p,m),u[b++]=d,u[b++]=h,u[b++]=p,u[b++]=m}return a.fill(0),c},decrypt:(o,s)=>{fse(o);const a=use(e),l=Vn(n),u=m9(o.length,s),c=Vn(o),f=Vn(u);let d=l[0],h=l[1],p=l[2],m=l[3];for(let b=0;b+4<=c.length;){const y=d,v=h,w=p,g=m;d=c[b+0],h=c[b+1],p=c[b+2],m=c[b+3];const{s0:x,s1:k,s2:E,s3:D}=cse(a,d,h,p,m);f[b++]=x^y,f[b++]=k^v,f[b++]=E^w,f[b++]=D^g}return a.fill(0),hse(u,i)}}}),y9=t=>Uint8Array.from(t.split("").map(e=>e.charCodeAt(0))),mse=y9("expand 16-byte k"),gse=y9("expand 32-byte k"),yse=Vn(mse),b9=Vn(gse);b9.slice();function Qe(t,e){return t<>>32-e}function rk(t){return t.byteOffset%4===0}const Tp=64,bse=16,v9=2**32-1,S_=new Uint32Array;function vse(t,e,n,r,i,o,s,a){const l=i.length,u=new Uint8Array(Tp),c=Vn(u),f=rk(i)&&rk(o),d=f?Vn(i):S_,h=f?Vn(o):S_;for(let p=0;p=v9)throw new Error("arx: counter overflow");const m=Math.min(Tp,l-p);if(f&&m===Tp){const b=p/4;if(p%4!==0)throw new Error("arx: invalid block position");for(let y=0,v;y{Vo(a),Vo(l),Vo(u);const d=u.length;if(c||(c=new Uint8Array(d)),Vo(c),Gb(f),f<0||f>=v9)throw new Error("arx: counter overflow");if(c.length0;)h.pop().fill(0);return c}}function kse(t,e,n,r,i,o=20){let s=t[0],a=t[1],l=t[2],u=t[3],c=e[0],f=e[1],d=e[2],h=e[3],p=e[4],m=e[5],b=e[6],y=e[7],v=i,w=n[0],g=n[1],x=n[2],k=s,E=a,D=l,O=u,N=c,C=f,R=d,T=h,q=p,A=m,S=b,P=y,B=v,j=w,z=g,J=x;for(let ae=0;aei?e.create().update(r).digest():r);for(let s=0;snew k9(t,e).update(n).digest();Pg.create=(t,e)=>new k9(t,e);function xse(t,e,n){return uo.hash(t),Pg(t,Qd(n),Qd(e))}const Yb=new Uint8Array([0]),C_=new Uint8Array;function Ese(t,e,n,r=32){if(uo.hash(t),uo.number(r),r>255*t.outputLen)throw new Error("Length should be <= 255*HashLen");const i=Math.ceil(r/t.outputLen);n===void 0&&(n=C_);const o=new Uint8Array(i*t.outputLen),s=Pg.create(t,e),a=s._cloneInto(),l=new Uint8Array(s.outputLen);for(let u=0;u{for(var n in e)Sse(t,n,{get:e[n],enumerable:!0})},Xl=Symbol("verified"),Cse=t=>t instanceof Object;function x9(t){if(!Cse(t)||typeof t.kind!="number"||typeof t.content!="string"||typeof t.created_at!="number"||typeof t.pubkey!="string"||!t.pubkey.match(/^[a-f0-9]{64}$/)||!Array.isArray(t.tags))return!1;for(let e=0;eOse,QueueNode:()=>E9,binarySearch:()=>rE,insertEventIntoAscendingList:()=>Mse,insertEventIntoDescendingList:()=>Tse,normalizeURL:()=>Ase,utf8Decoder:()=>ro,utf8Encoder:()=>Li});var ro=new TextDecoder("utf-8"),Li=new TextEncoder;function Ase(t){t.indexOf("://")===-1&&(t="wss://"+t);let e=new URL(t);return e.pathname=e.pathname.replace(/\/+/g,"/"),e.pathname.endsWith("/")&&(e.pathname=e.pathname.slice(0,-1)),(e.port==="80"&&e.protocol==="ws:"||e.port==="443"&&e.protocol==="wss:")&&(e.port=""),e.searchParams.sort(),e.hash="",e.toString()}function Tse(t,e){const[n,r]=rE(t,i=>e.id===i.id?0:e.created_at===i.created_at?-1:i.created_at-e.created_at);return r||t.splice(n,0,e),t}function Mse(t,e){const[n,r]=rE(t,i=>e.id===i.id?0:e.created_at===i.created_at?-1:e.created_at-i.created_at);return r||t.splice(n,0,e),t}function rE(t,e){let n=0,r=t.length-1;for(;n<=r;){const i=Math.floor((n+r)/2),o=e(t[i]);if(o===0)return[i,!0];o<0?r=i-1:n=i+1}return[n,!1]}var E9=class{constructor(e){Te(this,"value");Te(this,"next",null);Te(this,"prev",null);this.value=e}},Ose=class{constructor(){Te(this,"first");Te(this,"last");this.first=null,this.last=null}enqueue(e){const n=new E9(e);return this.last?this.last===this.first?(this.last=n,this.last.prev=this.first,this.first.next=n):(n.prev=this.last,this.last.next=n,this.last=n):(this.first=n,this.last=n),!0}dequeue(){if(!this.first)return null;if(this.first===this.last){const n=this.first;return this.first=null,this.last=null,n.value}const e=this.first;return this.first=e.next,e.value}},Dse=class{generateSecretKey(){return no.utils.randomPrivateKey()}getPublicKey(e){return un(no.getPublicKey(e))}finalizeEvent(e,n){const r=e;return r.pubkey=un(no.getPublicKey(n)),r.id=k0(r),r.sig=un(no.sign(k0(r),n)),r[Xl]=!0,r}verifyEvent(e){if(typeof e[Xl]=="boolean")return e[Xl];const n=k0(e);if(n!==e.id)return e[Xl]=!1,!1;try{const r=no.verify(e.sig,n,e.pubkey);return e[Xl]=r,r}catch{return e[Xl]=!1,!1}}};function Nse(t){if(!x9(t))throw new Error("can't serialize event with wrong or missing properties");return JSON.stringify([0,t.pubkey,t.created_at,t.kind,t.tags,t.content])}function k0(t){let e=zc(Li.encode(Nse(t)));return un(e)}var zg=new Dse;zg.generateSecretKey;zg.getPublicKey;var Da=zg.finalizeEvent,iE=zg.verifyEvent,$se={};Ht($se,{Application:()=>$ae,BadgeAward:()=>qse,BadgeDefinition:()=>_ae,BlockedRelaysList:()=>fae,BookmarkList:()=>lae,Bookmarksets:()=>Eae,Calendar:()=>zae,CalendarEventRSVP:()=>jae,ChannelCreation:()=>T9,ChannelHideMessage:()=>D9,ChannelMessage:()=>O9,ChannelMetadata:()=>M9,ChannelMuteUser:()=>N9,ClassifiedListing:()=>Fae,ClientAuth:()=>$9,CommunitiesList:()=>uae,CommunityDefinition:()=>Uae,CommunityPostApproval:()=>Yse,Contacts:()=>Bse,CreateOrUpdateProduct:()=>Mae,CreateOrUpdateStall:()=>Tae,Curationsets:()=>Sae,Date:()=>Bae,DraftClassifiedListing:()=>Lae,DraftLong:()=>Dae,Emojisets:()=>Nae,EncryptedDirectMessage:()=>Pse,EncryptedDirectMessages:()=>zse,EventDeletion:()=>jse,FileMetadata:()=>Hse,FileServerPreference:()=>mae,Followsets:()=>wae,GenericRepost:()=>Vse,Genericlists:()=>kae,HTTPAuth:()=>aE,Handlerinformation:()=>Vae,Handlerrecommendation:()=>qae,Highlights:()=>iae,InterestsList:()=>hae,Interestsets:()=>Aae,JobFeedback:()=>eae,JobRequest:()=>Qse,JobResult:()=>Xse,Label:()=>Zse,LightningPubRPC:()=>yae,LiveChatMessage:()=>Wse,LiveEvent:()=>Iae,LongFormArticle:()=>Oae,Metadata:()=>Rse,Mutelist:()=>oae,NWCWalletInfo:()=>gae,NWCWalletRequest:()=>I9,NWCWalletResponse:()=>bae,NostrConnect:()=>vae,OpenTimestamps:()=>Use,Pinlist:()=>sae,ProblemTracker:()=>Jse,ProfileBadges:()=>Cae,PublicChatsList:()=>cae,Reaction:()=>sE,RecommendRelay:()=>Lse,RelayList:()=>aae,Relaysets:()=>xae,Report:()=>Kse,Reporting:()=>Gse,Repost:()=>oE,SearchRelaysList:()=>dae,ShortTextNote:()=>Fse,Time:()=>Pae,UserEmojiList:()=>pae,UserStatuses:()=>Rae,Zap:()=>rae,ZapGoal:()=>tae,ZapRequest:()=>nae,classifyKind:()=>Ise,isEphemeralKind:()=>_9,isParameterizedReplaceableKind:()=>A9,isRegularKind:()=>S9,isReplaceableKind:()=>C9});function S9(t){return 1e3<=t&&t<1e4||[1,2,4,5,6,7,8,16,40,41,42,43,44].includes(t)}function C9(t){return[0,3].includes(t)||1e4<=t&&t<2e4}function _9(t){return 2e4<=t&&t<3e4}function A9(t){return 3e4<=t&&t<4e4}function Ise(t){return S9(t)?"regular":C9(t)?"replaceable":_9(t)?"ephemeral":A9(t)?"parameterized":"unknown"}var Rse=0,Fse=1,Lse=2,Bse=3,Pse=4,zse=4,jse=5,oE=6,sE=7,qse=8,Vse=16,T9=40,M9=41,O9=42,D9=43,N9=44,Use=1040,Hse=1063,Wse=1311,Jse=1971,Kse=1984,Gse=1984,Zse=1985,Yse=4550,Qse=5999,Xse=6999,eae=7e3,tae=9041,nae=9734,rae=9735,iae=9802,oae=1e4,sae=10001,aae=10002,lae=10003,uae=10004,cae=10005,fae=10006,dae=10007,hae=10015,pae=10030,mae=10096,gae=13194,yae=21e3,$9=22242,I9=23194,bae=23195,vae=24133,aE=27235,wae=3e4,kae=30001,xae=30002,Eae=30003,Sae=30004,Cae=30008,_ae=30009,Aae=30015,Tae=30017,Mae=30018,Oae=30023,Dae=30024,Nae=30030,$ae=30078,Iae=30311,Rae=30315,Fae=30402,Lae=30403,Bae=31922,Pae=31923,zae=31924,jae=31925,qae=31989,Vae=31990,Uae=34550,Hae={};Ht(Hae,{getHex64:()=>lE,getInt:()=>R9,getSubscriptionId:()=>Wae,matchEventId:()=>Jae,matchEventKind:()=>Gae,matchEventPubkey:()=>Kae});function lE(t,e){let n=e.length+3,r=t.indexOf(`"${e}":`)+n,i=t.slice(r).indexOf('"')+r+1;return t.slice(i,i+64)}function R9(t,e){let n=e.length,r=t.indexOf(`"${e}":`)+n+3,i=t.slice(r),o=Math.min(i.indexOf(","),i.indexOf("}"));return parseInt(i.slice(0,o),10)}function Wae(t){let e=t.slice(0,22).indexOf('"EVENT"');if(e===-1)return null;let n=t.slice(e+7+1).indexOf('"');if(n===-1)return null;let r=e+7+1+n,i=t.slice(r+1,80).indexOf('"');if(i===-1)return null;let o=r+1+i;return t.slice(r+1,o)}function Jae(t,e){return e===lE(t,"id")}function Kae(t,e){return e===lE(t,"pubkey")}function Gae(t,e){return e===R9(t,"kind")}var Zae={};Ht(Zae,{makeAuthEvent:()=>Yae});function Yae(t,e){return{kind:$9,created_at:Math.floor(Date.now()/1e3),tags:[["relay",t],["challenge",e]],content:""}}var Qae;try{Qae=WebSocket}catch{}var Xae;try{Xae=WebSocket}catch{}var F9={};Ht(F9,{BECH32_REGEX:()=>L9,Bech32MaxSize:()=>uE,decode:()=>jg,encodeBytes:()=>qg,naddrEncode:()=>sle,neventEncode:()=>ole,noteEncode:()=>rle,nprofileEncode:()=>ile,npubEncode:()=>nle,nrelayEncode:()=>ale,nsecEncode:()=>tle});var uE=5e3,L9=/[\x21-\x7E]{1,83}1[023456789acdefghjklmnpqrstuvwxyz]{6,}/;function ele(t){const e=new Uint8Array(4);return e[0]=t>>24&255,e[1]=t>>16&255,e[2]=t>>8&255,e[3]=t&255,e}function jg(t){var i,o,s,a,l,u,c,f;let{prefix:e,words:n}=Ec.decode(t,uE),r=new Uint8Array(Ec.fromWords(n));switch(e){case"nprofile":{let d=Mp(r);if(!((i=d[0])!=null&&i[0]))throw new Error("missing TLV 0 for nprofile");if(d[0][0].length!==32)throw new Error("TLV 0 should be 32 bytes");return{type:"nprofile",data:{pubkey:un(d[0][0]),relays:d[1]?d[1].map(h=>ro.decode(h)):[]}}}case"nevent":{let d=Mp(r);if(!((o=d[0])!=null&&o[0]))throw new Error("missing TLV 0 for nevent");if(d[0][0].length!==32)throw new Error("TLV 0 should be 32 bytes");if(d[2]&&d[2][0].length!==32)throw new Error("TLV 2 should be 32 bytes");if(d[3]&&d[3][0].length!==4)throw new Error("TLV 3 should be 4 bytes");return{type:"nevent",data:{id:un(d[0][0]),relays:d[1]?d[1].map(h=>ro.decode(h)):[],author:(s=d[2])!=null&&s[0]?un(d[2][0]):void 0,kind:(a=d[3])!=null&&a[0]?parseInt(un(d[3][0]),16):void 0}}}case"naddr":{let d=Mp(r);if(!((l=d[0])!=null&&l[0]))throw new Error("missing TLV 0 for naddr");if(!((u=d[2])!=null&&u[0]))throw new Error("missing TLV 2 for naddr");if(d[2][0].length!==32)throw new Error("TLV 2 should be 32 bytes");if(!((c=d[3])!=null&&c[0]))throw new Error("missing TLV 3 for naddr");if(d[3][0].length!==4)throw new Error("TLV 3 should be 4 bytes");return{type:"naddr",data:{identifier:ro.decode(d[0][0]),pubkey:un(d[2][0]),kind:parseInt(un(d[3][0]),16),relays:d[1]?d[1].map(h=>ro.decode(h)):[]}}}case"nrelay":{let d=Mp(r);if(!((f=d[0])!=null&&f[0]))throw new Error("missing TLV 0 for nrelay");return{type:"nrelay",data:ro.decode(d[0][0])}}case"nsec":return{type:e,data:r};case"npub":case"note":return{type:e,data:un(r)};default:throw new Error(`unknown prefix ${e}`)}}function Mp(t){let e={},n=t;for(;n.length>0;){let r=n[0],i=n[1],o=n.slice(2,2+i);if(n=n.slice(2+i),o.lengthLi.encode(n))});return Oh("nprofile",e)}function ole(t){let e;t.kind!==void 0&&(e=ele(t.kind));let n=Vg({0:[xc(t.id)],1:(t.relays||[]).map(r=>Li.encode(r)),2:t.author?[xc(t.author)]:[],3:e?[new Uint8Array(e)]:[]});return Oh("nevent",n)}function sle(t){let e=new ArrayBuffer(4);new DataView(e).setUint32(0,t.kind,!1);let n=Vg({0:[Li.encode(t.identifier)],1:(t.relays||[]).map(r=>Li.encode(r)),2:[xc(t.pubkey)],3:[new Uint8Array(e)]});return Oh("naddr",n)}function ale(t){let e=Vg({0:[Li.encode(t)]});return Oh("nrelay",e)}function Vg(t){let e=[];return Object.entries(t).reverse().forEach(([n,r])=>{r.forEach(i=>{let o=new Uint8Array(i.length+2);o.set([parseInt(n)],0),o.set([i.length],1),o.set(i,2),e.push(o)})}),Lg(...e)}var lle={};Ht(lle,{decrypt:()=>ule,encrypt:()=>B9});async function B9(t,e,n){const r=t instanceof Uint8Array?un(t):t,i=Pc.getSharedSecret(r,"02"+e),o=P9(i);let s=Uint8Array.from(s9(16)),a=Li.encode(n),l=g9(o,s).encrypt(a),u=Qo.encode(new Uint8Array(l)),c=Qo.encode(new Uint8Array(s.buffer));return`${u}?iv=${c}`}async function ule(t,e,n){const r=t instanceof Uint8Array?un(t):t;let[i,o]=n.split("?iv="),s=Pc.getSharedSecret(r,"02"+e),a=P9(s),l=Qo.decode(o),u=Qo.decode(i),c=g9(a,l).decrypt(u);return ro.decode(c)}function P9(t){return t.slice(1,33)}var cle={};Ht(cle,{NIP05_REGEX:()=>z9,isValid:()=>hle,queryProfile:()=>j9,searchDomain:()=>dle,useFetchImplementation:()=>fle});var z9=/^(?:([\w.+-]+)@)?([\w_-]+(\.[\w_-]+)+)$/,Ug;try{Ug=fetch}catch{}function fle(t){Ug=t}async function dle(t,e=""){try{const n=`https://${t}/.well-known/nostr.json?name=${e}`;return(await(await Ug(n,{redirect:"error"})).json()).names}catch{return{}}}async function j9(t){var o;const e=t.match(z9);if(!e)return null;const[n,r="_",i]=e;try{const s=`https://${i}/.well-known/nostr.json?name=${r}`,a=await(await Ug(s,{redirect:"error"})).json();let l=a.names[r];return l?{pubkey:l,relays:(o=a.relays)==null?void 0:o[l]}:null}catch{return null}}async function hle(t,e){let n=await j9(e);return n?n.pubkey===t:!1}var ple={};Ht(ple,{parse:()=>mle});function mle(t){const e={reply:void 0,root:void 0,mentions:[],profiles:[]},n=[];for(const r of t.tags)r[0]==="e"&&r[1]&&n.push(r),r[0]==="p"&&r[1]&&e.profiles.push({pubkey:r[1],relays:r[2]?[r[2]]:[]});for(let r=0;rble,useFetchImplementation:()=>yle});var q9;try{q9=fetch}catch{}function yle(t){q9=t}async function ble(t){return await(await fetch(t.replace("ws://","http://").replace("wss://","https://"),{headers:{Accept:"application/nostr+json"}})).json()}var vle={};Ht(vle,{getPow:()=>V9,minePow:()=>wle});function V9(t){let e=0;for(let n=0;n=e)break}return r}var kle={};Ht(kle,{finishRepostEvent:()=>xle,getRepostedEvent:()=>Ele,getRepostedEventPointer:()=>U9});function xle(t,e,n,r){return Da({kind:oE,tags:[...t.tags??[],["e",e.id,n],["p",e.pubkey]],content:t.content===""?"":JSON.stringify(e),created_at:t.created_at},r)}function U9(t){if(t.kind!==oE)return;let e,n;for(let r=t.tags.length-1;r>=0&&(e===void 0||n===void 0);r--){const i=t.tags[r];i.length>=2&&(i[0]==="e"&&e===void 0?e=i:i[0]==="p"&&n===void 0&&(n=i))}if(e!==void 0)return{id:e[1],relays:[e[2],n==null?void 0:n[2]].filter(r=>typeof r=="string"),author:n==null?void 0:n[1]}}function Ele(t,{skipVerification:e}={}){const n=U9(t);if(n===void 0||t.content==="")return;let r;try{r=JSON.parse(t.content)}catch{return}if(r.id===n.id&&!(!e&&!iE(r)))return r}var Sle={};Ht(Sle,{NOSTR_URI_REGEX:()=>Hg,parse:()=>_le,test:()=>Cle});var Hg=new RegExp(`nostr:(${L9.source})`);function Cle(t){return typeof t=="string"&&new RegExp(`^${Hg.source}$`).test(t)}function _le(t){const e=t.match(new RegExp(`^${Hg.source}$`));if(!e)throw new Error(`Invalid Nostr URI: ${t}`);return{uri:e[0],value:e[1],decoded:jg(e[1])}}var Ale={};Ht(Ale,{finishReactionEvent:()=>Tle,getReactedEventPointer:()=>Mle});function Tle(t,e,n){const r=e.tags.filter(i=>i.length>=2&&(i[0]==="e"||i[0]==="p"));return Da({...t,kind:sE,tags:[...t.tags??[],...r,["e",e.id],["p",e.pubkey]],content:t.content??"+"},n)}function Mle(t){if(t.kind!==sE)return;let e,n;for(let r=t.tags.length-1;r>=0&&(e===void 0||n===void 0);r--){const i=t.tags[r];i.length>=2&&(i[0]==="e"&&e===void 0?e=i:i[0]==="p"&&n===void 0&&(n=i))}if(!(e===void 0||n===void 0))return{id:e[1],relays:[e[2],n[2]].filter(r=>r!==void 0),author:n[1]}}var Ole={};Ht(Ole,{matchAll:()=>Dle,regex:()=>cE,replaceAll:()=>Nle});var cE=()=>new RegExp(`\\b${Hg.source}\\b`,"g");function*Dle(t){const e=t.matchAll(cE());for(const n of e)try{const[r,i]=n;yield{uri:r,value:i,decoded:jg(i),start:n.index,end:n.index+r.length}}catch{}}function Nle(t,e){return t.replaceAll(cE(),(n,r)=>e({uri:n,value:r,decoded:jg(r)}))}var $le={};Ht($le,{channelCreateEvent:()=>Ile,channelHideMessageEvent:()=>Lle,channelMessageEvent:()=>Fle,channelMetadataEvent:()=>Rle,channelMuteUserEvent:()=>Ble});var Ile=(t,e)=>{let n;if(typeof t.content=="object")n=JSON.stringify(t.content);else if(typeof t.content=="string")n=t.content;else return;return Da({kind:T9,tags:[...t.tags??[]],content:n,created_at:t.created_at},e)},Rle=(t,e)=>{let n;if(typeof t.content=="object")n=JSON.stringify(t.content);else if(typeof t.content=="string")n=t.content;else return;return Da({kind:M9,tags:[["e",t.channel_create_event_id],...t.tags??[]],content:n,created_at:t.created_at},e)},Fle=(t,e)=>{const n=[["e",t.channel_create_event_id,t.relay_url,"root"]];return t.reply_to_channel_message_event_id&&n.push(["e",t.reply_to_channel_message_event_id,t.relay_url,"reply"]),Da({kind:O9,tags:[...n,...t.tags??[]],content:t.content,created_at:t.created_at},e)},Lle=(t,e)=>{let n;if(typeof t.content=="object")n=JSON.stringify(t.content);else if(typeof t.content=="string")n=t.content;else return;return Da({kind:D9,tags:[["e",t.channel_message_event_id],...t.tags??[]],content:n,created_at:t.created_at},e)},Ble=(t,e)=>{let n;if(typeof t.content=="object")n=JSON.stringify(t.content);else if(typeof t.content=="string")n=t.content;else return;return Da({kind:N9,tags:[["p",t.pubkey_to_mute],...t.tags??[]],content:n,created_at:t.created_at},e)},Ple={};Ht(Ple,{EMOJI_SHORTCODE_REGEX:()=>H9,matchAll:()=>zle,regex:()=>fE,replaceAll:()=>jle});var H9=/:(\w+):/,fE=()=>new RegExp(`\\B${H9.source}\\B`,"g");function*zle(t){const e=t.matchAll(fE());for(const n of e)try{const[r,i]=n;yield{shortcode:r,name:i,start:n.index,end:n.index+r.length}}catch{}}function jle(t,e){return t.replaceAll(fE(),(n,r)=>e({shortcode:n,name:r}))}var qle={};Ht(qle,{useFetchImplementation:()=>Vle,validateGithub:()=>Ule});var dE;try{dE=fetch}catch{}function Vle(t){dE=t}async function Ule(t,e,n){try{return await(await dE(`https://gist.github.com/${e}/${n}/raw`)).text()===`Verifying that I control the following Nostr public key: ${t}`}catch{return!1}}var Hle={};Ht(Hle,{decrypt:()=>Q9,encrypt:()=>Y9,getConversationKey:()=>K9,v2:()=>Zle});var W9=1,J9=65535;function K9(t,e){const n=Pc.getSharedSecret(t,"02"+e).subarray(1,33);return xse(zc,n,"nip44-v2")}function G9(t,e){const n=Ese(zc,t,e,76);return{chacha_key:n.subarray(0,32),chacha_nonce:n.subarray(32,44),hmac_key:n.subarray(44,76)}}function hE(t){if(!Number.isSafeInteger(t)||t<1)throw new Error("expected positive integer");if(t<=32)return 32;const e=1<J9)throw new Error("invalid plaintext size: must be between 1 and 65535 bytes");const e=new Uint8Array(2);return new DataView(e.buffer).setUint16(0,t,!1),e}function Jle(t){const e=Li.encode(t),n=e.length,r=Wle(n),i=new Uint8Array(hE(n)-n);return Lg(r,e,i)}function Kle(t){const e=new DataView(t.buffer).getUint16(0),n=t.subarray(2,2+e);if(eJ9||n.length!==e||t.length!==2+hE(e))throw new Error("invalid padding");return ro.decode(n)}function Z9(t,e,n){if(n.length!==32)throw new Error("AAD associated data must be 32 bytes");const r=Lg(n,e);return Pg(zc,t,r)}function Gle(t){if(typeof t!="string")throw new Error("payload must be a valid string");const e=t.length;if(e<132||e>87472)throw new Error("invalid payload length: "+e);if(t[0]==="#")throw new Error("unknown encryption version");let n;try{n=Qo.decode(t)}catch(o){throw new Error("invalid base64: "+o.message)}const r=n.length;if(r<99||r>65603)throw new Error("invalid data length: "+r);const i=n[0];if(i!==2)throw new Error("unknown encryption version "+i);return{nonce:n.subarray(1,33),ciphertext:n.subarray(33,-32),mac:n.subarray(-32)}}function Y9(t,e,n=s9(32)){const{chacha_key:r,chacha_nonce:i,hmac_key:o}=G9(e,n),s=Jle(t),a=w9(r,i,s),l=Z9(o,a,n);return Qo.encode(Lg(new Uint8Array([2]),n,a,l))}function Q9(t,e){const{nonce:n,ciphertext:r,mac:i}=Gle(t),{chacha_key:o,chacha_nonce:s,hmac_key:a}=G9(e,n),l=Z9(a,r,n);if(!rse(l,i))throw new Error("invalid MAC");const u=w9(o,s,r);return Kle(u)}var Zle={utils:{getConversationKey:K9,calcPaddedLen:hE},encrypt:Y9,decrypt:Q9},Yle={};Ht(Yle,{makeNwcRequestEvent:()=>Xle,parseConnectionString:()=>Qle});function Qle(t){const{pathname:e,searchParams:n}=new URL(t),r=e,i=n.get("relay"),o=n.get("secret");if(!r||!i||!o)throw new Error("invalid connection string");return{pubkey:r,relay:i,secret:o}}async function Xle(t,e,n){const i=await B9(e,t,JSON.stringify({method:"pay_invoice",params:{invoice:n}})),o={kind:I9,created_at:Math.round(Date.now()/1e3),content:i,tags:[["p",t]]};return Da(o,e)}var eue={};Ht(eue,{getZapEndpoint:()=>nue,makeZapReceipt:()=>oue,makeZapRequest:()=>rue,useFetchImplementation:()=>tue,validateZapRequest:()=>iue});var pE;try{pE=fetch}catch{}function tue(t){pE=t}async function nue(t){try{let e="",{lud06:n,lud16:r}=JSON.parse(t.content);if(n){let{words:s}=Ec.decode(n,1e3),a=Ec.fromWords(s);e=ro.decode(a)}else if(r){let[s,a]=r.split("@");e=new URL(`/.well-known/lnurlp/${s}`,`https://${a}`).toString()}else return null;let o=await(await pE(e)).json();if(o.allowsNostr&&o.nostrPubkey)return o.callback}catch{}return null}function rue({profile:t,event:e,amount:n,relays:r,comment:i=""}){if(!n)throw new Error("amount not given");if(!t)throw new Error("profile not given");let o={kind:9734,created_at:Math.round(Date.now()/1e3),content:i,tags:[["p",t],["amount",n.toString()],["relays",...r]]};return e&&o.tags.push(["e",e]),o}function iue(t){let e;try{e=JSON.parse(t)}catch{return"Invalid zap request JSON."}if(!x9(e))return"Zap request is not a valid Nostr event.";if(!iE(e))return"Invalid signature on zap request.";let n=e.tags.find(([o,s])=>o==="p"&&s);if(!n)return"Zap request doesn't have a 'p' tag.";if(!n[1].match(/^[a-f0-9]{64}$/))return"Zap request 'p' tag is not valid hex.";let r=e.tags.find(([o,s])=>o==="e"&&s);return r&&!r[1].match(/^[a-f0-9]{64}$/)?"Zap request 'e' tag is not valid hex.":e.tags.find(([o,s])=>o==="relays"&&s)?null:"Zap request doesn't have a 'relays' tag."}function oue({zapRequest:t,preimage:e,bolt11:n,paidAt:r}){let i=JSON.parse(t),o=i.tags.filter(([a])=>a==="e"||a==="p"||a==="a"),s={kind:9735,created_at:Math.round(r.getTime()/1e3),content:"",tags:[...o,["P",i.pubkey],["bolt11",n],["description",t]]};return e&&s.tags.push(["preimage",e]),s}var sue={};Ht(sue,{getToken:()=>aue,hashPayload:()=>mE,unpackEventFromToken:()=>eI,validateEvent:()=>sI,validateEventKind:()=>nI,validateEventMethodTag:()=>iI,validateEventPayloadTag:()=>oI,validateEventTimestamp:()=>tI,validateEventUrlTag:()=>rI,validateToken:()=>lue});var X9="Nostr ";async function aue(t,e,n,r=!1,i){const o={kind:aE,tags:[["u",t],["method",e]],created_at:Math.round(new Date().getTime()/1e3),content:""};i&&o.tags.push(["payload",mE(i)]);const s=await n(o);return(r?X9:"")+Qo.encode(Li.encode(JSON.stringify(s)))}async function lue(t,e,n){const r=await eI(t).catch(o=>{throw o});return await sI(r,e,n).catch(o=>{throw o})}async function eI(t){if(!t)throw new Error("Missing token");t=t.replace(X9,"");const e=ro.decode(Qo.decode(t));if(!e||e.length===0||!e.startsWith("{"))throw new Error("Invalid token");return JSON.parse(e)}function tI(t){return t.created_at?Math.round(new Date().getTime()/1e3)-t.created_at<60:!1}function nI(t){return t.kind===aE}function rI(t,e){const n=t.tags.find(r=>r[0]==="u");return n?n.length>0&&n[1]===e:!1}function iI(t,e){const n=t.tags.find(r=>r[0]==="method");return n?n.length>0&&n[1].toLowerCase()===e.toLowerCase():!1}function mE(t){const e=zc(Li.encode(JSON.stringify(t)));return un(e)}function oI(t,e){const n=t.tags.find(i=>i[0]==="payload");if(!n)return!1;const r=mE(e);return n.length>0&&n[1]===r}async function sI(t,e,n,r){if(!iE(t))throw new Error("Invalid nostr event, signature invalid");if(!nI(t))throw new Error("Invalid nostr event, kind invalid");if(!tI(t))throw new Error("Invalid nostr event, created_at timestamp invalid");if(!rI(t,e))throw new Error("Invalid nostr event, url tag invalid");if(!iI(t,n))throw new Error("Invalid nostr event, method tag invalid");if(r&&typeof r=="object"&&Object.keys(r).length>0&&!oI(t,r))throw new Error("Invalid nostr event, payload tag does not match request body hash");return!0}var aI={exports:{}};(function(t,e){(function(n,r){t.exports=r(ee)})(gF,function(n){return function(r){var i={};function o(s){if(i[s])return i[s].exports;var a=i[s]={i:s,l:!1,exports:{}};return r[s].call(a.exports,a,a.exports,o),a.l=!0,a.exports}return o.m=r,o.c=i,o.d=function(s,a,l){o.o(s,a)||Object.defineProperty(s,a,{enumerable:!0,get:l})},o.r=function(s){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})},o.t=function(s,a){if(1&a&&(s=o(s)),8&a||4&a&&typeof s=="object"&&s&&s.__esModule)return s;var l=Object.create(null);if(o.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:s}),2&a&&typeof s!="string")for(var u in s)o.d(l,u,(function(c){return s[c]}).bind(null,u));return l},o.n=function(s){var a=s&&s.__esModule?function(){return s.default}:function(){return s};return o.d(a,"a",a),a},o.o=function(s,a){return Object.prototype.hasOwnProperty.call(s,a)},o.p="",o(o.s=48)}([function(r,i){r.exports=n},function(r,i){var o=r.exports={version:"2.6.12"};typeof __e=="number"&&(__e=o)},function(r,i,o){var s=o(26)("wks"),a=o(17),l=o(3).Symbol,u=typeof l=="function";(r.exports=function(c){return s[c]||(s[c]=u&&l[c]||(u?l:a)("Symbol."+c))}).store=s},function(r,i){var o=r.exports=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=o)},function(r,i,o){r.exports=!o(8)(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},function(r,i){var o={}.hasOwnProperty;r.exports=function(s,a){return o.call(s,a)}},function(r,i,o){var s=o(7),a=o(16);r.exports=o(4)?function(l,u,c){return s.f(l,u,a(1,c))}:function(l,u,c){return l[u]=c,l}},function(r,i,o){var s=o(10),a=o(35),l=o(23),u=Object.defineProperty;i.f=o(4)?Object.defineProperty:function(c,f,d){if(s(c),f=l(f,!0),s(d),a)try{return u(c,f,d)}catch{}if("get"in d||"set"in d)throw TypeError("Accessors not supported!");return"value"in d&&(c[f]=d.value),c}},function(r,i){r.exports=function(o){try{return!!o()}catch{return!0}}},function(r,i,o){var s=o(40),a=o(22);r.exports=function(l){return s(a(l))}},function(r,i,o){var s=o(11);r.exports=function(a){if(!s(a))throw TypeError(a+" is not an object!");return a}},function(r,i){r.exports=function(o){return typeof o=="object"?o!==null:typeof o=="function"}},function(r,i){r.exports={}},function(r,i,o){var s=o(39),a=o(27);r.exports=Object.keys||function(l){return s(l,a)}},function(r,i){r.exports=!0},function(r,i,o){var s=o(3),a=o(1),l=o(53),u=o(6),c=o(5),f=function(d,h,p){var m,b,y,v=d&f.F,w=d&f.G,g=d&f.S,x=d&f.P,k=d&f.B,E=d&f.W,D=w?a:a[h]||(a[h]={}),O=D.prototype,N=w?s:g?s[h]:(s[h]||{}).prototype;for(m in w&&(p=h),p)(b=!v&&N&&N[m]!==void 0)&&c(D,m)||(y=b?N[m]:p[m],D[m]=w&&typeof N[m]!="function"?p[m]:k&&b?l(y,s):E&&N[m]==y?function(C){var R=function(T,q,A){if(this instanceof C){switch(arguments.length){case 0:return new C;case 1:return new C(T);case 2:return new C(T,q)}return new C(T,q,A)}return C.apply(this,arguments)};return R.prototype=C.prototype,R}(y):x&&typeof y=="function"?l(Function.call,y):y,x&&((D.virtual||(D.virtual={}))[m]=y,d&f.R&&O&&!O[m]&&u(O,m,y)))};f.F=1,f.G=2,f.S=4,f.P=8,f.B=16,f.W=32,f.U=64,f.R=128,r.exports=f},function(r,i){r.exports=function(o,s){return{enumerable:!(1&o),configurable:!(2&o),writable:!(4&o),value:s}}},function(r,i){var o=0,s=Math.random();r.exports=function(a){return"Symbol(".concat(a===void 0?"":a,")_",(++o+s).toString(36))}},function(r,i,o){var s=o(22);r.exports=function(a){return Object(s(a))}},function(r,i){i.f={}.propertyIsEnumerable},function(r,i,o){var s=o(52)(!0);o(34)(String,"String",function(a){this._t=String(a),this._i=0},function(){var a,l=this._t,u=this._i;return u>=l.length?{value:void 0,done:!0}:(a=s(l,u),this._i+=a.length,{value:a,done:!1})})},function(r,i){var o=Math.ceil,s=Math.floor;r.exports=function(a){return isNaN(a=+a)?0:(a>0?s:o)(a)}},function(r,i){r.exports=function(o){if(o==null)throw TypeError("Can't call method on "+o);return o}},function(r,i,o){var s=o(11);r.exports=function(a,l){if(!s(a))return a;var u,c;if(l&&typeof(u=a.toString)=="function"&&!s(c=u.call(a))||typeof(u=a.valueOf)=="function"&&!s(c=u.call(a))||!l&&typeof(u=a.toString)=="function"&&!s(c=u.call(a)))return c;throw TypeError("Can't convert object to primitive value")}},function(r,i){var o={}.toString;r.exports=function(s){return o.call(s).slice(8,-1)}},function(r,i,o){var s=o(26)("keys"),a=o(17);r.exports=function(l){return s[l]||(s[l]=a(l))}},function(r,i,o){var s=o(1),a=o(3),l=a["__core-js_shared__"]||(a["__core-js_shared__"]={});(r.exports=function(u,c){return l[u]||(l[u]=c!==void 0?c:{})})("versions",[]).push({version:s.version,mode:o(14)?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},function(r,i){r.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(r,i,o){var s=o(7).f,a=o(5),l=o(2)("toStringTag");r.exports=function(u,c,f){u&&!a(u=f?u:u.prototype,l)&&s(u,l,{configurable:!0,value:c})}},function(r,i,o){o(62);for(var s=o(3),a=o(6),l=o(12),u=o(2)("toStringTag"),c="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),f=0;fdocument.F=Object<\/script>"),d.close(),f=d.F;p--;)delete f.prototype[l[p]];return f()};r.exports=Object.create||function(d,h){var p;return d!==null?(c.prototype=s(d),p=new c,c.prototype=null,p[u]=d):p=f(),h===void 0?p:a(p,h)}},function(r,i,o){var s=o(5),a=o(9),l=o(57)(!1),u=o(25)("IE_PROTO");r.exports=function(c,f){var d,h=a(c),p=0,m=[];for(d in h)d!=u&&s(h,d)&&m.push(d);for(;f.length>p;)s(h,d=f[p++])&&(~l(m,d)||m.push(d));return m}},function(r,i,o){var s=o(24);r.exports=Object("z").propertyIsEnumerable(0)?Object:function(a){return s(a)=="String"?a.split(""):Object(a)}},function(r,i,o){var s=o(39),a=o(27).concat("length","prototype");i.f=Object.getOwnPropertyNames||function(l){return s(l,a)}},function(r,i,o){var s=o(24),a=o(2)("toStringTag"),l=s(function(){return arguments}())=="Arguments";r.exports=function(u){var c,f,d;return u===void 0?"Undefined":u===null?"Null":typeof(f=function(h,p){try{return h[p]}catch{}}(c=Object(u),a))=="string"?f:l?s(c):(d=s(c))=="Object"&&typeof c.callee=="function"?"Arguments":d}},function(r,i){var o;o=function(){return this}();try{o=o||new Function("return this")()}catch{typeof window=="object"&&(o=window)}r.exports=o},function(r,i){var o=/-?\d+(\.\d+)?%?/g;r.exports=function(s){return s.match(o)}},function(r,i,o){Object.defineProperty(i,"__esModule",{value:!0}),i.getBase16Theme=i.createStyling=i.invertTheme=void 0;var s=b(o(49)),a=b(o(76)),l=b(o(81)),u=b(o(89)),c=b(o(93)),f=function(O){if(O&&O.__esModule)return O;var N={};if(O!=null)for(var C in O)Object.prototype.hasOwnProperty.call(O,C)&&(N[C]=O[C]);return N.default=O,N}(o(94)),d=b(o(132)),h=b(o(133)),p=b(o(138)),m=o(139);function b(O){return O&&O.__esModule?O:{default:O}}var y=f.default,v=(0,u.default)(y),w=(0,p.default)(h.default,m.rgb2yuv,function(O){var N,C=(0,l.default)(O,3),R=C[0],T=C[1],q=C[2];return[(N=R,N<.25?1:N<.5?.9-N:1.1-N),T,q]},m.yuv2rgb,d.default),g=function(O){return function(N){return{className:[N.className,O.className].filter(Boolean).join(" "),style:(0,a.default)({},N.style||{},O.style||{})}}},x=function(O,N){var C=(0,u.default)(N);for(var R in O)C.indexOf(R)===-1&&C.push(R);return C.reduce(function(T,q){return T[q]=function(A,S){if(A===void 0)return S;if(S===void 0)return A;var P=A===void 0?"undefined":(0,s.default)(A),B=S===void 0?"undefined":(0,s.default)(S);switch(P){case"string":switch(B){case"string":return[S,A].filter(Boolean).join(" ");case"object":return g({className:A,style:S});case"function":return function(j){for(var z=arguments.length,J=Array(z>1?z-1:0),K=1;K1?z-1:0),K=1;K1?z-1:0),K=1;K1?z-1:0),K=1;K1?z-1:0),K=1;K2?C-2:0),T=2;T3?N-3:0),R=3;R1&&arguments[1]!==void 0?arguments[1]:{},q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},A=T.defaultBase16,S=A===void 0?y:A,P=T.base16Themes,B=P===void 0?null:P,j=D(q,B);j&&(q=(0,a.default)({},j,q));var z=v.reduce(function(fe,ke){return fe[ke]=q[ke]||S[ke],fe},{}),J=(0,u.default)(q).reduce(function(fe,ke){return v.indexOf(ke)===-1&&(fe[ke]=q[ke]),fe},{}),K=O(z),ae=x(J,K);return(0,c.default)(k,2).apply(void 0,[ae].concat(C))},3),i.getBase16Theme=function(O,N){if(O&&O.extend&&(O=O.extend),typeof O=="string"){var C=O.split(":"),R=(0,l.default)(C,2),T=R[0],q=R[1];O=(N||{})[T]||f[T],q==="inverted"&&(O=E(O))}return O&&O.hasOwnProperty("base00")?O:void 0})},function(r,i,o){var s,a=typeof Reflect=="object"?Reflect:null,l=a&&typeof a.apply=="function"?a.apply:function(g,x,k){return Function.prototype.apply.call(g,x,k)};s=a&&typeof a.ownKeys=="function"?a.ownKeys:Object.getOwnPropertySymbols?function(g){return Object.getOwnPropertyNames(g).concat(Object.getOwnPropertySymbols(g))}:function(g){return Object.getOwnPropertyNames(g)};var u=Number.isNaN||function(g){return g!=g};function c(){c.init.call(this)}r.exports=c,r.exports.once=function(g,x){return new Promise(function(k,E){function D(){O!==void 0&&g.removeListener("error",O),k([].slice.call(arguments))}var O;x!=="error"&&(O=function(N){g.removeListener(x,D),E(N)},g.once("error",O)),g.once(x,D)})},c.EventEmitter=c,c.prototype._events=void 0,c.prototype._eventsCount=0,c.prototype._maxListeners=void 0;var f=10;function d(g){if(typeof g!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof g)}function h(g){return g._maxListeners===void 0?c.defaultMaxListeners:g._maxListeners}function p(g,x,k,E){var D,O,N,C;if(d(k),(O=g._events)===void 0?(O=g._events=Object.create(null),g._eventsCount=0):(O.newListener!==void 0&&(g.emit("newListener",x,k.listener?k.listener:k),O=g._events),N=O[x]),N===void 0)N=O[x]=k,++g._eventsCount;else if(typeof N=="function"?N=O[x]=E?[k,N]:[N,k]:E?N.unshift(k):N.push(k),(D=h(g))>0&&N.length>D&&!N.warned){N.warned=!0;var R=new Error("Possible EventEmitter memory leak detected. "+N.length+" "+String(x)+" listeners added. Use emitter.setMaxListeners() to increase limit");R.name="MaxListenersExceededWarning",R.emitter=g,R.type=x,R.count=N.length,C=R,console&&console.warn&&console.warn(C)}return g}function m(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function b(g,x,k){var E={fired:!1,wrapFn:void 0,target:g,type:x,listener:k},D=m.bind(E);return D.listener=k,E.wrapFn=D,D}function y(g,x,k){var E=g._events;if(E===void 0)return[];var D=E[x];return D===void 0?[]:typeof D=="function"?k?[D.listener||D]:[D]:k?function(O){for(var N=new Array(O.length),C=0;C0&&(O=x[0]),O instanceof Error)throw O;var N=new Error("Unhandled error."+(O?" ("+O.message+")":""));throw N.context=O,N}var C=D[g];if(C===void 0)return!1;if(typeof C=="function")l(C,this,x);else{var R=C.length,T=w(C,R);for(k=0;k=0;O--)if(k[O]===x||k[O].listener===x){N=k[O].listener,D=O;break}if(D<0)return this;D===0?k.shift():function(C,R){for(;R+1=0;E--)this.removeListener(g,x[E]);return this},c.prototype.listeners=function(g){return y(this,g,!0)},c.prototype.rawListeners=function(g){return y(this,g,!1)},c.listenerCount=function(g,x){return typeof g.listenerCount=="function"?g.listenerCount(x):v.call(g,x)},c.prototype.listenerCount=v,c.prototype.eventNames=function(){return this._eventsCount>0?s(this._events):[]}},function(r,i,o){r.exports.Dispatcher=o(140)},function(r,i,o){r.exports=o(142)},function(r,i,o){i.__esModule=!0;var s=u(o(50)),a=u(o(65)),l=typeof a.default=="function"&&typeof s.default=="symbol"?function(c){return typeof c}:function(c){return c&&typeof a.default=="function"&&c.constructor===a.default&&c!==a.default.prototype?"symbol":typeof c};function u(c){return c&&c.__esModule?c:{default:c}}i.default=typeof a.default=="function"&&l(s.default)==="symbol"?function(c){return c===void 0?"undefined":l(c)}:function(c){return c&&typeof a.default=="function"&&c.constructor===a.default&&c!==a.default.prototype?"symbol":c===void 0?"undefined":l(c)}},function(r,i,o){r.exports={default:o(51),__esModule:!0}},function(r,i,o){o(20),o(29),r.exports=o(30).f("iterator")},function(r,i,o){var s=o(21),a=o(22);r.exports=function(l){return function(u,c){var f,d,h=String(a(u)),p=s(c),m=h.length;return p<0||p>=m?l?"":void 0:(f=h.charCodeAt(p))<55296||f>56319||p+1===m||(d=h.charCodeAt(p+1))<56320||d>57343?l?h.charAt(p):f:l?h.slice(p,p+2):d-56320+(f-55296<<10)+65536}}},function(r,i,o){var s=o(54);r.exports=function(a,l,u){if(s(a),l===void 0)return a;switch(u){case 1:return function(c){return a.call(l,c)};case 2:return function(c,f){return a.call(l,c,f)};case 3:return function(c,f,d){return a.call(l,c,f,d)}}return function(){return a.apply(l,arguments)}}},function(r,i){r.exports=function(o){if(typeof o!="function")throw TypeError(o+" is not a function!");return o}},function(r,i,o){var s=o(38),a=o(16),l=o(28),u={};o(6)(u,o(2)("iterator"),function(){return this}),r.exports=function(c,f,d){c.prototype=s(u,{next:a(1,d)}),l(c,f+" Iterator")}},function(r,i,o){var s=o(7),a=o(10),l=o(13);r.exports=o(4)?Object.defineProperties:function(u,c){a(u);for(var f,d=l(c),h=d.length,p=0;h>p;)s.f(u,f=d[p++],c[f]);return u}},function(r,i,o){var s=o(9),a=o(58),l=o(59);r.exports=function(u){return function(c,f,d){var h,p=s(c),m=a(p.length),b=l(d,m);if(u&&f!=f){for(;m>b;)if((h=p[b++])!=h)return!0}else for(;m>b;b++)if((u||b in p)&&p[b]===f)return u||b||0;return!u&&-1}}},function(r,i,o){var s=o(21),a=Math.min;r.exports=function(l){return l>0?a(s(l),9007199254740991):0}},function(r,i,o){var s=o(21),a=Math.max,l=Math.min;r.exports=function(u,c){return(u=s(u))<0?a(u+c,0):l(u,c)}},function(r,i,o){var s=o(3).document;r.exports=s&&s.documentElement},function(r,i,o){var s=o(5),a=o(18),l=o(25)("IE_PROTO"),u=Object.prototype;r.exports=Object.getPrototypeOf||function(c){return c=a(c),s(c,l)?c[l]:typeof c.constructor=="function"&&c instanceof c.constructor?c.constructor.prototype:c instanceof Object?u:null}},function(r,i,o){var s=o(63),a=o(64),l=o(12),u=o(9);r.exports=o(34)(Array,"Array",function(c,f){this._t=u(c),this._i=0,this._k=f},function(){var c=this._t,f=this._k,d=this._i++;return!c||d>=c.length?(this._t=void 0,a(1)):a(0,f=="keys"?d:f=="values"?c[d]:[d,c[d]])},"values"),l.Arguments=l.Array,s("keys"),s("values"),s("entries")},function(r,i){r.exports=function(){}},function(r,i){r.exports=function(o,s){return{value:s,done:!!o}}},function(r,i,o){r.exports={default:o(66),__esModule:!0}},function(r,i,o){o(67),o(73),o(74),o(75),r.exports=o(1).Symbol},function(r,i,o){var s=o(3),a=o(5),l=o(4),u=o(15),c=o(37),f=o(68).KEY,d=o(8),h=o(26),p=o(28),m=o(17),b=o(2),y=o(30),v=o(31),w=o(69),g=o(70),x=o(10),k=o(11),E=o(18),D=o(9),O=o(23),N=o(16),C=o(38),R=o(71),T=o(72),q=o(32),A=o(7),S=o(13),P=T.f,B=A.f,j=R.f,z=s.Symbol,J=s.JSON,K=J&&J.stringify,ae=b("_hidden"),fe=b("toPrimitive"),ke={}.propertyIsEnumerable,ve=h("symbol-registry"),xe=h("symbols"),Se=h("op-symbols"),Oe=Object.prototype,Fe=typeof z=="function"&&!!q.f,mt=s.QObject,Ce=!mt||!mt.prototype||!mt.prototype.findChild,pe=l&&d(function(){return C(B({},"a",{get:function(){return B(this,"a",{value:7}).a}})).a!=7})?function(W,X,se){var ge=P(Oe,X);ge&&delete Oe[X],B(W,X,se),ge&&W!==Oe&&B(Oe,X,ge)}:B,De=function(W){var X=xe[W]=C(z.prototype);return X._k=W,X},Le=Fe&&typeof z.iterator=="symbol"?function(W){return typeof W=="symbol"}:function(W){return W instanceof z},Ge=function(W,X,se){return W===Oe&&Ge(Se,X,se),x(W),X=O(X,!0),x(se),a(xe,X)?(se.enumerable?(a(W,ae)&&W[ae][X]&&(W[ae][X]=!1),se=C(se,{enumerable:N(0,!1)})):(a(W,ae)||B(W,ae,N(1,{})),W[ae][X]=!0),pe(W,X,se)):B(W,X,se)},Qt=function(W,X){x(W);for(var se,ge=w(X=D(X)),Pe=0,Be=ge.length;Be>Pe;)Ge(W,se=ge[Pe++],X[se]);return W},rt=function(W){var X=ke.call(this,W=O(W,!0));return!(this===Oe&&a(xe,W)&&!a(Se,W))&&(!(X||!a(this,W)||!a(xe,W)||a(this,ae)&&this[ae][W])||X)},it=function(W,X){if(W=D(W),X=O(X,!0),W!==Oe||!a(xe,X)||a(Se,X)){var se=P(W,X);return!se||!a(xe,X)||a(W,ae)&&W[ae][X]||(se.enumerable=!0),se}},bt=function(W){for(var X,se=j(D(W)),ge=[],Pe=0;se.length>Pe;)a(xe,X=se[Pe++])||X==ae||X==f||ge.push(X);return ge},Ft=function(W){for(var X,se=W===Oe,ge=j(se?Se:D(W)),Pe=[],Be=0;ge.length>Be;)!a(xe,X=ge[Be++])||se&&!a(Oe,X)||Pe.push(xe[X]);return Pe};Fe||(c((z=function(){if(this instanceof z)throw TypeError("Symbol is not a constructor!");var W=m(arguments.length>0?arguments[0]:void 0),X=function(se){this===Oe&&X.call(Se,se),a(this,ae)&&a(this[ae],W)&&(this[ae][W]=!1),pe(this,W,N(1,se))};return l&&Ce&&pe(Oe,W,{configurable:!0,set:X}),De(W)}).prototype,"toString",function(){return this._k}),T.f=it,A.f=Ge,o(41).f=R.f=bt,o(19).f=rt,q.f=Ft,l&&!o(14)&&c(Oe,"propertyIsEnumerable",rt,!0),y.f=function(W){return De(b(W))}),u(u.G+u.W+u.F*!Fe,{Symbol:z});for(var Lt="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),at=0;Lt.length>at;)b(Lt[at++]);for(var gt=S(b.store),Y=0;gt.length>Y;)v(gt[Y++]);u(u.S+u.F*!Fe,"Symbol",{for:function(W){return a(ve,W+="")?ve[W]:ve[W]=z(W)},keyFor:function(W){if(!Le(W))throw TypeError(W+" is not a symbol!");for(var X in ve)if(ve[X]===W)return X},useSetter:function(){Ce=!0},useSimple:function(){Ce=!1}}),u(u.S+u.F*!Fe,"Object",{create:function(W,X){return X===void 0?C(W):Qt(C(W),X)},defineProperty:Ge,defineProperties:Qt,getOwnPropertyDescriptor:it,getOwnPropertyNames:bt,getOwnPropertySymbols:Ft});var U=d(function(){q.f(1)});u(u.S+u.F*U,"Object",{getOwnPropertySymbols:function(W){return q.f(E(W))}}),J&&u(u.S+u.F*(!Fe||d(function(){var W=z();return K([W])!="[null]"||K({a:W})!="{}"||K(Object(W))!="{}"})),"JSON",{stringify:function(W){for(var X,se,ge=[W],Pe=1;arguments.length>Pe;)ge.push(arguments[Pe++]);if(se=X=ge[1],(k(X)||W!==void 0)&&!Le(W))return g(X)||(X=function(Be,nt){if(typeof se=="function"&&(nt=se.call(this,Be,nt)),!Le(nt))return nt}),ge[1]=X,K.apply(J,ge)}}),z.prototype[fe]||o(6)(z.prototype,fe,z.prototype.valueOf),p(z,"Symbol"),p(Math,"Math",!0),p(s.JSON,"JSON",!0)},function(r,i,o){var s=o(17)("meta"),a=o(11),l=o(5),u=o(7).f,c=0,f=Object.isExtensible||function(){return!0},d=!o(8)(function(){return f(Object.preventExtensions({}))}),h=function(m){u(m,s,{value:{i:"O"+ ++c,w:{}}})},p=r.exports={KEY:s,NEED:!1,fastKey:function(m,b){if(!a(m))return typeof m=="symbol"?m:(typeof m=="string"?"S":"P")+m;if(!l(m,s)){if(!f(m))return"F";if(!b)return"E";h(m)}return m[s].i},getWeak:function(m,b){if(!l(m,s)){if(!f(m))return!0;if(!b)return!1;h(m)}return m[s].w},onFreeze:function(m){return d&&p.NEED&&f(m)&&!l(m,s)&&h(m),m}}},function(r,i,o){var s=o(13),a=o(32),l=o(19);r.exports=function(u){var c=s(u),f=a.f;if(f)for(var d,h=f(u),p=l.f,m=0;h.length>m;)p.call(u,d=h[m++])&&c.push(d);return c}},function(r,i,o){var s=o(24);r.exports=Array.isArray||function(a){return s(a)=="Array"}},function(r,i,o){var s=o(9),a=o(41).f,l={}.toString,u=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];r.exports.f=function(c){return u&&l.call(c)=="[object Window]"?function(f){try{return a(f)}catch{return u.slice()}}(c):a(s(c))}},function(r,i,o){var s=o(19),a=o(16),l=o(9),u=o(23),c=o(5),f=o(35),d=Object.getOwnPropertyDescriptor;i.f=o(4)?d:function(h,p){if(h=l(h),p=u(p,!0),f)try{return d(h,p)}catch{}if(c(h,p))return a(!s.f.call(h,p),h[p])}},function(r,i){},function(r,i,o){o(31)("asyncIterator")},function(r,i,o){o(31)("observable")},function(r,i,o){i.__esModule=!0;var s,a=o(77),l=(s=a)&&s.__esModule?s:{default:s};i.default=l.default||function(u){for(var c=1;cy;)for(var g,x=f(arguments[y++]),k=v?a(x).concat(v(x)):a(x),E=k.length,D=0;E>D;)g=k[D++],s&&!w.call(x,g)||(m[g]=x[g]);return m}:d},function(r,i,o){i.__esModule=!0;var s=l(o(82)),a=l(o(85));function l(u){return u&&u.__esModule?u:{default:u}}i.default=function(u,c){if(Array.isArray(u))return u;if((0,s.default)(Object(u)))return function(f,d){var h=[],p=!0,m=!1,b=void 0;try{for(var y,v=(0,a.default)(f);!(p=(y=v.next()).done)&&(h.push(y.value),!d||h.length!==d);p=!0);}catch(w){m=!0,b=w}finally{try{!p&&v.return&&v.return()}finally{if(m)throw b}}return h}(u,c);throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(r,i,o){r.exports={default:o(83),__esModule:!0}},function(r,i,o){o(29),o(20),r.exports=o(84)},function(r,i,o){var s=o(42),a=o(2)("iterator"),l=o(12);r.exports=o(1).isIterable=function(u){var c=Object(u);return c[a]!==void 0||"@@iterator"in c||l.hasOwnProperty(s(c))}},function(r,i,o){r.exports={default:o(86),__esModule:!0}},function(r,i,o){o(29),o(20),r.exports=o(87)},function(r,i,o){var s=o(10),a=o(88);r.exports=o(1).getIterator=function(l){var u=a(l);if(typeof u!="function")throw TypeError(l+" is not iterable!");return s(u.call(l))}},function(r,i,o){var s=o(42),a=o(2)("iterator"),l=o(12);r.exports=o(1).getIteratorMethod=function(u){if(u!=null)return u[a]||u["@@iterator"]||l[s(u)]}},function(r,i,o){r.exports={default:o(90),__esModule:!0}},function(r,i,o){o(91),r.exports=o(1).Object.keys},function(r,i,o){var s=o(18),a=o(13);o(92)("keys",function(){return function(l){return a(s(l))}})},function(r,i,o){var s=o(15),a=o(1),l=o(8);r.exports=function(u,c){var f=(a.Object||{})[u]||Object[u],d={};d[u]=c(f),s(s.S+s.F*l(function(){f(1)}),"Object",d)}},function(r,i,o){(function(s){var a=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],l=/^\s+|\s+$/g,u=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,c=/\{\n\/\* \[wrapped with (.+)\] \*/,f=/,? & /,d=/^[-+]0x[0-9a-f]+$/i,h=/^0b[01]+$/i,p=/^\[object .+?Constructor\]$/,m=/^0o[0-7]+$/i,b=/^(?:0|[1-9]\d*)$/,y=parseInt,v=typeof s=="object"&&s&&s.Object===Object&&s,w=typeof self=="object"&&self&&self.Object===Object&&self,g=v||w||Function("return this")();function x(Y,U,W){switch(W.length){case 0:return Y.call(U);case 1:return Y.call(U,W[0]);case 2:return Y.call(U,W[0],W[1]);case 3:return Y.call(U,W[0],W[1],W[2])}return Y.apply(U,W)}function k(Y,U){return!!(Y&&Y.length)&&function(W,X,se){if(X!=X)return function(Be,nt,G,re){for(var me=Be.length,Ee=G+-1;++Ee-1}function E(Y){return Y!=Y}function D(Y,U){for(var W=Y.length,X=0;W--;)Y[W]===U&&X++;return X}function O(Y,U){for(var W=-1,X=Y.length,se=0,ge=[];++W2?C:void 0);function ke(Y){return Lt(Y)?J(Y):{}}function ve(Y){return!(!Lt(Y)||function(U){return!!S&&S in U}(Y))&&(function(U){var W=Lt(U)?j.call(U):"";return W=="[object Function]"||W=="[object GeneratorFunction]"}(Y)||function(U){var W=!1;if(U!=null&&typeof U.toString!="function")try{W=!!(U+"")}catch{}return W}(Y)?z:p).test(function(U){if(U!=null){try{return P.call(U)}catch{}try{return U+""}catch{}}return""}(Y))}function xe(Y,U,W,X){for(var se=-1,ge=Y.length,Pe=W.length,Be=-1,nt=U.length,G=K(ge-Pe,0),re=Array(nt+G),me=!X;++Be1&&Ie.reverse(),re&&nt1?"& ":"")+U[X],U=U.join(W>2?", ":" "),Y.replace(u,`{ -/* [wrapped with `+U+`] */ -`)}function Qt(Y,U){return!!(U=U??9007199254740991)&&(typeof Y=="number"||b.test(Y))&&Y>-1&&Y%1==0&&Y1&&l--,c=6*l<1?s+6*(a-s)*l:2*l<1?a:3*l<2?s+(a-s)*(2/3-l)*6:s,u[p]=255*c;return u}},function(r,i,o){(function(s){var a=typeof s=="object"&&s&&s.Object===Object&&s,l=typeof self=="object"&&self&&self.Object===Object&&self,u=a||l||Function("return this")();function c(O,N,C){switch(C.length){case 0:return O.call(N);case 1:return O.call(N,C[0]);case 2:return O.call(N,C[0],C[1]);case 3:return O.call(N,C[0],C[1],C[2])}return O.apply(N,C)}function f(O,N){for(var C=-1,R=N.length,T=O.length;++C-1&&T%1==0&&T<=9007199254740991}(R.length)&&!function(T){var q=function(A){var S=typeof A;return!!A&&(S=="object"||S=="function")}(T)?p.call(T):"";return q=="[object Function]"||q=="[object GeneratorFunction]"}(R)}(C)}(N)&&h.call(N,"callee")&&(!b.call(N,"callee")||p.call(N)=="[object Arguments]")}(O)||!!(y&&O&&O[y])}var g=Array.isArray,x,k,E,D=(k=function(O){var N=(O=function(T,q,A,S,P){var B=-1,j=T.length;for(A||(A=w),P||(P=[]);++B2?l-2:0),c=2;c"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var M,$=p(F);if(L){var I=p(this).constructor;M=Reflect.construct($,arguments,I)}else M=$.apply(this,arguments);return y(this,M)}}o.r(i);var w=o(0),g=o.n(w);function x(){var F=this.constructor.getDerivedStateFromProps(this.props,this.state);F!=null&&this.setState(F)}function k(F){this.setState((function(L){var M=this.constructor.getDerivedStateFromProps(F,L);return M??null}).bind(this))}function E(F,L){try{var M=this.props,$=this.state;this.props=F,this.state=L,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(M,$)}finally{this.props=M,this.state=$}}function D(F){var L=F.prototype;if(!L||!L.isReactComponent)throw new Error("Can only polyfill class components");if(typeof F.getDerivedStateFromProps!="function"&&typeof L.getSnapshotBeforeUpdate!="function")return F;var M=null,$=null,I=null;if(typeof L.componentWillMount=="function"?M="componentWillMount":typeof L.UNSAFE_componentWillMount=="function"&&(M="UNSAFE_componentWillMount"),typeof L.componentWillReceiveProps=="function"?$="componentWillReceiveProps":typeof L.UNSAFE_componentWillReceiveProps=="function"&&($="UNSAFE_componentWillReceiveProps"),typeof L.componentWillUpdate=="function"?I="componentWillUpdate":typeof L.UNSAFE_componentWillUpdate=="function"&&(I="UNSAFE_componentWillUpdate"),M!==null||$!==null||I!==null){var H=F.displayName||F.name,Q=typeof F.getDerivedStateFromProps=="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error(`Unsafe legacy lifecycles will not be called for components using new component APIs. +3. "-" cannot repeat`);At.customSchemes.push([t,e])}function ate(){At.scanner=Qee(At.customSchemes);for(let t=0;t{const i=e.some(u=>u.docChanged)&&!n.doc.eq(r.doc),o=e.some(u=>u.getMeta("preventAutolink"));if(!i||o)return;const{tr:s}=r,a=EG(n.doc,[...e]);if(DG(a).forEach(({newRange:u})=>{const c=CG(r.doc,u,h=>h.isTextblock);let f,d;if(c.length>1?(f=c[0],d=r.doc.textBetween(f.pos,f.pos+f.node.nodeSize,void 0," ")):c.length&&r.doc.textBetween(u.from,u.to," "," ").endsWith(" ")&&(f=c[0],d=r.doc.textBetween(f.pos,u.to,void 0," ")),f&&d){const h=d.split(" ").filter(y=>y!=="");if(h.length<=0)return!1;const p=h[h.length-1],m=f.pos+d.lastIndexOf(p);if(!p)return!1;const b=UN(p).map(y=>y.toObject(t.defaultProtocol));if(!lte(b))return!1;b.filter(y=>y.isLink).map(y=>({...y,from:m+y.start+1,to:m+y.end+1})).filter(y=>r.schema.marks.code?!r.doc.rangeHasMark(y.from,y.to,r.schema.marks.code):!0).filter(y=>t.validate(y.value)).forEach(y=>{$D(y.from,y.to,r.doc).some(v=>v.mark.type===t.type)||s.addMark(y.from,y.to,t.type.create({href:y.href}))})}}),!!s.steps.length)return s}})}function cte(t){return new ns({key:new rs("handleClickLink"),props:{handleClick:(e,n,r)=>{var i,o;if(r.button!==0||!e.editable)return!1;let s=r.target;const a=[];for(;s.nodeName!=="DIV";)a.push(s),s=s.parentNode;if(!a.find(d=>d.nodeName==="A"))return!1;const l=TG(e.state,t.type.name),u=r.target,c=(i=u==null?void 0:u.href)!==null&&i!==void 0?i:l.href,f=(o=u==null?void 0:u.target)!==null&&o!==void 0?o:l.target;return u&&c?(window.open(c,f),!0):!1}}})}function fte(t){return new ns({key:new rs("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{state:i}=e,{selection:o}=i,{empty:s}=o;if(s)return!1;let a="";r.content.forEach(u=>{a+=u.textContent});const l=O3(a,{defaultProtocol:t.defaultProtocol}).find(u=>u.isLink&&u.value===a);return!a||!l?!1:(t.editor.commands.setMark(t.type,{href:l.href}),!0)}}})}const dte=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function i_(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const i=typeof r=="string"?r:r.scheme;i&&n.push(i)}),!t||t.replace(dte,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z+.-]+(?:[^a-z+.-:]|$))`,"i"))}const hte=Ud.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.protocols.forEach(t=>{if(typeof t=="string"){r_(t);return}r_(t.scheme,t.optionalSlashes)})},onDestroy(){ste()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:t=>!!t}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!i_(e,this.options.protocols)?!1:null}}]},renderHTML({HTMLAttributes:t}){return i_(t.href,this.options.protocols)?["a",qd(this.options.HTMLAttributes,t),0]:["a",qd(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:e})=>e().setMark(this.name,t).setMeta("preventAutolink",!0).run(),toggleLink:t=>({chain:e})=>e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[ID({find:t=>{const e=[];if(t){const{validate:n}=this.options,r=O3(t).filter(i=>i.isLink&&n(i.value));r.length&&r.forEach(i=>e.push({text:i.value,data:{href:i.href},index:i.start}))}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[];return this.options.autolink&&t.push(ute({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:this.options.validate})),this.options.openOnClick===!0&&t.push(cte({type:this.type})),this.options.linkOnPaste&&t.push(fte({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}}),pte=hte.configure({autolink:!1}).extend({addPasteRules(){return[{find:t=>{const e=[];for(const{start:n,value:r,href:i}of O3(t.replace(/\ufffc/g," "))||[])!dZ(i)&&!i.startsWith("tel:")||e.push({index:n,text:r,data:{href:i}});return e},handler:t=>{var e;const{range:n,state:r,match:i}=t,{from:o,to:s}=n,{nodes:a,marks:l}=r.schema,u=this.editor.storage.nostr.imeta,c=(e=i.data)==null?void 0:e.href,f=mZ(c,c,u);if(f!=="text"&&a[f]){r.tr.replaceWith(o,s,a[f].create({src:c}));return}r.tr.addMark(o,s,l.link.create({href:c}))}}]}});function Pb(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`positive integer expected, not ${t}`)}function o_(t){if(typeof t!="boolean")throw new Error(`boolean expected, not ${t}`)}function mte(t){return t instanceof Uint8Array||t!=null&&typeof t=="object"&&t.constructor.name==="Uint8Array"}function qo(t,...e){if(!mte(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error(`Uint8Array expected of length ${e}, not of length=${t.length}`)}/*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */const Un=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),gte=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!gte)throw new Error("Non little-endian hardware is not supported");function yte(t,e){if(e==null||typeof e!="object")throw new Error("options must be defined");return Object.assign(t,e)}function bte(t,e){if(t.length!==e.length)return!1;let n=0;for(let r=0;r(Object.assign(e,t),e),aa=16,wte=283;function D3(t){return t<<1^wte&-(t>>7)}function Tu(t,e){let n=0;for(;e>0;e>>=1)n^=t&-(e&1),t=D3(t);return n}const Uw=(()=>{let t=new Uint8Array(256);for(let n=0,r=1;n<256;n++,r^=D3(r))t[n]=r;const e=new Uint8Array(256);e[0]=99;for(let n=0;n<255;n++){let r=t[255-n];r|=r<<8,e[t[n]]=(r^r>>4^r>>5^r>>6^r>>7^99)&255}return e})(),kte=Uw.map((t,e)=>Uw.indexOf(e)),xte=t=>t<<24|t>>>8,zb=t=>t<<8|t>>>24;function VN(t,e){if(t.length!==256)throw new Error("Wrong sbox length");const n=new Uint32Array(256).map((u,c)=>e(t[c])),r=n.map(zb),i=r.map(zb),o=i.map(zb),s=new Uint32Array(256*256),a=new Uint32Array(256*256),l=new Uint16Array(256*256);for(let u=0;u<256;u++)for(let c=0;c<256;c++){const f=u*256+c;s[f]=n[u]^r[c],a[f]=i[u]^o[c],l[f]=t[u]<<8|t[c]}return{sbox:t,sbox2:l,T0:n,T1:r,T2:i,T3:o,T01:s,T23:a}}const N3=VN(Uw,t=>Tu(t,3)<<24|t<<16|t<<8|Tu(t,2)),HN=VN(kte,t=>Tu(t,11)<<24|Tu(t,13)<<16|Tu(t,9)<<8|Tu(t,14)),Ete=(()=>{const t=new Uint8Array(16);for(let e=0,n=1;e<16;e++,n=D3(n))t[e]=n;return t})();function WN(t){qo(t);const e=t.length;if(![16,24,32].includes(e))throw new Error(`aes: wrong key size: should be 16, 24 or 32, got: ${e}`);const{sbox2:n}=N3,r=Un(t),i=r.length,o=a=>lo(n,a,a,a,a),s=new Uint32Array(e+28);s.set(r);for(let a=i;a6&&a%i===4&&(l=o(l)),s[a]=s[a-i]^l}return s}function Ste(t){const e=WN(t),n=e.slice(),r=e.length,{sbox2:i}=N3,{T0:o,T1:s,T2:a,T3:l}=HN;for(let u=0;u>>8&255]^a[f>>>16&255]^l[f>>>24]}return n}function Ws(t,e,n,r,i,o){return t[n<<8&65280|r>>>8&255]^e[i>>>8&65280|o>>>24&255]}function lo(t,e,n,r,i){return t[e&255|n&65280]|t[r>>>16&255|i>>>16&65280]<<16}function s_(t,e,n,r,i){const{sbox2:o,T01:s,T23:a}=N3;let l=0;e^=t[l++],n^=t[l++],r^=t[l++],i^=t[l++];const u=t.length/4-2;for(let p=0;p16)throw new Error(`aes/pcks5: wrong padding byte: ${r}`);const i=t.subarray(0,-r);for(let o=0;o{const a=WN(e),{b:l,o:u,out:c}=Ate(o,i,s),f=Un(n);let d=f[0],h=f[1],p=f[2],m=f[3],b=0;for(;b+4<=l.length;)d^=l[b+0],h^=l[b+1],p^=l[b+2],m^=l[b+3],{s0:d,s1:h,s2:p,s3:m}=s_(a,d,h,p,m),u[b++]=d,u[b++]=h,u[b++]=p,u[b++]=m;if(i){const y=Mte(o.subarray(b*4));d^=y[0],h^=y[1],p^=y[2],m^=y[3],{s0:d,s1:h,s2:p,s3:m}=s_(a,d,h,p,m),u[b++]=d,u[b++]=h,u[b++]=p,u[b++]=m}return a.fill(0),c},decrypt:(o,s)=>{_te(o);const a=Ste(e),l=Un(n),u=JN(o.length,s),c=Un(o),f=Un(u);let d=l[0],h=l[1],p=l[2],m=l[3];for(let b=0;b+4<=c.length;){const y=d,v=h,w=p,g=m;d=c[b+0],h=c[b+1],p=c[b+2],m=c[b+3];const{s0:x,s1:k,s2:E,s3:D}=Cte(a,d,h,p,m);f[b++]=x^y,f[b++]=k^v,f[b++]=E^w,f[b++]=D^g}return a.fill(0),Tte(u,i)}}}),GN=t=>Uint8Array.from(t.split("").map(e=>e.charCodeAt(0))),Ote=GN("expand 16-byte k"),Dte=GN("expand 32-byte k"),Nte=Un(Ote),ZN=Un(Dte);ZN.slice();function Ye(t,e){return t<>>32-e}function Vw(t){return t.byteOffset%4===0}const Ap=64,$te=16,YN=2**32-1,a_=new Uint32Array;function Ite(t,e,n,r,i,o,s,a){const l=i.length,u=new Uint8Array(Ap),c=Un(u),f=Vw(i)&&Vw(o),d=f?Un(i):a_,h=f?Un(o):a_;for(let p=0;p=YN)throw new Error("arx: counter overflow");const m=Math.min(Ap,l-p);if(f&&m===Ap){const b=p/4;if(p%4!==0)throw new Error("arx: invalid block position");for(let y=0,v;y<$te;y++)v=b+y,h[v]=d[v]^c[y];p+=Ap;continue}for(let b=0,y;b{qo(a),qo(l),qo(u);const d=u.length;if(c||(c=new Uint8Array(d)),qo(c),Pb(f),f<0||f>=YN)throw new Error("arx: counter overflow");if(c.length0;)h.pop().fill(0);return c}}function Fte(t,e,n,r,i,o=20){let s=t[0],a=t[1],l=t[2],u=t[3],c=e[0],f=e[1],d=e[2],h=e[3],p=e[4],m=e[5],b=e[6],y=e[7],v=i,w=n[0],g=n[1],x=n[2],k=s,E=a,D=l,O=u,N=c,C=f,R=d,T=h,q=p,A=m,S=b,P=y,B=v,j=w,z=g,J=x;for(let ae=0;aei?e.create().update(r).digest():r);for(let s=0;snew XN(t,e).update(n).digest();_g.create=(t,e)=>new XN(t,e);function Lte(t,e,n){return oo.hash(t),_g(t,Vd(n),Vd(e))}const jb=new Uint8Array([0]),l_=new Uint8Array;function Bte(t,e,n,r=32){if(oo.hash(t),oo.number(r),r>255*t.outputLen)throw new Error("Length should be <= 255*HashLen");const i=Math.ceil(r/t.outputLen);n===void 0&&(n=l_);const o=new Uint8Array(i*t.outputLen),s=_g.create(t,e),a=s._cloneInto(),l=new Uint8Array(s.outputLen);for(let u=0;u{for(var n in e)Pte(t,n,{get:e[n],enumerable:!0})},Ql=Symbol("verified"),zte=t=>t instanceof Object;function e$(t){if(!zte(t)||typeof t.kind!="number"||typeof t.content!="string"||typeof t.created_at!="number"||typeof t.pubkey!="string"||!t.pubkey.match(/^[a-f0-9]{64}$/)||!Array.isArray(t.tags))return!1;for(let e=0;eHte,QueueNode:()=>t$,binarySearch:()=>$3,insertEventIntoAscendingList:()=>Vte,insertEventIntoDescendingList:()=>Ute,normalizeURL:()=>qte,utf8Decoder:()=>to,utf8Encoder:()=>Fi});var to=new TextDecoder("utf-8"),Fi=new TextEncoder;function qte(t){t.indexOf("://")===-1&&(t="wss://"+t);let e=new URL(t);return e.pathname=e.pathname.replace(/\/+/g,"/"),e.pathname.endsWith("/")&&(e.pathname=e.pathname.slice(0,-1)),(e.port==="80"&&e.protocol==="ws:"||e.port==="443"&&e.protocol==="wss:")&&(e.port=""),e.searchParams.sort(),e.hash="",e.toString()}function Ute(t,e){const[n,r]=$3(t,i=>e.id===i.id?0:e.created_at===i.created_at?-1:i.created_at-e.created_at);return r||t.splice(n,0,e),t}function Vte(t,e){const[n,r]=$3(t,i=>e.id===i.id?0:e.created_at===i.created_at?-1:e.created_at-i.created_at);return r||t.splice(n,0,e),t}function $3(t,e){let n=0,r=t.length-1;for(;n<=r;){const i=Math.floor((n+r)/2),o=e(t[i]);if(o===0)return[i,!0];o<0?r=i-1:n=i+1}return[n,!1]}var t$=class{constructor(e){id(this,"value"),id(this,"next",null),id(this,"prev",null),this.value=e}},Hte=class{constructor(){id(this,"first"),id(this,"last"),this.first=null,this.last=null}enqueue(e){const n=new t$(e);return this.last?this.last===this.first?(this.last=n,this.last.prev=this.first,this.first.next=n):(n.prev=this.last,this.last.next=n,this.last=n):(this.first=n,this.last=n),!0}dequeue(){if(!this.first)return null;if(this.first===this.last){const n=this.first;return this.first=null,this.last=null,n.value}const e=this.first;return this.first=e.next,e.value}},Wte=class{generateSecretKey(){return eo.utils.randomPrivateKey()}getPublicKey(t){return ln(eo.getPublicKey(t))}finalizeEvent(t,e){const n=t;return n.pubkey=ln(eo.getPublicKey(e)),n.id=k0(n),n.sig=ln(eo.sign(k0(n),e)),n[Ql]=!0,n}verifyEvent(t){if(typeof t[Ql]=="boolean")return t[Ql];const e=k0(t);if(e!==t.id)return t[Ql]=!1,!1;try{const n=eo.verify(t.sig,e,t.pubkey);return t[Ql]=n,n}catch{return t[Ql]=!1,!1}}};function Jte(t){if(!e$(t))throw new Error("can't serialize event with wrong or missing properties");return JSON.stringify([0,t.pubkey,t.created_at,t.kind,t.tags,t.content])}function k0(t){let e=Rc(Fi.encode(Jte(t)));return ln(e)}var Ag=new Wte;Ag.generateSecretKey;Ag.getPublicKey;var Ma=Ag.finalizeEvent,I3=Ag.verifyEvent,Kte={};Vt(Kte,{Application:()=>Kne,BadgeAward:()=>rne,BadgeDefinition:()=>jne,BlockedRelaysList:()=>_ne,BookmarkList:()=>Ene,Bookmarksets:()=>Bne,Calendar:()=>tre,CalendarEventRSVP:()=>nre,ChannelCreation:()=>s$,ChannelHideMessage:()=>u$,ChannelMessage:()=>l$,ChannelMetadata:()=>a$,ChannelMuteUser:()=>c$,ClassifiedListing:()=>Yne,ClientAuth:()=>f$,CommunitiesList:()=>Sne,CommunityDefinition:()=>ore,CommunityPostApproval:()=>dne,Contacts:()=>Xte,CreateOrUpdateProduct:()=>Vne,CreateOrUpdateStall:()=>Une,Curationsets:()=>Pne,Date:()=>Xne,DraftClassifiedListing:()=>Qne,DraftLong:()=>Wne,Emojisets:()=>Jne,EncryptedDirectMessage:()=>ene,EncryptedDirectMessages:()=>tne,EventDeletion:()=>nne,FileMetadata:()=>sne,FileServerPreference:()=>One,Followsets:()=>Rne,GenericRepost:()=>ine,Genericlists:()=>Fne,HTTPAuth:()=>L3,Handlerinformation:()=>ire,Handlerrecommendation:()=>rre,Highlights:()=>vne,InterestsList:()=>Tne,Interestsets:()=>qne,JobFeedback:()=>mne,JobRequest:()=>hne,JobResult:()=>pne,Label:()=>fne,LightningPubRPC:()=>Nne,LiveChatMessage:()=>ane,LiveEvent:()=>Gne,LongFormArticle:()=>Hne,Metadata:()=>Zte,Mutelist:()=>wne,NWCWalletInfo:()=>Dne,NWCWalletRequest:()=>d$,NWCWalletResponse:()=>$ne,NostrConnect:()=>Ine,OpenTimestamps:()=>one,Pinlist:()=>kne,ProblemTracker:()=>lne,ProfileBadges:()=>zne,PublicChatsList:()=>Cne,Reaction:()=>F3,RecommendRelay:()=>Qte,RelayList:()=>xne,Relaysets:()=>Lne,Report:()=>une,Reporting:()=>cne,Repost:()=>R3,SearchRelaysList:()=>Ane,ShortTextNote:()=>Yte,Time:()=>ere,UserEmojiList:()=>Mne,UserStatuses:()=>Zne,Zap:()=>bne,ZapGoal:()=>gne,ZapRequest:()=>yne,classifyKind:()=>Gte,isEphemeralKind:()=>i$,isParameterizedReplaceableKind:()=>o$,isRegularKind:()=>n$,isReplaceableKind:()=>r$});function n$(t){return 1e3<=t&&t<1e4||[1,2,4,5,6,7,8,16,40,41,42,43,44].includes(t)}function r$(t){return[0,3].includes(t)||1e4<=t&&t<2e4}function i$(t){return 2e4<=t&&t<3e4}function o$(t){return 3e4<=t&&t<4e4}function Gte(t){return n$(t)?"regular":r$(t)?"replaceable":i$(t)?"ephemeral":o$(t)?"parameterized":"unknown"}var Zte=0,Yte=1,Qte=2,Xte=3,ene=4,tne=4,nne=5,R3=6,F3=7,rne=8,ine=16,s$=40,a$=41,l$=42,u$=43,c$=44,one=1040,sne=1063,ane=1311,lne=1971,une=1984,cne=1984,fne=1985,dne=4550,hne=5999,pne=6999,mne=7e3,gne=9041,yne=9734,bne=9735,vne=9802,wne=1e4,kne=10001,xne=10002,Ene=10003,Sne=10004,Cne=10005,_ne=10006,Ane=10007,Tne=10015,Mne=10030,One=10096,Dne=13194,Nne=21e3,f$=22242,d$=23194,$ne=23195,Ine=24133,L3=27235,Rne=3e4,Fne=30001,Lne=30002,Bne=30003,Pne=30004,zne=30008,jne=30009,qne=30015,Une=30017,Vne=30018,Hne=30023,Wne=30024,Jne=30030,Kne=30078,Gne=30311,Zne=30315,Yne=30402,Qne=30403,Xne=31922,ere=31923,tre=31924,nre=31925,rre=31989,ire=31990,ore=34550,sre={};Vt(sre,{getHex64:()=>B3,getInt:()=>h$,getSubscriptionId:()=>are,matchEventId:()=>lre,matchEventKind:()=>cre,matchEventPubkey:()=>ure});function B3(t,e){let n=e.length+3,r=t.indexOf(`"${e}":`)+n,i=t.slice(r).indexOf('"')+r+1;return t.slice(i,i+64)}function h$(t,e){let n=e.length,r=t.indexOf(`"${e}":`)+n+3,i=t.slice(r),o=Math.min(i.indexOf(","),i.indexOf("}"));return parseInt(i.slice(0,o),10)}function are(t){let e=t.slice(0,22).indexOf('"EVENT"');if(e===-1)return null;let n=t.slice(e+7+1).indexOf('"');if(n===-1)return null;let r=e+7+1+n,i=t.slice(r+1,80).indexOf('"');if(i===-1)return null;let o=r+1+i;return t.slice(r+1,o)}function lre(t,e){return e===B3(t,"id")}function ure(t,e){return e===B3(t,"pubkey")}function cre(t,e){return e===h$(t,"kind")}var fre={};Vt(fre,{makeAuthEvent:()=>dre});function dre(t,e){return{kind:f$,created_at:Math.floor(Date.now()/1e3),tags:[["relay",t],["challenge",e]],content:""}}var hre;try{hre=WebSocket}catch{}var pre;try{pre=WebSocket}catch{}var Wo={};Vt(Wo,{BECH32_REGEX:()=>p$,Bech32MaxSize:()=>P3,decode:()=>Tg,encodeBytes:()=>Mg,naddrEncode:()=>kre,neventEncode:()=>wre,noteEncode:()=>bre,nprofileEncode:()=>vre,npubEncode:()=>yre,nrelayEncode:()=>xre,nsecEncode:()=>gre});var P3=5e3,p$=/[\x21-\x7E]{1,83}1[023456789acdefghjklmnpqrstuvwxyz]{6,}/;function mre(t){const e=new Uint8Array(4);return e[0]=t>>24&255,e[1]=t>>16&255,e[2]=t>>8&255,e[3]=t&255,e}function Tg(t){var e,n,r,i,o,s,a,l;let{prefix:u,words:c}=pc.decode(t,P3),f=new Uint8Array(pc.fromWords(c));switch(u){case"nprofile":{let d=Tp(f);if(!((e=d[0])!=null&&e[0]))throw new Error("missing TLV 0 for nprofile");if(d[0][0].length!==32)throw new Error("TLV 0 should be 32 bytes");return{type:"nprofile",data:{pubkey:ln(d[0][0]),relays:d[1]?d[1].map(h=>to.decode(h)):[]}}}case"nevent":{let d=Tp(f);if(!((n=d[0])!=null&&n[0]))throw new Error("missing TLV 0 for nevent");if(d[0][0].length!==32)throw new Error("TLV 0 should be 32 bytes");if(d[2]&&d[2][0].length!==32)throw new Error("TLV 2 should be 32 bytes");if(d[3]&&d[3][0].length!==4)throw new Error("TLV 3 should be 4 bytes");return{type:"nevent",data:{id:ln(d[0][0]),relays:d[1]?d[1].map(h=>to.decode(h)):[],author:(r=d[2])!=null&&r[0]?ln(d[2][0]):void 0,kind:(i=d[3])!=null&&i[0]?parseInt(ln(d[3][0]),16):void 0}}}case"naddr":{let d=Tp(f);if(!((o=d[0])!=null&&o[0]))throw new Error("missing TLV 0 for naddr");if(!((s=d[2])!=null&&s[0]))throw new Error("missing TLV 2 for naddr");if(d[2][0].length!==32)throw new Error("TLV 2 should be 32 bytes");if(!((a=d[3])!=null&&a[0]))throw new Error("missing TLV 3 for naddr");if(d[3][0].length!==4)throw new Error("TLV 3 should be 4 bytes");return{type:"naddr",data:{identifier:to.decode(d[0][0]),pubkey:ln(d[2][0]),kind:parseInt(ln(d[3][0]),16),relays:d[1]?d[1].map(h=>to.decode(h)):[]}}}case"nrelay":{let d=Tp(f);if(!((l=d[0])!=null&&l[0]))throw new Error("missing TLV 0 for nrelay");return{type:"nrelay",data:to.decode(d[0][0])}}case"nsec":return{type:u,data:f};case"npub":case"note":return{type:u,data:ln(f)};default:throw new Error(`unknown prefix ${u}`)}}function Tp(t){let e={},n=t;for(;n.length>0;){let r=n[0],i=n[1],o=n.slice(2,2+i);if(n=n.slice(2+i),o.lengthFi.encode(n))});return Mh("nprofile",e)}function wre(t){let e;t.kind!==void 0&&(e=mre(t.kind));let n=Og({0:[hc(t.id)],1:(t.relays||[]).map(r=>Fi.encode(r)),2:t.author?[hc(t.author)]:[],3:e?[new Uint8Array(e)]:[]});return Mh("nevent",n)}function kre(t){let e=new ArrayBuffer(4);new DataView(e).setUint32(0,t.kind,!1);let n=Og({0:[Fi.encode(t.identifier)],1:(t.relays||[]).map(r=>Fi.encode(r)),2:[hc(t.pubkey)],3:[new Uint8Array(e)]});return Mh("naddr",n)}function xre(t){let e=Og({0:[Fi.encode(t)]});return Mh("nrelay",e)}function Og(t){let e=[];return Object.entries(t).reverse().forEach(([n,r])=>{r.forEach(i=>{let o=new Uint8Array(i.length+2);o.set([parseInt(n)],0),o.set([i.length],1),o.set(i,2),e.push(o)})}),pg(...e)}var Ere={};Vt(Ere,{decrypt:()=>Sre,encrypt:()=>m$});async function m$(t,e,n){const r=t instanceof Uint8Array?ln(t):t,i=Lc.getSharedSecret(r,"02"+e),o=g$(i);let s=Uint8Array.from(jD(16)),a=Fi.encode(n),l=KN(o,s).encrypt(a),u=ko.encode(new Uint8Array(l)),c=ko.encode(new Uint8Array(s.buffer));return`${u}?iv=${c}`}async function Sre(t,e,n){const r=t instanceof Uint8Array?ln(t):t;let[i,o]=n.split("?iv="),s=Lc.getSharedSecret(r,"02"+e),a=g$(s),l=ko.decode(o),u=ko.decode(i),c=KN(a,l).decrypt(u);return to.decode(c)}function g$(t){return t.slice(1,33)}var Cre={};Vt(Cre,{NIP05_REGEX:()=>y$,isValid:()=>Tre,queryProfile:()=>b$,searchDomain:()=>Are,useFetchImplementation:()=>_re});var y$=/^(?:([\w.+-]+)@)?([\w_-]+(\.[\w_-]+)+)$/,Dg;try{Dg=fetch}catch{}function _re(t){Dg=t}async function Are(t,e=""){try{const n=`https://${t}/.well-known/nostr.json?name=${e}`;return(await(await Dg(n,{redirect:"error"})).json()).names}catch{return{}}}async function b$(t){var e;const n=t.match(y$);if(!n)return null;const[r,i="_",o]=n;try{const s=`https://${o}/.well-known/nostr.json?name=${i}`,a=await(await Dg(s,{redirect:"error"})).json();let l=a.names[i];return l?{pubkey:l,relays:(e=a.relays)==null?void 0:e[l]}:null}catch{return null}}async function Tre(t,e){let n=await b$(e);return n?n.pubkey===t:!1}var Mre={};Vt(Mre,{parse:()=>Ore});function Ore(t){const e={reply:void 0,root:void 0,mentions:[],profiles:[]},n=[];for(const r of t.tags)r[0]==="e"&&r[1]&&n.push(r),r[0]==="p"&&r[1]&&e.profiles.push({pubkey:r[1],relays:r[2]?[r[2]]:[]});for(let r=0;r$re,useFetchImplementation:()=>Nre});var v$;try{v$=fetch}catch{}function Nre(t){v$=t}async function $re(t){return await(await fetch(t.replace("ws://","http://").replace("wss://","https://"),{headers:{Accept:"application/nostr+json"}})).json()}var Ire={};Vt(Ire,{getPow:()=>w$,minePow:()=>Rre});function w$(t){let e=0;for(let n=0;n=e)break}return r}var Fre={};Vt(Fre,{finishRepostEvent:()=>Lre,getRepostedEvent:()=>Bre,getRepostedEventPointer:()=>k$});function Lre(t,e,n,r){return Ma({kind:R3,tags:[...t.tags??[],["e",e.id,n],["p",e.pubkey]],content:t.content===""?"":JSON.stringify(e),created_at:t.created_at},r)}function k$(t){if(t.kind!==R3)return;let e,n;for(let r=t.tags.length-1;r>=0&&(e===void 0||n===void 0);r--){const i=t.tags[r];i.length>=2&&(i[0]==="e"&&e===void 0?e=i:i[0]==="p"&&n===void 0&&(n=i))}if(e!==void 0)return{id:e[1],relays:[e[2],n==null?void 0:n[2]].filter(r=>typeof r=="string"),author:n==null?void 0:n[1]}}function Bre(t,{skipVerification:e}={}){const n=k$(t);if(n===void 0||t.content==="")return;let r;try{r=JSON.parse(t.content)}catch{return}if(r.id===n.id&&!(!e&&!I3(r)))return r}var Pre={};Vt(Pre,{NOSTR_URI_REGEX:()=>Ng,parse:()=>jre,test:()=>zre});var Ng=new RegExp(`nostr:(${p$.source})`);function zre(t){return typeof t=="string"&&new RegExp(`^${Ng.source}$`).test(t)}function jre(t){const e=t.match(new RegExp(`^${Ng.source}$`));if(!e)throw new Error(`Invalid Nostr URI: ${t}`);return{uri:e[0],value:e[1],decoded:Tg(e[1])}}var qre={};Vt(qre,{finishReactionEvent:()=>Ure,getReactedEventPointer:()=>Vre});function Ure(t,e,n){const r=e.tags.filter(i=>i.length>=2&&(i[0]==="e"||i[0]==="p"));return Ma({...t,kind:F3,tags:[...t.tags??[],...r,["e",e.id],["p",e.pubkey]],content:t.content??"+"},n)}function Vre(t){if(t.kind!==F3)return;let e,n;for(let r=t.tags.length-1;r>=0&&(e===void 0||n===void 0);r--){const i=t.tags[r];i.length>=2&&(i[0]==="e"&&e===void 0?e=i:i[0]==="p"&&n===void 0&&(n=i))}if(!(e===void 0||n===void 0))return{id:e[1],relays:[e[2],n[2]].filter(r=>r!==void 0),author:n[1]}}var Hre={};Vt(Hre,{matchAll:()=>Wre,regex:()=>z3,replaceAll:()=>Jre});var z3=()=>new RegExp(`\\b${Ng.source}\\b`,"g");function*Wre(t){const e=t.matchAll(z3());for(const n of e)try{const[r,i]=n;yield{uri:r,value:i,decoded:Tg(i),start:n.index,end:n.index+r.length}}catch{}}function Jre(t,e){return t.replaceAll(z3(),(n,r)=>e({uri:n,value:r,decoded:Tg(r)}))}var Kre={};Vt(Kre,{channelCreateEvent:()=>Gre,channelHideMessageEvent:()=>Qre,channelMessageEvent:()=>Yre,channelMetadataEvent:()=>Zre,channelMuteUserEvent:()=>Xre});var Gre=(t,e)=>{let n;if(typeof t.content=="object")n=JSON.stringify(t.content);else if(typeof t.content=="string")n=t.content;else return;return Ma({kind:s$,tags:[...t.tags??[]],content:n,created_at:t.created_at},e)},Zre=(t,e)=>{let n;if(typeof t.content=="object")n=JSON.stringify(t.content);else if(typeof t.content=="string")n=t.content;else return;return Ma({kind:a$,tags:[["e",t.channel_create_event_id],...t.tags??[]],content:n,created_at:t.created_at},e)},Yre=(t,e)=>{const n=[["e",t.channel_create_event_id,t.relay_url,"root"]];return t.reply_to_channel_message_event_id&&n.push(["e",t.reply_to_channel_message_event_id,t.relay_url,"reply"]),Ma({kind:l$,tags:[...n,...t.tags??[]],content:t.content,created_at:t.created_at},e)},Qre=(t,e)=>{let n;if(typeof t.content=="object")n=JSON.stringify(t.content);else if(typeof t.content=="string")n=t.content;else return;return Ma({kind:u$,tags:[["e",t.channel_message_event_id],...t.tags??[]],content:n,created_at:t.created_at},e)},Xre=(t,e)=>{let n;if(typeof t.content=="object")n=JSON.stringify(t.content);else if(typeof t.content=="string")n=t.content;else return;return Ma({kind:c$,tags:[["p",t.pubkey_to_mute],...t.tags??[]],content:n,created_at:t.created_at},e)},eie={};Vt(eie,{EMOJI_SHORTCODE_REGEX:()=>x$,matchAll:()=>tie,regex:()=>j3,replaceAll:()=>nie});var x$=/:(\w+):/,j3=()=>new RegExp(`\\B${x$.source}\\B`,"g");function*tie(t){const e=t.matchAll(j3());for(const n of e)try{const[r,i]=n;yield{shortcode:r,name:i,start:n.index,end:n.index+r.length}}catch{}}function nie(t,e){return t.replaceAll(j3(),(n,r)=>e({shortcode:n,name:r}))}var rie={};Vt(rie,{useFetchImplementation:()=>iie,validateGithub:()=>oie});var q3;try{q3=fetch}catch{}function iie(t){q3=t}async function oie(t,e,n){try{return await(await q3(`https://gist.github.com/${e}/${n}/raw`)).text()===`Verifying that I control the following Nostr public key: ${t}`}catch{return!1}}var sie={};Vt(sie,{decrypt:()=>M$,encrypt:()=>T$,getConversationKey:()=>C$,v2:()=>fie});var E$=1,S$=65535;function C$(t,e){const n=Lc.getSharedSecret(t,"02"+e).subarray(1,33);return Lte(Rc,n,"nip44-v2")}function _$(t,e){const n=Bte(Rc,t,e,76);return{chacha_key:n.subarray(0,32),chacha_nonce:n.subarray(32,44),hmac_key:n.subarray(44,76)}}function U3(t){if(!Number.isSafeInteger(t)||t<1)throw new Error("expected positive integer");if(t<=32)return 32;const e=1<S$)throw new Error("invalid plaintext size: must be between 1 and 65535 bytes");const e=new Uint8Array(2);return new DataView(e.buffer).setUint16(0,t,!1),e}function lie(t){const e=Fi.encode(t),n=e.length,r=aie(n),i=new Uint8Array(U3(n)-n);return pg(r,e,i)}function uie(t){const e=new DataView(t.buffer).getUint16(0),n=t.subarray(2,2+e);if(eS$||n.length!==e||t.length!==2+U3(e))throw new Error("invalid padding");return to.decode(n)}function A$(t,e,n){if(n.length!==32)throw new Error("AAD associated data must be 32 bytes");const r=pg(n,e);return _g(Rc,t,r)}function cie(t){if(typeof t!="string")throw new Error("payload must be a valid string");const e=t.length;if(e<132||e>87472)throw new Error("invalid payload length: "+e);if(t[0]==="#")throw new Error("unknown encryption version");let n;try{n=ko.decode(t)}catch(o){throw new Error("invalid base64: "+o.message)}const r=n.length;if(r<99||r>65603)throw new Error("invalid data length: "+r);const i=n[0];if(i!==2)throw new Error("unknown encryption version "+i);return{nonce:n.subarray(1,33),ciphertext:n.subarray(33,-32),mac:n.subarray(-32)}}function T$(t,e,n=jD(32)){const{chacha_key:r,chacha_nonce:i,hmac_key:o}=_$(e,n),s=lie(t),a=QN(r,i,s),l=A$(o,a,n);return ko.encode(pg(new Uint8Array([2]),n,a,l))}function M$(t,e){const{nonce:n,ciphertext:r,mac:i}=cie(t),{chacha_key:o,chacha_nonce:s,hmac_key:a}=_$(e,n),l=A$(a,r,n);if(!bte(l,i))throw new Error("invalid MAC");const u=QN(o,s,r);return uie(u)}var fie={utils:{getConversationKey:C$,calcPaddedLen:U3},encrypt:T$,decrypt:M$},die={};Vt(die,{makeNwcRequestEvent:()=>pie,parseConnectionString:()=>hie});function hie(t){const{pathname:e,searchParams:n}=new URL(t),r=e,i=n.get("relay"),o=n.get("secret");if(!r||!i||!o)throw new Error("invalid connection string");return{pubkey:r,relay:i,secret:o}}async function pie(t,e,n){const i=await m$(e,t,JSON.stringify({method:"pay_invoice",params:{invoice:n}})),o={kind:d$,created_at:Math.round(Date.now()/1e3),content:i,tags:[["p",t]]};return Ma(o,e)}var mie={};Vt(mie,{getZapEndpoint:()=>yie,makeZapReceipt:()=>wie,makeZapRequest:()=>bie,useFetchImplementation:()=>gie,validateZapRequest:()=>vie});var V3;try{V3=fetch}catch{}function gie(t){V3=t}async function yie(t){try{let e="",{lud06:n,lud16:r}=JSON.parse(t.content);if(n){let{words:s}=pc.decode(n,1e3),a=pc.fromWords(s);e=to.decode(a)}else if(r){let[s,a]=r.split("@");e=new URL(`/.well-known/lnurlp/${s}`,`https://${a}`).toString()}else return null;let o=await(await V3(e)).json();if(o.allowsNostr&&o.nostrPubkey)return o.callback}catch{}return null}function bie({profile:t,event:e,amount:n,relays:r,comment:i=""}){if(!n)throw new Error("amount not given");if(!t)throw new Error("profile not given");let o={kind:9734,created_at:Math.round(Date.now()/1e3),content:i,tags:[["p",t],["amount",n.toString()],["relays",...r]]};return e&&o.tags.push(["e",e]),o}function vie(t){let e;try{e=JSON.parse(t)}catch{return"Invalid zap request JSON."}if(!e$(e))return"Zap request is not a valid Nostr event.";if(!I3(e))return"Invalid signature on zap request.";let n=e.tags.find(([o,s])=>o==="p"&&s);if(!n)return"Zap request doesn't have a 'p' tag.";if(!n[1].match(/^[a-f0-9]{64}$/))return"Zap request 'p' tag is not valid hex.";let r=e.tags.find(([o,s])=>o==="e"&&s);return r&&!r[1].match(/^[a-f0-9]{64}$/)?"Zap request 'e' tag is not valid hex.":e.tags.find(([o,s])=>o==="relays"&&s)?null:"Zap request doesn't have a 'relays' tag."}function wie({zapRequest:t,preimage:e,bolt11:n,paidAt:r}){let i=JSON.parse(t),o=i.tags.filter(([a])=>a==="e"||a==="p"||a==="a"),s={kind:9735,created_at:Math.round(r.getTime()/1e3),content:"",tags:[...o,["P",i.pubkey],["bolt11",n],["description",t]]};return e&&s.tags.push(["preimage",e]),s}var kie={};Vt(kie,{getToken:()=>xie,hashPayload:()=>H3,unpackEventFromToken:()=>D$,validateEvent:()=>L$,validateEventKind:()=>$$,validateEventMethodTag:()=>R$,validateEventPayloadTag:()=>F$,validateEventTimestamp:()=>N$,validateEventUrlTag:()=>I$,validateToken:()=>Eie});var O$="Nostr ";async function xie(t,e,n,r=!1,i){const o={kind:L3,tags:[["u",t],["method",e]],created_at:Math.round(new Date().getTime()/1e3),content:""};i&&o.tags.push(["payload",H3(i)]);const s=await n(o);return(r?O$:"")+ko.encode(Fi.encode(JSON.stringify(s)))}async function Eie(t,e,n){const r=await D$(t).catch(o=>{throw o});return await L$(r,e,n).catch(o=>{throw o})}async function D$(t){if(!t)throw new Error("Missing token");t=t.replace(O$,"");const e=to.decode(ko.decode(t));if(!e||e.length===0||!e.startsWith("{"))throw new Error("Invalid token");return JSON.parse(e)}function N$(t){return t.created_at?Math.round(new Date().getTime()/1e3)-t.created_at<60:!1}function $$(t){return t.kind===L3}function I$(t,e){const n=t.tags.find(r=>r[0]==="u");return n?n.length>0&&n[1]===e:!1}function R$(t,e){const n=t.tags.find(r=>r[0]==="method");return n?n.length>0&&n[1].toLowerCase()===e.toLowerCase():!1}function H3(t){const e=Rc(Fi.encode(JSON.stringify(t)));return ln(e)}function F$(t,e){const n=t.tags.find(i=>i[0]==="payload");if(!n)return!1;const r=H3(e);return n.length>0&&n[1]===r}async function L$(t,e,n,r){if(!I3(t))throw new Error("Invalid nostr event, signature invalid");if(!$$(t))throw new Error("Invalid nostr event, kind invalid");if(!N$(t))throw new Error("Invalid nostr event, created_at timestamp invalid");if(!I$(t,e))throw new Error("Invalid nostr event, url tag invalid");if(!R$(t,n))throw new Error("Invalid nostr event, method tag invalid");if(r&&typeof r=="object"&&Object.keys(r).length>0&&!F$(t,r))throw new Error("Invalid nostr event, payload tag does not match request body hash");return!0}const Sie=/(nostr:)?(naddr1[0-9a-z]+)/g,Cie=Ri.create({name:"naddr",group:"block",atom:!0,selectable:!0,draggable:!0,priority:1e3,addAttributes(){return{naddr:{default:null},identifier:{default:null},pubkey:{default:null},kind:{default:null},relays:{default:[]}}},renderHTML(t){return["div",{"data-naddr":t.node.attrs.naddr}]},renderText(t){return t.node.attrs.naddr},addStorage(){return{markdown:{serialize(t,e){t.write(e.attrs.naddr)},parse:{}}}},addCommands(){return{insertNAddr:({naddr:t})=>({commands:e})=>{var n;const r=t.split(":"),i=(n=Wo.decode(r[r.length-1]))==null?void 0:n.data;return e.insertContent({type:this.name,attrs:{...i,naddr:t}},{updateSelection:!1})}}},addPasteRules(){return[Sh({type:this.type,getAttributes:t=>t.data,find:t=>{const e=[];for(const n of t.matchAll(Sie))try{const r=n[0],i=Wo.decode(n[2]).data;e.push(dc(n,{...i,naddr:r}))}catch{continue}return e}})]}}),_ie=/(nostr:)?(note1[0-9a-z]+)/g,Aie=/(nostr:)?(nevent1[0-9a-z]+)/g,Tie=Ri.create({name:"nevent",group:"block",selectable:!0,draggable:!0,priority:1e3,addAttributes(){return{id:{default:null},kind:{default:null},author:{default:null},relays:{default:[]},nevent:{default:null}}},renderHTML(t){return["div",{"data-nevent":t.node.attrs.nevent}]},renderText(t){return t.node.attrs.nevent},parseHTML(){return[{tag:"div[data-nevent]"}]},addStorage(){return{markdown:{serialize(t,e){t.write(e.attrs.nevent)},parse:{}}}},addCommands(){return{insertNEvent:({nevent:t})=>({commands:e})=>{var n;const r=t.split(":"),i=(n=Wo.decode(r[r.length-1]))==null?void 0:n.data;return e.insertContent({type:this.name,attrs:{...i,nevent:t}},{updateSelection:!1})}}},addPasteRules(){return[Sh({type:this.type,getAttributes:t=>t.data,find:t=>{const e=[];for(const n of t.matchAll(_ie))try{const r=Wo.decode(n[2]).data,i=n[0];e.push(dc(n,{id:r,nevent:i}))}catch{continue}for(const n of t.matchAll(Aie))try{const r=Wo.decode(n[2]).data,i=n[0];e.push(dc(n,{...r,nevent:i}))}catch{continue}return e}})]}}),Mie=/^(https?:\/\/)?(www\.|music\.)?(youtube\.com|youtu\.be|youtube-nocookie\.com)\/(?!channel\/)(?!@)(.+)?$/,Oie=/^(https?:\/\/)?(www\.|music\.)?(youtube\.com|youtu\.be)\/(?!channel\/)(?!@)(.+)?$/g,B$=t=>t.match(Mie),u_=t=>t?"https://www.youtube-nocookie.com/embed/":"https://www.youtube.com/embed/",Die=t=>{const{url:e,allowFullscreen:n,autoplay:r,ccLanguage:i,ccLoadPolicy:o,controls:s,disableKBcontrols:a,enableIFrameApi:l,endTime:u,interfaceLanguage:c,ivLoadPolicy:f,loop:d,modestBranding:h,nocookie:p,origin:m,playlist:b,progressBarColor:y,startAt:v}=t;if(!B$(e))return null;if(e.includes("/embed/"))return e;if(e.includes("youtu.be")){const E=e.split("/").pop();return E?`${u_(p)}${E}`:null}const g=/(?:v=|shorts\/)([-\w]+)/gm.exec(e);if(!g||!g[1])return null;let x=`${u_(p)}${g[1]}`;const k=[];return n===!1&&k.push("fs=0"),r&&k.push("autoplay=1"),i&&k.push(`cc_lang_pref=${i}`),o&&k.push("cc_load_policy=1"),s||k.push("controls=0"),a&&k.push("disablekb=1"),l&&k.push("enablejsapi=1"),u&&k.push(`end=${u}`),c&&k.push(`hl=${c}`),f&&k.push(`iv_load_policy=${f}`),d&&k.push("loop=1"),h&&k.push("modestbranding=1"),m&&k.push(`origin=${m}`),b&&k.push(`playlist=${b}`),v&&k.push(`start=${v}`),y&&k.push(`color=${y}`),k.length&&(x+=`?${k.join("&")}`),x},Nie=Ri.create({name:"youtube",addOptions(){return{addPasteHandler:!0,allowFullscreen:!0,autoplay:!1,ccLanguage:void 0,ccLoadPolicy:void 0,controls:!0,disableKBcontrols:!1,enableIFrameApi:!1,endTime:0,height:480,interfaceLanguage:void 0,ivLoadPolicy:0,loop:!1,modestBranding:!1,HTMLAttributes:{},inline:!1,nocookie:!1,origin:"",playlist:"",progressBarColor:void 0,width:640}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},start:{default:0},width:{default:this.options.width},height:{default:this.options.height}}},parseHTML(){return[{tag:"div[data-youtube-video] iframe"}]},addCommands(){return{setYoutubeVideo:t=>({commands:e})=>B$(t.src)?e.insertContent({type:this.name,attrs:t}):!1}},addPasteRules(){return this.options.addPasteHandler?[Sh({find:Oie,type:this.type,getAttributes:t=>({src:t.input})})]:[]},renderHTML({HTMLAttributes:t}){const e=Die({url:t.src,allowFullscreen:this.options.allowFullscreen,autoplay:this.options.autoplay,ccLanguage:this.options.ccLanguage,ccLoadPolicy:this.options.ccLoadPolicy,controls:this.options.controls,disableKBcontrols:this.options.disableKBcontrols,enableIFrameApi:this.options.enableIFrameApi,endTime:this.options.endTime,interfaceLanguage:this.options.interfaceLanguage,ivLoadPolicy:this.options.ivLoadPolicy,loop:this.options.loop,modestBranding:this.options.modestBranding,nocookie:this.options.nocookie,origin:this.options.origin,playlist:this.options.playlist,progressBarColor:this.options.progressBarColor,startAt:t.start||0});return t.src=e,["div",{"data-youtube-video":""},["iframe",qd(this.options.HTMLAttributes,{width:this.options.width,height:this.options.height,allowfullscreen:this.options.allowFullscreen,autoplay:this.options.autoplay,ccLanguage:this.options.ccLanguage,ccLoadPolicy:this.options.ccLoadPolicy,disableKBcontrols:this.options.disableKBcontrols,enableIFrameApi:this.options.enableIFrameApi,endTime:this.options.endTime,interfaceLanguage:this.options.interfaceLanguage,ivLoadPolicy:this.options.ivLoadPolicy,loop:this.options.loop,modestBranding:this.options.modestBranding,origin:this.options.origin,playlist:this.options.playlist,progressBarColor:this.options.progressBarColor},t)]]}}),$ie={bh:"blurhash"};function Iie(t){const e={};for(const n of t)if(n[0]==="imeta"){let r;for(const[i,o]of n.map(s=>s.split(/ (.+)/))){const s=$ie[i]||i;if(s==="url"&&(r=o,e[r]??(e[r]={})),o&&r)switch(s){case"fallback":{e[r].fallback=[...e[r].fallback||[],o];break}case"dim":{const a=o.split("x");e[r].dim={width:parseInt(a[0]),height:parseInt(a[1])};break}default:{e[r][s]=o;break}}}}return e}const Rie=/(nostr:)?(npub1[0-9a-z]+)/g,Fie=/(nostr:)?(nprofile1[0-9a-z]+)/g,Lie=Ri.create({name:"nprofile",inline:!0,group:"inline",atom:!0,priority:1e3,addAttributes(){return{nprofile:{default:null},pubkey:{default:null},relays:{default:[]}}},renderHTML({HTMLAttributes:t}){return["span",qd(t,{"data-type":"nprofile"}),"@"]},renderText(t){return t.node.attrs.nprofile},addStorage(){return{markdown:{serialize(t,e){t.write(e.attrs.nprofile)},parse:{}}}},addCommands(){return{insertNProfile:({nprofile:t})=>({chain:e})=>{var n;const r=t.split(":"),i=(n=Wo.decode(r[r.length-1]))==null?void 0:n.data;return e().insertContent({type:this.name,attrs:{...i,nprofile:t}}).insertContent(" ").run()}}},addPasteRules(){return[Sh({type:this.type,getAttributes:t=>t.data,find:t=>{const e=[];for(const n of t.matchAll(Rie))try{const r=n[0],i=Wo.decode(n[2]).data;e.push(dc(n,{pubkey:i,nprofile:r}))}catch{continue}for(const n of t.matchAll(Fie))try{const r=n[0],i=Wo.decode(n[2]).data;e.push(dc(n,{...i,nprofile:r}))}catch{continue}return e}})]}}),Bie=/(nsec1[0-9a-z]+)/g,Pie=is.create({name:"nsecReject",addOptions(){return{}},addPasteRules(){return[{find:Bie,handler:t=>{if(t.chain().deleteRange(t.range).insertContentAt(t.range.from,{text:"*NSEC_DELETED*",type:"text"}).run(),this.options.onError){this.options.onError(t);return}window.alert("DO NOT PASTE YOUR NSEC INTO THE EDITOR")}}]}}),zie=/(#[^\s]+)/g,jie=/(#[^\s]+)$/g,qie=Ud.create({name:"tag",inline:!0,selectable:!0,inclusive:!1,group:"inline",priority:100,addStorage(){return{markdown:{serialize:{open:"",close:"",mixable:!1,expelEnclosingWhitespace:!0},parse:{}}}},renderHTML(t){return["a",{...t.mark.attrs},0]},addAttributes(){return{tag:{default:null}}},addPasteRules(){return[ID({find:zie,getAttributes:t=>({tag:t[0]}),type:this.type})]},addInputRules(){return[{find:jie,handler:({state:t,range:e,match:n})=>{t.tr.delete(e.from,e.to).insertText(n[0]).addMark(e.from,e.to+1,this.type.create({tag:n[0]}))}}]}}),Uie=Ri.create({name:"tweet",group:"block",selectable:!0,draggable:!0,addAttributes(){return{src:{default:null}}},addStorage(){return{markdown:{serialize(t,e){t.write(e.attrs.src)},parse:{}}}},renderText(t){return t.node.attrs.src},renderHTML(){return["div",{}]}}),Vie=Ri.create({name:"video",inline:!1,group:"block",atom:!0,selectable:!0,draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},file:{default:null},sha256:{default:null},uploading:{default:!1},uploadError:{default:null},uploadType:{default:"nip96"},uploadUrl:{default:"https://nostr.build"}}},renderText(t){return t.node.attrs.src},renderHTML(){return["video",{}]},addStorage(){return{markdown:{serialize:LN.nodes.image,parse:{}}}}}),Hw=is.create({name:"nostr",addExtensions(){const{extend:t={}}=this.options,e=[];return this.options.nprofile!==!1&&e.push(Lie.extend(t.nprofile)),this.options.nevent!==!1&&e.push(Tie.extend(t.nevent)),this.options.naddr!==!1&&e.push(Cie.extend(t.naddr)),this.options.link!==!1&&e.push(pte.extend(t.link).configure(this.options.link)),this.options.tag!==!1&&e.push(qie.extend(t.tag)),this.options.youtube!==!1&&e.push(Nie.extend({renderText:n=>n.node.attrs.src,...t.youtube})),this.options.image!==!1&&e.push(Uee.configure(this.options.image).extend(t.image)),this.options.video!==!1&&e.push(Vie.extend(t.video)),this.options.tweet!==!1&&e.push(Uie.extend(t.tweet)),this.options.bolt11!==!1&&e.push(yZ.extend(t.bolt11)),this.options.nsecReject!==!1&&e.push(Pie),this.options.fileUpload!==!1&&e.push(HY.configure(this.options.fileUpload)),e},addStorage(){return{imeta:null,pending:!1,setImeta:()=>{},getNprofiles:()=>[],getNevents:()=>[]}},onBeforeCreate(){this.storage.setImeta=t=>{this.storage.imeta=t},this.storage.getNprofiles=()=>{const t=[];return this.editor.state.doc.descendants(e=>{e.type.name==="nprofile"&&t.push(e.attrs)}),t},this.storage.getNevents=()=>{const t=[];return this.editor.state.doc.descendants(e=>{e.type.name==="nevents"&&t.push(e.attrs)}),t}},addCommands(){return{setEventContent:(t,e)=>n=>(this.storage.setImeta(e||Iie(t.tags)),n.chain().setMeta("parse",!0).setMeta("uiEvent","paste").setContent(t.kind===1?t.content.replace(/(\n)+/g,"
"):t.content),!0),setEventContentKind0:t=>e=>{if(t.kind!==0)return!1;let n;try{n=JSON.parse(t.content)}catch{return!1}return e.chain().setMeta("parse",!0).setMeta("uiEvent","paste").setContent(n.about,!0),!0}}}});function c_(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function P$(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function Hie(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");c_(t.outputLen),c_(t.blockLen)}function s1(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function Wie(t,e){P$(t);const n=e.outputLen;if(t.lengtht instanceof Uint8Array,Ub=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),Vi=(t,e)=>t<<32-e|t>>>e,Jie=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Jie)throw new Error("Non little-endian hardware is not supported");function Kie(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function W3(t){if(typeof t=="string"&&(t=Kie(t)),!z$(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}function Gie(...t){const e=new Uint8Array(t.reduce((r,i)=>r+i.length,0));let n=0;return t.forEach(r=>{if(!z$(r))throw new Error("Uint8Array expected");e.set(r,n),n+=r.length}),e}let j$=class{clone(){return this._cloneInto()}};function Zie(t){const e=r=>t().update(W3(r)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function q$(t=32){if(qb&&typeof qb.getRandomValues=="function")return qb.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}function Yie(t,e,n,r){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,n,r);const i=BigInt(32),o=BigInt(4294967295),s=Number(n>>i&o),a=Number(n&o),l=r?4:0,u=r?0:4;t.setUint32(e+l,s,r),t.setUint32(e+u,a,r)}let Qie=class extends j${constructor(e,n,r,i){super(),this.blockLen=e,this.outputLen=n,this.padOffset=r,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Ub(this.buffer)}update(e){s1(this);const{view:n,buffer:r,blockLen:i}=this;e=W3(e);const o=e.length;for(let s=0;si-s&&(this.process(r,0),s=0);for(let f=s;fc.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;ft&e^~t&n,eoe=(t,e,n)=>t&e^t&n^e&n,toe=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ws=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ks=new Uint32Array(64);let noe=class extends Qie{constructor(){super(64,32,8,!1),this.A=ws[0]|0,this.B=ws[1]|0,this.C=ws[2]|0,this.D=ws[3]|0,this.E=ws[4]|0,this.F=ws[5]|0,this.G=ws[6]|0,this.H=ws[7]|0}get(){const{A:e,B:n,C:r,D:i,E:o,F:s,G:a,H:l}=this;return[e,n,r,i,o,s,a,l]}set(e,n,r,i,o,s,a,l){this.A=e|0,this.B=n|0,this.C=r|0,this.D=i|0,this.E=o|0,this.F=s|0,this.G=a|0,this.H=l|0}process(e,n){for(let f=0;f<16;f++,n+=4)ks[f]=e.getUint32(n,!1);for(let f=16;f<64;f++){const d=ks[f-15],h=ks[f-2],p=Vi(d,7)^Vi(d,18)^d>>>3,m=Vi(h,17)^Vi(h,19)^h>>>10;ks[f]=m+ks[f-7]+p+ks[f-16]|0}let{A:r,B:i,C:o,D:s,E:a,F:l,G:u,H:c}=this;for(let f=0;f<64;f++){const d=Vi(a,6)^Vi(a,11)^Vi(a,25),h=c+d+Xie(a,l,u)+toe[f]+ks[f]|0,m=(Vi(r,2)^Vi(r,13)^Vi(r,22))+eoe(r,i,o)|0;c=u,u=l,l=a,a=s+h|0,s=o,o=i,i=r,r=h+m|0}r=r+this.A|0,i=i+this.B|0,o=o+this.C|0,s=s+this.D|0,a=a+this.E|0,l=l+this.F|0,u=u+this.G|0,c=c+this.H|0,this.set(r,i,o,s,a,l,u,c)}roundClean(){ks.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};const Ww=Zie(()=>new noe);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const U$=BigInt(0),$g=BigInt(1),roe=BigInt(2),Ig=t=>t instanceof Uint8Array,ioe=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function wc(t){if(!Ig(t))throw new Error("Uint8Array expected");let e="";for(let n=0;nr+i.length,0));let n=0;return t.forEach(r=>{if(!Ig(r))throw new Error("Uint8Array expected");e.set(r,n),n+=r.length}),e}function soe(t,e){if(t.length!==e.length)return!1;for(let n=0;nU$;t>>=$g,e+=1);return e}function uoe(t,e){return t>>BigInt(e)&$g}const coe=(t,e,n)=>t|(n?$g:U$)<(roe<new Uint8Array(t),f_=t=>Uint8Array.from(t);function H$(t,e,n){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=Vb(t),i=Vb(t),o=0;const s=()=>{r.fill(1),i.fill(0),o=0},a=(...f)=>n(i,r,...f),l=(f=Vb())=>{i=a(f_([0]),f),r=a(),f.length!==0&&(i=a(f_([1]),f),r=a())},u=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const d=[];for(;f{s(),l(f);let h;for(;!(h=d(u()));)l();return s(),h}}const foe={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||t instanceof Uint8Array,isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function Oh(t,e,n={}){const r=(i,o,s)=>{const a=foe[o];if(typeof a!="function")throw new Error(`Invalid validator "${o}", expected function`);const l=t[i];if(!(s&&l===void 0)&&!a(l,t))throw new Error(`Invalid param ${String(i)}=${l} (${typeof l}), expected ${o}`)};for(const[i,o]of Object.entries(e))r(i,o,!1);for(const[i,o]of Object.entries(n))r(i,o,!0);return t}const doe=Object.freeze(Object.defineProperty({__proto__:null,bitGet:uoe,bitLen:loe,bitMask:Z3,bitSet:coe,bytesToHex:wc,bytesToNumberBE:Sr,bytesToNumberLE:K3,concatBytes:$l,createHmacDrbg:H$,ensureBytes:Pn,equalBytes:soe,hexToBytes:kc,hexToNumber:J3,numberToBytesBE:ma,numberToBytesLE:G3,numberToHexUnpadded:V$,numberToVarBytesBE:ooe,utf8ToBytes:aoe,validateObject:Oh},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const hn=BigInt(0),Ut=BigInt(1),Ha=BigInt(2),hoe=BigInt(3),Jw=BigInt(4),d_=BigInt(5),h_=BigInt(8);BigInt(9);BigInt(16);function An(t,e){const n=t%e;return n>=hn?n:e+n}function poe(t,e,n){if(n<=hn||e 0");if(n===Ut)return hn;let r=Ut;for(;e>hn;)e&Ut&&(r=r*t%n),t=t*t%n,e>>=Ut;return r}function Xr(t,e,n){let r=t;for(;e-- >hn;)r*=r,r%=n;return r}function Kw(t,e){if(t===hn||e<=hn)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let n=An(t,e),r=e,i=hn,o=Ut;for(;n!==hn;){const a=r/n,l=r%n,u=i-o*a;r=n,n=l,i=o,o=u}if(r!==Ut)throw new Error("invert: does not exist");return An(i,e)}function moe(t){const e=(t-Ut)/Ha;let n,r,i;for(n=t-Ut,r=0;n%Ha===hn;n/=Ha,r++);for(i=Ha;i(r[i]="function",r),e);return Oh(t,n)}function voe(t,e,n){if(n 0");if(n===hn)return t.ONE;if(n===Ut)return e;let r=t.ONE,i=e;for(;n>hn;)n&Ut&&(r=t.mul(r,i)),i=t.sqr(i),n>>=Ut;return r}function woe(t,e){const n=new Array(e.length),r=e.reduce((o,s,a)=>t.is0(s)?o:(n[a]=o,t.mul(o,s)),t.ONE),i=t.inv(r);return e.reduceRight((o,s,a)=>t.is0(s)?o:(n[a]=t.mul(o,n[a]),t.mul(o,s)),i),n}function W$(t,e){const n=e!==void 0?e:t.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function koe(t,e,n=!1,r={}){if(t<=hn)throw new Error(`Expected Field ORDER > 0, got ${t}`);const{nBitLength:i,nByteLength:o}=W$(t,e);if(o>2048)throw new Error("Field lengths over 2048 bytes are not supported");const s=goe(t),a=Object.freeze({ORDER:t,BITS:i,BYTES:o,MASK:Z3(i),ZERO:hn,ONE:Ut,create:l=>An(l,t),isValid:l=>{if(typeof l!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof l}`);return hn<=l&&ll===hn,isOdd:l=>(l&Ut)===Ut,neg:l=>An(-l,t),eql:(l,u)=>l===u,sqr:l=>An(l*l,t),add:(l,u)=>An(l+u,t),sub:(l,u)=>An(l-u,t),mul:(l,u)=>An(l*u,t),pow:(l,u)=>voe(a,l,u),div:(l,u)=>An(l*Kw(u,t),t),sqrN:l=>l*l,addN:(l,u)=>l+u,subN:(l,u)=>l-u,mulN:(l,u)=>l*u,inv:l=>Kw(l,t),sqrt:r.sqrt||(l=>s(a,l)),invertBatch:l=>woe(a,l),cmov:(l,u,c)=>c?u:l,toBytes:l=>n?G3(l,o):ma(l,o),fromBytes:l=>{if(l.length!==o)throw new Error(`Fp.fromBytes: expected ${o}, got ${l.length}`);return n?K3(l):Sr(l)}});return Object.freeze(a)}function J$(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function K$(t){const e=J$(t);return e+Math.ceil(e/2)}function xoe(t,e,n=!1){const r=t.length,i=J$(e),o=K$(e);if(r<16||r1024)throw new Error(`expected ${o}-1024 bytes of input, got ${r}`);const s=n?Sr(t):K3(t),a=An(s,e-Ut)+Ut;return n?G3(a,i):ma(a,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Eoe=BigInt(0),Hb=BigInt(1);function Soe(t,e){const n=(i,o)=>{const s=o.negate();return i?s:o},r=i=>{const o=Math.ceil(e/i)+1,s=2**(i-1);return{windows:o,windowSize:s}};return{constTimeNegate:n,unsafeLadder(i,o){let s=t.ZERO,a=i;for(;o>Eoe;)o&Hb&&(s=s.add(a)),a=a.double(),o>>=Hb;return s},precomputeWindow(i,o){const{windows:s,windowSize:a}=r(o),l=[];let u=i,c=u;for(let f=0;f>=h,b>l&&(b-=d,s+=Hb);const y=m,v=m+Math.abs(b)-1,w=p%2!==0,g=b<0;b===0?c=c.add(n(w,o[y])):u=u.add(n(g,o[v]))}return{p:u,f:c}},wNAFCached(i,o,s,a){const l=i._WINDOW_SIZE||1;let u=o.get(i);return u||(u=this.precomputeWindow(i,l),l!==1&&o.set(i,a(u))),this.wNAF(l,u,s)}}}function G$(t){return boe(t.Fp),Oh(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...W$(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Coe(t){const e=G$(t);Oh(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:i}=e;if(n){if(!r.eql(i,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:_oe,hexToBytes:Aoe}=doe,tl={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(t){const{Err:e}=tl;if(t.length<2||t[0]!==2)throw new e("Invalid signature integer tag");const n=t[1],r=t.subarray(2,n+2);if(!n||r.length!==n)throw new e("Invalid signature integer: wrong length");if(r[0]&128)throw new e("Invalid signature integer: negative");if(r[0]===0&&!(r[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:_oe(r),l:t.subarray(n+2)}},toSig(t){const{Err:e}=tl,n=typeof t=="string"?Aoe(t):t;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let r=n.length;if(r<2||n[0]!=48)throw new e("Invalid signature tag");if(n[1]!==r-2)throw new e("Invalid signature: incorrect length");const{d:i,l:o}=tl._parseInt(n.subarray(2)),{d:s,l:a}=tl._parseInt(o);if(a.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s}},hexFromSig(t){const e=u=>Number.parseInt(u[0],16)&8?"00"+u:u,n=u=>{const c=u.toString(16);return c.length&1?`0${c}`:c},r=e(n(t.s)),i=e(n(t.r)),o=r.length/2,s=i.length/2,a=n(o),l=n(s);return`30${n(s+o+4)}02${l}${i}02${a}${r}`}},Bo=BigInt(0),ni=BigInt(1);BigInt(2);const p_=BigInt(3);BigInt(4);function Toe(t){const e=Coe(t),{Fp:n}=e,r=e.toBytes||((p,m,b)=>{const y=m.toAffine();return $l(Uint8Array.from([4]),n.toBytes(y.x),n.toBytes(y.y))}),i=e.fromBytes||(p=>{const m=p.subarray(1),b=n.fromBytes(m.subarray(0,n.BYTES)),y=n.fromBytes(m.subarray(n.BYTES,2*n.BYTES));return{x:b,y}});function o(p){const{a:m,b}=e,y=n.sqr(p),v=n.mul(y,p);return n.add(n.add(v,n.mul(p,m)),b)}if(!n.eql(n.sqr(e.Gy),o(e.Gx)))throw new Error("bad generator point: equation left != right");function s(p){return typeof p=="bigint"&&Bon.eql(w,n.ZERO);return v(b)&&v(y)?f.ZERO:new f(b,y,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(m){const b=n.invertBatch(m.map(y=>y.pz));return m.map((y,v)=>y.toAffine(b[v])).map(f.fromAffine)}static fromHex(m){const b=f.fromAffine(i(Pn("pointHex",m)));return b.assertValidity(),b}static fromPrivateKey(m){return f.BASE.multiply(l(m))}_setWindowSize(m){this._WINDOW_SIZE=m,u.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!n.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:m,y:b}=this.toAffine();if(!n.isValid(m)||!n.isValid(b))throw new Error("bad point: x or y not FE");const y=n.sqr(b),v=o(m);if(!n.eql(y,v))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:m}=this.toAffine();if(n.isOdd)return!n.isOdd(m);throw new Error("Field doesn't support isOdd")}equals(m){c(m);const{px:b,py:y,pz:v}=this,{px:w,py:g,pz:x}=m,k=n.eql(n.mul(b,x),n.mul(w,v)),E=n.eql(n.mul(y,x),n.mul(g,v));return k&&E}negate(){return new f(this.px,n.neg(this.py),this.pz)}double(){const{a:m,b}=e,y=n.mul(b,p_),{px:v,py:w,pz:g}=this;let x=n.ZERO,k=n.ZERO,E=n.ZERO,D=n.mul(v,v),O=n.mul(w,w),N=n.mul(g,g),C=n.mul(v,w);return C=n.add(C,C),E=n.mul(v,g),E=n.add(E,E),x=n.mul(m,E),k=n.mul(y,N),k=n.add(x,k),x=n.sub(O,k),k=n.add(O,k),k=n.mul(x,k),x=n.mul(C,x),E=n.mul(y,E),N=n.mul(m,N),C=n.sub(D,N),C=n.mul(m,C),C=n.add(C,E),E=n.add(D,D),D=n.add(E,D),D=n.add(D,N),D=n.mul(D,C),k=n.add(k,D),N=n.mul(w,g),N=n.add(N,N),D=n.mul(N,C),x=n.sub(x,D),E=n.mul(N,O),E=n.add(E,E),E=n.add(E,E),new f(x,k,E)}add(m){c(m);const{px:b,py:y,pz:v}=this,{px:w,py:g,pz:x}=m;let k=n.ZERO,E=n.ZERO,D=n.ZERO;const O=e.a,N=n.mul(e.b,p_);let C=n.mul(b,w),R=n.mul(y,g),T=n.mul(v,x),q=n.add(b,y),A=n.add(w,g);q=n.mul(q,A),A=n.add(C,R),q=n.sub(q,A),A=n.add(b,v);let S=n.add(w,x);return A=n.mul(A,S),S=n.add(C,T),A=n.sub(A,S),S=n.add(y,v),k=n.add(g,x),S=n.mul(S,k),k=n.add(R,T),S=n.sub(S,k),D=n.mul(O,A),k=n.mul(N,T),D=n.add(k,D),k=n.sub(R,D),D=n.add(R,D),E=n.mul(k,D),R=n.add(C,C),R=n.add(R,C),T=n.mul(O,T),A=n.mul(N,A),R=n.add(R,T),T=n.sub(C,T),T=n.mul(O,T),A=n.add(A,T),C=n.mul(R,A),E=n.add(E,C),C=n.mul(S,A),k=n.mul(q,k),k=n.sub(k,C),C=n.mul(q,R),D=n.mul(S,D),D=n.add(D,C),new f(k,E,D)}subtract(m){return this.add(m.negate())}is0(){return this.equals(f.ZERO)}wNAF(m){return h.wNAFCached(this,u,m,b=>{const y=n.invertBatch(b.map(v=>v.pz));return b.map((v,w)=>v.toAffine(y[w])).map(f.fromAffine)})}multiplyUnsafe(m){const b=f.ZERO;if(m===Bo)return b;if(a(m),m===ni)return this;const{endo:y}=e;if(!y)return h.unsafeLadder(this,m);let{k1neg:v,k1:w,k2neg:g,k2:x}=y.splitScalar(m),k=b,E=b,D=this;for(;w>Bo||x>Bo;)w&ni&&(k=k.add(D)),x&ni&&(E=E.add(D)),D=D.double(),w>>=ni,x>>=ni;return v&&(k=k.negate()),g&&(E=E.negate()),E=new f(n.mul(E.px,y.beta),E.py,E.pz),k.add(E)}multiply(m){a(m);let b=m,y,v;const{endo:w}=e;if(w){const{k1neg:g,k1:x,k2neg:k,k2:E}=w.splitScalar(b);let{p:D,f:O}=this.wNAF(x),{p:N,f:C}=this.wNAF(E);D=h.constTimeNegate(g,D),N=h.constTimeNegate(k,N),N=new f(n.mul(N.px,w.beta),N.py,N.pz),y=D.add(N),v=O.add(C)}else{const{p:g,f:x}=this.wNAF(b);y=g,v=x}return f.normalizeZ([y,v])[0]}multiplyAndAddUnsafe(m,b,y){const v=f.BASE,w=(x,k)=>k===Bo||k===ni||!x.equals(v)?x.multiplyUnsafe(k):x.multiply(k),g=w(this,b).add(w(m,y));return g.is0()?void 0:g}toAffine(m){const{px:b,py:y,pz:v}=this,w=this.is0();m==null&&(m=w?n.ONE:n.inv(v));const g=n.mul(b,m),x=n.mul(y,m),k=n.mul(v,m);if(w)return{x:n.ZERO,y:n.ZERO};if(!n.eql(k,n.ONE))throw new Error("invZ was invalid");return{x:g,y:x}}isTorsionFree(){const{h:m,isTorsionFree:b}=e;if(m===ni)return!0;if(b)return b(f,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:m,clearCofactor:b}=e;return m===ni?this:b?b(f,this):this.multiplyUnsafe(e.h)}toRawBytes(m=!0){return this.assertValidity(),r(f,this,m)}toHex(m=!0){return wc(this.toRawBytes(m))}}f.BASE=new f(e.Gx,e.Gy,n.ONE),f.ZERO=new f(n.ZERO,n.ONE,n.ZERO);const d=e.nBitLength,h=Soe(f,e.endo?Math.ceil(d/2):d);return{CURVE:e,ProjectivePoint:f,normPrivateKeyToScalar:l,weierstrassEquation:o,isWithinCurveOrder:s}}function Moe(t){const e=G$(t);return Oh(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function Ooe(t){const e=Moe(t),{Fp:n,n:r}=e,i=n.BYTES+1,o=2*n.BYTES+1;function s(A){return Bowc(ma(A,e.nByteLength));function p(A){const S=r>>ni;return A>S}function m(A){return p(A)?a(-A):A}const b=(A,S,P)=>Sr(A.slice(S,P));class y{constructor(S,P,B){this.r=S,this.s=P,this.recovery=B,this.assertValidity()}static fromCompact(S){const P=e.nByteLength;return S=Pn("compactSignature",S,P*2),new y(b(S,0,P),b(S,P,2*P))}static fromDER(S){const{r:P,s:B}=tl.toSig(Pn("DER",S));return new y(P,B)}assertValidity(){if(!d(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!d(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(S){return new y(this.r,this.s,S)}recoverPublicKey(S){const{r:P,s:B,recovery:j}=this,z=E(Pn("msgHash",S));if(j==null||![0,1,2,3].includes(j))throw new Error("recovery id invalid");const J=j===2||j===3?P+e.n:P;if(J>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const K=j&1?"03":"02",ae=u.fromHex(K+h(J)),fe=l(J),ke=a(-z*fe),ve=a(B*fe),xe=u.BASE.multiplyAndAddUnsafe(ae,ke,ve);if(!xe)throw new Error("point at infinify");return xe.assertValidity(),xe}hasHighS(){return p(this.s)}normalizeS(){return this.hasHighS()?new y(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return kc(this.toDERHex())}toDERHex(){return tl.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return kc(this.toCompactHex())}toCompactHex(){return h(this.r)+h(this.s)}}const v={isValidPrivateKey(A){try{return c(A),!0}catch{return!1}},normPrivateKeyToScalar:c,randomPrivateKey:()=>{const A=K$(e.n);return xoe(e.randomBytes(A),e.n)},precompute(A=8,S=u.BASE){return S._setWindowSize(A),S.multiply(BigInt(3)),S}};function w(A,S=!0){return u.fromPrivateKey(A).toRawBytes(S)}function g(A){const S=A instanceof Uint8Array,P=typeof A=="string",B=(S||P)&&A.length;return S?B===i||B===o:P?B===2*i||B===2*o:A instanceof u}function x(A,S,P=!0){if(g(A))throw new Error("first arg must be private key");if(!g(S))throw new Error("second arg must be public key");return u.fromHex(S).multiply(c(A)).toRawBytes(P)}const k=e.bits2int||function(A){const S=Sr(A),P=A.length*8-e.nBitLength;return P>0?S>>BigInt(P):S},E=e.bits2int_modN||function(A){return a(k(A))},D=Z3(e.nBitLength);function O(A){if(typeof A!="bigint")throw new Error("bigint expected");if(!(Bo<=A&&AOe in P))throw new Error("sign() legacy options not supported");const{hash:B,randomBytes:j}=e;let{lowS:z,prehash:J,extraEntropy:K}=P;z==null&&(z=!0),A=Pn("msgHash",A),J&&(A=Pn("prehashed msgHash",B(A)));const ae=E(A),fe=c(S),ke=[O(fe),O(ae)];if(K!=null){const Oe=K===!0?j(n.BYTES):K;ke.push(Pn("extraEntropy",Oe))}const ve=$l(...ke),xe=ae;function Se(Oe){const Fe=k(Oe);if(!d(Fe))return;const mt=l(Fe),Ce=u.BASE.multiply(Fe).toAffine(),pe=a(Ce.x);if(pe===Bo)return;const De=a(mt*a(xe+pe*fe));if(De===Bo)return;let Le=(Ce.x===pe?0:2)|Number(Ce.y&ni),Ge=De;return z&&p(De)&&(Ge=m(De),Le^=1),new y(pe,Ge,Le)}return{seed:ve,k2sig:Se}}const C={lowS:e.lowS,prehash:!1},R={lowS:e.lowS,prehash:!1};function T(A,S,P=C){const{seed:B,k2sig:j}=N(A,S,P),z=e;return H$(z.hash.outputLen,z.nByteLength,z.hmac)(B,j)}u.BASE._setWindowSize(8);function q(A,S,P,B=R){var Ce;const j=A;if(S=Pn("msgHash",S),P=Pn("publicKey",P),"strict"in B)throw new Error("options.strict was renamed to lowS");const{lowS:z,prehash:J}=B;let K,ae;try{if(typeof j=="string"||j instanceof Uint8Array)try{K=y.fromDER(j)}catch(pe){if(!(pe instanceof tl.Err))throw pe;K=y.fromCompact(j)}else if(typeof j=="object"&&typeof j.r=="bigint"&&typeof j.s=="bigint"){const{r:pe,s:De}=j;K=new y(pe,De)}else throw new Error("PARSE");ae=u.fromHex(P)}catch(pe){if(pe.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(z&&K.hasHighS())return!1;J&&(S=e.hash(S));const{r:fe,s:ke}=K,ve=E(S),xe=l(ke),Se=a(ve*xe),Oe=a(fe*xe),Fe=(Ce=u.BASE.multiplyAndAddUnsafe(ae,Se,Oe))==null?void 0:Ce.toAffine();return Fe?a(Fe.x)===fe:!1}return{CURVE:e,getPublicKey:w,getSharedSecret:x,sign:T,verify:q,ProjectivePoint:u,Signature:y,utils:v}}let Z$=class extends j${constructor(e,n){super(),this.finished=!1,this.destroyed=!1,Hie(e);const r=W3(n);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,o=new Uint8Array(i);o.set(r.length>i?e.create().update(r).digest():r);for(let s=0;snew Z$(t,e).update(n).digest();Y$.create=(t,e)=>new Z$(t,e);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Doe(t){return{hash:t,hmac:(e,...n)=>Y$(t,e,Gie(...n)),randomBytes:q$}}function Noe(t,e){const n=r=>Ooe({...t,...Doe(r)});return Object.freeze({...n(e),create:n})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Rg=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),a1=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Q$=BigInt(1),l1=BigInt(2),m_=(t,e)=>(t+e/l1)/e;function X$(t){const e=Rg,n=BigInt(3),r=BigInt(6),i=BigInt(11),o=BigInt(22),s=BigInt(23),a=BigInt(44),l=BigInt(88),u=t*t*t%e,c=u*u*t%e,f=Xr(c,n,e)*c%e,d=Xr(f,n,e)*c%e,h=Xr(d,l1,e)*u%e,p=Xr(h,i,e)*h%e,m=Xr(p,o,e)*p%e,b=Xr(m,a,e)*m%e,y=Xr(b,l,e)*b%e,v=Xr(y,a,e)*m%e,w=Xr(v,n,e)*c%e,g=Xr(w,s,e)*p%e,x=Xr(g,r,e)*u%e,k=Xr(x,l1,e);if(!Gw.eql(Gw.sqr(k),t))throw new Error("Cannot find square root");return k}const Gw=koe(Rg,void 0,void 0,{sqrt:X$}),Pc=Noe({a:BigInt(0),b:BigInt(7),Fp:Gw,n:a1,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=a1,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-Q$*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=n,s=BigInt("0x100000000000000000000000000000000"),a=m_(o*t,e),l=m_(-r*t,e);let u=An(t-a*n-l*i,e),c=An(-a*r-l*o,e);const f=u>s,d=c>s;if(f&&(u=e-u),d&&(c=e-c),u>s||c>s)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:f,k1:u,k2neg:d,k2:c}}}},Ww),Fg=BigInt(0),e9=t=>typeof t=="bigint"&&Fgtypeof t=="bigint"&&Fgi.charCodeAt(0)));n=$l(r,r),g_[t]=n}return Ww($l(n,...e))}const Y3=t=>t.toRawBytes(!0).slice(1),Zw=t=>ma(t,32),Wb=t=>An(t,Rg),Qd=t=>An(t,a1),Q3=Pc.ProjectivePoint,Ioe=(t,e,n)=>Q3.BASE.multiplyAndAddUnsafe(t,e,n);function Yw(t){let e=Pc.utils.normPrivateKeyToScalar(t),n=Q3.fromPrivateKey(e);return{scalar:n.hasEvenY()?e:Qd(-e),bytes:Y3(n)}}function t9(t){if(!e9(t))throw new Error("bad x: need 0 < x < p");const e=Wb(t*t),n=Wb(e*t+BigInt(7));let r=X$(n);r%l1!==Fg&&(r=Wb(-r));const i=new Q3(t,r,Q$);return i.assertValidity(),i}function n9(...t){return Qd(Sr(u1("BIP0340/challenge",...t)))}function Roe(t){return Yw(t).bytes}function Foe(t,e,n=q$(32)){const r=Pn("message",t),{bytes:i,scalar:o}=Yw(e),s=Pn("auxRand",n,32),a=Zw(o^Sr(u1("BIP0340/aux",s))),l=u1("BIP0340/nonce",a,i,r),u=Qd(Sr(l));if(u===Fg)throw new Error("sign failed: k is zero");const{bytes:c,scalar:f}=Yw(u),d=n9(c,i,r),h=new Uint8Array(64);if(h.set(c,0),h.set(Zw(Qd(f+d*o)),32),!r9(h,r,i))throw new Error("sign: Invalid signature produced");return h}function r9(t,e,n){const r=Pn("signature",t,64),i=Pn("message",e),o=Pn("publicKey",n,32);try{const s=t9(Sr(o)),a=Sr(r.subarray(0,32));if(!e9(a))return!1;const l=Sr(r.subarray(32,64));if(!$oe(l))return!1;const u=n9(Zw(a),Y3(s),i),c=Ioe(s,l,Qd(-u));return!(!c||!c.hasEvenY()||c.toAffine().x!==a)}catch{return!1}}const no={getPublicKey:Roe,sign:Foe,verify:r9,utils:{randomPrivateKey:Pc.utils.randomPrivateKey,lift_x:t9,pointToBytes:Y3,numberToBytesBE:ma,bytesToNumberBE:Sr,taggedHash:u1,mod:An}},Jb=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const X3=t=>t instanceof Uint8Array,Kb=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),Hi=(t,e)=>t<<32-e|t>>>e,Loe=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Loe)throw new Error("Non little-endian hardware is not supported");const Boe=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function un(t){if(!X3(t))throw new Error("Uint8Array expected");let e="";for(let n=0;nr+i.length,0));let n=0;return t.forEach(r=>{if(!X3(r))throw new Error("Uint8Array expected");e.set(r,n),n+=r.length}),e}class i9{clone(){return this._cloneInto()}}function o9(t){const e=r=>t().update(Xd(r)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function s9(t=32){if(Jb&&typeof Jb.getRandomValues=="function")return Jb.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}function Qw(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function zoe(t){if(typeof t!="boolean")throw new Error(`Expected boolean, not ${t}`)}function a9(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function joe(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Qw(t.outputLen),Qw(t.blockLen)}function qoe(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function Uoe(t,e){a9(t);const n=e.outputLen;if(t.length>i&o),a=Number(n&o),l=r?4:0,u=r?0:4;t.setUint32(e+l,s,r),t.setUint32(e+u,a,r)}class Hoe extends i9{constructor(e,n,r,i){super(),this.blockLen=e,this.outputLen=n,this.padOffset=r,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Kb(this.buffer)}update(e){uo.exists(this);const{view:n,buffer:r,blockLen:i}=this;e=Xd(e);const o=e.length;for(let s=0;si-s&&(this.process(r,0),s=0);for(let f=s;fc.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;ft&e^~t&n,Joe=(t,e,n)=>t&e^t&n^e&n,Koe=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),xs=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Es=new Uint32Array(64);class l9 extends Hoe{constructor(){super(64,32,8,!1),this.A=xs[0]|0,this.B=xs[1]|0,this.C=xs[2]|0,this.D=xs[3]|0,this.E=xs[4]|0,this.F=xs[5]|0,this.G=xs[6]|0,this.H=xs[7]|0}get(){const{A:e,B:n,C:r,D:i,E:o,F:s,G:a,H:l}=this;return[e,n,r,i,o,s,a,l]}set(e,n,r,i,o,s,a,l){this.A=e|0,this.B=n|0,this.C=r|0,this.D=i|0,this.E=o|0,this.F=s|0,this.G=a|0,this.H=l|0}process(e,n){for(let f=0;f<16;f++,n+=4)Es[f]=e.getUint32(n,!1);for(let f=16;f<64;f++){const d=Es[f-15],h=Es[f-2],p=Hi(d,7)^Hi(d,18)^d>>>3,m=Hi(h,17)^Hi(h,19)^h>>>10;Es[f]=m+Es[f-7]+p+Es[f-16]|0}let{A:r,B:i,C:o,D:s,E:a,F:l,G:u,H:c}=this;for(let f=0;f<64;f++){const d=Hi(a,6)^Hi(a,11)^Hi(a,25),h=c+d+Woe(a,l,u)+Koe[f]+Es[f]|0,m=(Hi(r,2)^Hi(r,13)^Hi(r,22))+Joe(r,i,o)|0;c=u,u=l,l=a,a=s+h|0,s=o,o=i,i=r,r=h+m|0}r=r+this.A|0,i=i+this.B|0,o=o+this.C|0,s=s+this.D|0,a=a+this.E|0,l=l+this.F|0,u=u+this.G|0,c=c+this.H|0,this.set(r,i,o,s,a,l,u,c)}roundClean(){Es.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class Goe extends l9{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}const zc=o9(()=>new l9);o9(()=>new Goe);/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */function jc(t){if(!Number.isSafeInteger(t))throw new Error(`Wrong integer: ${t}`)}function us(...t){const e=(i,o)=>s=>i(o(s)),n=Array.from(t).reverse().reduce((i,o)=>i?e(i,o.encode):o.encode,void 0),r=t.reduce((i,o)=>i?e(i,o.decode):o.decode,void 0);return{encode:n,decode:r}}function cs(t){return{encode:e=>{if(!Array.isArray(e)||e.length&&typeof e[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return e.map(n=>{if(jc(n),n<0||n>=t.length)throw new Error(`Digit index outside alphabet: ${n} (alphabet: ${t.length})`);return t[n]})},decode:e=>{if(!Array.isArray(e)||e.length&&typeof e[0]!="string")throw new Error("alphabet.decode input should be array of strings");return e.map(n=>{if(typeof n!="string")throw new Error(`alphabet.decode: not string element=${n}`);const r=t.indexOf(n);if(r===-1)throw new Error(`Unknown letter: "${n}". Allowed: ${t}`);return r})}}}function fs(t=""){if(typeof t!="string")throw new Error("join separator should be string");return{encode:e=>{if(!Array.isArray(e)||e.length&&typeof e[0]!="string")throw new Error("join.encode input should be array of strings");for(let n of e)if(typeof n!="string")throw new Error(`join.encode: non-string input=${n}`);return e.join(t)},decode:e=>{if(typeof e!="string")throw new Error("join.decode input should be string");return e.split(t)}}}function Bg(t,e="="){if(jc(t),typeof e!="string")throw new Error("padding chr should be string");return{encode(n){if(!Array.isArray(n)||n.length&&typeof n[0]!="string")throw new Error("padding.encode input should be array of strings");for(let r of n)if(typeof r!="string")throw new Error(`padding.encode: non-string input=${r}`);for(;n.length*t%8;)n.push(e);return n},decode(n){if(!Array.isArray(n)||n.length&&typeof n[0]!="string")throw new Error("padding.encode input should be array of strings");for(let i of n)if(typeof i!="string")throw new Error(`padding.decode: non-string input=${i}`);let r=n.length;if(r*t%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;r>0&&n[r-1]===e;r--)if(!((r-1)*t%8))throw new Error("Invalid padding: string has too much padding");return n.slice(0,r)}}}function u9(t){if(typeof t!="function")throw new Error("normalize fn should be function");return{encode:e=>e,decode:e=>t(e)}}function y_(t,e,n){if(e<2)throw new Error(`convertRadix: wrong from=${e}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: wrong to=${n}, base cannot be less than 2`);if(!Array.isArray(t))throw new Error("convertRadix: data should be array");if(!t.length)return[];let r=0;const i=[],o=Array.from(t);for(o.forEach(s=>{if(jc(s),s<0||s>=e)throw new Error(`Wrong integer: ${s}`)});;){let s=0,a=!0;for(let l=r;le?c9(e,t%e):t,c1=(t,e)=>t+(e-c9(t,e));function Xw(t,e,n,r){if(!Array.isArray(t))throw new Error("convertRadix2: data should be array");if(e<=0||e>32)throw new Error(`convertRadix2: wrong from=${e}`);if(n<=0||n>32)throw new Error(`convertRadix2: wrong to=${n}`);if(c1(e,n)>32)throw new Error(`convertRadix2: carry overflow from=${e} to=${n} carryBits=${c1(e,n)}`);let i=0,o=0;const s=2**n-1,a=[];for(const l of t){if(jc(l),l>=2**e)throw new Error(`convertRadix2: invalid data word=${l} from=${e}`);if(i=i<32)throw new Error(`convertRadix2: carry overflow pos=${o} from=${e}`);for(o+=e;o>=n;o-=n)a.push((i>>o-n&s)>>>0);i&=2**o-1}if(i=i<=e)throw new Error("Excess padding");if(!r&&i)throw new Error(`Non-zero padding: ${i}`);return r&&o>0&&a.push(i>>>0),a}function Zoe(t){return jc(t),{encode:e=>{if(!(e instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return y_(Array.from(e),2**8,t)},decode:e=>{if(!Array.isArray(e)||e.length&&typeof e[0]!="number")throw new Error("radix.decode input should be array of strings");return Uint8Array.from(y_(e,t,2**8))}}}function Oa(t,e=!1){if(jc(t),t<=0||t>32)throw new Error("radix2: bits should be in (0..32]");if(c1(8,t)>32||c1(t,8)>32)throw new Error("radix2: carry overflow");return{encode:n=>{if(!(n instanceof Uint8Array))throw new Error("radix2.encode input should be Uint8Array");return Xw(Array.from(n),8,t,!e)},decode:n=>{if(!Array.isArray(n)||n.length&&typeof n[0]!="number")throw new Error("radix2.decode input should be array of strings");return Uint8Array.from(Xw(n,t,8,e))}}}function b_(t){if(typeof t!="function")throw new Error("unsafeWrapper fn should be function");return function(...e){try{return t.apply(null,e)}catch{}}}const Yoe=us(Oa(4),cs("0123456789ABCDEF"),fs("")),Qoe=us(Oa(5),cs("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),Bg(5),fs(""));us(Oa(5),cs("0123456789ABCDEFGHIJKLMNOPQRSTUV"),Bg(5),fs(""));us(Oa(5),cs("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),fs(""),u9(t=>t.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")));const Qo=us(Oa(6),cs("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),Bg(6),fs("")),Xoe=us(Oa(6),cs("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),Bg(6),fs("")),eE=t=>us(Zoe(58),cs(t),fs("")),ek=eE("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");eE("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ");eE("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");const v_=[0,2,3,5,6,7,9,10,11],ese={encode(t){let e="";for(let n=0;n>25;let n=(t&33554431)<<5;for(let r=0;r>r&1)===1&&(n^=w_[r]);return n}function k_(t,e,n=1){const r=t.length;let i=1;for(let o=0;o126)throw new Error(`Invalid prefix (${t})`);i=ff(i)^s>>5}i=ff(i);for(let o=0;od)throw new TypeError(`Length ${h} exceeds limit ${d}`);return c=c.toLowerCase(),`${c}1${tk.encode(f)}${k_(c,f,e)}`}function a(c,f=90){if(typeof c!="string")throw new Error(`bech32.decode input should be string, not ${typeof c}`);if(c.length<8||f!==!1&&c.length>f)throw new TypeError(`Wrong string length: ${c.length} (${c}). Expected (8..${f})`);const d=c.toLowerCase();if(c!==d&&c!==c.toUpperCase())throw new Error("String must be lowercase or uppercase");c=d;const h=c.lastIndexOf("1");if(h===0||h===-1)throw new Error('Letter "1" must be present between prefix and data only');const p=c.slice(0,h),m=c.slice(h+1);if(m.length<6)throw new Error("Data must be at least 6 characters long");const b=tk.decode(m).slice(0,-6),y=k_(p,b,e);if(!m.endsWith(y))throw new Error(`Invalid checksum in ${c}: expected "${y}"`);return{prefix:p,words:b}}const l=b_(a);function u(c){const{prefix:f,words:d}=a(c,!1);return{prefix:f,words:d,bytes:r(d)}}return{encode:s,decode:a,decodeToBytes:u,decodeUnsafe:l,fromWords:r,fromWordsUnsafe:o,toWords:i}}const Ec=f9("bech32");f9("bech32m");const tse={encode:t=>new TextDecoder().decode(t),decode:t=>new TextEncoder().encode(t)},nse=us(Oa(4),cs("0123456789abcdef"),fs(""),u9(t=>{if(typeof t!="string"||t.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof t} with length ${t.length}`);return t.toLowerCase()})),rse={utf8:tse,hex:nse,base16:Yoe,base32:Qoe,base64:Qo,base64url:Xoe,base58:ek,base58xmr:ese};`${Object.keys(rse).join(", ")}`;function Gb(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`positive integer expected, not ${t}`)}function x_(t){if(typeof t!="boolean")throw new Error(`boolean expected, not ${t}`)}function ise(t){return t instanceof Uint8Array||t!=null&&typeof t=="object"&&t.constructor.name==="Uint8Array"}function Uo(t,...e){if(!ise(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error(`Uint8Array expected of length ${e}, not of length=${t.length}`)}/*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */const Vn=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),ose=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!ose)throw new Error("Non little-endian hardware is not supported");function sse(t,e){if(e==null||typeof e!="object")throw new Error("options must be defined");return Object.assign(t,e)}function ase(t,e){if(t.length!==e.length)return!1;let n=0;for(let r=0;r(Object.assign(e,t),e),la=16,use=283;function tE(t){return t<<1^use&-(t>>7)}function Mu(t,e){let n=0;for(;e>0;e>>=1)n^=t&-(e&1),t=tE(t);return n}const nk=(()=>{let t=new Uint8Array(256);for(let n=0,r=1;n<256;n++,r^=tE(r))t[n]=r;const e=new Uint8Array(256);e[0]=99;for(let n=0;n<255;n++){let r=t[255-n];r|=r<<8,e[t[n]]=(r^r>>4^r>>5^r>>6^r>>7^99)&255}return e})(),cse=nk.map((t,e)=>nk.indexOf(e)),fse=t=>t<<24|t>>>8,Zb=t=>t<<8|t>>>24;function d9(t,e){if(t.length!==256)throw new Error("Wrong sbox length");const n=new Uint32Array(256).map((u,c)=>e(t[c])),r=n.map(Zb),i=r.map(Zb),o=i.map(Zb),s=new Uint32Array(256*256),a=new Uint32Array(256*256),l=new Uint16Array(256*256);for(let u=0;u<256;u++)for(let c=0;c<256;c++){const f=u*256+c;s[f]=n[u]^r[c],a[f]=i[u]^o[c],l[f]=t[u]<<8|t[c]}return{sbox:t,sbox2:l,T0:n,T1:r,T2:i,T3:o,T01:s,T23:a}}const nE=d9(nk,t=>Mu(t,3)<<24|t<<16|t<<8|Mu(t,2)),h9=d9(cse,t=>Mu(t,11)<<24|Mu(t,13)<<16|Mu(t,9)<<8|Mu(t,14)),dse=(()=>{const t=new Uint8Array(16);for(let e=0,n=1;e<16;e++,n=tE(n))t[e]=n;return t})();function p9(t){Uo(t);const e=t.length;if(![16,24,32].includes(e))throw new Error(`aes: wrong key size: should be 16, 24 or 32, got: ${e}`);const{sbox2:n}=nE,r=Vn(t),i=r.length,o=a=>co(n,a,a,a,a),s=new Uint32Array(e+28);s.set(r);for(let a=i;a6&&a%i===4&&(l=o(l)),s[a]=s[a-i]^l}return s}function hse(t){const e=p9(t),n=e.slice(),r=e.length,{sbox2:i}=nE,{T0:o,T1:s,T2:a,T3:l}=h9;for(let u=0;u>>8&255]^a[f>>>16&255]^l[f>>>24]}return n}function Js(t,e,n,r,i,o){return t[n<<8&65280|r>>>8&255]^e[i>>>8&65280|o>>>24&255]}function co(t,e,n,r,i){return t[e&255|n&65280]|t[r>>>16&255|i>>>16&65280]<<16}function E_(t,e,n,r,i){const{sbox2:o,T01:s,T23:a}=nE;let l=0;e^=t[l++],n^=t[l++],r^=t[l++],i^=t[l++];const u=t.length/4-2;for(let p=0;p16)throw new Error(`aes/pcks5: wrong padding byte: ${r}`);const i=t.subarray(0,-r);for(let o=0;o{const a=p9(e),{b:l,o:u,out:c}=gse(o,i,s),f=Vn(n);let d=f[0],h=f[1],p=f[2],m=f[3],b=0;for(;b+4<=l.length;)d^=l[b+0],h^=l[b+1],p^=l[b+2],m^=l[b+3],{s0:d,s1:h,s2:p,s3:m}=E_(a,d,h,p,m),u[b++]=d,u[b++]=h,u[b++]=p,u[b++]=m;if(i){const y=bse(o.subarray(b*4));d^=y[0],h^=y[1],p^=y[2],m^=y[3],{s0:d,s1:h,s2:p,s3:m}=E_(a,d,h,p,m),u[b++]=d,u[b++]=h,u[b++]=p,u[b++]=m}return a.fill(0),c},decrypt:(o,s)=>{mse(o);const a=hse(e),l=Vn(n),u=m9(o.length,s),c=Vn(o),f=Vn(u);let d=l[0],h=l[1],p=l[2],m=l[3];for(let b=0;b+4<=c.length;){const y=d,v=h,w=p,g=m;d=c[b+0],h=c[b+1],p=c[b+2],m=c[b+3];const{s0:x,s1:k,s2:E,s3:D}=pse(a,d,h,p,m);f[b++]=x^y,f[b++]=k^v,f[b++]=E^w,f[b++]=D^g}return a.fill(0),yse(u,i)}}}),y9=t=>Uint8Array.from(t.split("").map(e=>e.charCodeAt(0))),vse=y9("expand 16-byte k"),wse=y9("expand 32-byte k"),kse=Vn(vse),b9=Vn(wse);b9.slice();function Qe(t,e){return t<>>32-e}function rk(t){return t.byteOffset%4===0}const Mp=64,xse=16,v9=2**32-1,S_=new Uint32Array;function Ese(t,e,n,r,i,o,s,a){const l=i.length,u=new Uint8Array(Mp),c=Vn(u),f=rk(i)&&rk(o),d=f?Vn(i):S_,h=f?Vn(o):S_;for(let p=0;p=v9)throw new Error("arx: counter overflow");const m=Math.min(Mp,l-p);if(f&&m===Mp){const b=p/4;if(p%4!==0)throw new Error("arx: invalid block position");for(let y=0,v;y{Uo(a),Uo(l),Uo(u);const d=u.length;if(c||(c=new Uint8Array(d)),Uo(c),Gb(f),f<0||f>=v9)throw new Error("arx: counter overflow");if(c.length0;)h.pop().fill(0);return c}}function Cse(t,e,n,r,i,o=20){let s=t[0],a=t[1],l=t[2],u=t[3],c=e[0],f=e[1],d=e[2],h=e[3],p=e[4],m=e[5],b=e[6],y=e[7],v=i,w=n[0],g=n[1],x=n[2],k=s,E=a,D=l,O=u,N=c,C=f,R=d,T=h,q=p,A=m,S=b,P=y,B=v,j=w,z=g,J=x;for(let ae=0;aei?e.create().update(r).digest():r);for(let s=0;snew k9(t,e).update(n).digest();Pg.create=(t,e)=>new k9(t,e);function _se(t,e,n){return uo.hash(t),Pg(t,Xd(n),Xd(e))}const Yb=new Uint8Array([0]),C_=new Uint8Array;function Ase(t,e,n,r=32){if(uo.hash(t),uo.number(r),r>255*t.outputLen)throw new Error("Length should be <= 255*HashLen");const i=Math.ceil(r/t.outputLen);n===void 0&&(n=C_);const o=new Uint8Array(i*t.outputLen),s=Pg.create(t,e),a=s._cloneInto(),l=new Uint8Array(s.outputLen);for(let u=0;u{for(var n in e)Tse(t,n,{get:e[n],enumerable:!0})},Xl=Symbol("verified"),Mse=t=>t instanceof Object;function x9(t){if(!Mse(t)||typeof t.kind!="number"||typeof t.content!="string"||typeof t.created_at!="number"||typeof t.pubkey!="string"||!t.pubkey.match(/^[a-f0-9]{64}$/)||!Array.isArray(t.tags))return!1;for(let e=0;eIse,QueueNode:()=>E9,binarySearch:()=>rE,insertEventIntoAscendingList:()=>$se,insertEventIntoDescendingList:()=>Nse,normalizeURL:()=>Dse,utf8Decoder:()=>ro,utf8Encoder:()=>Li});var ro=new TextDecoder("utf-8"),Li=new TextEncoder;function Dse(t){t.indexOf("://")===-1&&(t="wss://"+t);let e=new URL(t);return e.pathname=e.pathname.replace(/\/+/g,"/"),e.pathname.endsWith("/")&&(e.pathname=e.pathname.slice(0,-1)),(e.port==="80"&&e.protocol==="ws:"||e.port==="443"&&e.protocol==="wss:")&&(e.port=""),e.searchParams.sort(),e.hash="",e.toString()}function Nse(t,e){const[n,r]=rE(t,i=>e.id===i.id?0:e.created_at===i.created_at?-1:i.created_at-e.created_at);return r||t.splice(n,0,e),t}function $se(t,e){const[n,r]=rE(t,i=>e.id===i.id?0:e.created_at===i.created_at?-1:e.created_at-i.created_at);return r||t.splice(n,0,e),t}function rE(t,e){let n=0,r=t.length-1;for(;n<=r;){const i=Math.floor((n+r)/2),o=e(t[i]);if(o===0)return[i,!0];o<0?r=i-1:n=i+1}return[n,!1]}var E9=class{constructor(e){Te(this,"value");Te(this,"next",null);Te(this,"prev",null);this.value=e}},Ise=class{constructor(){Te(this,"first");Te(this,"last");this.first=null,this.last=null}enqueue(e){const n=new E9(e);return this.last?this.last===this.first?(this.last=n,this.last.prev=this.first,this.first.next=n):(n.prev=this.last,this.last.next=n,this.last=n):(this.first=n,this.last=n),!0}dequeue(){if(!this.first)return null;if(this.first===this.last){const n=this.first;return this.first=null,this.last=null,n.value}const e=this.first;return this.first=e.next,e.value}},Rse=class{generateSecretKey(){return no.utils.randomPrivateKey()}getPublicKey(e){return un(no.getPublicKey(e))}finalizeEvent(e,n){const r=e;return r.pubkey=un(no.getPublicKey(n)),r.id=x0(r),r.sig=un(no.sign(x0(r),n)),r[Xl]=!0,r}verifyEvent(e){if(typeof e[Xl]=="boolean")return e[Xl];const n=x0(e);if(n!==e.id)return e[Xl]=!1,!1;try{const r=no.verify(e.sig,n,e.pubkey);return e[Xl]=r,r}catch{return e[Xl]=!1,!1}}};function Fse(t){if(!x9(t))throw new Error("can't serialize event with wrong or missing properties");return JSON.stringify([0,t.pubkey,t.created_at,t.kind,t.tags,t.content])}function x0(t){let e=zc(Li.encode(Fse(t)));return un(e)}var zg=new Rse;zg.generateSecretKey;zg.getPublicKey;var Da=zg.finalizeEvent,iE=zg.verifyEvent,Lse={};Ht(Lse,{Application:()=>Lae,BadgeAward:()=>Wse,BadgeDefinition:()=>Oae,BlockedRelaysList:()=>mae,BookmarkList:()=>dae,Bookmarksets:()=>Aae,Calendar:()=>Vae,CalendarEventRSVP:()=>Hae,ChannelCreation:()=>T9,ChannelHideMessage:()=>D9,ChannelMessage:()=>O9,ChannelMetadata:()=>M9,ChannelMuteUser:()=>N9,ClassifiedListing:()=>zae,ClientAuth:()=>$9,CommunitiesList:()=>hae,CommunityDefinition:()=>Kae,CommunityPostApproval:()=>tae,Contacts:()=>qse,CreateOrUpdateProduct:()=>$ae,CreateOrUpdateStall:()=>Nae,Curationsets:()=>Tae,Date:()=>qae,DraftClassifiedListing:()=>jae,DraftLong:()=>Rae,Emojisets:()=>Fae,EncryptedDirectMessage:()=>Use,EncryptedDirectMessages:()=>Vse,EventDeletion:()=>Hse,FileMetadata:()=>Gse,FileServerPreference:()=>vae,Followsets:()=>Sae,GenericRepost:()=>Jse,Genericlists:()=>Cae,HTTPAuth:()=>aE,Handlerinformation:()=>Jae,Handlerrecommendation:()=>Wae,Highlights:()=>lae,InterestsList:()=>yae,Interestsets:()=>Dae,JobFeedback:()=>iae,JobRequest:()=>nae,JobResult:()=>rae,Label:()=>eae,LightningPubRPC:()=>kae,LiveChatMessage:()=>Zse,LiveEvent:()=>Bae,LongFormArticle:()=>Iae,Metadata:()=>Pse,Mutelist:()=>uae,NWCWalletInfo:()=>wae,NWCWalletRequest:()=>I9,NWCWalletResponse:()=>xae,NostrConnect:()=>Eae,OpenTimestamps:()=>Kse,Pinlist:()=>cae,ProblemTracker:()=>Yse,ProfileBadges:()=>Mae,PublicChatsList:()=>pae,Reaction:()=>sE,RecommendRelay:()=>jse,RelayList:()=>fae,Relaysets:()=>_ae,Report:()=>Qse,Reporting:()=>Xse,Repost:()=>oE,SearchRelaysList:()=>gae,ShortTextNote:()=>zse,Time:()=>Uae,UserEmojiList:()=>bae,UserStatuses:()=>Pae,Zap:()=>aae,ZapGoal:()=>oae,ZapRequest:()=>sae,classifyKind:()=>Bse,isEphemeralKind:()=>_9,isParameterizedReplaceableKind:()=>A9,isRegularKind:()=>S9,isReplaceableKind:()=>C9});function S9(t){return 1e3<=t&&t<1e4||[1,2,4,5,6,7,8,16,40,41,42,43,44].includes(t)}function C9(t){return[0,3].includes(t)||1e4<=t&&t<2e4}function _9(t){return 2e4<=t&&t<3e4}function A9(t){return 3e4<=t&&t<4e4}function Bse(t){return S9(t)?"regular":C9(t)?"replaceable":_9(t)?"ephemeral":A9(t)?"parameterized":"unknown"}var Pse=0,zse=1,jse=2,qse=3,Use=4,Vse=4,Hse=5,oE=6,sE=7,Wse=8,Jse=16,T9=40,M9=41,O9=42,D9=43,N9=44,Kse=1040,Gse=1063,Zse=1311,Yse=1971,Qse=1984,Xse=1984,eae=1985,tae=4550,nae=5999,rae=6999,iae=7e3,oae=9041,sae=9734,aae=9735,lae=9802,uae=1e4,cae=10001,fae=10002,dae=10003,hae=10004,pae=10005,mae=10006,gae=10007,yae=10015,bae=10030,vae=10096,wae=13194,kae=21e3,$9=22242,I9=23194,xae=23195,Eae=24133,aE=27235,Sae=3e4,Cae=30001,_ae=30002,Aae=30003,Tae=30004,Mae=30008,Oae=30009,Dae=30015,Nae=30017,$ae=30018,Iae=30023,Rae=30024,Fae=30030,Lae=30078,Bae=30311,Pae=30315,zae=30402,jae=30403,qae=31922,Uae=31923,Vae=31924,Hae=31925,Wae=31989,Jae=31990,Kae=34550,Gae={};Ht(Gae,{getHex64:()=>lE,getInt:()=>R9,getSubscriptionId:()=>Zae,matchEventId:()=>Yae,matchEventKind:()=>Xae,matchEventPubkey:()=>Qae});function lE(t,e){let n=e.length+3,r=t.indexOf(`"${e}":`)+n,i=t.slice(r).indexOf('"')+r+1;return t.slice(i,i+64)}function R9(t,e){let n=e.length,r=t.indexOf(`"${e}":`)+n+3,i=t.slice(r),o=Math.min(i.indexOf(","),i.indexOf("}"));return parseInt(i.slice(0,o),10)}function Zae(t){let e=t.slice(0,22).indexOf('"EVENT"');if(e===-1)return null;let n=t.slice(e+7+1).indexOf('"');if(n===-1)return null;let r=e+7+1+n,i=t.slice(r+1,80).indexOf('"');if(i===-1)return null;let o=r+1+i;return t.slice(r+1,o)}function Yae(t,e){return e===lE(t,"id")}function Qae(t,e){return e===lE(t,"pubkey")}function Xae(t,e){return e===R9(t,"kind")}var ele={};Ht(ele,{makeAuthEvent:()=>tle});function tle(t,e){return{kind:$9,created_at:Math.floor(Date.now()/1e3),tags:[["relay",t],["challenge",e]],content:""}}var nle;try{nle=WebSocket}catch{}var rle;try{rle=WebSocket}catch{}var F9={};Ht(F9,{BECH32_REGEX:()=>L9,Bech32MaxSize:()=>uE,decode:()=>jg,encodeBytes:()=>qg,naddrEncode:()=>cle,neventEncode:()=>ule,noteEncode:()=>ale,nprofileEncode:()=>lle,npubEncode:()=>sle,nrelayEncode:()=>fle,nsecEncode:()=>ole});var uE=5e3,L9=/[\x21-\x7E]{1,83}1[023456789acdefghjklmnpqrstuvwxyz]{6,}/;function ile(t){const e=new Uint8Array(4);return e[0]=t>>24&255,e[1]=t>>16&255,e[2]=t>>8&255,e[3]=t&255,e}function jg(t){var i,o,s,a,l,u,c,f;let{prefix:e,words:n}=Ec.decode(t,uE),r=new Uint8Array(Ec.fromWords(n));switch(e){case"nprofile":{let d=Op(r);if(!((i=d[0])!=null&&i[0]))throw new Error("missing TLV 0 for nprofile");if(d[0][0].length!==32)throw new Error("TLV 0 should be 32 bytes");return{type:"nprofile",data:{pubkey:un(d[0][0]),relays:d[1]?d[1].map(h=>ro.decode(h)):[]}}}case"nevent":{let d=Op(r);if(!((o=d[0])!=null&&o[0]))throw new Error("missing TLV 0 for nevent");if(d[0][0].length!==32)throw new Error("TLV 0 should be 32 bytes");if(d[2]&&d[2][0].length!==32)throw new Error("TLV 2 should be 32 bytes");if(d[3]&&d[3][0].length!==4)throw new Error("TLV 3 should be 4 bytes");return{type:"nevent",data:{id:un(d[0][0]),relays:d[1]?d[1].map(h=>ro.decode(h)):[],author:(s=d[2])!=null&&s[0]?un(d[2][0]):void 0,kind:(a=d[3])!=null&&a[0]?parseInt(un(d[3][0]),16):void 0}}}case"naddr":{let d=Op(r);if(!((l=d[0])!=null&&l[0]))throw new Error("missing TLV 0 for naddr");if(!((u=d[2])!=null&&u[0]))throw new Error("missing TLV 2 for naddr");if(d[2][0].length!==32)throw new Error("TLV 2 should be 32 bytes");if(!((c=d[3])!=null&&c[0]))throw new Error("missing TLV 3 for naddr");if(d[3][0].length!==4)throw new Error("TLV 3 should be 4 bytes");return{type:"naddr",data:{identifier:ro.decode(d[0][0]),pubkey:un(d[2][0]),kind:parseInt(un(d[3][0]),16),relays:d[1]?d[1].map(h=>ro.decode(h)):[]}}}case"nrelay":{let d=Op(r);if(!((f=d[0])!=null&&f[0]))throw new Error("missing TLV 0 for nrelay");return{type:"nrelay",data:ro.decode(d[0][0])}}case"nsec":return{type:e,data:r};case"npub":case"note":return{type:e,data:un(r)};default:throw new Error(`unknown prefix ${e}`)}}function Op(t){let e={},n=t;for(;n.length>0;){let r=n[0],i=n[1],o=n.slice(2,2+i);if(n=n.slice(2+i),o.lengthLi.encode(n))});return Dh("nprofile",e)}function ule(t){let e;t.kind!==void 0&&(e=ile(t.kind));let n=Ug({0:[xc(t.id)],1:(t.relays||[]).map(r=>Li.encode(r)),2:t.author?[xc(t.author)]:[],3:e?[new Uint8Array(e)]:[]});return Dh("nevent",n)}function cle(t){let e=new ArrayBuffer(4);new DataView(e).setUint32(0,t.kind,!1);let n=Ug({0:[Li.encode(t.identifier)],1:(t.relays||[]).map(r=>Li.encode(r)),2:[xc(t.pubkey)],3:[new Uint8Array(e)]});return Dh("naddr",n)}function fle(t){let e=Ug({0:[Li.encode(t)]});return Dh("nrelay",e)}function Ug(t){let e=[];return Object.entries(t).reverse().forEach(([n,r])=>{r.forEach(i=>{let o=new Uint8Array(i.length+2);o.set([parseInt(n)],0),o.set([i.length],1),o.set(i,2),e.push(o)})}),Lg(...e)}var dle={};Ht(dle,{decrypt:()=>hle,encrypt:()=>B9});async function B9(t,e,n){const r=t instanceof Uint8Array?un(t):t,i=Pc.getSharedSecret(r,"02"+e),o=P9(i);let s=Uint8Array.from(s9(16)),a=Li.encode(n),l=g9(o,s).encrypt(a),u=Qo.encode(new Uint8Array(l)),c=Qo.encode(new Uint8Array(s.buffer));return`${u}?iv=${c}`}async function hle(t,e,n){const r=t instanceof Uint8Array?un(t):t;let[i,o]=n.split("?iv="),s=Pc.getSharedSecret(r,"02"+e),a=P9(s),l=Qo.decode(o),u=Qo.decode(i),c=g9(a,l).decrypt(u);return ro.decode(c)}function P9(t){return t.slice(1,33)}var ple={};Ht(ple,{NIP05_REGEX:()=>z9,isValid:()=>yle,queryProfile:()=>j9,searchDomain:()=>gle,useFetchImplementation:()=>mle});var z9=/^(?:([\w.+-]+)@)?([\w_-]+(\.[\w_-]+)+)$/,Vg;try{Vg=fetch}catch{}function mle(t){Vg=t}async function gle(t,e=""){try{const n=`https://${t}/.well-known/nostr.json?name=${e}`;return(await(await Vg(n,{redirect:"error"})).json()).names}catch{return{}}}async function j9(t){var o;const e=t.match(z9);if(!e)return null;const[n,r="_",i]=e;try{const s=`https://${i}/.well-known/nostr.json?name=${r}`,a=await(await Vg(s,{redirect:"error"})).json();let l=a.names[r];return l?{pubkey:l,relays:(o=a.relays)==null?void 0:o[l]}:null}catch{return null}}async function yle(t,e){let n=await j9(e);return n?n.pubkey===t:!1}var ble={};Ht(ble,{parse:()=>vle});function vle(t){const e={reply:void 0,root:void 0,mentions:[],profiles:[]},n=[];for(const r of t.tags)r[0]==="e"&&r[1]&&n.push(r),r[0]==="p"&&r[1]&&e.profiles.push({pubkey:r[1],relays:r[2]?[r[2]]:[]});for(let r=0;rxle,useFetchImplementation:()=>kle});var q9;try{q9=fetch}catch{}function kle(t){q9=t}async function xle(t){return await(await fetch(t.replace("ws://","http://").replace("wss://","https://"),{headers:{Accept:"application/nostr+json"}})).json()}var Ele={};Ht(Ele,{getPow:()=>U9,minePow:()=>Sle});function U9(t){let e=0;for(let n=0;n=e)break}return r}var Cle={};Ht(Cle,{finishRepostEvent:()=>_le,getRepostedEvent:()=>Ale,getRepostedEventPointer:()=>V9});function _le(t,e,n,r){return Da({kind:oE,tags:[...t.tags??[],["e",e.id,n],["p",e.pubkey]],content:t.content===""?"":JSON.stringify(e),created_at:t.created_at},r)}function V9(t){if(t.kind!==oE)return;let e,n;for(let r=t.tags.length-1;r>=0&&(e===void 0||n===void 0);r--){const i=t.tags[r];i.length>=2&&(i[0]==="e"&&e===void 0?e=i:i[0]==="p"&&n===void 0&&(n=i))}if(e!==void 0)return{id:e[1],relays:[e[2],n==null?void 0:n[2]].filter(r=>typeof r=="string"),author:n==null?void 0:n[1]}}function Ale(t,{skipVerification:e}={}){const n=V9(t);if(n===void 0||t.content==="")return;let r;try{r=JSON.parse(t.content)}catch{return}if(r.id===n.id&&!(!e&&!iE(r)))return r}var Tle={};Ht(Tle,{NOSTR_URI_REGEX:()=>Hg,parse:()=>Ole,test:()=>Mle});var Hg=new RegExp(`nostr:(${L9.source})`);function Mle(t){return typeof t=="string"&&new RegExp(`^${Hg.source}$`).test(t)}function Ole(t){const e=t.match(new RegExp(`^${Hg.source}$`));if(!e)throw new Error(`Invalid Nostr URI: ${t}`);return{uri:e[0],value:e[1],decoded:jg(e[1])}}var Dle={};Ht(Dle,{finishReactionEvent:()=>Nle,getReactedEventPointer:()=>$le});function Nle(t,e,n){const r=e.tags.filter(i=>i.length>=2&&(i[0]==="e"||i[0]==="p"));return Da({...t,kind:sE,tags:[...t.tags??[],...r,["e",e.id],["p",e.pubkey]],content:t.content??"+"},n)}function $le(t){if(t.kind!==sE)return;let e,n;for(let r=t.tags.length-1;r>=0&&(e===void 0||n===void 0);r--){const i=t.tags[r];i.length>=2&&(i[0]==="e"&&e===void 0?e=i:i[0]==="p"&&n===void 0&&(n=i))}if(!(e===void 0||n===void 0))return{id:e[1],relays:[e[2],n[2]].filter(r=>r!==void 0),author:n[1]}}var Ile={};Ht(Ile,{matchAll:()=>Rle,regex:()=>cE,replaceAll:()=>Fle});var cE=()=>new RegExp(`\\b${Hg.source}\\b`,"g");function*Rle(t){const e=t.matchAll(cE());for(const n of e)try{const[r,i]=n;yield{uri:r,value:i,decoded:jg(i),start:n.index,end:n.index+r.length}}catch{}}function Fle(t,e){return t.replaceAll(cE(),(n,r)=>e({uri:n,value:r,decoded:jg(r)}))}var Lle={};Ht(Lle,{channelCreateEvent:()=>Ble,channelHideMessageEvent:()=>jle,channelMessageEvent:()=>zle,channelMetadataEvent:()=>Ple,channelMuteUserEvent:()=>qle});var Ble=(t,e)=>{let n;if(typeof t.content=="object")n=JSON.stringify(t.content);else if(typeof t.content=="string")n=t.content;else return;return Da({kind:T9,tags:[...t.tags??[]],content:n,created_at:t.created_at},e)},Ple=(t,e)=>{let n;if(typeof t.content=="object")n=JSON.stringify(t.content);else if(typeof t.content=="string")n=t.content;else return;return Da({kind:M9,tags:[["e",t.channel_create_event_id],...t.tags??[]],content:n,created_at:t.created_at},e)},zle=(t,e)=>{const n=[["e",t.channel_create_event_id,t.relay_url,"root"]];return t.reply_to_channel_message_event_id&&n.push(["e",t.reply_to_channel_message_event_id,t.relay_url,"reply"]),Da({kind:O9,tags:[...n,...t.tags??[]],content:t.content,created_at:t.created_at},e)},jle=(t,e)=>{let n;if(typeof t.content=="object")n=JSON.stringify(t.content);else if(typeof t.content=="string")n=t.content;else return;return Da({kind:D9,tags:[["e",t.channel_message_event_id],...t.tags??[]],content:n,created_at:t.created_at},e)},qle=(t,e)=>{let n;if(typeof t.content=="object")n=JSON.stringify(t.content);else if(typeof t.content=="string")n=t.content;else return;return Da({kind:N9,tags:[["p",t.pubkey_to_mute],...t.tags??[]],content:n,created_at:t.created_at},e)},Ule={};Ht(Ule,{EMOJI_SHORTCODE_REGEX:()=>H9,matchAll:()=>Vle,regex:()=>fE,replaceAll:()=>Hle});var H9=/:(\w+):/,fE=()=>new RegExp(`\\B${H9.source}\\B`,"g");function*Vle(t){const e=t.matchAll(fE());for(const n of e)try{const[r,i]=n;yield{shortcode:r,name:i,start:n.index,end:n.index+r.length}}catch{}}function Hle(t,e){return t.replaceAll(fE(),(n,r)=>e({shortcode:n,name:r}))}var Wle={};Ht(Wle,{useFetchImplementation:()=>Jle,validateGithub:()=>Kle});var dE;try{dE=fetch}catch{}function Jle(t){dE=t}async function Kle(t,e,n){try{return await(await dE(`https://gist.github.com/${e}/${n}/raw`)).text()===`Verifying that I control the following Nostr public key: ${t}`}catch{return!1}}var Gle={};Ht(Gle,{decrypt:()=>Q9,encrypt:()=>Y9,getConversationKey:()=>K9,v2:()=>eue});var W9=1,J9=65535;function K9(t,e){const n=Pc.getSharedSecret(t,"02"+e).subarray(1,33);return _se(zc,n,"nip44-v2")}function G9(t,e){const n=Ase(zc,t,e,76);return{chacha_key:n.subarray(0,32),chacha_nonce:n.subarray(32,44),hmac_key:n.subarray(44,76)}}function hE(t){if(!Number.isSafeInteger(t)||t<1)throw new Error("expected positive integer");if(t<=32)return 32;const e=1<J9)throw new Error("invalid plaintext size: must be between 1 and 65535 bytes");const e=new Uint8Array(2);return new DataView(e.buffer).setUint16(0,t,!1),e}function Yle(t){const e=Li.encode(t),n=e.length,r=Zle(n),i=new Uint8Array(hE(n)-n);return Lg(r,e,i)}function Qle(t){const e=new DataView(t.buffer).getUint16(0),n=t.subarray(2,2+e);if(eJ9||n.length!==e||t.length!==2+hE(e))throw new Error("invalid padding");return ro.decode(n)}function Z9(t,e,n){if(n.length!==32)throw new Error("AAD associated data must be 32 bytes");const r=Lg(n,e);return Pg(zc,t,r)}function Xle(t){if(typeof t!="string")throw new Error("payload must be a valid string");const e=t.length;if(e<132||e>87472)throw new Error("invalid payload length: "+e);if(t[0]==="#")throw new Error("unknown encryption version");let n;try{n=Qo.decode(t)}catch(o){throw new Error("invalid base64: "+o.message)}const r=n.length;if(r<99||r>65603)throw new Error("invalid data length: "+r);const i=n[0];if(i!==2)throw new Error("unknown encryption version "+i);return{nonce:n.subarray(1,33),ciphertext:n.subarray(33,-32),mac:n.subarray(-32)}}function Y9(t,e,n=s9(32)){const{chacha_key:r,chacha_nonce:i,hmac_key:o}=G9(e,n),s=Yle(t),a=w9(r,i,s),l=Z9(o,a,n);return Qo.encode(Lg(new Uint8Array([2]),n,a,l))}function Q9(t,e){const{nonce:n,ciphertext:r,mac:i}=Xle(t),{chacha_key:o,chacha_nonce:s,hmac_key:a}=G9(e,n),l=Z9(a,r,n);if(!ase(l,i))throw new Error("invalid MAC");const u=w9(o,s,r);return Qle(u)}var eue={utils:{getConversationKey:K9,calcPaddedLen:hE},encrypt:Y9,decrypt:Q9},tue={};Ht(tue,{makeNwcRequestEvent:()=>rue,parseConnectionString:()=>nue});function nue(t){const{pathname:e,searchParams:n}=new URL(t),r=e,i=n.get("relay"),o=n.get("secret");if(!r||!i||!o)throw new Error("invalid connection string");return{pubkey:r,relay:i,secret:o}}async function rue(t,e,n){const i=await B9(e,t,JSON.stringify({method:"pay_invoice",params:{invoice:n}})),o={kind:I9,created_at:Math.round(Date.now()/1e3),content:i,tags:[["p",t]]};return Da(o,e)}var iue={};Ht(iue,{getZapEndpoint:()=>sue,makeZapReceipt:()=>uue,makeZapRequest:()=>aue,useFetchImplementation:()=>oue,validateZapRequest:()=>lue});var pE;try{pE=fetch}catch{}function oue(t){pE=t}async function sue(t){try{let e="",{lud06:n,lud16:r}=JSON.parse(t.content);if(n){let{words:s}=Ec.decode(n,1e3),a=Ec.fromWords(s);e=ro.decode(a)}else if(r){let[s,a]=r.split("@");e=new URL(`/.well-known/lnurlp/${s}`,`https://${a}`).toString()}else return null;let o=await(await pE(e)).json();if(o.allowsNostr&&o.nostrPubkey)return o.callback}catch{}return null}function aue({profile:t,event:e,amount:n,relays:r,comment:i=""}){if(!n)throw new Error("amount not given");if(!t)throw new Error("profile not given");let o={kind:9734,created_at:Math.round(Date.now()/1e3),content:i,tags:[["p",t],["amount",n.toString()],["relays",...r]]};return e&&o.tags.push(["e",e]),o}function lue(t){let e;try{e=JSON.parse(t)}catch{return"Invalid zap request JSON."}if(!x9(e))return"Zap request is not a valid Nostr event.";if(!iE(e))return"Invalid signature on zap request.";let n=e.tags.find(([o,s])=>o==="p"&&s);if(!n)return"Zap request doesn't have a 'p' tag.";if(!n[1].match(/^[a-f0-9]{64}$/))return"Zap request 'p' tag is not valid hex.";let r=e.tags.find(([o,s])=>o==="e"&&s);return r&&!r[1].match(/^[a-f0-9]{64}$/)?"Zap request 'e' tag is not valid hex.":e.tags.find(([o,s])=>o==="relays"&&s)?null:"Zap request doesn't have a 'relays' tag."}function uue({zapRequest:t,preimage:e,bolt11:n,paidAt:r}){let i=JSON.parse(t),o=i.tags.filter(([a])=>a==="e"||a==="p"||a==="a"),s={kind:9735,created_at:Math.round(r.getTime()/1e3),content:"",tags:[...o,["P",i.pubkey],["bolt11",n],["description",t]]};return e&&s.tags.push(["preimage",e]),s}var cue={};Ht(cue,{getToken:()=>fue,hashPayload:()=>mE,unpackEventFromToken:()=>eI,validateEvent:()=>sI,validateEventKind:()=>nI,validateEventMethodTag:()=>iI,validateEventPayloadTag:()=>oI,validateEventTimestamp:()=>tI,validateEventUrlTag:()=>rI,validateToken:()=>due});var X9="Nostr ";async function fue(t,e,n,r=!1,i){const o={kind:aE,tags:[["u",t],["method",e]],created_at:Math.round(new Date().getTime()/1e3),content:""};i&&o.tags.push(["payload",mE(i)]);const s=await n(o);return(r?X9:"")+Qo.encode(Li.encode(JSON.stringify(s)))}async function due(t,e,n){const r=await eI(t).catch(o=>{throw o});return await sI(r,e,n).catch(o=>{throw o})}async function eI(t){if(!t)throw new Error("Missing token");t=t.replace(X9,"");const e=ro.decode(Qo.decode(t));if(!e||e.length===0||!e.startsWith("{"))throw new Error("Invalid token");return JSON.parse(e)}function tI(t){return t.created_at?Math.round(new Date().getTime()/1e3)-t.created_at<60:!1}function nI(t){return t.kind===aE}function rI(t,e){const n=t.tags.find(r=>r[0]==="u");return n?n.length>0&&n[1]===e:!1}function iI(t,e){const n=t.tags.find(r=>r[0]==="method");return n?n.length>0&&n[1].toLowerCase()===e.toLowerCase():!1}function mE(t){const e=zc(Li.encode(JSON.stringify(t)));return un(e)}function oI(t,e){const n=t.tags.find(i=>i[0]==="payload");if(!n)return!1;const r=mE(e);return n.length>0&&n[1]===r}async function sI(t,e,n,r){if(!iE(t))throw new Error("Invalid nostr event, signature invalid");if(!nI(t))throw new Error("Invalid nostr event, kind invalid");if(!tI(t))throw new Error("Invalid nostr event, created_at timestamp invalid");if(!rI(t,e))throw new Error("Invalid nostr event, url tag invalid");if(!iI(t,n))throw new Error("Invalid nostr event, method tag invalid");if(r&&typeof r=="object"&&Object.keys(r).length>0&&!oI(t,r))throw new Error("Invalid nostr event, payload tag does not match request body hash");return!0}var aI={exports:{}};(function(t,e){(function(n,r){t.exports=r(ee)})(gF,function(n){return function(r){var i={};function o(s){if(i[s])return i[s].exports;var a=i[s]={i:s,l:!1,exports:{}};return r[s].call(a.exports,a,a.exports,o),a.l=!0,a.exports}return o.m=r,o.c=i,o.d=function(s,a,l){o.o(s,a)||Object.defineProperty(s,a,{enumerable:!0,get:l})},o.r=function(s){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})},o.t=function(s,a){if(1&a&&(s=o(s)),8&a||4&a&&typeof s=="object"&&s&&s.__esModule)return s;var l=Object.create(null);if(o.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:s}),2&a&&typeof s!="string")for(var u in s)o.d(l,u,(function(c){return s[c]}).bind(null,u));return l},o.n=function(s){var a=s&&s.__esModule?function(){return s.default}:function(){return s};return o.d(a,"a",a),a},o.o=function(s,a){return Object.prototype.hasOwnProperty.call(s,a)},o.p="",o(o.s=48)}([function(r,i){r.exports=n},function(r,i){var o=r.exports={version:"2.6.12"};typeof __e=="number"&&(__e=o)},function(r,i,o){var s=o(26)("wks"),a=o(17),l=o(3).Symbol,u=typeof l=="function";(r.exports=function(c){return s[c]||(s[c]=u&&l[c]||(u?l:a)("Symbol."+c))}).store=s},function(r,i){var o=r.exports=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=o)},function(r,i,o){r.exports=!o(8)(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},function(r,i){var o={}.hasOwnProperty;r.exports=function(s,a){return o.call(s,a)}},function(r,i,o){var s=o(7),a=o(16);r.exports=o(4)?function(l,u,c){return s.f(l,u,a(1,c))}:function(l,u,c){return l[u]=c,l}},function(r,i,o){var s=o(10),a=o(35),l=o(23),u=Object.defineProperty;i.f=o(4)?Object.defineProperty:function(c,f,d){if(s(c),f=l(f,!0),s(d),a)try{return u(c,f,d)}catch{}if("get"in d||"set"in d)throw TypeError("Accessors not supported!");return"value"in d&&(c[f]=d.value),c}},function(r,i){r.exports=function(o){try{return!!o()}catch{return!0}}},function(r,i,o){var s=o(40),a=o(22);r.exports=function(l){return s(a(l))}},function(r,i,o){var s=o(11);r.exports=function(a){if(!s(a))throw TypeError(a+" is not an object!");return a}},function(r,i){r.exports=function(o){return typeof o=="object"?o!==null:typeof o=="function"}},function(r,i){r.exports={}},function(r,i,o){var s=o(39),a=o(27);r.exports=Object.keys||function(l){return s(l,a)}},function(r,i){r.exports=!0},function(r,i,o){var s=o(3),a=o(1),l=o(53),u=o(6),c=o(5),f=function(d,h,p){var m,b,y,v=d&f.F,w=d&f.G,g=d&f.S,x=d&f.P,k=d&f.B,E=d&f.W,D=w?a:a[h]||(a[h]={}),O=D.prototype,N=w?s:g?s[h]:(s[h]||{}).prototype;for(m in w&&(p=h),p)(b=!v&&N&&N[m]!==void 0)&&c(D,m)||(y=b?N[m]:p[m],D[m]=w&&typeof N[m]!="function"?p[m]:k&&b?l(y,s):E&&N[m]==y?function(C){var R=function(T,q,A){if(this instanceof C){switch(arguments.length){case 0:return new C;case 1:return new C(T);case 2:return new C(T,q)}return new C(T,q,A)}return C.apply(this,arguments)};return R.prototype=C.prototype,R}(y):x&&typeof y=="function"?l(Function.call,y):y,x&&((D.virtual||(D.virtual={}))[m]=y,d&f.R&&O&&!O[m]&&u(O,m,y)))};f.F=1,f.G=2,f.S=4,f.P=8,f.B=16,f.W=32,f.U=64,f.R=128,r.exports=f},function(r,i){r.exports=function(o,s){return{enumerable:!(1&o),configurable:!(2&o),writable:!(4&o),value:s}}},function(r,i){var o=0,s=Math.random();r.exports=function(a){return"Symbol(".concat(a===void 0?"":a,")_",(++o+s).toString(36))}},function(r,i,o){var s=o(22);r.exports=function(a){return Object(s(a))}},function(r,i){i.f={}.propertyIsEnumerable},function(r,i,o){var s=o(52)(!0);o(34)(String,"String",function(a){this._t=String(a),this._i=0},function(){var a,l=this._t,u=this._i;return u>=l.length?{value:void 0,done:!0}:(a=s(l,u),this._i+=a.length,{value:a,done:!1})})},function(r,i){var o=Math.ceil,s=Math.floor;r.exports=function(a){return isNaN(a=+a)?0:(a>0?s:o)(a)}},function(r,i){r.exports=function(o){if(o==null)throw TypeError("Can't call method on "+o);return o}},function(r,i,o){var s=o(11);r.exports=function(a,l){if(!s(a))return a;var u,c;if(l&&typeof(u=a.toString)=="function"&&!s(c=u.call(a))||typeof(u=a.valueOf)=="function"&&!s(c=u.call(a))||!l&&typeof(u=a.toString)=="function"&&!s(c=u.call(a)))return c;throw TypeError("Can't convert object to primitive value")}},function(r,i){var o={}.toString;r.exports=function(s){return o.call(s).slice(8,-1)}},function(r,i,o){var s=o(26)("keys"),a=o(17);r.exports=function(l){return s[l]||(s[l]=a(l))}},function(r,i,o){var s=o(1),a=o(3),l=a["__core-js_shared__"]||(a["__core-js_shared__"]={});(r.exports=function(u,c){return l[u]||(l[u]=c!==void 0?c:{})})("versions",[]).push({version:s.version,mode:o(14)?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},function(r,i){r.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(r,i,o){var s=o(7).f,a=o(5),l=o(2)("toStringTag");r.exports=function(u,c,f){u&&!a(u=f?u:u.prototype,l)&&s(u,l,{configurable:!0,value:c})}},function(r,i,o){o(62);for(var s=o(3),a=o(6),l=o(12),u=o(2)("toStringTag"),c="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),f=0;fdocument.F=Object<\/script>"),d.close(),f=d.F;p--;)delete f.prototype[l[p]];return f()};r.exports=Object.create||function(d,h){var p;return d!==null?(c.prototype=s(d),p=new c,c.prototype=null,p[u]=d):p=f(),h===void 0?p:a(p,h)}},function(r,i,o){var s=o(5),a=o(9),l=o(57)(!1),u=o(25)("IE_PROTO");r.exports=function(c,f){var d,h=a(c),p=0,m=[];for(d in h)d!=u&&s(h,d)&&m.push(d);for(;f.length>p;)s(h,d=f[p++])&&(~l(m,d)||m.push(d));return m}},function(r,i,o){var s=o(24);r.exports=Object("z").propertyIsEnumerable(0)?Object:function(a){return s(a)=="String"?a.split(""):Object(a)}},function(r,i,o){var s=o(39),a=o(27).concat("length","prototype");i.f=Object.getOwnPropertyNames||function(l){return s(l,a)}},function(r,i,o){var s=o(24),a=o(2)("toStringTag"),l=s(function(){return arguments}())=="Arguments";r.exports=function(u){var c,f,d;return u===void 0?"Undefined":u===null?"Null":typeof(f=function(h,p){try{return h[p]}catch{}}(c=Object(u),a))=="string"?f:l?s(c):(d=s(c))=="Object"&&typeof c.callee=="function"?"Arguments":d}},function(r,i){var o;o=function(){return this}();try{o=o||new Function("return this")()}catch{typeof window=="object"&&(o=window)}r.exports=o},function(r,i){var o=/-?\d+(\.\d+)?%?/g;r.exports=function(s){return s.match(o)}},function(r,i,o){Object.defineProperty(i,"__esModule",{value:!0}),i.getBase16Theme=i.createStyling=i.invertTheme=void 0;var s=b(o(49)),a=b(o(76)),l=b(o(81)),u=b(o(89)),c=b(o(93)),f=function(O){if(O&&O.__esModule)return O;var N={};if(O!=null)for(var C in O)Object.prototype.hasOwnProperty.call(O,C)&&(N[C]=O[C]);return N.default=O,N}(o(94)),d=b(o(132)),h=b(o(133)),p=b(o(138)),m=o(139);function b(O){return O&&O.__esModule?O:{default:O}}var y=f.default,v=(0,u.default)(y),w=(0,p.default)(h.default,m.rgb2yuv,function(O){var N,C=(0,l.default)(O,3),R=C[0],T=C[1],q=C[2];return[(N=R,N<.25?1:N<.5?.9-N:1.1-N),T,q]},m.yuv2rgb,d.default),g=function(O){return function(N){return{className:[N.className,O.className].filter(Boolean).join(" "),style:(0,a.default)({},N.style||{},O.style||{})}}},x=function(O,N){var C=(0,u.default)(N);for(var R in O)C.indexOf(R)===-1&&C.push(R);return C.reduce(function(T,q){return T[q]=function(A,S){if(A===void 0)return S;if(S===void 0)return A;var P=A===void 0?"undefined":(0,s.default)(A),B=S===void 0?"undefined":(0,s.default)(S);switch(P){case"string":switch(B){case"string":return[S,A].filter(Boolean).join(" ");case"object":return g({className:A,style:S});case"function":return function(j){for(var z=arguments.length,J=Array(z>1?z-1:0),K=1;K1?z-1:0),K=1;K1?z-1:0),K=1;K1?z-1:0),K=1;K1?z-1:0),K=1;K2?C-2:0),T=2;T3?N-3:0),R=3;R1&&arguments[1]!==void 0?arguments[1]:{},q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},A=T.defaultBase16,S=A===void 0?y:A,P=T.base16Themes,B=P===void 0?null:P,j=D(q,B);j&&(q=(0,a.default)({},j,q));var z=v.reduce(function(fe,ke){return fe[ke]=q[ke]||S[ke],fe},{}),J=(0,u.default)(q).reduce(function(fe,ke){return v.indexOf(ke)===-1&&(fe[ke]=q[ke]),fe},{}),K=O(z),ae=x(J,K);return(0,c.default)(k,2).apply(void 0,[ae].concat(C))},3),i.getBase16Theme=function(O,N){if(O&&O.extend&&(O=O.extend),typeof O=="string"){var C=O.split(":"),R=(0,l.default)(C,2),T=R[0],q=R[1];O=(N||{})[T]||f[T],q==="inverted"&&(O=E(O))}return O&&O.hasOwnProperty("base00")?O:void 0})},function(r,i,o){var s,a=typeof Reflect=="object"?Reflect:null,l=a&&typeof a.apply=="function"?a.apply:function(g,x,k){return Function.prototype.apply.call(g,x,k)};s=a&&typeof a.ownKeys=="function"?a.ownKeys:Object.getOwnPropertySymbols?function(g){return Object.getOwnPropertyNames(g).concat(Object.getOwnPropertySymbols(g))}:function(g){return Object.getOwnPropertyNames(g)};var u=Number.isNaN||function(g){return g!=g};function c(){c.init.call(this)}r.exports=c,r.exports.once=function(g,x){return new Promise(function(k,E){function D(){O!==void 0&&g.removeListener("error",O),k([].slice.call(arguments))}var O;x!=="error"&&(O=function(N){g.removeListener(x,D),E(N)},g.once("error",O)),g.once(x,D)})},c.EventEmitter=c,c.prototype._events=void 0,c.prototype._eventsCount=0,c.prototype._maxListeners=void 0;var f=10;function d(g){if(typeof g!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof g)}function h(g){return g._maxListeners===void 0?c.defaultMaxListeners:g._maxListeners}function p(g,x,k,E){var D,O,N,C;if(d(k),(O=g._events)===void 0?(O=g._events=Object.create(null),g._eventsCount=0):(O.newListener!==void 0&&(g.emit("newListener",x,k.listener?k.listener:k),O=g._events),N=O[x]),N===void 0)N=O[x]=k,++g._eventsCount;else if(typeof N=="function"?N=O[x]=E?[k,N]:[N,k]:E?N.unshift(k):N.push(k),(D=h(g))>0&&N.length>D&&!N.warned){N.warned=!0;var R=new Error("Possible EventEmitter memory leak detected. "+N.length+" "+String(x)+" listeners added. Use emitter.setMaxListeners() to increase limit");R.name="MaxListenersExceededWarning",R.emitter=g,R.type=x,R.count=N.length,C=R,console&&console.warn&&console.warn(C)}return g}function m(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function b(g,x,k){var E={fired:!1,wrapFn:void 0,target:g,type:x,listener:k},D=m.bind(E);return D.listener=k,E.wrapFn=D,D}function y(g,x,k){var E=g._events;if(E===void 0)return[];var D=E[x];return D===void 0?[]:typeof D=="function"?k?[D.listener||D]:[D]:k?function(O){for(var N=new Array(O.length),C=0;C0&&(O=x[0]),O instanceof Error)throw O;var N=new Error("Unhandled error."+(O?" ("+O.message+")":""));throw N.context=O,N}var C=D[g];if(C===void 0)return!1;if(typeof C=="function")l(C,this,x);else{var R=C.length,T=w(C,R);for(k=0;k=0;O--)if(k[O]===x||k[O].listener===x){N=k[O].listener,D=O;break}if(D<0)return this;D===0?k.shift():function(C,R){for(;R+1=0;E--)this.removeListener(g,x[E]);return this},c.prototype.listeners=function(g){return y(this,g,!0)},c.prototype.rawListeners=function(g){return y(this,g,!1)},c.listenerCount=function(g,x){return typeof g.listenerCount=="function"?g.listenerCount(x):v.call(g,x)},c.prototype.listenerCount=v,c.prototype.eventNames=function(){return this._eventsCount>0?s(this._events):[]}},function(r,i,o){r.exports.Dispatcher=o(140)},function(r,i,o){r.exports=o(142)},function(r,i,o){i.__esModule=!0;var s=u(o(50)),a=u(o(65)),l=typeof a.default=="function"&&typeof s.default=="symbol"?function(c){return typeof c}:function(c){return c&&typeof a.default=="function"&&c.constructor===a.default&&c!==a.default.prototype?"symbol":typeof c};function u(c){return c&&c.__esModule?c:{default:c}}i.default=typeof a.default=="function"&&l(s.default)==="symbol"?function(c){return c===void 0?"undefined":l(c)}:function(c){return c&&typeof a.default=="function"&&c.constructor===a.default&&c!==a.default.prototype?"symbol":c===void 0?"undefined":l(c)}},function(r,i,o){r.exports={default:o(51),__esModule:!0}},function(r,i,o){o(20),o(29),r.exports=o(30).f("iterator")},function(r,i,o){var s=o(21),a=o(22);r.exports=function(l){return function(u,c){var f,d,h=String(a(u)),p=s(c),m=h.length;return p<0||p>=m?l?"":void 0:(f=h.charCodeAt(p))<55296||f>56319||p+1===m||(d=h.charCodeAt(p+1))<56320||d>57343?l?h.charAt(p):f:l?h.slice(p,p+2):d-56320+(f-55296<<10)+65536}}},function(r,i,o){var s=o(54);r.exports=function(a,l,u){if(s(a),l===void 0)return a;switch(u){case 1:return function(c){return a.call(l,c)};case 2:return function(c,f){return a.call(l,c,f)};case 3:return function(c,f,d){return a.call(l,c,f,d)}}return function(){return a.apply(l,arguments)}}},function(r,i){r.exports=function(o){if(typeof o!="function")throw TypeError(o+" is not a function!");return o}},function(r,i,o){var s=o(38),a=o(16),l=o(28),u={};o(6)(u,o(2)("iterator"),function(){return this}),r.exports=function(c,f,d){c.prototype=s(u,{next:a(1,d)}),l(c,f+" Iterator")}},function(r,i,o){var s=o(7),a=o(10),l=o(13);r.exports=o(4)?Object.defineProperties:function(u,c){a(u);for(var f,d=l(c),h=d.length,p=0;h>p;)s.f(u,f=d[p++],c[f]);return u}},function(r,i,o){var s=o(9),a=o(58),l=o(59);r.exports=function(u){return function(c,f,d){var h,p=s(c),m=a(p.length),b=l(d,m);if(u&&f!=f){for(;m>b;)if((h=p[b++])!=h)return!0}else for(;m>b;b++)if((u||b in p)&&p[b]===f)return u||b||0;return!u&&-1}}},function(r,i,o){var s=o(21),a=Math.min;r.exports=function(l){return l>0?a(s(l),9007199254740991):0}},function(r,i,o){var s=o(21),a=Math.max,l=Math.min;r.exports=function(u,c){return(u=s(u))<0?a(u+c,0):l(u,c)}},function(r,i,o){var s=o(3).document;r.exports=s&&s.documentElement},function(r,i,o){var s=o(5),a=o(18),l=o(25)("IE_PROTO"),u=Object.prototype;r.exports=Object.getPrototypeOf||function(c){return c=a(c),s(c,l)?c[l]:typeof c.constructor=="function"&&c instanceof c.constructor?c.constructor.prototype:c instanceof Object?u:null}},function(r,i,o){var s=o(63),a=o(64),l=o(12),u=o(9);r.exports=o(34)(Array,"Array",function(c,f){this._t=u(c),this._i=0,this._k=f},function(){var c=this._t,f=this._k,d=this._i++;return!c||d>=c.length?(this._t=void 0,a(1)):a(0,f=="keys"?d:f=="values"?c[d]:[d,c[d]])},"values"),l.Arguments=l.Array,s("keys"),s("values"),s("entries")},function(r,i){r.exports=function(){}},function(r,i){r.exports=function(o,s){return{value:s,done:!!o}}},function(r,i,o){r.exports={default:o(66),__esModule:!0}},function(r,i,o){o(67),o(73),o(74),o(75),r.exports=o(1).Symbol},function(r,i,o){var s=o(3),a=o(5),l=o(4),u=o(15),c=o(37),f=o(68).KEY,d=o(8),h=o(26),p=o(28),m=o(17),b=o(2),y=o(30),v=o(31),w=o(69),g=o(70),x=o(10),k=o(11),E=o(18),D=o(9),O=o(23),N=o(16),C=o(38),R=o(71),T=o(72),q=o(32),A=o(7),S=o(13),P=T.f,B=A.f,j=R.f,z=s.Symbol,J=s.JSON,K=J&&J.stringify,ae=b("_hidden"),fe=b("toPrimitive"),ke={}.propertyIsEnumerable,ve=h("symbol-registry"),xe=h("symbols"),Se=h("op-symbols"),Oe=Object.prototype,Fe=typeof z=="function"&&!!q.f,mt=s.QObject,Ce=!mt||!mt.prototype||!mt.prototype.findChild,pe=l&&d(function(){return C(B({},"a",{get:function(){return B(this,"a",{value:7}).a}})).a!=7})?function(W,X,se){var ge=P(Oe,X);ge&&delete Oe[X],B(W,X,se),ge&&W!==Oe&&B(Oe,X,ge)}:B,De=function(W){var X=xe[W]=C(z.prototype);return X._k=W,X},Le=Fe&&typeof z.iterator=="symbol"?function(W){return typeof W=="symbol"}:function(W){return W instanceof z},Ge=function(W,X,se){return W===Oe&&Ge(Se,X,se),x(W),X=O(X,!0),x(se),a(xe,X)?(se.enumerable?(a(W,ae)&&W[ae][X]&&(W[ae][X]=!1),se=C(se,{enumerable:N(0,!1)})):(a(W,ae)||B(W,ae,N(1,{})),W[ae][X]=!0),pe(W,X,se)):B(W,X,se)},Qt=function(W,X){x(W);for(var se,ge=w(X=D(X)),Pe=0,Be=ge.length;Be>Pe;)Ge(W,se=ge[Pe++],X[se]);return W},rt=function(W){var X=ke.call(this,W=O(W,!0));return!(this===Oe&&a(xe,W)&&!a(Se,W))&&(!(X||!a(this,W)||!a(xe,W)||a(this,ae)&&this[ae][W])||X)},it=function(W,X){if(W=D(W),X=O(X,!0),W!==Oe||!a(xe,X)||a(Se,X)){var se=P(W,X);return!se||!a(xe,X)||a(W,ae)&&W[ae][X]||(se.enumerable=!0),se}},bt=function(W){for(var X,se=j(D(W)),ge=[],Pe=0;se.length>Pe;)a(xe,X=se[Pe++])||X==ae||X==f||ge.push(X);return ge},Ft=function(W){for(var X,se=W===Oe,ge=j(se?Se:D(W)),Pe=[],Be=0;ge.length>Be;)!a(xe,X=ge[Be++])||se&&!a(Oe,X)||Pe.push(xe[X]);return Pe};Fe||(c((z=function(){if(this instanceof z)throw TypeError("Symbol is not a constructor!");var W=m(arguments.length>0?arguments[0]:void 0),X=function(se){this===Oe&&X.call(Se,se),a(this,ae)&&a(this[ae],W)&&(this[ae][W]=!1),pe(this,W,N(1,se))};return l&&Ce&&pe(Oe,W,{configurable:!0,set:X}),De(W)}).prototype,"toString",function(){return this._k}),T.f=it,A.f=Ge,o(41).f=R.f=bt,o(19).f=rt,q.f=Ft,l&&!o(14)&&c(Oe,"propertyIsEnumerable",rt,!0),y.f=function(W){return De(b(W))}),u(u.G+u.W+u.F*!Fe,{Symbol:z});for(var Lt="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),at=0;Lt.length>at;)b(Lt[at++]);for(var gt=S(b.store),Y=0;gt.length>Y;)v(gt[Y++]);u(u.S+u.F*!Fe,"Symbol",{for:function(W){return a(ve,W+="")?ve[W]:ve[W]=z(W)},keyFor:function(W){if(!Le(W))throw TypeError(W+" is not a symbol!");for(var X in ve)if(ve[X]===W)return X},useSetter:function(){Ce=!0},useSimple:function(){Ce=!1}}),u(u.S+u.F*!Fe,"Object",{create:function(W,X){return X===void 0?C(W):Qt(C(W),X)},defineProperty:Ge,defineProperties:Qt,getOwnPropertyDescriptor:it,getOwnPropertyNames:bt,getOwnPropertySymbols:Ft});var V=d(function(){q.f(1)});u(u.S+u.F*V,"Object",{getOwnPropertySymbols:function(W){return q.f(E(W))}}),J&&u(u.S+u.F*(!Fe||d(function(){var W=z();return K([W])!="[null]"||K({a:W})!="{}"||K(Object(W))!="{}"})),"JSON",{stringify:function(W){for(var X,se,ge=[W],Pe=1;arguments.length>Pe;)ge.push(arguments[Pe++]);if(se=X=ge[1],(k(X)||W!==void 0)&&!Le(W))return g(X)||(X=function(Be,nt){if(typeof se=="function"&&(nt=se.call(this,Be,nt)),!Le(nt))return nt}),ge[1]=X,K.apply(J,ge)}}),z.prototype[fe]||o(6)(z.prototype,fe,z.prototype.valueOf),p(z,"Symbol"),p(Math,"Math",!0),p(s.JSON,"JSON",!0)},function(r,i,o){var s=o(17)("meta"),a=o(11),l=o(5),u=o(7).f,c=0,f=Object.isExtensible||function(){return!0},d=!o(8)(function(){return f(Object.preventExtensions({}))}),h=function(m){u(m,s,{value:{i:"O"+ ++c,w:{}}})},p=r.exports={KEY:s,NEED:!1,fastKey:function(m,b){if(!a(m))return typeof m=="symbol"?m:(typeof m=="string"?"S":"P")+m;if(!l(m,s)){if(!f(m))return"F";if(!b)return"E";h(m)}return m[s].i},getWeak:function(m,b){if(!l(m,s)){if(!f(m))return!0;if(!b)return!1;h(m)}return m[s].w},onFreeze:function(m){return d&&p.NEED&&f(m)&&!l(m,s)&&h(m),m}}},function(r,i,o){var s=o(13),a=o(32),l=o(19);r.exports=function(u){var c=s(u),f=a.f;if(f)for(var d,h=f(u),p=l.f,m=0;h.length>m;)p.call(u,d=h[m++])&&c.push(d);return c}},function(r,i,o){var s=o(24);r.exports=Array.isArray||function(a){return s(a)=="Array"}},function(r,i,o){var s=o(9),a=o(41).f,l={}.toString,u=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];r.exports.f=function(c){return u&&l.call(c)=="[object Window]"?function(f){try{return a(f)}catch{return u.slice()}}(c):a(s(c))}},function(r,i,o){var s=o(19),a=o(16),l=o(9),u=o(23),c=o(5),f=o(35),d=Object.getOwnPropertyDescriptor;i.f=o(4)?d:function(h,p){if(h=l(h),p=u(p,!0),f)try{return d(h,p)}catch{}if(c(h,p))return a(!s.f.call(h,p),h[p])}},function(r,i){},function(r,i,o){o(31)("asyncIterator")},function(r,i,o){o(31)("observable")},function(r,i,o){i.__esModule=!0;var s,a=o(77),l=(s=a)&&s.__esModule?s:{default:s};i.default=l.default||function(u){for(var c=1;cy;)for(var g,x=f(arguments[y++]),k=v?a(x).concat(v(x)):a(x),E=k.length,D=0;E>D;)g=k[D++],s&&!w.call(x,g)||(m[g]=x[g]);return m}:d},function(r,i,o){i.__esModule=!0;var s=l(o(82)),a=l(o(85));function l(u){return u&&u.__esModule?u:{default:u}}i.default=function(u,c){if(Array.isArray(u))return u;if((0,s.default)(Object(u)))return function(f,d){var h=[],p=!0,m=!1,b=void 0;try{for(var y,v=(0,a.default)(f);!(p=(y=v.next()).done)&&(h.push(y.value),!d||h.length!==d);p=!0);}catch(w){m=!0,b=w}finally{try{!p&&v.return&&v.return()}finally{if(m)throw b}}return h}(u,c);throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(r,i,o){r.exports={default:o(83),__esModule:!0}},function(r,i,o){o(29),o(20),r.exports=o(84)},function(r,i,o){var s=o(42),a=o(2)("iterator"),l=o(12);r.exports=o(1).isIterable=function(u){var c=Object(u);return c[a]!==void 0||"@@iterator"in c||l.hasOwnProperty(s(c))}},function(r,i,o){r.exports={default:o(86),__esModule:!0}},function(r,i,o){o(29),o(20),r.exports=o(87)},function(r,i,o){var s=o(10),a=o(88);r.exports=o(1).getIterator=function(l){var u=a(l);if(typeof u!="function")throw TypeError(l+" is not iterable!");return s(u.call(l))}},function(r,i,o){var s=o(42),a=o(2)("iterator"),l=o(12);r.exports=o(1).getIteratorMethod=function(u){if(u!=null)return u[a]||u["@@iterator"]||l[s(u)]}},function(r,i,o){r.exports={default:o(90),__esModule:!0}},function(r,i,o){o(91),r.exports=o(1).Object.keys},function(r,i,o){var s=o(18),a=o(13);o(92)("keys",function(){return function(l){return a(s(l))}})},function(r,i,o){var s=o(15),a=o(1),l=o(8);r.exports=function(u,c){var f=(a.Object||{})[u]||Object[u],d={};d[u]=c(f),s(s.S+s.F*l(function(){f(1)}),"Object",d)}},function(r,i,o){(function(s){var a=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],l=/^\s+|\s+$/g,u=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,c=/\{\n\/\* \[wrapped with (.+)\] \*/,f=/,? & /,d=/^[-+]0x[0-9a-f]+$/i,h=/^0b[01]+$/i,p=/^\[object .+?Constructor\]$/,m=/^0o[0-7]+$/i,b=/^(?:0|[1-9]\d*)$/,y=parseInt,v=typeof s=="object"&&s&&s.Object===Object&&s,w=typeof self=="object"&&self&&self.Object===Object&&self,g=v||w||Function("return this")();function x(Y,V,W){switch(W.length){case 0:return Y.call(V);case 1:return Y.call(V,W[0]);case 2:return Y.call(V,W[0],W[1]);case 3:return Y.call(V,W[0],W[1],W[2])}return Y.apply(V,W)}function k(Y,V){return!!(Y&&Y.length)&&function(W,X,se){if(X!=X)return function(Be,nt,G,re){for(var me=Be.length,Ee=G+-1;++Ee-1}function E(Y){return Y!=Y}function D(Y,V){for(var W=Y.length,X=0;W--;)Y[W]===V&&X++;return X}function O(Y,V){for(var W=-1,X=Y.length,se=0,ge=[];++W2?C:void 0);function ke(Y){return Lt(Y)?J(Y):{}}function ve(Y){return!(!Lt(Y)||function(V){return!!S&&S in V}(Y))&&(function(V){var W=Lt(V)?j.call(V):"";return W=="[object Function]"||W=="[object GeneratorFunction]"}(Y)||function(V){var W=!1;if(V!=null&&typeof V.toString!="function")try{W=!!(V+"")}catch{}return W}(Y)?z:p).test(function(V){if(V!=null){try{return P.call(V)}catch{}try{return V+""}catch{}}return""}(Y))}function xe(Y,V,W,X){for(var se=-1,ge=Y.length,Pe=W.length,Be=-1,nt=V.length,G=K(ge-Pe,0),re=Array(nt+G),me=!X;++Be1&&Ie.reverse(),re&&nt1?"& ":"")+V[X],V=V.join(W>2?", ":" "),Y.replace(u,`{ +/* [wrapped with `+V+`] */ +`)}function Qt(Y,V){return!!(V=V??9007199254740991)&&(typeof Y=="number"||b.test(Y))&&Y>-1&&Y%1==0&&Y1&&l--,c=6*l<1?s+6*(a-s)*l:2*l<1?a:3*l<2?s+(a-s)*(2/3-l)*6:s,u[p]=255*c;return u}},function(r,i,o){(function(s){var a=typeof s=="object"&&s&&s.Object===Object&&s,l=typeof self=="object"&&self&&self.Object===Object&&self,u=a||l||Function("return this")();function c(O,N,C){switch(C.length){case 0:return O.call(N);case 1:return O.call(N,C[0]);case 2:return O.call(N,C[0],C[1]);case 3:return O.call(N,C[0],C[1],C[2])}return O.apply(N,C)}function f(O,N){for(var C=-1,R=N.length,T=O.length;++C-1&&T%1==0&&T<=9007199254740991}(R.length)&&!function(T){var q=function(A){var S=typeof A;return!!A&&(S=="object"||S=="function")}(T)?p.call(T):"";return q=="[object Function]"||q=="[object GeneratorFunction]"}(R)}(C)}(N)&&h.call(N,"callee")&&(!b.call(N,"callee")||p.call(N)=="[object Arguments]")}(O)||!!(y&&O&&O[y])}var g=Array.isArray,x,k,E,D=(k=function(O){var N=(O=function(T,q,A,S,P){var B=-1,j=T.length;for(A||(A=w),P||(P=[]);++B2?l-2:0),c=2;c"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var M,$=p(F);if(L){var I=p(this).constructor;M=Reflect.construct($,arguments,I)}else M=$.apply(this,arguments);return y(this,M)}}o.r(i);var w=o(0),g=o.n(w);function x(){var F=this.constructor.getDerivedStateFromProps(this.props,this.state);F!=null&&this.setState(F)}function k(F){this.setState((function(L){var M=this.constructor.getDerivedStateFromProps(F,L);return M??null}).bind(this))}function E(F,L){try{var M=this.props,$=this.state;this.props=F,this.state=L,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(M,$)}finally{this.props=M,this.state=$}}function D(F){var L=F.prototype;if(!L||!L.isReactComponent)throw new Error("Can only polyfill class components");if(typeof F.getDerivedStateFromProps!="function"&&typeof L.getSnapshotBeforeUpdate!="function")return F;var M=null,$=null,I=null;if(typeof L.componentWillMount=="function"?M="componentWillMount":typeof L.UNSAFE_componentWillMount=="function"&&(M="UNSAFE_componentWillMount"),typeof L.componentWillReceiveProps=="function"?$="componentWillReceiveProps":typeof L.UNSAFE_componentWillReceiveProps=="function"&&($="UNSAFE_componentWillReceiveProps"),typeof L.componentWillUpdate=="function"?I="componentWillUpdate":typeof L.UNSAFE_componentWillUpdate=="function"&&(I="UNSAFE_componentWillUpdate"),M!==null||$!==null||I!==null){var H=F.displayName||F.name,Q=typeof F.getDerivedStateFromProps=="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error(`Unsafe legacy lifecycles will not be called for components using new component APIs. `+H+" uses "+Q+" but also contains the following legacy lifecycles:"+(M!==null?` `+M:"")+($!==null?` @@ -240,16 +240,16 @@ img.ProseMirror-separator { `+I:"")+` The above lifecycles should be removed. Learn more about this warning here: -https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof F.getDerivedStateFromProps=="function"&&(L.componentWillMount=x,L.componentWillReceiveProps=k),typeof L.getSnapshotBeforeUpdate=="function"){if(typeof L.componentDidUpdate!="function")throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");L.componentWillUpdate=E;var Z=L.componentDidUpdate;L.componentDidUpdate=function(V,te,be){var Ve=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:be;Z.call(this,V,te,Ve)}}return F}function O(F,L){if(F==null)return{};var M,$,I=function(Q,Z){if(Q==null)return{};var V,te,be={},Ve=Object.keys(Q);for(te=0;te=0||(be[V]=Q[V]);return be}(F,L);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(F);for($=0;$=0||Object.prototype.propertyIsEnumerable.call(F,M)&&(I[M]=F[M])}return I}function N(F){var L=function(M){return{}.toString.call(M).match(/\s([a-zA-Z]+)/)[1].toLowerCase()}(F);return L==="number"&&(L=isNaN(F)?"nan":(0|F)!=F?"float":"integer"),L}x.__suppressDeprecationWarning=!0,k.__suppressDeprecationWarning=!0,E.__suppressDeprecationWarning=!0;var C={scheme:"rjv-default",author:"mac gainor",base00:"rgba(0, 0, 0, 0)",base01:"rgb(245, 245, 245)",base02:"rgb(235, 235, 235)",base03:"#93a1a1",base04:"rgba(0, 0, 0, 0.3)",base05:"#586e75",base06:"#073642",base07:"#002b36",base08:"#d33682",base09:"#cb4b16",base0A:"#dc322f",base0B:"#859900",base0C:"#6c71c4",base0D:"#586e75",base0E:"#2aa198",base0F:"#268bd2"},R={scheme:"rjv-grey",author:"mac gainor",base00:"rgba(1, 1, 1, 0)",base01:"rgba(1, 1, 1, 0.1)",base02:"rgba(0, 0, 0, 0.2)",base03:"rgba(1, 1, 1, 0.3)",base04:"rgba(0, 0, 0, 0.4)",base05:"rgba(1, 1, 1, 0.5)",base06:"rgba(1, 1, 1, 0.6)",base07:"rgba(1, 1, 1, 0.7)",base08:"rgba(1, 1, 1, 0.8)",base09:"rgba(1, 1, 1, 0.8)",base0A:"rgba(1, 1, 1, 0.8)",base0B:"rgba(1, 1, 1, 0.8)",base0C:"rgba(1, 1, 1, 0.8)",base0D:"rgba(1, 1, 1, 0.8)",base0E:"rgba(1, 1, 1, 0.8)",base0F:"rgba(1, 1, 1, 0.8)"},T={white:"#fff",black:"#000",transparent:"rgba(1, 1, 1, 0)",globalFontFamily:"monospace",globalCursor:"default",indentBlockWidth:"5px",braceFontWeight:"bold",braceCursor:"pointer",ellipsisFontSize:"18px",ellipsisLineHeight:"10px",ellipsisCursor:"pointer",keyMargin:"0px 5px",keyLetterSpacing:"0.5px",keyFontStyle:"none",keyBorderRadius:"3px",keyColonWeight:"bold",keyVerticalAlign:"top",keyOpacity:"0.85",keyOpacityHover:"1",keyValPaddingTop:"3px",keyValPaddingBottom:"3px",keyValPaddingRight:"5px",keyValBorderLeft:"1px solid",keyValBorderHover:"2px solid",keyValPaddingHover:"3px 5px 3px 4px",pushedContentMarginLeft:"6px",variableValuePaddingRight:"6px",nullFontSize:"11px",nullFontWeight:"bold",nullPadding:"1px 2px",nullBorderRadius:"3px",nanFontSize:"11px",nanFontWeight:"bold",nanPadding:"1px 2px",nanBorderRadius:"3px",undefinedFontSize:"11px",undefinedFontWeight:"bold",undefinedPadding:"1px 2px",undefinedBorderRadius:"3px",dataTypeFontSize:"11px",dataTypeMarginRight:"4px",datatypeOpacity:"0.8",objectSizeBorderRadius:"3px",objectSizeFontStyle:"italic",objectSizeMargin:"0px 6px 0px 0px",clipboardCursor:"pointer",clipboardCheckMarginLeft:"-12px",metaDataPadding:"0px 0px 0px 10px",arrayGroupMetaPadding:"0px 0px 0px 4px",iconContainerWidth:"17px",tooltipPadding:"4px",editInputMinWidth:"130px",editInputBorderRadius:"2px",editInputPadding:"5px",editInputMarginRight:"4px",editInputFontFamily:"monospace",iconCursor:"pointer",iconFontSize:"15px",iconPaddingRight:"1px",dateValueMarginLeft:"2px",iconMarginRight:"3px",detectedRowPaddingTop:"3px",addKeyCoverBackground:"rgba(255, 255, 255, 0.3)",addKeyCoverPosition:"absolute",addKeyCoverPositionPx:"0px",addKeyModalWidth:"200px",addKeyModalMargin:"auto",addKeyModalPadding:"10px",addKeyModalRadius:"3px"},q=o(45),A=function(F){var L=function(M){return{backgroundColor:M.base00,ellipsisColor:M.base09,braceColor:M.base07,expandedIcon:M.base0D,collapsedIcon:M.base0E,keyColor:M.base07,arrayKeyColor:M.base0C,objectSize:M.base04,copyToClipboard:M.base0F,copyToClipboardCheck:M.base0D,objectBorder:M.base02,dataTypes:{boolean:M.base0E,date:M.base0D,float:M.base0B,function:M.base0D,integer:M.base0F,string:M.base09,nan:M.base08,null:M.base0A,undefined:M.base05,regexp:M.base0A,background:M.base02},editVariable:{editIcon:M.base0E,cancelIcon:M.base09,removeIcon:M.base09,addIcon:M.base0E,checkIcon:M.base0E,background:M.base01,color:M.base0A,border:M.base07},addKeyModal:{background:M.base05,border:M.base04,color:M.base0A,labelColor:M.base01},validationFailure:{background:M.base09,iconColor:M.base01,fontColor:M.base01}}}(F);return{"app-container":{fontFamily:T.globalFontFamily,cursor:T.globalCursor,backgroundColor:L.backgroundColor,position:"relative"},ellipsis:{display:"inline-block",color:L.ellipsisColor,fontSize:T.ellipsisFontSize,lineHeight:T.ellipsisLineHeight,cursor:T.ellipsisCursor},"brace-row":{display:"inline-block",cursor:"pointer"},brace:{display:"inline-block",cursor:T.braceCursor,fontWeight:T.braceFontWeight,color:L.braceColor},"expanded-icon":{color:L.expandedIcon},"collapsed-icon":{color:L.collapsedIcon},colon:{display:"inline-block",margin:T.keyMargin,color:L.keyColor,verticalAlign:"top"},objectKeyVal:function(M,$){return{style:l({paddingTop:T.keyValPaddingTop,paddingRight:T.keyValPaddingRight,paddingBottom:T.keyValPaddingBottom,borderLeft:T.keyValBorderLeft+" "+L.objectBorder,":hover":{paddingLeft:$.paddingLeft-1+"px",borderLeft:T.keyValBorderHover+" "+L.objectBorder}},$)}},"object-key-val-no-border":{padding:T.keyValPadding},"pushed-content":{marginLeft:T.pushedContentMarginLeft},variableValue:function(M,$){return{style:l({display:"inline-block",paddingRight:T.variableValuePaddingRight,position:"relative"},$)}},"object-name":{display:"inline-block",color:L.keyColor,letterSpacing:T.keyLetterSpacing,fontStyle:T.keyFontStyle,verticalAlign:T.keyVerticalAlign,opacity:T.keyOpacity,":hover":{opacity:T.keyOpacityHover}},"array-key":{display:"inline-block",color:L.arrayKeyColor,letterSpacing:T.keyLetterSpacing,fontStyle:T.keyFontStyle,verticalAlign:T.keyVerticalAlign,opacity:T.keyOpacity,":hover":{opacity:T.keyOpacityHover}},"object-size":{color:L.objectSize,borderRadius:T.objectSizeBorderRadius,fontStyle:T.objectSizeFontStyle,margin:T.objectSizeMargin,cursor:"default"},"data-type-label":{fontSize:T.dataTypeFontSize,marginRight:T.dataTypeMarginRight,opacity:T.datatypeOpacity},boolean:{display:"inline-block",color:L.dataTypes.boolean},date:{display:"inline-block",color:L.dataTypes.date},"date-value":{marginLeft:T.dateValueMarginLeft},float:{display:"inline-block",color:L.dataTypes.float},function:{display:"inline-block",color:L.dataTypes.function,cursor:"pointer",whiteSpace:"pre-line"},"function-value":{fontStyle:"italic"},integer:{display:"inline-block",color:L.dataTypes.integer},string:{display:"inline-block",color:L.dataTypes.string},nan:{display:"inline-block",color:L.dataTypes.nan,fontSize:T.nanFontSize,fontWeight:T.nanFontWeight,backgroundColor:L.dataTypes.background,padding:T.nanPadding,borderRadius:T.nanBorderRadius},null:{display:"inline-block",color:L.dataTypes.null,fontSize:T.nullFontSize,fontWeight:T.nullFontWeight,backgroundColor:L.dataTypes.background,padding:T.nullPadding,borderRadius:T.nullBorderRadius},undefined:{display:"inline-block",color:L.dataTypes.undefined,fontSize:T.undefinedFontSize,padding:T.undefinedPadding,borderRadius:T.undefinedBorderRadius,backgroundColor:L.dataTypes.background},regexp:{display:"inline-block",color:L.dataTypes.regexp},"copy-to-clipboard":{cursor:T.clipboardCursor},"copy-icon":{color:L.copyToClipboard,fontSize:T.iconFontSize,marginRight:T.iconMarginRight,verticalAlign:"top"},"copy-icon-copied":{color:L.copyToClipboardCheck,marginLeft:T.clipboardCheckMarginLeft},"array-group-meta-data":{display:"inline-block",padding:T.arrayGroupMetaPadding},"object-meta-data":{display:"inline-block",padding:T.metaDataPadding},"icon-container":{display:"inline-block",width:T.iconContainerWidth},tooltip:{padding:T.tooltipPadding},removeVarIcon:{verticalAlign:"top",display:"inline-block",color:L.editVariable.removeIcon,cursor:T.iconCursor,fontSize:T.iconFontSize,marginRight:T.iconMarginRight},addVarIcon:{verticalAlign:"top",display:"inline-block",color:L.editVariable.addIcon,cursor:T.iconCursor,fontSize:T.iconFontSize,marginRight:T.iconMarginRight},editVarIcon:{verticalAlign:"top",display:"inline-block",color:L.editVariable.editIcon,cursor:T.iconCursor,fontSize:T.iconFontSize,marginRight:T.iconMarginRight},"edit-icon-container":{display:"inline-block",verticalAlign:"top"},"check-icon":{display:"inline-block",cursor:T.iconCursor,color:L.editVariable.checkIcon,fontSize:T.iconFontSize,paddingRight:T.iconPaddingRight},"cancel-icon":{display:"inline-block",cursor:T.iconCursor,color:L.editVariable.cancelIcon,fontSize:T.iconFontSize,paddingRight:T.iconPaddingRight},"edit-input":{display:"inline-block",minWidth:T.editInputMinWidth,borderRadius:T.editInputBorderRadius,backgroundColor:L.editVariable.background,color:L.editVariable.color,padding:T.editInputPadding,marginRight:T.editInputMarginRight,fontFamily:T.editInputFontFamily},"detected-row":{paddingTop:T.detectedRowPaddingTop},"key-modal-request":{position:T.addKeyCoverPosition,top:T.addKeyCoverPositionPx,left:T.addKeyCoverPositionPx,right:T.addKeyCoverPositionPx,bottom:T.addKeyCoverPositionPx,backgroundColor:T.addKeyCoverBackground},"key-modal":{width:T.addKeyModalWidth,backgroundColor:L.addKeyModal.background,marginLeft:T.addKeyModalMargin,marginRight:T.addKeyModalMargin,padding:T.addKeyModalPadding,borderRadius:T.addKeyModalRadius,marginTop:"15px",position:"relative"},"key-modal-label":{color:L.addKeyModal.labelColor,marginLeft:"2px",marginBottom:"5px",fontSize:"11px"},"key-modal-input-container":{overflow:"hidden"},"key-modal-input":{width:"100%",padding:"3px 6px",fontFamily:"monospace",color:L.addKeyModal.color,border:"none",boxSizing:"border-box",borderRadius:"2px"},"key-modal-cancel":{backgroundColor:L.editVariable.removeIcon,position:"absolute",top:"0px",right:"0px",borderRadius:"0px 3px 0px 3px",cursor:"pointer"},"key-modal-cancel-icon":{color:L.addKeyModal.labelColor,fontSize:T.iconFontSize,transform:"rotate(45deg)"},"key-modal-submit":{color:L.editVariable.addIcon,fontSize:T.iconFontSize,position:"absolute",right:"2px",top:"3px",cursor:"pointer"},"function-ellipsis":{display:"inline-block",color:L.ellipsisColor,fontSize:T.ellipsisFontSize,lineHeight:T.ellipsisLineHeight,cursor:T.ellipsisCursor},"validation-failure":{float:"right",padding:"3px 6px",borderRadius:"2px",cursor:"pointer",color:L.validationFailure.fontColor,backgroundColor:L.validationFailure.background},"validation-failure-label":{marginRight:"6px"},"validation-failure-clear":{position:"relative",verticalAlign:"top",cursor:"pointer",color:L.validationFailure.iconColor,fontSize:T.iconFontSize,transform:"rotate(45deg)"}}};function S(F,L,M){return F||console.error("theme has not been set"),function($){var I=C;return $!==!1&&$!=="none"||(I=R),Object(q.createStyling)(A,{defaultBase16:I})($)}(F)(L,M)}var P=function(F){h(M,F);var L=v(M);function M(){return u(this,M),L.apply(this,arguments)}return f(M,[{key:"render",value:function(){var $=this.props,I=($.rjvId,$.type_name),H=$.displayDataTypes,Q=$.theme;return H?g.a.createElement("span",Object.assign({className:"data-type-label"},S(Q,"data-type-label")),I):null}}]),M}(g.a.PureComponent),B=function(F){h(M,F);var L=v(M);function M(){return u(this,M),L.apply(this,arguments)}return f(M,[{key:"render",value:function(){var $=this.props;return g.a.createElement("div",S($.theme,"boolean"),g.a.createElement(P,Object.assign({type_name:"bool"},$)),$.value?"true":"false")}}]),M}(g.a.PureComponent),j=function(F){h(M,F);var L=v(M);function M(){return u(this,M),L.apply(this,arguments)}return f(M,[{key:"render",value:function(){var $=this.props;return g.a.createElement("div",S($.theme,"date"),g.a.createElement(P,Object.assign({type_name:"date"},$)),g.a.createElement("span",Object.assign({className:"date-value"},S($.theme,"date-value")),$.value.toLocaleTimeString("en-us",{weekday:"short",year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})))}}]),M}(g.a.PureComponent),z=function(F){h(M,F);var L=v(M);function M(){return u(this,M),L.apply(this,arguments)}return f(M,[{key:"render",value:function(){var $=this.props;return g.a.createElement("div",S($.theme,"float"),g.a.createElement(P,Object.assign({type_name:"float"},$)),this.props.value)}}]),M}(g.a.PureComponent);function J(F,L){(L==null||L>F.length)&&(L=F.length);for(var M=0,$=new Array(L);M"u"||F[Symbol.iterator]==null){if(Array.isArray(F)||(M=K(F))||L){M&&(F=M);var $=0,I=function(){};return{s:I,n:function(){return $>=F.length?{done:!0}:{done:!1,value:F[$++]}},e:function(V){throw V},f:I}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var H,Q=!0,Z=!1;return{s:function(){M=F[Symbol.iterator]()},n:function(){var V=M.next();return Q=V.done,V},e:function(V){Z=!0,H=V},f:function(){try{Q||M.return==null||M.return()}finally{if(Z)throw H}}}}function fe(F){return function(L){if(Array.isArray(L))return J(L)}(F)||function(L){if(typeof Symbol<"u"&&Symbol.iterator in Object(L))return Array.from(L)}(F)||K(F)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}var ke=o(46),ve=new(o(47)).Dispatcher,xe=new(function(F){h(M,F);var L=v(M);function M(){var $;u(this,M);for(var I=arguments.length,H=new Array(I),Q=0;QI&&(Z.style.cursor="pointer",this.state.collapsed&&(Q=g.a.createElement("span",null,Q.substring(0,I),g.a.createElement("span",S(H,"ellipsis")," ...")))),g.a.createElement("div",S(H,"string"),g.a.createElement(P,Object.assign({type_name:"string"},$)),g.a.createElement("span",Object.assign({className:"string-value"},Z,{onClick:this.toggleCollapsed}),'"',Q,'"'))}}]),M}(g.a.PureComponent),Le=function(F){h(M,F);var L=v(M);function M(){return u(this,M),L.apply(this,arguments)}return f(M,[{key:"render",value:function(){return g.a.createElement("div",S(this.props.theme,"undefined"),"undefined")}}]),M}(g.a.PureComponent);function Ge(){return(Ge=Object.assign||function(F){for(var L=1;L=0||(zh[Nr]=Ne[Nr]);return zh}(F,["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"]),be,Ve=te.value!==void 0,Ze=Object(w.useRef)(null),lt=bt(Ze,L),qe=Object(w.useRef)(0),ut=Object(w.useRef)(),Pt=function(){var Ne=Ze.current,rn=M&&ut.current?ut.current:function(Oo){var jh=window.getComputedStyle(Oo);if(jh===null)return null;var ql,In=(ql=jh,Y.reduce(function(Yc,Ul){return Yc[Ul]=ql[Ul],Yc},{})),Vl=In.boxSizing;return Vl===""?null:(U&&Vl==="border-box"&&(In.width=parseFloat(In.width)+parseFloat(In.borderRightWidth)+parseFloat(In.borderLeftWidth)+parseFloat(In.paddingRight)+parseFloat(In.paddingLeft)+"px"),{sizingStyle:In,paddingSize:parseFloat(In.paddingBottom)+parseFloat(In.paddingTop),borderSize:parseFloat(In.borderBottomWidth)+parseFloat(In.borderTopWidth)})}(Ne);if(rn){ut.current=rn;var Nr=function(Oo,jh,ql,In){ql===void 0&&(ql=1),In===void 0&&(In=1/0),at||((at=document.createElement("textarea")).setAttribute("tab-index","-1"),at.setAttribute("aria-hidden","true"),Lt(at)),at.parentNode===null&&document.body.appendChild(at);var Vl=Oo.paddingSize,Yc=Oo.borderSize,Ul=Oo.sizingStyle,YE=Ul.boxSizing;Object.keys(Ul).forEach(function(fy){var Hl=fy;at.style[Hl]=Ul[Hl]}),Lt(at),at.value=jh;var qh=function(fy,Hl){var QE=fy.scrollHeight;return Hl.sizingStyle.boxSizing==="border-box"?QE+Hl.borderSize:QE-Hl.paddingSize}(at,Oo);at.value="x";var ly=at.scrollHeight-Vl,uy=ly*ql;YE==="border-box"&&(uy=uy+Vl+Yc),qh=Math.max(uy,qh);var cy=ly*In;return YE==="border-box"&&(cy=cy+Vl+Yc),[qh=Math.min(cy,qh),ly]}(rn,Ne.value||Ne.placeholder||"x",I,$),Mo=Nr[0],zh=Nr[1];qe.current!==Mo&&(qe.current=Mo,Ne.style.setProperty("height",Mo+"px","important"),V(Mo,{rowHeight:zh}))}};return Object(w.useLayoutEffect)(Pt),be=rt(Pt),Object(w.useLayoutEffect)(function(){var Ne=function(rn){be.current(rn)};return window.addEventListener("resize",Ne),function(){window.removeEventListener("resize",Ne)}},[]),Object(w.createElement)("textarea",Ge({},te,{onChange:function(Ne){Ve||Pt(),Q(Ne)},ref:lt}))},X=Object(w.forwardRef)(W);function se(F){F=F.trim();try{if((F=JSON.stringify(JSON.parse(F)))[0]==="[")return ge("array",JSON.parse(F));if(F[0]==="{")return ge("object",JSON.parse(F));if(F.match(/\-?\d+\.\d+/)&&F.match(/\-?\d+\.\d+/)[0]===F)return ge("float",parseFloat(F));if(F.match(/\-?\d+e-\d+/)&&F.match(/\-?\d+e-\d+/)[0]===F)return ge("float",Number(F));if(F.match(/\-?\d+/)&&F.match(/\-?\d+/)[0]===F)return ge("integer",parseInt(F));if(F.match(/\-?\d+e\+\d+/)&&F.match(/\-?\d+e\+\d+/)[0]===F)return ge("integer",Number(F))}catch{}switch(F=F.toLowerCase()){case"undefined":return ge("undefined",void 0);case"nan":return ge("nan",NaN);case"null":return ge("null",null);case"true":return ge("boolean",!0);case"false":return ge("boolean",!1);default:if(F=Date.parse(F))return ge("date",new Date(F))}return ge(!1,null)}function ge(F,L){return{type:F,value:L}}var Pe=function(F){h(M,F);var L=v(M);function M(){return u(this,M),L.apply(this,arguments)}return f(M,[{key:"render",value:function(){var $=this.props,I=$.style,H=O($,["style"]);return g.a.createElement("span",H,g.a.createElement("svg",Object.assign({},Ie(I),{viewBox:"0 0 24 24",fill:"currentColor",preserveAspectRatio:"xMidYMid meet"}),g.a.createElement("path",{d:"M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M7,13H17V11H7"})))}}]),M}(g.a.PureComponent),Be=function(F){h(M,F);var L=v(M);function M(){return u(this,M),L.apply(this,arguments)}return f(M,[{key:"render",value:function(){var $=this.props,I=$.style,H=O($,["style"]);return g.a.createElement("span",H,g.a.createElement("svg",Object.assign({},Ie(I),{viewBox:"0 0 24 24",fill:"currentColor",preserveAspectRatio:"xMidYMid meet"}),g.a.createElement("path",{d:"M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M13,7H11V11H7V13H11V17H13V13H17V11H13V7Z"})))}}]),M}(g.a.PureComponent),nt=function(F){h(M,F);var L=v(M);function M(){return u(this,M),L.apply(this,arguments)}return f(M,[{key:"render",value:function(){var $=this.props,I=$.style,H=O($,["style"]),Q=Ie(I).style;return g.a.createElement("span",H,g.a.createElement("svg",{fill:Q.color,width:Q.height,height:Q.width,style:Q,viewBox:"0 0 1792 1792"},g.a.createElement("path",{d:"M1344 800v64q0 14-9 23t-23 9h-832q-14 0-23-9t-9-23v-64q0-14 9-23t23-9h832q14 0 23 9t9 23zm128 448v-832q0-66-47-113t-113-47h-832q-66 0-113 47t-47 113v832q0 66 47 113t113 47h832q66 0 113-47t47-113zm128-832v832q0 119-84.5 203.5t-203.5 84.5h-832q-119 0-203.5-84.5t-84.5-203.5v-832q0-119 84.5-203.5t203.5-84.5h832q119 0 203.5 84.5t84.5 203.5z"})))}}]),M}(g.a.PureComponent),G=function(F){h(M,F);var L=v(M);function M(){return u(this,M),L.apply(this,arguments)}return f(M,[{key:"render",value:function(){var $=this.props,I=$.style,H=O($,["style"]),Q=Ie(I).style;return g.a.createElement("span",H,g.a.createElement("svg",{fill:Q.color,width:Q.height,height:Q.width,style:Q,viewBox:"0 0 1792 1792"},g.a.createElement("path",{d:"M1344 800v64q0 14-9 23t-23 9h-352v352q0 14-9 23t-23 9h-64q-14 0-23-9t-9-23v-352h-352q-14 0-23-9t-9-23v-64q0-14 9-23t23-9h352v-352q0-14 9-23t23-9h64q14 0 23 9t9 23v352h352q14 0 23 9t9 23zm128 448v-832q0-66-47-113t-113-47h-832q-66 0-113 47t-47 113v832q0 66 47 113t113 47h832q66 0 113-47t47-113zm128-832v832q0 119-84.5 203.5t-203.5 84.5h-832q-119 0-203.5-84.5t-84.5-203.5v-832q0-119 84.5-203.5t203.5-84.5h832q119 0 203.5 84.5t84.5 203.5z"})))}}]),M}(g.a.PureComponent),re=function(F){h(M,F);var L=v(M);function M(){return u(this,M),L.apply(this,arguments)}return f(M,[{key:"render",value:function(){var $=this.props,I=$.style,H=O($,["style"]);return g.a.createElement("span",H,g.a.createElement("svg",{style:l(l({},Ie(I).style),{},{paddingLeft:"2px",verticalAlign:"top"}),viewBox:"0 0 15 15",fill:"currentColor"},g.a.createElement("path",{d:"M0 14l6-6-6-6z"})))}}]),M}(g.a.PureComponent),me=function(F){h(M,F);var L=v(M);function M(){return u(this,M),L.apply(this,arguments)}return f(M,[{key:"render",value:function(){var $=this.props,I=$.style,H=O($,["style"]);return g.a.createElement("span",H,g.a.createElement("svg",{style:l(l({},Ie(I).style),{},{paddingLeft:"2px",verticalAlign:"top"}),viewBox:"0 0 15 15",fill:"currentColor"},g.a.createElement("path",{d:"M0 5l6 6 6-6z"})))}}]),M}(g.a.PureComponent),Ee=function(F){h(M,F);var L=v(M);function M(){return u(this,M),L.apply(this,arguments)}return f(M,[{key:"render",value:function(){var $=this.props,I=$.style,H=O($,["style"]);return g.a.createElement("span",H,g.a.createElement("svg",Object.assign({},Ie(I),{viewBox:"0 0 40 40",fill:"currentColor",preserveAspectRatio:"xMidYMid meet"}),g.a.createElement("g",null,g.a.createElement("path",{d:"m30 35h-25v-22.5h25v7.5h2.5v-12.5c0-1.4-1.1-2.5-2.5-2.5h-7.5c0-2.8-2.2-5-5-5s-5 2.2-5 5h-7.5c-1.4 0-2.5 1.1-2.5 2.5v27.5c0 1.4 1.1 2.5 2.5 2.5h25c1.4 0 2.5-1.1 2.5-2.5v-5h-2.5v5z m-20-27.5h2.5s2.5-1.1 2.5-2.5 1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5 1.3 2.5 2.5 2.5h2.5s2.5 1.1 2.5 2.5h-20c0-1.5 1.1-2.5 2.5-2.5z m-2.5 20h5v-2.5h-5v2.5z m17.5-5v-5l-10 7.5 10 7.5v-5h12.5v-5h-12.5z m-17.5 10h7.5v-2.5h-7.5v2.5z m12.5-17.5h-12.5v2.5h12.5v-2.5z m-7.5 5h-5v2.5h5v-2.5z"}))))}}]),M}(g.a.PureComponent),Ae=function(F){h(M,F);var L=v(M);function M(){return u(this,M),L.apply(this,arguments)}return f(M,[{key:"render",value:function(){var $=this.props,I=$.style,H=O($,["style"]);return g.a.createElement("span",H,g.a.createElement("svg",Object.assign({},Ie(I),{viewBox:"0 0 40 40",fill:"currentColor",preserveAspectRatio:"xMidYMid meet"}),g.a.createElement("g",null,g.a.createElement("path",{d:"m28.6 25q0-0.5-0.4-1l-4-4 4-4q0.4-0.5 0.4-1 0-0.6-0.4-1.1l-2-2q-0.4-0.4-1-0.4-0.6 0-1 0.4l-4.1 4.1-4-4.1q-0.4-0.4-1-0.4-0.6 0-1 0.4l-2 2q-0.5 0.5-0.5 1.1 0 0.5 0.5 1l4 4-4 4q-0.5 0.5-0.5 1 0 0.7 0.5 1.1l2 2q0.4 0.4 1 0.4 0.6 0 1-0.4l4-4.1 4.1 4.1q0.4 0.4 1 0.4 0.6 0 1-0.4l2-2q0.4-0.4 0.4-1z m8.7-5q0 4.7-2.3 8.6t-6.3 6.2-8.6 2.3-8.6-2.3-6.2-6.2-2.3-8.6 2.3-8.6 6.2-6.2 8.6-2.3 8.6 2.3 6.3 6.2 2.3 8.6z"}))))}}]),M}(g.a.PureComponent),ot=function(F){h(M,F);var L=v(M);function M(){return u(this,M),L.apply(this,arguments)}return f(M,[{key:"render",value:function(){var $=this.props,I=$.style,H=O($,["style"]);return g.a.createElement("span",H,g.a.createElement("svg",Object.assign({},Ie(I),{viewBox:"0 0 40 40",fill:"currentColor",preserveAspectRatio:"xMidYMid meet"}),g.a.createElement("g",null,g.a.createElement("path",{d:"m30.1 21.4v-2.8q0-0.6-0.4-1t-1-0.5h-5.7v-5.7q0-0.6-0.4-1t-1-0.4h-2.9q-0.6 0-1 0.4t-0.4 1v5.7h-5.7q-0.6 0-1 0.5t-0.5 1v2.8q0 0.6 0.5 1t1 0.5h5.7v5.7q0 0.5 0.4 1t1 0.4h2.9q0.6 0 1-0.4t0.4-1v-5.7h5.7q0.6 0 1-0.5t0.4-1z m7.2-1.4q0 4.7-2.3 8.6t-6.3 6.2-8.6 2.3-8.6-2.3-6.2-6.2-2.3-8.6 2.3-8.6 6.2-6.2 8.6-2.3 8.6 2.3 6.3 6.2 2.3 8.6z"}))))}}]),M}(g.a.PureComponent),_t=function(F){h(M,F);var L=v(M);function M(){return u(this,M),L.apply(this,arguments)}return f(M,[{key:"render",value:function(){var $=this.props,I=$.style,H=O($,["style"]);return g.a.createElement("span",H,g.a.createElement("svg",Object.assign({},Ie(I),{viewBox:"0 0 40 40",fill:"currentColor",preserveAspectRatio:"xMidYMid meet"}),g.a.createElement("g",null,g.a.createElement("path",{d:"m31.6 21.6h-10v10h-3.2v-10h-10v-3.2h10v-10h3.2v10h10v3.2z"}))))}}]),M}(g.a.PureComponent),Xt=function(F){h(M,F);var L=v(M);function M(){return u(this,M),L.apply(this,arguments)}return f(M,[{key:"render",value:function(){var $=this.props,I=$.style,H=O($,["style"]);return g.a.createElement("span",H,g.a.createElement("svg",Object.assign({},Ie(I),{viewBox:"0 0 40 40",fill:"currentColor",preserveAspectRatio:"xMidYMid meet"}),g.a.createElement("g",null,g.a.createElement("path",{d:"m19.8 26.4l2.6-2.6-3.4-3.4-2.6 2.6v1.3h2.2v2.1h1.2z m9.8-16q-0.3-0.4-0.7 0l-7.8 7.8q-0.4 0.4 0 0.7t0.7 0l7.8-7.8q0.4-0.4 0-0.7z m1.8 13.2v4.3q0 2.6-1.9 4.5t-4.5 1.9h-18.6q-2.6 0-4.5-1.9t-1.9-4.5v-18.6q0-2.7 1.9-4.6t4.5-1.8h18.6q1.4 0 2.6 0.5 0.3 0.2 0.4 0.5 0.1 0.4-0.2 0.7l-1.1 1.1q-0.3 0.3-0.7 0.1-0.5-0.1-1-0.1h-18.6q-1.4 0-2.5 1.1t-1 2.5v18.6q0 1.4 1 2.5t2.5 1h18.6q1.5 0 2.5-1t1.1-2.5v-2.9q0-0.2 0.2-0.4l1.4-1.5q0.3-0.3 0.8-0.1t0.4 0.6z m-2.1-16.5l6.4 6.5-15 15h-6.4v-6.5z m9.9 3l-2.1 2-6.4-6.4 2.1-2q0.6-0.7 1.5-0.7t1.5 0.7l3.4 3.4q0.6 0.6 0.6 1.5t-0.6 1.5z"}))))}}]),M}(g.a.PureComponent),Nt=function(F){h(M,F);var L=v(M);function M(){return u(this,M),L.apply(this,arguments)}return f(M,[{key:"render",value:function(){var $=this.props,I=$.style,H=O($,["style"]);return g.a.createElement("span",H,g.a.createElement("svg",Object.assign({},Ie(I),{viewBox:"0 0 40 40",fill:"currentColor",preserveAspectRatio:"xMidYMid meet"}),g.a.createElement("g",null,g.a.createElement("path",{d:"m31.7 16.4q0-0.6-0.4-1l-2.1-2.1q-0.4-0.4-1-0.4t-1 0.4l-9.1 9.1-5-5q-0.5-0.4-1-0.4t-1 0.4l-2.1 2q-0.4 0.4-0.4 1 0 0.6 0.4 1l8.1 8.1q0.4 0.4 1 0.4 0.6 0 1-0.4l12.2-12.1q0.4-0.4 0.4-1z m5.6 3.6q0 4.7-2.3 8.6t-6.3 6.2-8.6 2.3-8.6-2.3-6.2-6.2-2.3-8.6 2.3-8.6 6.2-6.2 8.6-2.3 8.6 2.3 6.3 6.2 2.3 8.6z"}))))}}]),M}(g.a.PureComponent);function Ie(F){return F||(F={}),{style:l(l({verticalAlign:"middle"},F),{},{color:F.color?F.color:"#000000",height:"1em",width:"1em"})}}var Bt=function(F){h(M,F);var L=v(M);function M($){var I;return u(this,M),(I=L.call(this,$)).copiedTimer=null,I.handleCopy=function(){var H=document.createElement("textarea"),Q=I.props,Z=Q.clickCallback,V=Q.src,te=Q.namespace;H.innerHTML=JSON.stringify(I.clipboardValue(V),null," "),document.body.appendChild(H),H.select(),document.execCommand("copy"),document.body.removeChild(H),I.copiedTimer=setTimeout(function(){I.setState({copied:!1})},5500),I.setState({copied:!0},function(){typeof Z=="function"&&Z({src:V,namespace:te,name:te[te.length-1]})})},I.getClippyIcon=function(){var H=I.props.theme;return I.state.copied?g.a.createElement("span",null,g.a.createElement(Ee,Object.assign({className:"copy-icon"},S(H,"copy-icon"))),g.a.createElement("span",S(H,"copy-icon-copied"),"✔")):g.a.createElement(Ee,Object.assign({className:"copy-icon"},S(H,"copy-icon")))},I.clipboardValue=function(H){switch(N(H)){case"function":case"regexp":return H.toString();default:return H}},I.state={copied:!1},I}return f(M,[{key:"componentWillUnmount",value:function(){this.copiedTimer&&(clearTimeout(this.copiedTimer),this.copiedTimer=null)}},{key:"render",value:function(){var $=this.props,I=($.src,$.theme),H=$.hidden,Q=$.rowHovered,Z=S(I,"copy-to-clipboard").style,V="inline";return H&&(V="none"),g.a.createElement("span",{className:"copy-to-clipboard-container",title:"Copy to clipboard",style:{verticalAlign:"top",display:Q?"inline-block":"none"}},g.a.createElement("span",{style:l(l({},Z),{},{display:V}),onClick:this.handleCopy},this.getClippyIcon()))}}]),M}(g.a.PureComponent),Wt=function(F){h(M,F);var L=v(M);function M($){var I;return u(this,M),(I=L.call(this,$)).getEditIcon=function(){var H=I.props,Q=H.variable,Z=H.theme;return g.a.createElement("div",{className:"click-to-edit",style:{verticalAlign:"top",display:I.state.hovered?"inline-block":"none"}},g.a.createElement(Xt,Object.assign({className:"click-to-edit-icon"},S(Z,"editVarIcon"),{onClick:function(){I.prepopInput(Q)}})))},I.prepopInput=function(H){if(I.props.onEdit!==!1){var Q=function(V){var te;switch(N(V)){case"undefined":te="undefined";break;case"nan":te="NaN";break;case"string":te=V;break;case"date":case"function":case"regexp":te=V.toString();break;default:try{te=JSON.stringify(V,null," ")}catch{te=""}}return te}(H.value),Z=se(Q);I.setState({editMode:!0,editValue:Q,parsedInput:{type:Z.type,value:Z.value}})}},I.getRemoveIcon=function(){var H=I.props,Q=H.variable,Z=H.namespace,V=H.theme,te=H.rjvId;return g.a.createElement("div",{className:"click-to-remove",style:{verticalAlign:"top",display:I.state.hovered?"inline-block":"none"}},g.a.createElement(Ae,Object.assign({className:"click-to-remove-icon"},S(V,"removeVarIcon"),{onClick:function(){ve.dispatch({name:"VARIABLE_REMOVED",rjvId:te,data:{name:Q.name,namespace:Z,existing_value:Q.value,variable_removed:!0}})}})))},I.getValue=function(H,Q){var Z=!Q&&H.type,V=b(I).props;switch(Z){case!1:return I.getEditInput();case"string":return g.a.createElement(De,Object.assign({value:H.value},V));case"integer":return g.a.createElement(Ce,Object.assign({value:H.value},V));case"float":return g.a.createElement(z,Object.assign({value:H.value},V));case"boolean":return g.a.createElement(B,Object.assign({value:H.value},V));case"function":return g.a.createElement(Oe,Object.assign({value:H.value},V));case"null":return g.a.createElement(mt,V);case"nan":return g.a.createElement(Fe,V);case"undefined":return g.a.createElement(Le,V);case"date":return g.a.createElement(j,Object.assign({value:H.value},V));case"regexp":return g.a.createElement(pe,Object.assign({value:H.value},V));default:return g.a.createElement("div",{className:"object-value"},JSON.stringify(H.value))}},I.getEditInput=function(){var H=I.props.theme,Q=I.state.editValue;return g.a.createElement("div",null,g.a.createElement(X,Object.assign({type:"text",inputRef:function(Z){return Z&&Z.focus()},value:Q,className:"variable-editor",onChange:function(Z){var V=Z.target.value,te=se(V);I.setState({editValue:V,parsedInput:{type:te.type,value:te.value}})},onKeyDown:function(Z){switch(Z.key){case"Escape":I.setState({editMode:!1,editValue:""});break;case"Enter":(Z.ctrlKey||Z.metaKey)&&I.submitEdit(!0)}Z.stopPropagation()},placeholder:"update this value",minRows:2},S(H,"edit-input"))),g.a.createElement("div",S(H,"edit-icon-container"),g.a.createElement(Ae,Object.assign({className:"edit-cancel"},S(H,"cancel-icon"),{onClick:function(){I.setState({editMode:!1,editValue:""})}})),g.a.createElement(Nt,Object.assign({className:"edit-check string-value"},S(H,"check-icon"),{onClick:function(){I.submitEdit()}})),g.a.createElement("div",null,I.showDetected())))},I.submitEdit=function(H){var Q=I.props,Z=Q.variable,V=Q.namespace,te=Q.rjvId,be=I.state,Ve=be.editValue,Ze=be.parsedInput,lt=Ve;H&&Ze.type&&(lt=Ze.value),I.setState({editMode:!1}),ve.dispatch({name:"VARIABLE_UPDATED",rjvId:te,data:{name:Z.name,namespace:V,existing_value:Z.value,new_value:lt,variable_removed:!1}})},I.showDetected=function(){var H=I.props,Q=H.theme,Z=(H.variable,H.namespace,H.rjvId,I.state.parsedInput),V=(Z.type,Z.value,I.getDetectedInput());if(V)return g.a.createElement("div",null,g.a.createElement("div",S(Q,"detected-row"),V,g.a.createElement(Nt,{className:"edit-check detected",style:l({verticalAlign:"top",paddingLeft:"3px"},S(Q,"check-icon").style),onClick:function(){I.submitEdit(!0)}})))},I.getDetectedInput=function(){var H=I.state.parsedInput,Q=H.type,Z=H.value,V=b(I).props,te=V.theme;if(Q!==!1)switch(Q.toLowerCase()){case"object":return g.a.createElement("span",null,g.a.createElement("span",{style:l(l({},S(te,"brace").style),{},{cursor:"default"})},"{"),g.a.createElement("span",{style:l(l({},S(te,"ellipsis").style),{},{cursor:"default"})},"..."),g.a.createElement("span",{style:l(l({},S(te,"brace").style),{},{cursor:"default"})},"}"));case"array":return g.a.createElement("span",null,g.a.createElement("span",{style:l(l({},S(te,"brace").style),{},{cursor:"default"})},"["),g.a.createElement("span",{style:l(l({},S(te,"ellipsis").style),{},{cursor:"default"})},"..."),g.a.createElement("span",{style:l(l({},S(te,"brace").style),{},{cursor:"default"})},"]"));case"string":return g.a.createElement(De,Object.assign({value:Z},V));case"integer":return g.a.createElement(Ce,Object.assign({value:Z},V));case"float":return g.a.createElement(z,Object.assign({value:Z},V));case"boolean":return g.a.createElement(B,Object.assign({value:Z},V));case"function":return g.a.createElement(Oe,Object.assign({value:Z},V));case"null":return g.a.createElement(mt,V);case"nan":return g.a.createElement(Fe,V);case"undefined":return g.a.createElement(Le,V);case"date":return g.a.createElement(j,Object.assign({value:new Date(Z)},V))}},I.state={editMode:!1,editValue:"",hovered:!1,renameKey:!1,parsedInput:{type:!1,value:null}},I}return f(M,[{key:"render",value:function(){var $=this,I=this.props,H=I.variable,Q=I.singleIndent,Z=I.type,V=I.theme,te=I.namespace,be=I.indentWidth,Ve=I.enableClipboard,Ze=I.onEdit,lt=I.onDelete,qe=I.onSelect,ut=I.displayArrayKey,Pt=I.quotesOnKeys,Ne=this.state.editMode;return g.a.createElement("div",Object.assign({},S(V,"objectKeyVal",{paddingLeft:be*Q}),{onMouseEnter:function(){return $.setState(l(l({},$.state),{},{hovered:!0}))},onMouseLeave:function(){return $.setState(l(l({},$.state),{},{hovered:!1}))},className:"variable-row",key:H.name}),Z=="array"?ut?g.a.createElement("span",Object.assign({},S(V,"array-key"),{key:H.name+"_"+te}),H.name,g.a.createElement("div",S(V,"colon"),":")):null:g.a.createElement("span",null,g.a.createElement("span",Object.assign({},S(V,"object-name"),{className:"object-key",key:H.name+"_"+te}),!!Pt&&g.a.createElement("span",{style:{verticalAlign:"top"}},'"'),g.a.createElement("span",{style:{display:"inline-block"}},H.name),!!Pt&&g.a.createElement("span",{style:{verticalAlign:"top"}},'"')),g.a.createElement("span",S(V,"colon"),":")),g.a.createElement("div",Object.assign({className:"variable-value",onClick:qe===!1&&Ze===!1?null:function(rn){var Nr=fe(te);(rn.ctrlKey||rn.metaKey)&&Ze!==!1?$.prepopInput(H):qe!==!1&&(Nr.shift(),qe(l(l({},H),{},{namespace:Nr})))}},S(V,"variableValue",{cursor:qe===!1?"default":"pointer"})),this.getValue(H,Ne)),Ve?g.a.createElement(Bt,{rowHovered:this.state.hovered,hidden:Ne,src:H.value,clickCallback:Ve,theme:V,namespace:[].concat(fe(te),[H.name])}):null,Ze!==!1&&Ne==0?this.getEditIcon():null,lt!==!1&&Ne==0?this.getRemoveIcon():null)}}]),M}(g.a.PureComponent),vn=function(F){h(M,F);var L=v(M);function M(){var $;u(this,M);for(var I=arguments.length,H=new Array(I),Q=0;Q0?Ve:null,namespace:be.splice(0,be.length-1),existing_value:Ze,variable_removed:!1,key_name:null};N(Ze)==="object"?ve.dispatch({name:"ADD_VARIABLE_KEY_REQUEST",rjvId:lt,data:ut}):ve.dispatch({name:"VARIABLE_ADDED",rjvId:lt,data:l(l({},ut),{},{new_value:[].concat(fe(Ze),[null])})})}})))},$.getRemoveObject=function(Z){var V=$.props,te=V.theme,be=(V.hover,V.namespace),Ve=V.name,Ze=V.src,lt=V.rjvId;if(be.length!==1)return g.a.createElement("span",{className:"click-to-remove",style:{display:Z?"inline-block":"none"}},g.a.createElement(Ae,Object.assign({className:"click-to-remove-icon"},S(te,"removeVarIcon"),{onClick:function(){ve.dispatch({name:"VARIABLE_REMOVED",rjvId:lt,data:{name:Ve,namespace:be.splice(0,be.length-1),existing_value:Ze,variable_removed:!0}})}})))},$.render=function(){var Z=$.props,V=Z.theme,te=Z.onDelete,be=Z.onAdd,Ve=Z.enableClipboard,Ze=Z.src,lt=Z.namespace,qe=Z.rowHovered;return g.a.createElement("div",Object.assign({},S(V,"object-meta-data"),{className:"object-meta-data",onClick:function(ut){ut.stopPropagation()}}),$.getObjectSize(),Ve?g.a.createElement(Bt,{rowHovered:qe,clickCallback:Ve,src:Ze,theme:V,namespace:lt}):null,be!==!1?$.getAddAttribute(qe):null,te!==!1?$.getRemoveObject(qe):null)},$}return M}(g.a.PureComponent);function Dr(F){var L=F.parent_type,M=F.namespace,$=F.quotesOnKeys,I=F.theme,H=F.jsvRoot,Q=F.name,Z=F.displayArrayKey,V=F.name?F.name:"";return!H||Q!==!1&&Q!==null?L=="array"?Z?g.a.createElement("span",Object.assign({},S(I,"array-key"),{key:M}),g.a.createElement("span",{className:"array-key"},V),g.a.createElement("span",S(I,"colon"),":")):g.a.createElement("span",null):g.a.createElement("span",Object.assign({},S(I,"object-name"),{key:M}),g.a.createElement("span",{className:"object-key"},$&&g.a.createElement("span",{style:{verticalAlign:"top"}},'"'),g.a.createElement("span",null,V),$&&g.a.createElement("span",{style:{verticalAlign:"top"}},'"')),g.a.createElement("span",S(I,"colon"),":")):g.a.createElement("span",null)}function wn(F){var L=F.theme;switch(F.iconStyle){case"triangle":return g.a.createElement(me,Object.assign({},S(L,"expanded-icon"),{className:"expanded-icon"}));case"square":return g.a.createElement(nt,Object.assign({},S(L,"expanded-icon"),{className:"expanded-icon"}));default:return g.a.createElement(Pe,Object.assign({},S(L,"expanded-icon"),{className:"expanded-icon"}))}}function $n(F){var L=F.theme;switch(F.iconStyle){case"triangle":return g.a.createElement(re,Object.assign({},S(L,"collapsed-icon"),{className:"collapsed-icon"}));case"square":return g.a.createElement(G,Object.assign({},S(L,"collapsed-icon"),{className:"collapsed-icon"}));default:return g.a.createElement(Be,Object.assign({},S(L,"collapsed-icon"),{className:"collapsed-icon"}))}}var jl=function(F){h(M,F);var L=v(M);function M($){var I;return u(this,M),(I=L.call(this,$)).toggleCollapsed=function(H){var Q=[];for(var Z in I.state.expanded)Q.push(I.state.expanded[Z]);Q[H]=!Q[H],I.setState({expanded:Q})},I.state={expanded:[]},I}return f(M,[{key:"getExpandedIcon",value:function($){var I=this.props,H=I.theme,Q=I.iconStyle;return this.state.expanded[$]?g.a.createElement(wn,{theme:H,iconStyle:Q}):g.a.createElement($n,{theme:H,iconStyle:Q})}},{key:"render",value:function(){var $=this,I=this.props,H=I.src,Q=I.groupArraysAfterLength,Z=(I.depth,I.name),V=I.theme,te=I.jsvRoot,be=I.namespace,Ve=(I.parent_type,O(I,["src","groupArraysAfterLength","depth","name","theme","jsvRoot","namespace","parent_type"])),Ze=0,lt=5*this.props.indentWidth;te||(Ze=5*this.props.indentWidth);var qe=Q,ut=Math.ceil(H.length/qe);return g.a.createElement("div",Object.assign({className:"object-key-val"},S(V,te?"jsv-root":"objectKeyVal",{paddingLeft:Ze})),g.a.createElement(Dr,this.props),g.a.createElement("span",null,g.a.createElement(vn,Object.assign({size:H.length},this.props))),fe(Array(ut)).map(function(Pt,Ne){return g.a.createElement("div",Object.assign({key:Ne,className:"object-key-val array-group"},S(V,"objectKeyVal",{marginLeft:6,paddingLeft:lt})),g.a.createElement("span",S(V,"brace-row"),g.a.createElement("div",Object.assign({className:"icon-container"},S(V,"icon-container"),{onClick:function(rn){$.toggleCollapsed(Ne)}}),$.getExpandedIcon(Ne)),$.state.expanded[Ne]?g.a.createElement(Bh,Object.assign({key:Z+Ne,depth:0,name:!1,collapsed:!1,groupArraysAfterLength:qe,index_offset:Ne*qe,src:H.slice(Ne*qe,Ne*qe+qe),namespace:be,type:"array",parent_type:"array_group",theme:V},Ve)):g.a.createElement("span",Object.assign({},S(V,"brace"),{onClick:function(rn){$.toggleCollapsed(Ne)},className:"array-group-brace"}),"[",g.a.createElement("div",Object.assign({},S(V,"array-group-meta-data"),{className:"array-group-meta-data"}),g.a.createElement("span",Object.assign({className:"object-size"},S(V,"object-size")),Ne*qe," - ",Ne*qe+qe>H.length?H.length:Ne*qe+qe)),"]")))}))}}]),M}(g.a.PureComponent),Zc=function(F){h(M,F);var L=v(M);function M($){var I;u(this,M),(I=L.call(this,$)).toggleCollapsed=function(){I.setState({expanded:!I.state.expanded},function(){Se.set(I.props.rjvId,I.props.namespace,"expanded",I.state.expanded)})},I.getObjectContent=function(Q,Z,V){return g.a.createElement("div",{className:"pushed-content object-container"},g.a.createElement("div",Object.assign({className:"object-content"},S(I.props.theme,"pushed-content")),I.renderObjectContents(Z,V)))},I.getEllipsis=function(){return I.state.size===0?null:g.a.createElement("div",Object.assign({},S(I.props.theme,"ellipsis"),{className:"node-ellipsis",onClick:I.toggleCollapsed}),"...")},I.getObjectMetaData=function(Q){var Z=I.props,V=(Z.rjvId,Z.theme,I.state),te=V.size,be=V.hovered;return g.a.createElement(vn,Object.assign({rowHovered:be,size:te},I.props))},I.renderObjectContents=function(Q,Z){var V,te=I.props,be=te.depth,Ve=te.parent_type,Ze=te.index_offset,lt=te.groupArraysAfterLength,qe=te.namespace,ut=I.state.object_type,Pt=[],Ne=Object.keys(Q||{});return I.props.sortKeys&&ut!=="array"&&(Ne=Ne.sort()),Ne.forEach(function(rn){if(V=new uF(rn,Q[rn]),Ve==="array_group"&&Ze&&(V.name=parseInt(V.name)+Ze),Q.hasOwnProperty(rn))if(V.type==="object")Pt.push(g.a.createElement(Bh,Object.assign({key:V.name,depth:be+1,name:V.name,src:V.value,namespace:qe.concat(V.name),parent_type:ut},Z)));else if(V.type==="array"){var Nr=Bh;lt&&V.value.length>lt&&(Nr=jl),Pt.push(g.a.createElement(Nr,Object.assign({key:V.name,depth:be+1,name:V.name,src:V.value,namespace:qe.concat(V.name),type:"array",parent_type:ut},Z)))}else Pt.push(g.a.createElement(Wt,Object.assign({key:V.name+"_"+qe,variable:V,singleIndent:5,namespace:qe,type:I.props.type},Z)))}),Pt};var H=M.getState($);return I.state=l(l({},H),{},{prevProps:{}}),I}return f(M,[{key:"getBraceStart",value:function($,I){var H=this,Q=this.props,Z=Q.src,V=Q.theme,te=Q.iconStyle;if(Q.parent_type==="array_group")return g.a.createElement("span",null,g.a.createElement("span",S(V,"brace"),$==="array"?"[":"{"),I?this.getObjectMetaData(Z):null);var be=I?wn:$n;return g.a.createElement("span",null,g.a.createElement("span",Object.assign({onClick:function(Ve){H.toggleCollapsed()}},S(V,"brace-row")),g.a.createElement("div",Object.assign({className:"icon-container"},S(V,"icon-container")),g.a.createElement(be,{theme:V,iconStyle:te})),g.a.createElement(Dr,this.props),g.a.createElement("span",S(V,"brace"),$==="array"?"[":"{")),I?this.getObjectMetaData(Z):null)}},{key:"render",value:function(){var $=this,I=this.props,H=I.depth,Q=I.src,Z=(I.namespace,I.name,I.type,I.parent_type),V=I.theme,te=I.jsvRoot,be=I.iconStyle,Ve=O(I,["depth","src","namespace","name","type","parent_type","theme","jsvRoot","iconStyle"]),Ze=this.state,lt=Ze.object_type,qe=Ze.expanded,ut={};return te||Z==="array_group"?Z==="array_group"&&(ut.borderLeft=0,ut.display="inline"):ut.paddingLeft=5*this.props.indentWidth,g.a.createElement("div",Object.assign({className:"object-key-val",onMouseEnter:function(){return $.setState(l(l({},$.state),{},{hovered:!0}))},onMouseLeave:function(){return $.setState(l(l({},$.state),{},{hovered:!1}))}},S(V,te?"jsv-root":"objectKeyVal",ut)),this.getBraceStart(lt,qe),qe?this.getObjectContent(H,Q,l({theme:V,iconStyle:be},Ve)):this.getEllipsis(),g.a.createElement("span",{className:"brace-row"},g.a.createElement("span",{style:l(l({},S(V,"brace").style),{},{paddingLeft:qe?"3px":"0px"})},lt==="array"?"]":"}"),qe?null:this.getObjectMetaData(Q)))}}],[{key:"getDerivedStateFromProps",value:function($,I){var H=I.prevProps;return $.src!==H.src||$.collapsed!==H.collapsed||$.name!==H.name||$.namespace!==H.namespace||$.rjvId!==H.rjvId?l(l({},M.getState($)),{},{prevProps:$}):null}}]),M}(g.a.PureComponent);Zc.getState=function(F){var L=Object.keys(F.src).length,M=(F.collapsed===!1||F.collapsed!==!0&&F.collapsed>F.depth)&&(!F.shouldCollapse||F.shouldCollapse({name:F.name,src:F.src,type:N(F.src),namespace:F.namespace})===!1)&&L!==0;return{expanded:Se.get(F.rjvId,F.namespace,"expanded",M),object_type:F.type==="array"?"array":"object",parent_type:F.type==="array"?"array":"object",size:L,hovered:!1}};var uF=function F(L,M){u(this,F),this.name=L,this.value=M,this.type=N(M)};D(Zc);var Bh=Zc,cF=function(F){h(M,F);var L=v(M);function M(){var $;u(this,M);for(var I=arguments.length,H=new Array(I),Q=0;QZ.groupArraysAfterLength&&(te=jl),g.a.createElement("div",{className:"pretty-json-container object-container"},g.a.createElement("div",{className:"object-content"},g.a.createElement(te,Object.assign({namespace:V,depth:0,jsvRoot:!0},Z))))},$}return M}(g.a.PureComponent),fF=function(F){h(M,F);var L=v(M);function M($){var I;return u(this,M),(I=L.call(this,$)).closeModal=function(){ve.dispatch({rjvId:I.props.rjvId,name:"RESET"})},I.submit=function(){I.props.submit(I.state.input)},I.state={input:$.input?$.input:""},I}return f(M,[{key:"render",value:function(){var $=this,I=this.props,H=I.theme,Q=I.rjvId,Z=I.isValid,V=this.state.input,te=Z(V);return g.a.createElement("div",Object.assign({className:"key-modal-request"},S(H,"key-modal-request"),{onClick:this.closeModal}),g.a.createElement("div",Object.assign({},S(H,"key-modal"),{onClick:function(be){be.stopPropagation()}}),g.a.createElement("div",S(H,"key-modal-label"),"Key Name:"),g.a.createElement("div",{style:{position:"relative"}},g.a.createElement("input",Object.assign({},S(H,"key-modal-input"),{className:"key-modal-input",ref:function(be){return be&&be.focus()},spellCheck:!1,value:V,placeholder:"...",onChange:function(be){$.setState({input:be.target.value})},onKeyPress:function(be){te&&be.key==="Enter"?$.submit():be.key==="Escape"&&$.closeModal()}})),te?g.a.createElement(Nt,Object.assign({},S(H,"key-modal-submit"),{className:"key-modal-submit",onClick:function(be){return $.submit()}})):null),g.a.createElement("span",S(H,"key-modal-cancel"),g.a.createElement(_t,Object.assign({},S(H,"key-modal-cancel-icon"),{className:"key-modal-cancel",onClick:function(){ve.dispatch({rjvId:Q,name:"RESET"})}})))))}}]),M}(g.a.PureComponent),dF=function(F){h(M,F);var L=v(M);function M(){var $;u(this,M);for(var I=arguments.length,H=new Array(I),Q=0;Q>1}};Cn.from=function(t){if(t instanceof Cn)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Cn(e)};function lI(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),o=e.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)n++;return n}if(i.content.size||o.content.size){let s=lI(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function uI(t,e,n,r){for(let i=t.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let s=t.child(--i),a=e.child(--o),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 u=0,c=Math.min(s.text.length,a.text.length);for(;ue&&r(l,i+a,o||null,s)!==!1&&l.content.size){let c=a+1;l.nodesBetween(Math.max(0,e-c),Math.min(l.content.size,n-c),r,i+c)}a=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let o="",s=!0;return this.nodesBetween(e,n,(a,l)=>{let u=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&u||a.isTextblock)&&r&&(s?s=!1:o+=r),o+=u},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);oe)for(let o=0,s=0;se&&((sn)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,n-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,n-s-1))),r.push(a),i+=a.nodeSize),s=l}return new ue(r,i)}cutByIndex(e,n){return e==n?ue.empty:e==0&&n==this.content.length?this:new ue(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new ue(i,o)}addToStart(e){return new ue([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new ue(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;nthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),s=i+o.nodeSize;if(s>=e)return s==e||n>0?Op(r+1,s):Op(r,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return ue.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new ue(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return ue.empty;let n,r=0;for(let i=0;ithis.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;nr.type.rank-i.type.rank),n}};yt.none=[];class d1 extends Error{}class Me{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=fI(this.content,e+this.openStart,n);return r&&new Me(r,this.openStart,this.openEnd)}removeBetween(e,n){return new Me(cI(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return Me.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Me(ue.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new Me(e,r,i)}}Me.empty=new Me(ue.empty,0,0);function cI(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:s,offset:a}=t.findIndex(n);if(i==e||o.isText){if(a!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(cI(o.content,e-i-1,n-i-1)))}function fI(t,e,n,r){let{index:i,offset:o}=t.findIndex(e),s=t.maybeChild(i);if(o==e||s.isText)return t.cut(0,e).append(n).append(t.cut(e));let a=fI(s.content,e-o-1,n);return a&&t.replaceChild(i,s.copy(a))}function fue(t,e,n){if(n.openStart>t.depth)throw new d1("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new d1("Inconsistent open depths");return dI(t,e,n,0)}function dI(t,e,n,r){let i=t.index(r),o=t.node(r);if(i==e.index(r)&&r=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function fd(t,e,n,r){let i=(e||t).node(n),o=0,s=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(vl(t.nodeAfter,r),o++));for(let a=o;ai&&ok(t,e,i+1),s=r.depth>i&&ok(n,r,i+1),a=[];return fd(null,t,i,a),o&&s&&e.index(i)==n.index(i)?(hI(o,s),vl(wl(o,pI(t,e,n,r,i+1)),a)):(o&&vl(wl(o,h1(t,e,i+1)),a),fd(e,n,i,a),s&&vl(wl(s,h1(n,r,i+1)),a)),fd(r,null,i,a),new ue(a)}function h1(t,e,n){let r=[];if(fd(null,t,n,r),t.depth>n){let i=ok(t,e,n+1);vl(wl(i,h1(t,e,n+1)),r)}return fd(e,null,n,r),new ue(r)}function due(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)i=e.node(o).copy(ue.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class Xd{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new p1(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let s=e;;){let{index:a,offset:l}=s.content.findIndex(o),u=o-l;if(r.push(s,a,i+l),!u||(s=s.child(a),s.isText))break;o=u-1,i+=l+1}return new Xd(n,r,o)}static resolveCached(e,n){let r=__.get(e);if(r)for(let o=0;oe&&this.nodesBetween(e,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),mI(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=ue.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),a=s&&s.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=i;ln.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=ue.fromJSON(e,n.content),o=e.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};Vu.prototype.text=void 0;class m1 extends Vu{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):mI(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new m1(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new m1(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function mI(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Il{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new gue(e,n);if(r.next==null)return Il.empty;let i=gI(r);r.next&&r.err("Unexpected trailing text");let o=Eue(xue(i));return Sue(o,r),o}matchType(e){for(let n=0;nu.createAndFill()));for(let u=0;u=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s"+e.indexOf(r.next[s].next);return o}).join(` -`)}}Il.empty=new Il(!0);class gue{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function gI(t){let e=[];do e.push(yue(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function yue(t){let e=[];do e.push(bue(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function bue(t){let e=kue(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=vue(t,e);else break;return e}function A_(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function vue(t,e){let n=A_(t),r=n;return t.eat(",")&&(t.next!="}"?r=A_(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function wue(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let o in n){let s=n[o];s.groups.indexOf(e)>-1&&i.push(s)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function kue(t){if(t.eat("(")){let e=gI(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=wue(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function xue(t){let e=[[]];return i(o(t,0),n()),e;function n(){return e.push([])-1}function r(s,a,l){let u={term:l,to:a};return e[s].push(u),u}function i(s,a){s.forEach(l=>l.to=a)}function o(s,a){if(s.type=="choice")return s.exprs.reduce((l,u)=>l.concat(o(u,a)),[]);if(s.type=="seq")for(let l=0;;l++){let u=o(s.exprs[l],a);if(l==s.exprs.length-1)return u;i(u,a=n())}else if(s.type=="star"){let l=n();return r(a,l),i(o(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=n();return i(o(s.expr,a),l),i(o(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(a)].concat(o(s.expr,a));if(s.type=="range"){let l=a;for(let u=0;u{t[s].forEach(({term:a,to:l})=>{if(!a)return;let u;for(let c=0;c{u||i.push([a,u=[]]),u.indexOf(c)==-1&&u.push(c)})})});let o=e[r.join(",")]=new Il(r.indexOf(t.length-1)>-1);for(let s=0;s-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;nr[o]=new g1(o,n,s));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}}function Cue(t){let e=t.split("|");return n=>{let r=n===null?"null":typeof n;if(e.indexOf(r)<0)throw new RangeError(`Expected value of type ${e}, got ${r}`)}}class _ue{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default,this.validate=typeof e.validate=="string"?Cue(e.validate):e.validate}get isRequired(){return!this.hasDefault}}class gE{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=kI(i.attrs),this.excluded=null;let o=bI(this.attrs);this.instance=o?new yt(this,o):null}create(e=null){return!e&&this.instance?this.instance:new yt(this,vI(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new gE(o,i++,n,s)),r}removeFromSet(e){for(var n=0;n-1}}class xI{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=Cn.from(e.nodes),n.marks=Cn.from(e.marks||{}),this.nodes=g1.compile(this.spec.nodes,this),this.marks=gE.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],s=o.spec.content||"",a=o.spec.marks;if(o.contentMatch=r[s]||(r[s]=Il.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=a=="_"?null:a?M_(this,a.split(" ")):a==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:M_(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(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof g1){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,i)}text(e,n){let r=this.nodes.text;return new m1(r,r.defaultAttrs,e,yt.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return Vu.fromJSON(this,e)}markFromJSON(e){return yt.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function M_(t,e){let n=[];for(let r=0;r-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function Aue(t){return t.tag!=null}function Tue(t){return t.style!=null}class eh{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(Aue(i))this.tags.push(i);else if(Tue(i)){let o=/[^=]*/.exec(i.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let o=e.nodes[i.node];return o.contentMatch.matchType(o)})}parse(e,n={}){let r=new D_(this,n,!1);return r.addAll(e,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new D_(this,n,!0);return r.addAll(e,n.from,n.to),Me.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;ie.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(s.getAttrs){let l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let n=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s{r(s=N_(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=N_(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new eh(e,eh.schemaRules(e)))}}const EI={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},Mue={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},SI={ol:!0,ul:!0},y1=1,b1=2,dd=4;function O_(t,e,n){return e!=null?(e?y1:0)|(e==="full"?b1:0):t&&t.whitespace=="pre"?y1|b1:n&~dd}class Dp{constructor(e,n,r,i,o,s,a){this.type=e,this.attrs=n,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=a,this.content=[],this.activeMarks=yt.none,this.stashMarks=[],this.match=s||(a&dd?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(ue.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&y1)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=ue.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(ue.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}popFromStashMark(e){for(let n=this.stashMarks.length-1;n>=0;n--)if(e.eq(this.stashMarks[n]))return this.stashMarks.splice(n,1)[0]}applyPending(e){for(let n=0,r=this.pendingMarks;nthis.addAll(e)),s&&this.sync(a),this.needsBlock=l}else this.withStyleRules(e,()=>{this.addElementByRule(e,o,o.consuming===!1?i:void 0)})}leafFallback(e){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(` -`))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let n=yt.none,r=yt.none;if(e.length)for(let i=0;i{l.clearMark(u)&&(r=u.addToSet(r))}):n=this.parser.schema.marks[l.mark].create(l.attrs).addToSet(n),l.consuming===!1)a=l;else break}}return[n,r]}addElementByRule(e,n,r){let i,o,s;n.node?(o=this.parser.schema.nodes[n.node],o.isLeaf?this.insertNode(o.create(n.attrs))||this.leafFallback(e):i=this.enter(o,n.attrs||null,n.preserveWhitespace)):(s=this.parser.schema.marks[n.mark].create(n.attrs),this.addPendingMark(s));let a=this.top;if(o&&o.isLeaf)this.findInside(e);else if(r)this.addElement(e,r);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l)}i&&this.sync(a)&&this.open--,s&&this.removePendingMark(s,a)}addAll(e,n,r){let i=n||0;for(let o=n?e.childNodes[n]:e.firstChild,s=r==null?null:e.childNodes[r];o!=s;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o);this.findAtPoint(e,i)}findPlace(e){let n,r;for(let i=this.open;i>=0;i--){let o=this.nodes[i],s=o.findWrapping(e);if(s&&(!n||n.length>s.length)&&(n=s,r=o,!s.length)||o.solid)break}if(!n)return!1;this.sync(r);for(let i=0;ithis.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let n=this.open;n>=0;n--)if(this.nodes[n]==e)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(a,l)=>{for(;a>=0;a--){let u=n[a];if(u==""){if(a==n.length-1||a==0)continue;for(;l>=o;l--)if(s(a-1,l))return!0;return!1}else{let c=l>0||l==0&&i?this.nodes[l].type:r&&l>=o?r.node(l-o).type:null;if(!c||c.name!=u&&c.groups.indexOf(u)==-1)return!1;l--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(e){let n=$ue(e,this.top.pendingMarks);n&&this.top.stashMarks.push(n),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,n){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let s=i.popFromStashMark(e);s&&i.type&&i.type.allowsMarkType(s.type)&&(i.activeMarks=s.addToSet(i.activeMarks))}if(i==n)break}}}function Oue(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&SI.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function Due(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function N_(t){let e={};for(let n in t)e[n]=t[n];return e}function Nue(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],s=a=>{o.push(a);for(let l=0;l{if(o.length||s.marks.length){let a=0,l=0;for(;a=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&x0(Xb(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null){return x0(e,n,r)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new yE(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=$_(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return $_(e.marks)}}function $_(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Xb(t){return t.document||window.document}const I_=new WeakMap;function Iue(t){let e=I_.get(t);return e===void 0&&I_.set(t,e=Rue(t)),e}function Rue(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=i.indexOf(" ");s>0&&(n=i.slice(0,s),i=i.slice(s+1));let a,l=n?t.createElementNS(n,i):t.createElement(i),u=e[1],c=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){c=2;for(let f in u)if(u[f]!=null){let d=f.indexOf(" ");d>0?l.setAttributeNS(f.slice(0,d),f.slice(d+1),u[f]):l.setAttribute(f,u[f])}}for(let f=c;fc)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:h,contentDOM:p}=x0(t,d,n,r);if(l.appendChild(h),p){if(a)throw new RangeError("Multiple content holes");a=p}}}return{dom:l,contentDOM:a}}const CI=65535,_I=Math.pow(2,16);function Fue(t,e){return t+e*_I}function R_(t){return t&CI}function Lue(t){return(t-(t&CI))/_I}const AI=1,TI=2,E0=4,MI=8;class F_{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&MI)>0}get deletedBefore(){return(this.delInfo&(AI|E0))>0}get deletedAfter(){return(this.delInfo&(TI|E0))>0}get deletedAcross(){return(this.delInfo&E0)>0}}class Fr{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Fr.empty)return Fr.empty}recover(e){let n=0,r=R_(e);if(!this.inverted)for(let i=0;ie)break;let u=this.ranges[a+o],c=this.ranges[a+s],f=l+u;if(e<=f){let d=u?e==l?-1:e==f?1:n:n,h=l+i+(d<0?0:c);if(r)return h;let p=e==(n<0?l:f)?null:Fue(a/3,e-l),m=e==l?TI:e==f?AI:E0;return(n<0?e!=l:e!=f)&&(m|=MI),new F_(h,m,p)}i+=c-u}return r?e+i:new F_(e+i,0,null)}touches(e,n){let r=0,i=R_(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;ae)break;let u=this.ranges[a+o],c=l+u;if(e<=c&&a==i*3)return!0;r+=this.ranges[a+s]-u}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return Zt.fromReplace(e,this.from,this.to,o)}invert(){return new rl(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new nl(n.pos,r.pos,this.mark)}merge(e){return e instanceof nl&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new nl(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new nl(n.from,n.to,e.markFromJSON(n.mark))}}Kn.jsonID("addMark",nl);class rl extends Kn{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new Me(bE(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return Zt.fromReplace(e,this.from,this.to,r)}invert(){return new nl(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new rl(n.pos,r.pos,this.mark)}merge(e){return e instanceof rl&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new rl(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new rl(n.from,n.to,e.markFromJSON(n.mark))}}Kn.jsonID("removeMark",rl);class il extends Kn{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Zt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Zt.fromReplace(e,this.pos,this.pos+1,new Me(ue.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;ir.pos?null:new Cr(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Cr(n.from,n.to,n.gapFrom,n.gapTo,Me.fromJSON(e,n.slice),n.insert,!!n.structure)}}Kn.jsonID("replaceAround",Cr);function ak(t,e,n){let r=t.resolve(e),i=n-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function Bue(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function qc(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let i=t.$from.node(r),o=t.$from.index(r),s=t.$to.indexAfter(r);if(ro;u--,c--){let f=i.node(u),d=i.index(u);if(f.type.spec.isolating)return!1;let h=f.content.cutByIndex(d,f.childCount),p=r&&r[c+1];p&&(h=h.replaceChild(0,p.type.create(p.attrs)));let m=r&&r[c]||f;if(!f.canReplace(d+1,f.childCount)||!m.type.validContent(h))return!1}let a=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type)}function Pl(t,e){let n=t.resolve(e),r=n.index();return DI(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function DI(t,e){return!!(t&&e&&!t.isLeaf&&t.canAppend(e))}function Wg(t,e,n=-1){let r=t.resolve(e);for(let i=r.depth;;i--){let o,s,a=r.index(i);if(i==r.depth?(o=r.nodeBefore,s=r.nodeAfter):n>0?(o=r.node(i+1),a++,s=r.node(i).maybeChild(a)):(o=r.node(i).maybeChild(a-1),s=r.node(i+1)),o&&!o.isTextblock&&DI(o,s)&&r.node(i).canReplace(a,a+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}function vE(t,e,n=e,r=Me.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),o=t.resolve(n);return jue(i,o,r)?new Rr(e,n,r):new que(i,o,r).fit()}function jue(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class que{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=ue.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=ue.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,a=i.depth;for(;s&&a&&o.childCount==1;)o=o.firstChild.content,s--,a--;let l=new Me(o,s,a);return e>-1?new Cr(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new Rr(r.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=t2(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:u}=this.frontier[a],c,f=null;if(n==1&&(s?u.matchType(s.type)||(f=u.fillBefore(ue.from(s),!1)):o&&l.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:a,parent:o,inject:f};if(n==2&&s&&(c=u.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:o,wrap:c};if(o&&u.matchType(o.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=t2(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new Me(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=t2(e,n);if(i.childCount<=1&&n>0){let o=e.size-n<=n+i.size;this.unplaced=new Me(Bf(e,n-1,1),n-1,o?n-1:r)}else this.unplaced=new Me(Bf(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let m=0;m1||l==0||m.content.size)&&(f=b,c.push(NI(m.mark(d.allowedMarks(m.marks)),u==1?l:0,u==a.childCount?h:-1)))}let p=u==a.childCount;p||(h=-1),this.placed=Pf(this.placed,n,ue.from(c)),this.frontier[n].match=f,p&&h<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,b=a;m1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n=0;a--){let{match:l,type:u}=this.frontier[a],c=n2(e,a,u,l,!0);if(!c||c.childCount)continue e}return{depth:n,fit:s,move:o?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Pf(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=Pf(this.placed,this.depth,ue.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(ue.empty,!0);n.childCount&&(this.placed=Pf(this.placed,this.frontier.length,n))}}function Bf(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Bf(t.firstChild.content,e-1,n)))}function Pf(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Pf(t.lastChild.content,e-1,n)))}function t2(t,e){for(let n=0;n1&&(r=r.replaceChild(0,NI(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(ue.empty,!0)))),t.copy(r)}function n2(t,e,n,r,i){let o=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!Vue(n,o.content,s)?a:null}function Vue(t,e,n){for(let r=n;r=0;o--){let s=n<0?hu(e.node(0),e.node(o),e.before(o+1),e.index(o),n,r):hu(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,n,r);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new yo(e.node(0))}static atStart(e){return hu(e,e,0,0,1)||new yo(e)}static atEnd(e){return hu(e,e,e.content.size,e.childCount,-1)||new yo(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=r2[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in r2)throw new RangeError("Duplicate use of selection JSON ID "+e);return r2[e]=n,n.prototype.jsonID=e,n}getBookmark(){return Mt.between(this.$anchor,this.$head).getBookmark()}}pt.prototype.visible=!0;class Uue{constructor(e,n){this.$from=e,this.$to=n}}let B_=!1;function P_(t){!B_&&!t.parent.inlineContent&&(B_=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Mt extends pt{constructor(e,n=e){P_(e),P_(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return pt.near(r);let i=e.resolve(n.map(this.anchor));return new Mt(i.parent.inlineContent?i:r,r)}replace(e,n=Me.empty){if(super.replace(e,n),n==Me.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof Mt&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Jg(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Mt(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=pt.findFrom(n,r,!0)||pt.findFrom(n,-r,!0);if(o)n=o.$head;else return pt.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(pt.findFrom(e,-r,!0)||pt.findFrom(e,r,!0)).$anchor,e.pos0?0:1);i>0?s=0;s+=i){let a=e.child(s);if(a.isAtom){if(!o&&St.isSelectable(a))return St.create(t,n-(i<0?a.nodeSize:0))}else{let l=hu(t,a,n+i,i<0?a.childCount:0,i,o);if(l)return l}n+=a.nodeSize*i}return null}function z_(t,e,n){let r=t.steps.length-1;if(r{s==null&&(s=c)}),t.setSelection(pt.near(t.doc.resolve(s),n))}function j_(t,e){return!e||!t?t:t.bind(e)}class Np{constructor(e,n,r){this.name=e,this.init=j_(n.init,r),this.apply=j_(n.apply,r)}}new Np("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Np("selection",{init(t,e){return t.selection||pt.atStart(e.doc)},apply(t){return t.selection}}),new Np("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Np("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}});function $I(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=$I(i,e,{})),n[r]=i}return n}class Vc{constructor(e){this.spec=e,this.props={},e.props&&$I(e.props,this,this.props),this.key=e.key?e.key.key:II("plugin")}getState(e){return e[this.key]}}const i2=Object.create(null);function II(t){return t in i2?t+"$"+ ++i2[t]:(i2[t]=0,t+"$")}class Uc{constructor(e="key"){this.key=II(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Wue=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function RI(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const Jue=(t,e,n)=>{let r=RI(t,n);if(!r)return!1;let i=kE(r);if(!i){let s=r.blockRange(),a=s&&qc(s);return a==null?!1:(e&&e(t.tr.lift(s,a).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&PI(t,i,e))return!0;if(r.parent.content.size==0&&(Sc(o,"end")||St.isSelectable(o))){let s=vE(t.doc,r.before(),r.after(),Me.empty);if(s&&s.slice.size{let r=RI(t,n);if(!r)return!1;let i=kE(r);return i?FI(t,i,e):!1},Gue=(t,e,n)=>{let r=LI(t,n);if(!r)return!1;let i=xE(r);return i?FI(t,i,e):!1};function FI(t,e,n){let r=e.nodeBefore,i=r,o=e.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let c=i.lastChild;if(!c)return!1;i=c}let s=e.nodeAfter,a=s,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let c=a.firstChild;if(!c)return!1;a=c}let u=vE(t.doc,o,l,Me.empty);if(!u||u.from!=o||u instanceof Rr&&u.slice.size>=l-o)return!1;if(n){let c=t.tr.step(u);c.setSelection(Mt.create(c.doc,o)),n(c.scrollIntoView())}return!0}function Sc(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const Zue=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;o=kE(r)}let s=o&&o.nodeBefore;return!s||!St.isSelectable(s)?!1:(e&&e(t.tr.setSelection(St.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function kE(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function LI(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset{let r=LI(t,n);if(!r)return!1;let i=xE(r);if(!i)return!1;let o=i.nodeAfter;if(PI(t,i,e))return!0;if(r.parent.content.size==0&&(Sc(o,"start")||St.isSelectable(o))){let s=vE(t.doc,r.before(),r.after(),Me.empty);if(s&&s.slice.size{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset=0;e--){let n=t.node(e);if(t.index(e)+1{let n=t.selection,r=n instanceof St,i;if(r){if(n.node.isTextblock||!Pl(t.doc,n.from))return!1;i=n.from}else if(i=Wg(t.doc,n.from,-1),i==null)return!1;if(e){let o=t.tr.join(i);r&&o.setSelection(St.create(o.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},ece=(t,e)=>{let n=t.selection,r;if(n instanceof St){if(n.node.isTextblock||!Pl(t.doc,n.to))return!1;r=n.to}else if(r=Wg(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},tce=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),o=i&&qc(i);return o==null?!1:(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},nce=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(` -`).scrollIntoView()),!0)};function BI(t){for(let e=0;e{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=BI(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let a=n.after(),l=t.tr.replaceWith(a,a,s.createAndFill());l.setSelection(pt.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},ice=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof yo||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=BI(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!r.parentOffset&&i.index(){let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(Uu(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&qc(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)},sce=(t,e)=>{let{$from:n,to:r}=t.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),e&&e(t.tr.setSelection(St.create(t.doc,i))),!0)};function ace(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||Pl(t.doc,e.pos))?!1:(n&&n(t.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0)}function PI(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o,s;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(ace(t,e,n))return!0;let a=e.parent.canReplace(e.index(),e.index()+1);if(a&&(o=(s=r.contentMatchAt(r.childCount)).findWrapping(i.type))&&s.matchType(o[0]||i.type).validEnd){if(n){let f=e.pos+i.nodeSize,d=ue.empty;for(let m=o.length-1;m>=0;m--)d=ue.from(o[m].create(null,d));d=ue.from(r.copy(d));let h=t.tr.step(new Cr(e.pos-1,f,e.pos,f,new Me(d,1,0),o.length,!0)),p=f+2*o.length;Pl(h.doc,p)&&h.join(p),n(h.scrollIntoView())}return!0}let l=pt.findFrom(e,1),u=l&&l.$from.blockRange(l.$to),c=u&&qc(u);if(c!=null&&c>=e.depth)return n&&n(t.tr.lift(u,c).scrollIntoView()),!0;if(a&&Sc(i,"start",!0)&&Sc(r,"end")){let f=r,d=[];for(;d.push(f),!f.isTextblock;)f=f.lastChild;let h=i,p=1;for(;!h.isTextblock;h=h.firstChild)p++;if(f.canReplace(f.childCount,f.childCount,h.content)){if(n){let m=ue.empty;for(let y=d.length-1;y>=0;y--)m=ue.from(d[y].copy(m));let b=t.tr.step(new Cr(e.pos-d.length,e.pos+i.nodeSize,e.pos+p,e.pos+i.nodeSize-p,new Me(m,d.length,0),0,!0));n(b.scrollIntoView())}return!0}}return!1}function zI(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(n&&n(e.tr.setSelection(Mt.create(e.doc,t<0?i.start(o):i.end(o)))),!0):!1}}const lce=zI(-1),uce=zI(1);function cce(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=s&&OI(s,t,e);return a?(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0):!1}}function q_(t,e=null){return function(n,r){let i=!1;for(let o=0;o{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)i=!0;else{let c=n.doc.resolve(u),f=c.index();i=c.parent.canReplaceWith(f,f+1,t)}})}if(!i)return!1;if(r){let o=n.tr;for(let s=0;s=2&&i.node(s.depth-1).type.compatibleContent(t)&&s.startIndex==0){if(i.index(s.depth-1)==0)return!1;let c=n.doc.resolve(s.start-2);l=new p1(c,c,s.depth),s.endIndex=0;c--)o=ue.from(n[c].type.create(n[c].attrs,o));t.step(new Cr(e.start-(r?2:0),e.end,e.start,e.end,new Me(o,0,0),n.length,!0));let s=0;for(let c=0;cs.childCount>0&&s.firstChild.type==t);return o?n?r.node(o.depth-1).type==t?pce(e,n,t,o):mce(e,n,o):!0:!1}}function pce(t,e,n,r){let i=t.tr,o=r.end,s=r.$to.end(r.depth);om;p--)h-=i.child(p).nodeSize,r.delete(h-1,h+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==i.childCount,u=o.node(-1),c=o.index(-1);if(!u.canReplace(c+(a?0:1),c+1,s.content.append(l?ue.empty:ue.from(i))))return!1;let f=o.pos,d=f+s.nodeSize;return r.step(new Cr(f-(a?1:0),d+(l?1:0),f+1,d-1,new Me((a?ue.empty:ue.from(i.copy(ue.empty))).append(l?ue.empty:ue.from(i.copy(ue.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function gce(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,u=>u.childCount>0&&u.firstChild.type==t);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let a=o.parent,l=a.child(s-1);if(l.type!=t)return!1;if(n){let u=l.lastChild&&l.lastChild.type==a.type,c=ue.from(u?t.create():null),f=new Me(ue.from(t.create(null,ue.from(a.type.create(null,c)))),u?3:1,0),d=o.start,h=o.end;n(e.tr.step(new Cr(d-(u?3:1),h,d,h,f,1,!0)).scrollIntoView())}return!0}}function jI(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}class yce{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:n,state:r}=this,{view:i}=n,{tr:o}=r,s=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...c)=>{const f=l(...c)(s);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),f}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i,a=[],l=!!e,u=e||o.tr,c=()=>(!l&&n&&!u.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(u),a.every(d=>d===!0)),f={...Object.fromEntries(Object.entries(r).map(([d,h])=>[d,(...m)=>{const b=this.buildProps(u,n),y=h(...m)(b);return a.push(y),f}])),run:c};return f}createCan(e){const{rawCommands:n,state:r}=this,i=!1,o=e||r.tr,s=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(n).map(([l,u])=>[l,(...c)=>u(...c)({...s,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(e,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i,a={tr:e,editor:i,view:s,state:jI({state:o,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([l,u])=>[l,(...c)=>u(...c)(a)]))}};return a}}function rr(t,e,n){return t.config[e]===void 0&&t.parent?rr(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?rr(t.parent,e,n):null}):t.config[e]}function bce(t){const e=t.filter(i=>i.type==="extension"),n=t.filter(i=>i.type==="node"),r=t.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function Hn(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function vce(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){const a=o?o.split(" "):[],l=r[i]?r[i].split(" "):[],u=a.filter(c=>!l.includes(c));r[i]=[...l,...u].join(" ")}else i==="style"?r[i]=[r[i],o].join("; "):r[i]=o}),r},{})}function wce(t){return typeof t=="function"}function Pr(t,e=void 0,...n){return wce(t)?e?t.bind(e)(...n):t(...n):t}function kce(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function xce(t){return Object.prototype.toString.call(t).slice(8,-1)}function $p(t){return xce(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function Kg(t,e){const n={...t};return $p(t)&&$p(e)&&Object.keys(e).forEach(r=>{$p(e[r])&&$p(t[r])?n[r]=Kg(t[r],e[r]):n[r]=e[r]}),n}class yi{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Pr(rr(this,"addOptions",{name:this.name}))),this.storage=Pr(rr(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new yi(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Kg(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new yi({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Pr(rr(n,"addOptions",{name:n.name})),n.storage=Pr(rr(n,"addStorage",{name:n.name,options:n.options})),n}}function Ece(t,e,n){const{from:r,to:i}=e,{blockSeparator:o=` +https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof F.getDerivedStateFromProps=="function"&&(L.componentWillMount=x,L.componentWillReceiveProps=k),typeof L.getSnapshotBeforeUpdate=="function"){if(typeof L.componentDidUpdate!="function")throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");L.componentWillUpdate=E;var Z=L.componentDidUpdate;L.componentDidUpdate=function(U,te,be){var Ue=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:be;Z.call(this,U,te,Ue)}}return F}function O(F,L){if(F==null)return{};var M,$,I=function(Q,Z){if(Q==null)return{};var U,te,be={},Ue=Object.keys(Q);for(te=0;te=0||(be[U]=Q[U]);return be}(F,L);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(F);for($=0;$=0||Object.prototype.propertyIsEnumerable.call(F,M)&&(I[M]=F[M])}return I}function N(F){var L=function(M){return{}.toString.call(M).match(/\s([a-zA-Z]+)/)[1].toLowerCase()}(F);return L==="number"&&(L=isNaN(F)?"nan":(0|F)!=F?"float":"integer"),L}x.__suppressDeprecationWarning=!0,k.__suppressDeprecationWarning=!0,E.__suppressDeprecationWarning=!0;var C={scheme:"rjv-default",author:"mac gainor",base00:"rgba(0, 0, 0, 0)",base01:"rgb(245, 245, 245)",base02:"rgb(235, 235, 235)",base03:"#93a1a1",base04:"rgba(0, 0, 0, 0.3)",base05:"#586e75",base06:"#073642",base07:"#002b36",base08:"#d33682",base09:"#cb4b16",base0A:"#dc322f",base0B:"#859900",base0C:"#6c71c4",base0D:"#586e75",base0E:"#2aa198",base0F:"#268bd2"},R={scheme:"rjv-grey",author:"mac gainor",base00:"rgba(1, 1, 1, 0)",base01:"rgba(1, 1, 1, 0.1)",base02:"rgba(0, 0, 0, 0.2)",base03:"rgba(1, 1, 1, 0.3)",base04:"rgba(0, 0, 0, 0.4)",base05:"rgba(1, 1, 1, 0.5)",base06:"rgba(1, 1, 1, 0.6)",base07:"rgba(1, 1, 1, 0.7)",base08:"rgba(1, 1, 1, 0.8)",base09:"rgba(1, 1, 1, 0.8)",base0A:"rgba(1, 1, 1, 0.8)",base0B:"rgba(1, 1, 1, 0.8)",base0C:"rgba(1, 1, 1, 0.8)",base0D:"rgba(1, 1, 1, 0.8)",base0E:"rgba(1, 1, 1, 0.8)",base0F:"rgba(1, 1, 1, 0.8)"},T={white:"#fff",black:"#000",transparent:"rgba(1, 1, 1, 0)",globalFontFamily:"monospace",globalCursor:"default",indentBlockWidth:"5px",braceFontWeight:"bold",braceCursor:"pointer",ellipsisFontSize:"18px",ellipsisLineHeight:"10px",ellipsisCursor:"pointer",keyMargin:"0px 5px",keyLetterSpacing:"0.5px",keyFontStyle:"none",keyBorderRadius:"3px",keyColonWeight:"bold",keyVerticalAlign:"top",keyOpacity:"0.85",keyOpacityHover:"1",keyValPaddingTop:"3px",keyValPaddingBottom:"3px",keyValPaddingRight:"5px",keyValBorderLeft:"1px solid",keyValBorderHover:"2px solid",keyValPaddingHover:"3px 5px 3px 4px",pushedContentMarginLeft:"6px",variableValuePaddingRight:"6px",nullFontSize:"11px",nullFontWeight:"bold",nullPadding:"1px 2px",nullBorderRadius:"3px",nanFontSize:"11px",nanFontWeight:"bold",nanPadding:"1px 2px",nanBorderRadius:"3px",undefinedFontSize:"11px",undefinedFontWeight:"bold",undefinedPadding:"1px 2px",undefinedBorderRadius:"3px",dataTypeFontSize:"11px",dataTypeMarginRight:"4px",datatypeOpacity:"0.8",objectSizeBorderRadius:"3px",objectSizeFontStyle:"italic",objectSizeMargin:"0px 6px 0px 0px",clipboardCursor:"pointer",clipboardCheckMarginLeft:"-12px",metaDataPadding:"0px 0px 0px 10px",arrayGroupMetaPadding:"0px 0px 0px 4px",iconContainerWidth:"17px",tooltipPadding:"4px",editInputMinWidth:"130px",editInputBorderRadius:"2px",editInputPadding:"5px",editInputMarginRight:"4px",editInputFontFamily:"monospace",iconCursor:"pointer",iconFontSize:"15px",iconPaddingRight:"1px",dateValueMarginLeft:"2px",iconMarginRight:"3px",detectedRowPaddingTop:"3px",addKeyCoverBackground:"rgba(255, 255, 255, 0.3)",addKeyCoverPosition:"absolute",addKeyCoverPositionPx:"0px",addKeyModalWidth:"200px",addKeyModalMargin:"auto",addKeyModalPadding:"10px",addKeyModalRadius:"3px"},q=o(45),A=function(F){var L=function(M){return{backgroundColor:M.base00,ellipsisColor:M.base09,braceColor:M.base07,expandedIcon:M.base0D,collapsedIcon:M.base0E,keyColor:M.base07,arrayKeyColor:M.base0C,objectSize:M.base04,copyToClipboard:M.base0F,copyToClipboardCheck:M.base0D,objectBorder:M.base02,dataTypes:{boolean:M.base0E,date:M.base0D,float:M.base0B,function:M.base0D,integer:M.base0F,string:M.base09,nan:M.base08,null:M.base0A,undefined:M.base05,regexp:M.base0A,background:M.base02},editVariable:{editIcon:M.base0E,cancelIcon:M.base09,removeIcon:M.base09,addIcon:M.base0E,checkIcon:M.base0E,background:M.base01,color:M.base0A,border:M.base07},addKeyModal:{background:M.base05,border:M.base04,color:M.base0A,labelColor:M.base01},validationFailure:{background:M.base09,iconColor:M.base01,fontColor:M.base01}}}(F);return{"app-container":{fontFamily:T.globalFontFamily,cursor:T.globalCursor,backgroundColor:L.backgroundColor,position:"relative"},ellipsis:{display:"inline-block",color:L.ellipsisColor,fontSize:T.ellipsisFontSize,lineHeight:T.ellipsisLineHeight,cursor:T.ellipsisCursor},"brace-row":{display:"inline-block",cursor:"pointer"},brace:{display:"inline-block",cursor:T.braceCursor,fontWeight:T.braceFontWeight,color:L.braceColor},"expanded-icon":{color:L.expandedIcon},"collapsed-icon":{color:L.collapsedIcon},colon:{display:"inline-block",margin:T.keyMargin,color:L.keyColor,verticalAlign:"top"},objectKeyVal:function(M,$){return{style:l({paddingTop:T.keyValPaddingTop,paddingRight:T.keyValPaddingRight,paddingBottom:T.keyValPaddingBottom,borderLeft:T.keyValBorderLeft+" "+L.objectBorder,":hover":{paddingLeft:$.paddingLeft-1+"px",borderLeft:T.keyValBorderHover+" "+L.objectBorder}},$)}},"object-key-val-no-border":{padding:T.keyValPadding},"pushed-content":{marginLeft:T.pushedContentMarginLeft},variableValue:function(M,$){return{style:l({display:"inline-block",paddingRight:T.variableValuePaddingRight,position:"relative"},$)}},"object-name":{display:"inline-block",color:L.keyColor,letterSpacing:T.keyLetterSpacing,fontStyle:T.keyFontStyle,verticalAlign:T.keyVerticalAlign,opacity:T.keyOpacity,":hover":{opacity:T.keyOpacityHover}},"array-key":{display:"inline-block",color:L.arrayKeyColor,letterSpacing:T.keyLetterSpacing,fontStyle:T.keyFontStyle,verticalAlign:T.keyVerticalAlign,opacity:T.keyOpacity,":hover":{opacity:T.keyOpacityHover}},"object-size":{color:L.objectSize,borderRadius:T.objectSizeBorderRadius,fontStyle:T.objectSizeFontStyle,margin:T.objectSizeMargin,cursor:"default"},"data-type-label":{fontSize:T.dataTypeFontSize,marginRight:T.dataTypeMarginRight,opacity:T.datatypeOpacity},boolean:{display:"inline-block",color:L.dataTypes.boolean},date:{display:"inline-block",color:L.dataTypes.date},"date-value":{marginLeft:T.dateValueMarginLeft},float:{display:"inline-block",color:L.dataTypes.float},function:{display:"inline-block",color:L.dataTypes.function,cursor:"pointer",whiteSpace:"pre-line"},"function-value":{fontStyle:"italic"},integer:{display:"inline-block",color:L.dataTypes.integer},string:{display:"inline-block",color:L.dataTypes.string},nan:{display:"inline-block",color:L.dataTypes.nan,fontSize:T.nanFontSize,fontWeight:T.nanFontWeight,backgroundColor:L.dataTypes.background,padding:T.nanPadding,borderRadius:T.nanBorderRadius},null:{display:"inline-block",color:L.dataTypes.null,fontSize:T.nullFontSize,fontWeight:T.nullFontWeight,backgroundColor:L.dataTypes.background,padding:T.nullPadding,borderRadius:T.nullBorderRadius},undefined:{display:"inline-block",color:L.dataTypes.undefined,fontSize:T.undefinedFontSize,padding:T.undefinedPadding,borderRadius:T.undefinedBorderRadius,backgroundColor:L.dataTypes.background},regexp:{display:"inline-block",color:L.dataTypes.regexp},"copy-to-clipboard":{cursor:T.clipboardCursor},"copy-icon":{color:L.copyToClipboard,fontSize:T.iconFontSize,marginRight:T.iconMarginRight,verticalAlign:"top"},"copy-icon-copied":{color:L.copyToClipboardCheck,marginLeft:T.clipboardCheckMarginLeft},"array-group-meta-data":{display:"inline-block",padding:T.arrayGroupMetaPadding},"object-meta-data":{display:"inline-block",padding:T.metaDataPadding},"icon-container":{display:"inline-block",width:T.iconContainerWidth},tooltip:{padding:T.tooltipPadding},removeVarIcon:{verticalAlign:"top",display:"inline-block",color:L.editVariable.removeIcon,cursor:T.iconCursor,fontSize:T.iconFontSize,marginRight:T.iconMarginRight},addVarIcon:{verticalAlign:"top",display:"inline-block",color:L.editVariable.addIcon,cursor:T.iconCursor,fontSize:T.iconFontSize,marginRight:T.iconMarginRight},editVarIcon:{verticalAlign:"top",display:"inline-block",color:L.editVariable.editIcon,cursor:T.iconCursor,fontSize:T.iconFontSize,marginRight:T.iconMarginRight},"edit-icon-container":{display:"inline-block",verticalAlign:"top"},"check-icon":{display:"inline-block",cursor:T.iconCursor,color:L.editVariable.checkIcon,fontSize:T.iconFontSize,paddingRight:T.iconPaddingRight},"cancel-icon":{display:"inline-block",cursor:T.iconCursor,color:L.editVariable.cancelIcon,fontSize:T.iconFontSize,paddingRight:T.iconPaddingRight},"edit-input":{display:"inline-block",minWidth:T.editInputMinWidth,borderRadius:T.editInputBorderRadius,backgroundColor:L.editVariable.background,color:L.editVariable.color,padding:T.editInputPadding,marginRight:T.editInputMarginRight,fontFamily:T.editInputFontFamily},"detected-row":{paddingTop:T.detectedRowPaddingTop},"key-modal-request":{position:T.addKeyCoverPosition,top:T.addKeyCoverPositionPx,left:T.addKeyCoverPositionPx,right:T.addKeyCoverPositionPx,bottom:T.addKeyCoverPositionPx,backgroundColor:T.addKeyCoverBackground},"key-modal":{width:T.addKeyModalWidth,backgroundColor:L.addKeyModal.background,marginLeft:T.addKeyModalMargin,marginRight:T.addKeyModalMargin,padding:T.addKeyModalPadding,borderRadius:T.addKeyModalRadius,marginTop:"15px",position:"relative"},"key-modal-label":{color:L.addKeyModal.labelColor,marginLeft:"2px",marginBottom:"5px",fontSize:"11px"},"key-modal-input-container":{overflow:"hidden"},"key-modal-input":{width:"100%",padding:"3px 6px",fontFamily:"monospace",color:L.addKeyModal.color,border:"none",boxSizing:"border-box",borderRadius:"2px"},"key-modal-cancel":{backgroundColor:L.editVariable.removeIcon,position:"absolute",top:"0px",right:"0px",borderRadius:"0px 3px 0px 3px",cursor:"pointer"},"key-modal-cancel-icon":{color:L.addKeyModal.labelColor,fontSize:T.iconFontSize,transform:"rotate(45deg)"},"key-modal-submit":{color:L.editVariable.addIcon,fontSize:T.iconFontSize,position:"absolute",right:"2px",top:"3px",cursor:"pointer"},"function-ellipsis":{display:"inline-block",color:L.ellipsisColor,fontSize:T.ellipsisFontSize,lineHeight:T.ellipsisLineHeight,cursor:T.ellipsisCursor},"validation-failure":{float:"right",padding:"3px 6px",borderRadius:"2px",cursor:"pointer",color:L.validationFailure.fontColor,backgroundColor:L.validationFailure.background},"validation-failure-label":{marginRight:"6px"},"validation-failure-clear":{position:"relative",verticalAlign:"top",cursor:"pointer",color:L.validationFailure.iconColor,fontSize:T.iconFontSize,transform:"rotate(45deg)"}}};function S(F,L,M){return F||console.error("theme has not been set"),function($){var I=C;return $!==!1&&$!=="none"||(I=R),Object(q.createStyling)(A,{defaultBase16:I})($)}(F)(L,M)}var P=function(F){h(M,F);var L=v(M);function M(){return u(this,M),L.apply(this,arguments)}return f(M,[{key:"render",value:function(){var $=this.props,I=($.rjvId,$.type_name),H=$.displayDataTypes,Q=$.theme;return H?g.a.createElement("span",Object.assign({className:"data-type-label"},S(Q,"data-type-label")),I):null}}]),M}(g.a.PureComponent),B=function(F){h(M,F);var L=v(M);function M(){return u(this,M),L.apply(this,arguments)}return f(M,[{key:"render",value:function(){var $=this.props;return g.a.createElement("div",S($.theme,"boolean"),g.a.createElement(P,Object.assign({type_name:"bool"},$)),$.value?"true":"false")}}]),M}(g.a.PureComponent),j=function(F){h(M,F);var L=v(M);function M(){return u(this,M),L.apply(this,arguments)}return f(M,[{key:"render",value:function(){var $=this.props;return g.a.createElement("div",S($.theme,"date"),g.a.createElement(P,Object.assign({type_name:"date"},$)),g.a.createElement("span",Object.assign({className:"date-value"},S($.theme,"date-value")),$.value.toLocaleTimeString("en-us",{weekday:"short",year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})))}}]),M}(g.a.PureComponent),z=function(F){h(M,F);var L=v(M);function M(){return u(this,M),L.apply(this,arguments)}return f(M,[{key:"render",value:function(){var $=this.props;return g.a.createElement("div",S($.theme,"float"),g.a.createElement(P,Object.assign({type_name:"float"},$)),this.props.value)}}]),M}(g.a.PureComponent);function J(F,L){(L==null||L>F.length)&&(L=F.length);for(var M=0,$=new Array(L);M"u"||F[Symbol.iterator]==null){if(Array.isArray(F)||(M=K(F))||L){M&&(F=M);var $=0,I=function(){};return{s:I,n:function(){return $>=F.length?{done:!0}:{done:!1,value:F[$++]}},e:function(U){throw U},f:I}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var H,Q=!0,Z=!1;return{s:function(){M=F[Symbol.iterator]()},n:function(){var U=M.next();return Q=U.done,U},e:function(U){Z=!0,H=U},f:function(){try{Q||M.return==null||M.return()}finally{if(Z)throw H}}}}function fe(F){return function(L){if(Array.isArray(L))return J(L)}(F)||function(L){if(typeof Symbol<"u"&&Symbol.iterator in Object(L))return Array.from(L)}(F)||K(F)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}var ke=o(46),ve=new(o(47)).Dispatcher,xe=new(function(F){h(M,F);var L=v(M);function M(){var $;u(this,M);for(var I=arguments.length,H=new Array(I),Q=0;QI&&(Z.style.cursor="pointer",this.state.collapsed&&(Q=g.a.createElement("span",null,Q.substring(0,I),g.a.createElement("span",S(H,"ellipsis")," ...")))),g.a.createElement("div",S(H,"string"),g.a.createElement(P,Object.assign({type_name:"string"},$)),g.a.createElement("span",Object.assign({className:"string-value"},Z,{onClick:this.toggleCollapsed}),'"',Q,'"'))}}]),M}(g.a.PureComponent),Le=function(F){h(M,F);var L=v(M);function M(){return u(this,M),L.apply(this,arguments)}return f(M,[{key:"render",value:function(){return g.a.createElement("div",S(this.props.theme,"undefined"),"undefined")}}]),M}(g.a.PureComponent);function Ge(){return(Ge=Object.assign||function(F){for(var L=1;L=0||(jh[Nr]=Ne[Nr]);return jh}(F,["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"]),be,Ue=te.value!==void 0,Ze=Object(w.useRef)(null),lt=bt(Ze,L),qe=Object(w.useRef)(0),ut=Object(w.useRef)(),Pt=function(){var Ne=Ze.current,rn=M&&ut.current?ut.current:function(Oo){var qh=window.getComputedStyle(Oo);if(qh===null)return null;var ql,In=(ql=qh,Y.reduce(function(Yc,Vl){return Yc[Vl]=ql[Vl],Yc},{})),Ul=In.boxSizing;return Ul===""?null:(V&&Ul==="border-box"&&(In.width=parseFloat(In.width)+parseFloat(In.borderRightWidth)+parseFloat(In.borderLeftWidth)+parseFloat(In.paddingRight)+parseFloat(In.paddingLeft)+"px"),{sizingStyle:In,paddingSize:parseFloat(In.paddingBottom)+parseFloat(In.paddingTop),borderSize:parseFloat(In.borderBottomWidth)+parseFloat(In.borderTopWidth)})}(Ne);if(rn){ut.current=rn;var Nr=function(Oo,qh,ql,In){ql===void 0&&(ql=1),In===void 0&&(In=1/0),at||((at=document.createElement("textarea")).setAttribute("tab-index","-1"),at.setAttribute("aria-hidden","true"),Lt(at)),at.parentNode===null&&document.body.appendChild(at);var Ul=Oo.paddingSize,Yc=Oo.borderSize,Vl=Oo.sizingStyle,YE=Vl.boxSizing;Object.keys(Vl).forEach(function(fy){var Hl=fy;at.style[Hl]=Vl[Hl]}),Lt(at),at.value=qh;var Uh=function(fy,Hl){var QE=fy.scrollHeight;return Hl.sizingStyle.boxSizing==="border-box"?QE+Hl.borderSize:QE-Hl.paddingSize}(at,Oo);at.value="x";var ly=at.scrollHeight-Ul,uy=ly*ql;YE==="border-box"&&(uy=uy+Ul+Yc),Uh=Math.max(uy,Uh);var cy=ly*In;return YE==="border-box"&&(cy=cy+Ul+Yc),[Uh=Math.min(cy,Uh),ly]}(rn,Ne.value||Ne.placeholder||"x",I,$),Mo=Nr[0],jh=Nr[1];qe.current!==Mo&&(qe.current=Mo,Ne.style.setProperty("height",Mo+"px","important"),U(Mo,{rowHeight:jh}))}};return Object(w.useLayoutEffect)(Pt),be=rt(Pt),Object(w.useLayoutEffect)(function(){var Ne=function(rn){be.current(rn)};return window.addEventListener("resize",Ne),function(){window.removeEventListener("resize",Ne)}},[]),Object(w.createElement)("textarea",Ge({},te,{onChange:function(Ne){Ue||Pt(),Q(Ne)},ref:lt}))},X=Object(w.forwardRef)(W);function se(F){F=F.trim();try{if((F=JSON.stringify(JSON.parse(F)))[0]==="[")return ge("array",JSON.parse(F));if(F[0]==="{")return ge("object",JSON.parse(F));if(F.match(/\-?\d+\.\d+/)&&F.match(/\-?\d+\.\d+/)[0]===F)return ge("float",parseFloat(F));if(F.match(/\-?\d+e-\d+/)&&F.match(/\-?\d+e-\d+/)[0]===F)return ge("float",Number(F));if(F.match(/\-?\d+/)&&F.match(/\-?\d+/)[0]===F)return ge("integer",parseInt(F));if(F.match(/\-?\d+e\+\d+/)&&F.match(/\-?\d+e\+\d+/)[0]===F)return ge("integer",Number(F))}catch{}switch(F=F.toLowerCase()){case"undefined":return ge("undefined",void 0);case"nan":return ge("nan",NaN);case"null":return ge("null",null);case"true":return ge("boolean",!0);case"false":return ge("boolean",!1);default:if(F=Date.parse(F))return ge("date",new Date(F))}return ge(!1,null)}function ge(F,L){return{type:F,value:L}}var Pe=function(F){h(M,F);var L=v(M);function M(){return u(this,M),L.apply(this,arguments)}return f(M,[{key:"render",value:function(){var $=this.props,I=$.style,H=O($,["style"]);return g.a.createElement("span",H,g.a.createElement("svg",Object.assign({},Ie(I),{viewBox:"0 0 24 24",fill:"currentColor",preserveAspectRatio:"xMidYMid meet"}),g.a.createElement("path",{d:"M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M7,13H17V11H7"})))}}]),M}(g.a.PureComponent),Be=function(F){h(M,F);var L=v(M);function M(){return u(this,M),L.apply(this,arguments)}return f(M,[{key:"render",value:function(){var $=this.props,I=$.style,H=O($,["style"]);return g.a.createElement("span",H,g.a.createElement("svg",Object.assign({},Ie(I),{viewBox:"0 0 24 24",fill:"currentColor",preserveAspectRatio:"xMidYMid meet"}),g.a.createElement("path",{d:"M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M13,7H11V11H7V13H11V17H13V13H17V11H13V7Z"})))}}]),M}(g.a.PureComponent),nt=function(F){h(M,F);var L=v(M);function M(){return u(this,M),L.apply(this,arguments)}return f(M,[{key:"render",value:function(){var $=this.props,I=$.style,H=O($,["style"]),Q=Ie(I).style;return g.a.createElement("span",H,g.a.createElement("svg",{fill:Q.color,width:Q.height,height:Q.width,style:Q,viewBox:"0 0 1792 1792"},g.a.createElement("path",{d:"M1344 800v64q0 14-9 23t-23 9h-832q-14 0-23-9t-9-23v-64q0-14 9-23t23-9h832q14 0 23 9t9 23zm128 448v-832q0-66-47-113t-113-47h-832q-66 0-113 47t-47 113v832q0 66 47 113t113 47h832q66 0 113-47t47-113zm128-832v832q0 119-84.5 203.5t-203.5 84.5h-832q-119 0-203.5-84.5t-84.5-203.5v-832q0-119 84.5-203.5t203.5-84.5h832q119 0 203.5 84.5t84.5 203.5z"})))}}]),M}(g.a.PureComponent),G=function(F){h(M,F);var L=v(M);function M(){return u(this,M),L.apply(this,arguments)}return f(M,[{key:"render",value:function(){var $=this.props,I=$.style,H=O($,["style"]),Q=Ie(I).style;return g.a.createElement("span",H,g.a.createElement("svg",{fill:Q.color,width:Q.height,height:Q.width,style:Q,viewBox:"0 0 1792 1792"},g.a.createElement("path",{d:"M1344 800v64q0 14-9 23t-23 9h-352v352q0 14-9 23t-23 9h-64q-14 0-23-9t-9-23v-352h-352q-14 0-23-9t-9-23v-64q0-14 9-23t23-9h352v-352q0-14 9-23t23-9h64q14 0 23 9t9 23v352h352q14 0 23 9t9 23zm128 448v-832q0-66-47-113t-113-47h-832q-66 0-113 47t-47 113v832q0 66 47 113t113 47h832q66 0 113-47t47-113zm128-832v832q0 119-84.5 203.5t-203.5 84.5h-832q-119 0-203.5-84.5t-84.5-203.5v-832q0-119 84.5-203.5t203.5-84.5h832q119 0 203.5 84.5t84.5 203.5z"})))}}]),M}(g.a.PureComponent),re=function(F){h(M,F);var L=v(M);function M(){return u(this,M),L.apply(this,arguments)}return f(M,[{key:"render",value:function(){var $=this.props,I=$.style,H=O($,["style"]);return g.a.createElement("span",H,g.a.createElement("svg",{style:l(l({},Ie(I).style),{},{paddingLeft:"2px",verticalAlign:"top"}),viewBox:"0 0 15 15",fill:"currentColor"},g.a.createElement("path",{d:"M0 14l6-6-6-6z"})))}}]),M}(g.a.PureComponent),me=function(F){h(M,F);var L=v(M);function M(){return u(this,M),L.apply(this,arguments)}return f(M,[{key:"render",value:function(){var $=this.props,I=$.style,H=O($,["style"]);return g.a.createElement("span",H,g.a.createElement("svg",{style:l(l({},Ie(I).style),{},{paddingLeft:"2px",verticalAlign:"top"}),viewBox:"0 0 15 15",fill:"currentColor"},g.a.createElement("path",{d:"M0 5l6 6 6-6z"})))}}]),M}(g.a.PureComponent),Ee=function(F){h(M,F);var L=v(M);function M(){return u(this,M),L.apply(this,arguments)}return f(M,[{key:"render",value:function(){var $=this.props,I=$.style,H=O($,["style"]);return g.a.createElement("span",H,g.a.createElement("svg",Object.assign({},Ie(I),{viewBox:"0 0 40 40",fill:"currentColor",preserveAspectRatio:"xMidYMid meet"}),g.a.createElement("g",null,g.a.createElement("path",{d:"m30 35h-25v-22.5h25v7.5h2.5v-12.5c0-1.4-1.1-2.5-2.5-2.5h-7.5c0-2.8-2.2-5-5-5s-5 2.2-5 5h-7.5c-1.4 0-2.5 1.1-2.5 2.5v27.5c0 1.4 1.1 2.5 2.5 2.5h25c1.4 0 2.5-1.1 2.5-2.5v-5h-2.5v5z m-20-27.5h2.5s2.5-1.1 2.5-2.5 1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5 1.3 2.5 2.5 2.5h2.5s2.5 1.1 2.5 2.5h-20c0-1.5 1.1-2.5 2.5-2.5z m-2.5 20h5v-2.5h-5v2.5z m17.5-5v-5l-10 7.5 10 7.5v-5h12.5v-5h-12.5z m-17.5 10h7.5v-2.5h-7.5v2.5z m12.5-17.5h-12.5v2.5h12.5v-2.5z m-7.5 5h-5v2.5h5v-2.5z"}))))}}]),M}(g.a.PureComponent),Ae=function(F){h(M,F);var L=v(M);function M(){return u(this,M),L.apply(this,arguments)}return f(M,[{key:"render",value:function(){var $=this.props,I=$.style,H=O($,["style"]);return g.a.createElement("span",H,g.a.createElement("svg",Object.assign({},Ie(I),{viewBox:"0 0 40 40",fill:"currentColor",preserveAspectRatio:"xMidYMid meet"}),g.a.createElement("g",null,g.a.createElement("path",{d:"m28.6 25q0-0.5-0.4-1l-4-4 4-4q0.4-0.5 0.4-1 0-0.6-0.4-1.1l-2-2q-0.4-0.4-1-0.4-0.6 0-1 0.4l-4.1 4.1-4-4.1q-0.4-0.4-1-0.4-0.6 0-1 0.4l-2 2q-0.5 0.5-0.5 1.1 0 0.5 0.5 1l4 4-4 4q-0.5 0.5-0.5 1 0 0.7 0.5 1.1l2 2q0.4 0.4 1 0.4 0.6 0 1-0.4l4-4.1 4.1 4.1q0.4 0.4 1 0.4 0.6 0 1-0.4l2-2q0.4-0.4 0.4-1z m8.7-5q0 4.7-2.3 8.6t-6.3 6.2-8.6 2.3-8.6-2.3-6.2-6.2-2.3-8.6 2.3-8.6 6.2-6.2 8.6-2.3 8.6 2.3 6.3 6.2 2.3 8.6z"}))))}}]),M}(g.a.PureComponent),ot=function(F){h(M,F);var L=v(M);function M(){return u(this,M),L.apply(this,arguments)}return f(M,[{key:"render",value:function(){var $=this.props,I=$.style,H=O($,["style"]);return g.a.createElement("span",H,g.a.createElement("svg",Object.assign({},Ie(I),{viewBox:"0 0 40 40",fill:"currentColor",preserveAspectRatio:"xMidYMid meet"}),g.a.createElement("g",null,g.a.createElement("path",{d:"m30.1 21.4v-2.8q0-0.6-0.4-1t-1-0.5h-5.7v-5.7q0-0.6-0.4-1t-1-0.4h-2.9q-0.6 0-1 0.4t-0.4 1v5.7h-5.7q-0.6 0-1 0.5t-0.5 1v2.8q0 0.6 0.5 1t1 0.5h5.7v5.7q0 0.5 0.4 1t1 0.4h2.9q0.6 0 1-0.4t0.4-1v-5.7h5.7q0.6 0 1-0.5t0.4-1z m7.2-1.4q0 4.7-2.3 8.6t-6.3 6.2-8.6 2.3-8.6-2.3-6.2-6.2-2.3-8.6 2.3-8.6 6.2-6.2 8.6-2.3 8.6 2.3 6.3 6.2 2.3 8.6z"}))))}}]),M}(g.a.PureComponent),_t=function(F){h(M,F);var L=v(M);function M(){return u(this,M),L.apply(this,arguments)}return f(M,[{key:"render",value:function(){var $=this.props,I=$.style,H=O($,["style"]);return g.a.createElement("span",H,g.a.createElement("svg",Object.assign({},Ie(I),{viewBox:"0 0 40 40",fill:"currentColor",preserveAspectRatio:"xMidYMid meet"}),g.a.createElement("g",null,g.a.createElement("path",{d:"m31.6 21.6h-10v10h-3.2v-10h-10v-3.2h10v-10h3.2v10h10v3.2z"}))))}}]),M}(g.a.PureComponent),Xt=function(F){h(M,F);var L=v(M);function M(){return u(this,M),L.apply(this,arguments)}return f(M,[{key:"render",value:function(){var $=this.props,I=$.style,H=O($,["style"]);return g.a.createElement("span",H,g.a.createElement("svg",Object.assign({},Ie(I),{viewBox:"0 0 40 40",fill:"currentColor",preserveAspectRatio:"xMidYMid meet"}),g.a.createElement("g",null,g.a.createElement("path",{d:"m19.8 26.4l2.6-2.6-3.4-3.4-2.6 2.6v1.3h2.2v2.1h1.2z m9.8-16q-0.3-0.4-0.7 0l-7.8 7.8q-0.4 0.4 0 0.7t0.7 0l7.8-7.8q0.4-0.4 0-0.7z m1.8 13.2v4.3q0 2.6-1.9 4.5t-4.5 1.9h-18.6q-2.6 0-4.5-1.9t-1.9-4.5v-18.6q0-2.7 1.9-4.6t4.5-1.8h18.6q1.4 0 2.6 0.5 0.3 0.2 0.4 0.5 0.1 0.4-0.2 0.7l-1.1 1.1q-0.3 0.3-0.7 0.1-0.5-0.1-1-0.1h-18.6q-1.4 0-2.5 1.1t-1 2.5v18.6q0 1.4 1 2.5t2.5 1h18.6q1.5 0 2.5-1t1.1-2.5v-2.9q0-0.2 0.2-0.4l1.4-1.5q0.3-0.3 0.8-0.1t0.4 0.6z m-2.1-16.5l6.4 6.5-15 15h-6.4v-6.5z m9.9 3l-2.1 2-6.4-6.4 2.1-2q0.6-0.7 1.5-0.7t1.5 0.7l3.4 3.4q0.6 0.6 0.6 1.5t-0.6 1.5z"}))))}}]),M}(g.a.PureComponent),Nt=function(F){h(M,F);var L=v(M);function M(){return u(this,M),L.apply(this,arguments)}return f(M,[{key:"render",value:function(){var $=this.props,I=$.style,H=O($,["style"]);return g.a.createElement("span",H,g.a.createElement("svg",Object.assign({},Ie(I),{viewBox:"0 0 40 40",fill:"currentColor",preserveAspectRatio:"xMidYMid meet"}),g.a.createElement("g",null,g.a.createElement("path",{d:"m31.7 16.4q0-0.6-0.4-1l-2.1-2.1q-0.4-0.4-1-0.4t-1 0.4l-9.1 9.1-5-5q-0.5-0.4-1-0.4t-1 0.4l-2.1 2q-0.4 0.4-0.4 1 0 0.6 0.4 1l8.1 8.1q0.4 0.4 1 0.4 0.6 0 1-0.4l12.2-12.1q0.4-0.4 0.4-1z m5.6 3.6q0 4.7-2.3 8.6t-6.3 6.2-8.6 2.3-8.6-2.3-6.2-6.2-2.3-8.6 2.3-8.6 6.2-6.2 8.6-2.3 8.6 2.3 6.3 6.2 2.3 8.6z"}))))}}]),M}(g.a.PureComponent);function Ie(F){return F||(F={}),{style:l(l({verticalAlign:"middle"},F),{},{color:F.color?F.color:"#000000",height:"1em",width:"1em"})}}var Bt=function(F){h(M,F);var L=v(M);function M($){var I;return u(this,M),(I=L.call(this,$)).copiedTimer=null,I.handleCopy=function(){var H=document.createElement("textarea"),Q=I.props,Z=Q.clickCallback,U=Q.src,te=Q.namespace;H.innerHTML=JSON.stringify(I.clipboardValue(U),null," "),document.body.appendChild(H),H.select(),document.execCommand("copy"),document.body.removeChild(H),I.copiedTimer=setTimeout(function(){I.setState({copied:!1})},5500),I.setState({copied:!0},function(){typeof Z=="function"&&Z({src:U,namespace:te,name:te[te.length-1]})})},I.getClippyIcon=function(){var H=I.props.theme;return I.state.copied?g.a.createElement("span",null,g.a.createElement(Ee,Object.assign({className:"copy-icon"},S(H,"copy-icon"))),g.a.createElement("span",S(H,"copy-icon-copied"),"✔")):g.a.createElement(Ee,Object.assign({className:"copy-icon"},S(H,"copy-icon")))},I.clipboardValue=function(H){switch(N(H)){case"function":case"regexp":return H.toString();default:return H}},I.state={copied:!1},I}return f(M,[{key:"componentWillUnmount",value:function(){this.copiedTimer&&(clearTimeout(this.copiedTimer),this.copiedTimer=null)}},{key:"render",value:function(){var $=this.props,I=($.src,$.theme),H=$.hidden,Q=$.rowHovered,Z=S(I,"copy-to-clipboard").style,U="inline";return H&&(U="none"),g.a.createElement("span",{className:"copy-to-clipboard-container",title:"Copy to clipboard",style:{verticalAlign:"top",display:Q?"inline-block":"none"}},g.a.createElement("span",{style:l(l({},Z),{},{display:U}),onClick:this.handleCopy},this.getClippyIcon()))}}]),M}(g.a.PureComponent),Wt=function(F){h(M,F);var L=v(M);function M($){var I;return u(this,M),(I=L.call(this,$)).getEditIcon=function(){var H=I.props,Q=H.variable,Z=H.theme;return g.a.createElement("div",{className:"click-to-edit",style:{verticalAlign:"top",display:I.state.hovered?"inline-block":"none"}},g.a.createElement(Xt,Object.assign({className:"click-to-edit-icon"},S(Z,"editVarIcon"),{onClick:function(){I.prepopInput(Q)}})))},I.prepopInput=function(H){if(I.props.onEdit!==!1){var Q=function(U){var te;switch(N(U)){case"undefined":te="undefined";break;case"nan":te="NaN";break;case"string":te=U;break;case"date":case"function":case"regexp":te=U.toString();break;default:try{te=JSON.stringify(U,null," ")}catch{te=""}}return te}(H.value),Z=se(Q);I.setState({editMode:!0,editValue:Q,parsedInput:{type:Z.type,value:Z.value}})}},I.getRemoveIcon=function(){var H=I.props,Q=H.variable,Z=H.namespace,U=H.theme,te=H.rjvId;return g.a.createElement("div",{className:"click-to-remove",style:{verticalAlign:"top",display:I.state.hovered?"inline-block":"none"}},g.a.createElement(Ae,Object.assign({className:"click-to-remove-icon"},S(U,"removeVarIcon"),{onClick:function(){ve.dispatch({name:"VARIABLE_REMOVED",rjvId:te,data:{name:Q.name,namespace:Z,existing_value:Q.value,variable_removed:!0}})}})))},I.getValue=function(H,Q){var Z=!Q&&H.type,U=b(I).props;switch(Z){case!1:return I.getEditInput();case"string":return g.a.createElement(De,Object.assign({value:H.value},U));case"integer":return g.a.createElement(Ce,Object.assign({value:H.value},U));case"float":return g.a.createElement(z,Object.assign({value:H.value},U));case"boolean":return g.a.createElement(B,Object.assign({value:H.value},U));case"function":return g.a.createElement(Oe,Object.assign({value:H.value},U));case"null":return g.a.createElement(mt,U);case"nan":return g.a.createElement(Fe,U);case"undefined":return g.a.createElement(Le,U);case"date":return g.a.createElement(j,Object.assign({value:H.value},U));case"regexp":return g.a.createElement(pe,Object.assign({value:H.value},U));default:return g.a.createElement("div",{className:"object-value"},JSON.stringify(H.value))}},I.getEditInput=function(){var H=I.props.theme,Q=I.state.editValue;return g.a.createElement("div",null,g.a.createElement(X,Object.assign({type:"text",inputRef:function(Z){return Z&&Z.focus()},value:Q,className:"variable-editor",onChange:function(Z){var U=Z.target.value,te=se(U);I.setState({editValue:U,parsedInput:{type:te.type,value:te.value}})},onKeyDown:function(Z){switch(Z.key){case"Escape":I.setState({editMode:!1,editValue:""});break;case"Enter":(Z.ctrlKey||Z.metaKey)&&I.submitEdit(!0)}Z.stopPropagation()},placeholder:"update this value",minRows:2},S(H,"edit-input"))),g.a.createElement("div",S(H,"edit-icon-container"),g.a.createElement(Ae,Object.assign({className:"edit-cancel"},S(H,"cancel-icon"),{onClick:function(){I.setState({editMode:!1,editValue:""})}})),g.a.createElement(Nt,Object.assign({className:"edit-check string-value"},S(H,"check-icon"),{onClick:function(){I.submitEdit()}})),g.a.createElement("div",null,I.showDetected())))},I.submitEdit=function(H){var Q=I.props,Z=Q.variable,U=Q.namespace,te=Q.rjvId,be=I.state,Ue=be.editValue,Ze=be.parsedInput,lt=Ue;H&&Ze.type&&(lt=Ze.value),I.setState({editMode:!1}),ve.dispatch({name:"VARIABLE_UPDATED",rjvId:te,data:{name:Z.name,namespace:U,existing_value:Z.value,new_value:lt,variable_removed:!1}})},I.showDetected=function(){var H=I.props,Q=H.theme,Z=(H.variable,H.namespace,H.rjvId,I.state.parsedInput),U=(Z.type,Z.value,I.getDetectedInput());if(U)return g.a.createElement("div",null,g.a.createElement("div",S(Q,"detected-row"),U,g.a.createElement(Nt,{className:"edit-check detected",style:l({verticalAlign:"top",paddingLeft:"3px"},S(Q,"check-icon").style),onClick:function(){I.submitEdit(!0)}})))},I.getDetectedInput=function(){var H=I.state.parsedInput,Q=H.type,Z=H.value,U=b(I).props,te=U.theme;if(Q!==!1)switch(Q.toLowerCase()){case"object":return g.a.createElement("span",null,g.a.createElement("span",{style:l(l({},S(te,"brace").style),{},{cursor:"default"})},"{"),g.a.createElement("span",{style:l(l({},S(te,"ellipsis").style),{},{cursor:"default"})},"..."),g.a.createElement("span",{style:l(l({},S(te,"brace").style),{},{cursor:"default"})},"}"));case"array":return g.a.createElement("span",null,g.a.createElement("span",{style:l(l({},S(te,"brace").style),{},{cursor:"default"})},"["),g.a.createElement("span",{style:l(l({},S(te,"ellipsis").style),{},{cursor:"default"})},"..."),g.a.createElement("span",{style:l(l({},S(te,"brace").style),{},{cursor:"default"})},"]"));case"string":return g.a.createElement(De,Object.assign({value:Z},U));case"integer":return g.a.createElement(Ce,Object.assign({value:Z},U));case"float":return g.a.createElement(z,Object.assign({value:Z},U));case"boolean":return g.a.createElement(B,Object.assign({value:Z},U));case"function":return g.a.createElement(Oe,Object.assign({value:Z},U));case"null":return g.a.createElement(mt,U);case"nan":return g.a.createElement(Fe,U);case"undefined":return g.a.createElement(Le,U);case"date":return g.a.createElement(j,Object.assign({value:new Date(Z)},U))}},I.state={editMode:!1,editValue:"",hovered:!1,renameKey:!1,parsedInput:{type:!1,value:null}},I}return f(M,[{key:"render",value:function(){var $=this,I=this.props,H=I.variable,Q=I.singleIndent,Z=I.type,U=I.theme,te=I.namespace,be=I.indentWidth,Ue=I.enableClipboard,Ze=I.onEdit,lt=I.onDelete,qe=I.onSelect,ut=I.displayArrayKey,Pt=I.quotesOnKeys,Ne=this.state.editMode;return g.a.createElement("div",Object.assign({},S(U,"objectKeyVal",{paddingLeft:be*Q}),{onMouseEnter:function(){return $.setState(l(l({},$.state),{},{hovered:!0}))},onMouseLeave:function(){return $.setState(l(l({},$.state),{},{hovered:!1}))},className:"variable-row",key:H.name}),Z=="array"?ut?g.a.createElement("span",Object.assign({},S(U,"array-key"),{key:H.name+"_"+te}),H.name,g.a.createElement("div",S(U,"colon"),":")):null:g.a.createElement("span",null,g.a.createElement("span",Object.assign({},S(U,"object-name"),{className:"object-key",key:H.name+"_"+te}),!!Pt&&g.a.createElement("span",{style:{verticalAlign:"top"}},'"'),g.a.createElement("span",{style:{display:"inline-block"}},H.name),!!Pt&&g.a.createElement("span",{style:{verticalAlign:"top"}},'"')),g.a.createElement("span",S(U,"colon"),":")),g.a.createElement("div",Object.assign({className:"variable-value",onClick:qe===!1&&Ze===!1?null:function(rn){var Nr=fe(te);(rn.ctrlKey||rn.metaKey)&&Ze!==!1?$.prepopInput(H):qe!==!1&&(Nr.shift(),qe(l(l({},H),{},{namespace:Nr})))}},S(U,"variableValue",{cursor:qe===!1?"default":"pointer"})),this.getValue(H,Ne)),Ue?g.a.createElement(Bt,{rowHovered:this.state.hovered,hidden:Ne,src:H.value,clickCallback:Ue,theme:U,namespace:[].concat(fe(te),[H.name])}):null,Ze!==!1&&Ne==0?this.getEditIcon():null,lt!==!1&&Ne==0?this.getRemoveIcon():null)}}]),M}(g.a.PureComponent),vn=function(F){h(M,F);var L=v(M);function M(){var $;u(this,M);for(var I=arguments.length,H=new Array(I),Q=0;Q0?Ue:null,namespace:be.splice(0,be.length-1),existing_value:Ze,variable_removed:!1,key_name:null};N(Ze)==="object"?ve.dispatch({name:"ADD_VARIABLE_KEY_REQUEST",rjvId:lt,data:ut}):ve.dispatch({name:"VARIABLE_ADDED",rjvId:lt,data:l(l({},ut),{},{new_value:[].concat(fe(Ze),[null])})})}})))},$.getRemoveObject=function(Z){var U=$.props,te=U.theme,be=(U.hover,U.namespace),Ue=U.name,Ze=U.src,lt=U.rjvId;if(be.length!==1)return g.a.createElement("span",{className:"click-to-remove",style:{display:Z?"inline-block":"none"}},g.a.createElement(Ae,Object.assign({className:"click-to-remove-icon"},S(te,"removeVarIcon"),{onClick:function(){ve.dispatch({name:"VARIABLE_REMOVED",rjvId:lt,data:{name:Ue,namespace:be.splice(0,be.length-1),existing_value:Ze,variable_removed:!0}})}})))},$.render=function(){var Z=$.props,U=Z.theme,te=Z.onDelete,be=Z.onAdd,Ue=Z.enableClipboard,Ze=Z.src,lt=Z.namespace,qe=Z.rowHovered;return g.a.createElement("div",Object.assign({},S(U,"object-meta-data"),{className:"object-meta-data",onClick:function(ut){ut.stopPropagation()}}),$.getObjectSize(),Ue?g.a.createElement(Bt,{rowHovered:qe,clickCallback:Ue,src:Ze,theme:U,namespace:lt}):null,be!==!1?$.getAddAttribute(qe):null,te!==!1?$.getRemoveObject(qe):null)},$}return M}(g.a.PureComponent);function Dr(F){var L=F.parent_type,M=F.namespace,$=F.quotesOnKeys,I=F.theme,H=F.jsvRoot,Q=F.name,Z=F.displayArrayKey,U=F.name?F.name:"";return!H||Q!==!1&&Q!==null?L=="array"?Z?g.a.createElement("span",Object.assign({},S(I,"array-key"),{key:M}),g.a.createElement("span",{className:"array-key"},U),g.a.createElement("span",S(I,"colon"),":")):g.a.createElement("span",null):g.a.createElement("span",Object.assign({},S(I,"object-name"),{key:M}),g.a.createElement("span",{className:"object-key"},$&&g.a.createElement("span",{style:{verticalAlign:"top"}},'"'),g.a.createElement("span",null,U),$&&g.a.createElement("span",{style:{verticalAlign:"top"}},'"')),g.a.createElement("span",S(I,"colon"),":")):g.a.createElement("span",null)}function wn(F){var L=F.theme;switch(F.iconStyle){case"triangle":return g.a.createElement(me,Object.assign({},S(L,"expanded-icon"),{className:"expanded-icon"}));case"square":return g.a.createElement(nt,Object.assign({},S(L,"expanded-icon"),{className:"expanded-icon"}));default:return g.a.createElement(Pe,Object.assign({},S(L,"expanded-icon"),{className:"expanded-icon"}))}}function $n(F){var L=F.theme;switch(F.iconStyle){case"triangle":return g.a.createElement(re,Object.assign({},S(L,"collapsed-icon"),{className:"collapsed-icon"}));case"square":return g.a.createElement(G,Object.assign({},S(L,"collapsed-icon"),{className:"collapsed-icon"}));default:return g.a.createElement(Be,Object.assign({},S(L,"collapsed-icon"),{className:"collapsed-icon"}))}}var jl=function(F){h(M,F);var L=v(M);function M($){var I;return u(this,M),(I=L.call(this,$)).toggleCollapsed=function(H){var Q=[];for(var Z in I.state.expanded)Q.push(I.state.expanded[Z]);Q[H]=!Q[H],I.setState({expanded:Q})},I.state={expanded:[]},I}return f(M,[{key:"getExpandedIcon",value:function($){var I=this.props,H=I.theme,Q=I.iconStyle;return this.state.expanded[$]?g.a.createElement(wn,{theme:H,iconStyle:Q}):g.a.createElement($n,{theme:H,iconStyle:Q})}},{key:"render",value:function(){var $=this,I=this.props,H=I.src,Q=I.groupArraysAfterLength,Z=(I.depth,I.name),U=I.theme,te=I.jsvRoot,be=I.namespace,Ue=(I.parent_type,O(I,["src","groupArraysAfterLength","depth","name","theme","jsvRoot","namespace","parent_type"])),Ze=0,lt=5*this.props.indentWidth;te||(Ze=5*this.props.indentWidth);var qe=Q,ut=Math.ceil(H.length/qe);return g.a.createElement("div",Object.assign({className:"object-key-val"},S(U,te?"jsv-root":"objectKeyVal",{paddingLeft:Ze})),g.a.createElement(Dr,this.props),g.a.createElement("span",null,g.a.createElement(vn,Object.assign({size:H.length},this.props))),fe(Array(ut)).map(function(Pt,Ne){return g.a.createElement("div",Object.assign({key:Ne,className:"object-key-val array-group"},S(U,"objectKeyVal",{marginLeft:6,paddingLeft:lt})),g.a.createElement("span",S(U,"brace-row"),g.a.createElement("div",Object.assign({className:"icon-container"},S(U,"icon-container"),{onClick:function(rn){$.toggleCollapsed(Ne)}}),$.getExpandedIcon(Ne)),$.state.expanded[Ne]?g.a.createElement(Ph,Object.assign({key:Z+Ne,depth:0,name:!1,collapsed:!1,groupArraysAfterLength:qe,index_offset:Ne*qe,src:H.slice(Ne*qe,Ne*qe+qe),namespace:be,type:"array",parent_type:"array_group",theme:U},Ue)):g.a.createElement("span",Object.assign({},S(U,"brace"),{onClick:function(rn){$.toggleCollapsed(Ne)},className:"array-group-brace"}),"[",g.a.createElement("div",Object.assign({},S(U,"array-group-meta-data"),{className:"array-group-meta-data"}),g.a.createElement("span",Object.assign({className:"object-size"},S(U,"object-size")),Ne*qe," - ",Ne*qe+qe>H.length?H.length:Ne*qe+qe)),"]")))}))}}]),M}(g.a.PureComponent),Zc=function(F){h(M,F);var L=v(M);function M($){var I;u(this,M),(I=L.call(this,$)).toggleCollapsed=function(){I.setState({expanded:!I.state.expanded},function(){Se.set(I.props.rjvId,I.props.namespace,"expanded",I.state.expanded)})},I.getObjectContent=function(Q,Z,U){return g.a.createElement("div",{className:"pushed-content object-container"},g.a.createElement("div",Object.assign({className:"object-content"},S(I.props.theme,"pushed-content")),I.renderObjectContents(Z,U)))},I.getEllipsis=function(){return I.state.size===0?null:g.a.createElement("div",Object.assign({},S(I.props.theme,"ellipsis"),{className:"node-ellipsis",onClick:I.toggleCollapsed}),"...")},I.getObjectMetaData=function(Q){var Z=I.props,U=(Z.rjvId,Z.theme,I.state),te=U.size,be=U.hovered;return g.a.createElement(vn,Object.assign({rowHovered:be,size:te},I.props))},I.renderObjectContents=function(Q,Z){var U,te=I.props,be=te.depth,Ue=te.parent_type,Ze=te.index_offset,lt=te.groupArraysAfterLength,qe=te.namespace,ut=I.state.object_type,Pt=[],Ne=Object.keys(Q||{});return I.props.sortKeys&&ut!=="array"&&(Ne=Ne.sort()),Ne.forEach(function(rn){if(U=new uF(rn,Q[rn]),Ue==="array_group"&&Ze&&(U.name=parseInt(U.name)+Ze),Q.hasOwnProperty(rn))if(U.type==="object")Pt.push(g.a.createElement(Ph,Object.assign({key:U.name,depth:be+1,name:U.name,src:U.value,namespace:qe.concat(U.name),parent_type:ut},Z)));else if(U.type==="array"){var Nr=Ph;lt&&U.value.length>lt&&(Nr=jl),Pt.push(g.a.createElement(Nr,Object.assign({key:U.name,depth:be+1,name:U.name,src:U.value,namespace:qe.concat(U.name),type:"array",parent_type:ut},Z)))}else Pt.push(g.a.createElement(Wt,Object.assign({key:U.name+"_"+qe,variable:U,singleIndent:5,namespace:qe,type:I.props.type},Z)))}),Pt};var H=M.getState($);return I.state=l(l({},H),{},{prevProps:{}}),I}return f(M,[{key:"getBraceStart",value:function($,I){var H=this,Q=this.props,Z=Q.src,U=Q.theme,te=Q.iconStyle;if(Q.parent_type==="array_group")return g.a.createElement("span",null,g.a.createElement("span",S(U,"brace"),$==="array"?"[":"{"),I?this.getObjectMetaData(Z):null);var be=I?wn:$n;return g.a.createElement("span",null,g.a.createElement("span",Object.assign({onClick:function(Ue){H.toggleCollapsed()}},S(U,"brace-row")),g.a.createElement("div",Object.assign({className:"icon-container"},S(U,"icon-container")),g.a.createElement(be,{theme:U,iconStyle:te})),g.a.createElement(Dr,this.props),g.a.createElement("span",S(U,"brace"),$==="array"?"[":"{")),I?this.getObjectMetaData(Z):null)}},{key:"render",value:function(){var $=this,I=this.props,H=I.depth,Q=I.src,Z=(I.namespace,I.name,I.type,I.parent_type),U=I.theme,te=I.jsvRoot,be=I.iconStyle,Ue=O(I,["depth","src","namespace","name","type","parent_type","theme","jsvRoot","iconStyle"]),Ze=this.state,lt=Ze.object_type,qe=Ze.expanded,ut={};return te||Z==="array_group"?Z==="array_group"&&(ut.borderLeft=0,ut.display="inline"):ut.paddingLeft=5*this.props.indentWidth,g.a.createElement("div",Object.assign({className:"object-key-val",onMouseEnter:function(){return $.setState(l(l({},$.state),{},{hovered:!0}))},onMouseLeave:function(){return $.setState(l(l({},$.state),{},{hovered:!1}))}},S(U,te?"jsv-root":"objectKeyVal",ut)),this.getBraceStart(lt,qe),qe?this.getObjectContent(H,Q,l({theme:U,iconStyle:be},Ue)):this.getEllipsis(),g.a.createElement("span",{className:"brace-row"},g.a.createElement("span",{style:l(l({},S(U,"brace").style),{},{paddingLeft:qe?"3px":"0px"})},lt==="array"?"]":"}"),qe?null:this.getObjectMetaData(Q)))}}],[{key:"getDerivedStateFromProps",value:function($,I){var H=I.prevProps;return $.src!==H.src||$.collapsed!==H.collapsed||$.name!==H.name||$.namespace!==H.namespace||$.rjvId!==H.rjvId?l(l({},M.getState($)),{},{prevProps:$}):null}}]),M}(g.a.PureComponent);Zc.getState=function(F){var L=Object.keys(F.src).length,M=(F.collapsed===!1||F.collapsed!==!0&&F.collapsed>F.depth)&&(!F.shouldCollapse||F.shouldCollapse({name:F.name,src:F.src,type:N(F.src),namespace:F.namespace})===!1)&&L!==0;return{expanded:Se.get(F.rjvId,F.namespace,"expanded",M),object_type:F.type==="array"?"array":"object",parent_type:F.type==="array"?"array":"object",size:L,hovered:!1}};var uF=function F(L,M){u(this,F),this.name=L,this.value=M,this.type=N(M)};D(Zc);var Ph=Zc,cF=function(F){h(M,F);var L=v(M);function M(){var $;u(this,M);for(var I=arguments.length,H=new Array(I),Q=0;QZ.groupArraysAfterLength&&(te=jl),g.a.createElement("div",{className:"pretty-json-container object-container"},g.a.createElement("div",{className:"object-content"},g.a.createElement(te,Object.assign({namespace:U,depth:0,jsvRoot:!0},Z))))},$}return M}(g.a.PureComponent),fF=function(F){h(M,F);var L=v(M);function M($){var I;return u(this,M),(I=L.call(this,$)).closeModal=function(){ve.dispatch({rjvId:I.props.rjvId,name:"RESET"})},I.submit=function(){I.props.submit(I.state.input)},I.state={input:$.input?$.input:""},I}return f(M,[{key:"render",value:function(){var $=this,I=this.props,H=I.theme,Q=I.rjvId,Z=I.isValid,U=this.state.input,te=Z(U);return g.a.createElement("div",Object.assign({className:"key-modal-request"},S(H,"key-modal-request"),{onClick:this.closeModal}),g.a.createElement("div",Object.assign({},S(H,"key-modal"),{onClick:function(be){be.stopPropagation()}}),g.a.createElement("div",S(H,"key-modal-label"),"Key Name:"),g.a.createElement("div",{style:{position:"relative"}},g.a.createElement("input",Object.assign({},S(H,"key-modal-input"),{className:"key-modal-input",ref:function(be){return be&&be.focus()},spellCheck:!1,value:U,placeholder:"...",onChange:function(be){$.setState({input:be.target.value})},onKeyPress:function(be){te&&be.key==="Enter"?$.submit():be.key==="Escape"&&$.closeModal()}})),te?g.a.createElement(Nt,Object.assign({},S(H,"key-modal-submit"),{className:"key-modal-submit",onClick:function(be){return $.submit()}})):null),g.a.createElement("span",S(H,"key-modal-cancel"),g.a.createElement(_t,Object.assign({},S(H,"key-modal-cancel-icon"),{className:"key-modal-cancel",onClick:function(){ve.dispatch({rjvId:Q,name:"RESET"})}})))))}}]),M}(g.a.PureComponent),dF=function(F){h(M,F);var L=v(M);function M(){var $;u(this,M);for(var I=arguments.length,H=new Array(I),Q=0;Q>1}};Cn.from=function(t){if(t instanceof Cn)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Cn(e)};function lI(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),o=e.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)n++;return n}if(i.content.size||o.content.size){let s=lI(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function uI(t,e,n,r){for(let i=t.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let s=t.child(--i),a=e.child(--o),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 u=0,c=Math.min(s.text.length,a.text.length);for(;ue&&r(l,i+a,o||null,s)!==!1&&l.content.size){let c=a+1;l.nodesBetween(Math.max(0,e-c),Math.min(l.content.size,n-c),r,i+c)}a=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let o="",s=!0;return this.nodesBetween(e,n,(a,l)=>{let u=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&u||a.isTextblock)&&r&&(s?s=!1:o+=r),o+=u},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);oe)for(let o=0,s=0;se&&((sn)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,n-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,n-s-1))),r.push(a),i+=a.nodeSize),s=l}return new ue(r,i)}cutByIndex(e,n){return e==n?ue.empty:e==0&&n==this.content.length?this:new ue(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new ue(i,o)}addToStart(e){return new ue([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new ue(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;nthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),s=i+o.nodeSize;if(s>=e)return s==e||n>0?Dp(r+1,s):Dp(r,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return ue.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new ue(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return ue.empty;let n,r=0;for(let i=0;ithis.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;nr.type.rank-i.type.rank),n}};yt.none=[];class d1 extends Error{}class Me{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=fI(this.content,e+this.openStart,n);return r&&new Me(r,this.openStart,this.openEnd)}removeBetween(e,n){return new Me(cI(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return Me.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Me(ue.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new Me(e,r,i)}}Me.empty=new Me(ue.empty,0,0);function cI(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:s,offset:a}=t.findIndex(n);if(i==e||o.isText){if(a!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(cI(o.content,e-i-1,n-i-1)))}function fI(t,e,n,r){let{index:i,offset:o}=t.findIndex(e),s=t.maybeChild(i);if(o==e||s.isText)return t.cut(0,e).append(n).append(t.cut(e));let a=fI(s.content,e-o-1,n);return a&&t.replaceChild(i,s.copy(a))}function mue(t,e,n){if(n.openStart>t.depth)throw new d1("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new d1("Inconsistent open depths");return dI(t,e,n,0)}function dI(t,e,n,r){let i=t.index(r),o=t.node(r);if(i==e.index(r)&&r=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function fd(t,e,n,r){let i=(e||t).node(n),o=0,s=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(vl(t.nodeAfter,r),o++));for(let a=o;ai&&ok(t,e,i+1),s=r.depth>i&&ok(n,r,i+1),a=[];return fd(null,t,i,a),o&&s&&e.index(i)==n.index(i)?(hI(o,s),vl(wl(o,pI(t,e,n,r,i+1)),a)):(o&&vl(wl(o,h1(t,e,i+1)),a),fd(e,n,i,a),s&&vl(wl(s,h1(n,r,i+1)),a)),fd(r,null,i,a),new ue(a)}function h1(t,e,n){let r=[];if(fd(null,t,n,r),t.depth>n){let i=ok(t,e,n+1);vl(wl(i,h1(t,e,n+1)),r)}return fd(e,null,n,r),new ue(r)}function gue(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)i=e.node(o).copy(ue.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class eh{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new p1(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let s=e;;){let{index:a,offset:l}=s.content.findIndex(o),u=o-l;if(r.push(s,a,i+l),!u||(s=s.child(a),s.isText))break;o=u-1,i+=l+1}return new eh(n,r,o)}static resolveCached(e,n){let r=__.get(e);if(r)for(let o=0;oe&&this.nodesBetween(e,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),mI(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=ue.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),a=s&&s.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=i;ln.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=ue.fromJSON(e,n.content),o=e.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};Uu.prototype.text=void 0;class m1 extends Uu{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):mI(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new m1(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new m1(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function mI(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Il{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new wue(e,n);if(r.next==null)return Il.empty;let i=gI(r);r.next&&r.err("Unexpected trailing text");let o=Aue(_ue(i));return Tue(o,r),o}matchType(e){for(let n=0;nu.createAndFill()));for(let u=0;u=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s"+e.indexOf(r.next[s].next);return o}).join(` +`)}}Il.empty=new Il(!0);class wue{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function gI(t){let e=[];do e.push(kue(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function kue(t){let e=[];do e.push(xue(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function xue(t){let e=Cue(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=Eue(t,e);else break;return e}function A_(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function Eue(t,e){let n=A_(t),r=n;return t.eat(",")&&(t.next!="}"?r=A_(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function Sue(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let o in n){let s=n[o];s.groups.indexOf(e)>-1&&i.push(s)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function Cue(t){if(t.eat("(")){let e=gI(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=Sue(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function _ue(t){let e=[[]];return i(o(t,0),n()),e;function n(){return e.push([])-1}function r(s,a,l){let u={term:l,to:a};return e[s].push(u),u}function i(s,a){s.forEach(l=>l.to=a)}function o(s,a){if(s.type=="choice")return s.exprs.reduce((l,u)=>l.concat(o(u,a)),[]);if(s.type=="seq")for(let l=0;;l++){let u=o(s.exprs[l],a);if(l==s.exprs.length-1)return u;i(u,a=n())}else if(s.type=="star"){let l=n();return r(a,l),i(o(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=n();return i(o(s.expr,a),l),i(o(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(a)].concat(o(s.expr,a));if(s.type=="range"){let l=a;for(let u=0;u{t[s].forEach(({term:a,to:l})=>{if(!a)return;let u;for(let c=0;c{u||i.push([a,u=[]]),u.indexOf(c)==-1&&u.push(c)})})});let o=e[r.join(",")]=new Il(r.indexOf(t.length-1)>-1);for(let s=0;s-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;nr[o]=new g1(o,n,s));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}}function Mue(t){let e=t.split("|");return n=>{let r=n===null?"null":typeof n;if(e.indexOf(r)<0)throw new RangeError(`Expected value of type ${e}, got ${r}`)}}class Oue{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default,this.validate=typeof e.validate=="string"?Mue(e.validate):e.validate}get isRequired(){return!this.hasDefault}}class gE{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=kI(i.attrs),this.excluded=null;let o=bI(this.attrs);this.instance=o?new yt(this,o):null}create(e=null){return!e&&this.instance?this.instance:new yt(this,vI(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new gE(o,i++,n,s)),r}removeFromSet(e){for(var n=0;n-1}}class xI{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=Cn.from(e.nodes),n.marks=Cn.from(e.marks||{}),this.nodes=g1.compile(this.spec.nodes,this),this.marks=gE.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],s=o.spec.content||"",a=o.spec.marks;if(o.contentMatch=r[s]||(r[s]=Il.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=a=="_"?null:a?M_(this,a.split(" ")):a==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:M_(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(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof g1){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,i)}text(e,n){let r=this.nodes.text;return new m1(r,r.defaultAttrs,e,yt.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return Uu.fromJSON(this,e)}markFromJSON(e){return yt.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function M_(t,e){let n=[];for(let r=0;r-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function Due(t){return t.tag!=null}function Nue(t){return t.style!=null}class th{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(Due(i))this.tags.push(i);else if(Nue(i)){let o=/[^=]*/.exec(i.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let o=e.nodes[i.node];return o.contentMatch.matchType(o)})}parse(e,n={}){let r=new D_(this,n,!1);return r.addAll(e,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new D_(this,n,!0);return r.addAll(e,n.from,n.to),Me.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;ie.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(s.getAttrs){let l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let n=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s{r(s=N_(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=N_(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new th(e,th.schemaRules(e)))}}const EI={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},$ue={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},SI={ol:!0,ul:!0},y1=1,b1=2,dd=4;function O_(t,e,n){return e!=null?(e?y1:0)|(e==="full"?b1:0):t&&t.whitespace=="pre"?y1|b1:n&~dd}class Np{constructor(e,n,r,i,o,s,a){this.type=e,this.attrs=n,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=a,this.content=[],this.activeMarks=yt.none,this.stashMarks=[],this.match=s||(a&dd?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(ue.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&y1)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=ue.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(ue.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}popFromStashMark(e){for(let n=this.stashMarks.length-1;n>=0;n--)if(e.eq(this.stashMarks[n]))return this.stashMarks.splice(n,1)[0]}applyPending(e){for(let n=0,r=this.pendingMarks;nthis.addAll(e)),s&&this.sync(a),this.needsBlock=l}else this.withStyleRules(e,()=>{this.addElementByRule(e,o,o.consuming===!1?i:void 0)})}leafFallback(e){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(` +`))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let n=yt.none,r=yt.none;if(e.length)for(let i=0;i{l.clearMark(u)&&(r=u.addToSet(r))}):n=this.parser.schema.marks[l.mark].create(l.attrs).addToSet(n),l.consuming===!1)a=l;else break}}return[n,r]}addElementByRule(e,n,r){let i,o,s;n.node?(o=this.parser.schema.nodes[n.node],o.isLeaf?this.insertNode(o.create(n.attrs))||this.leafFallback(e):i=this.enter(o,n.attrs||null,n.preserveWhitespace)):(s=this.parser.schema.marks[n.mark].create(n.attrs),this.addPendingMark(s));let a=this.top;if(o&&o.isLeaf)this.findInside(e);else if(r)this.addElement(e,r);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l)}i&&this.sync(a)&&this.open--,s&&this.removePendingMark(s,a)}addAll(e,n,r){let i=n||0;for(let o=n?e.childNodes[n]:e.firstChild,s=r==null?null:e.childNodes[r];o!=s;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o);this.findAtPoint(e,i)}findPlace(e){let n,r;for(let i=this.open;i>=0;i--){let o=this.nodes[i],s=o.findWrapping(e);if(s&&(!n||n.length>s.length)&&(n=s,r=o,!s.length)||o.solid)break}if(!n)return!1;this.sync(r);for(let i=0;ithis.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let n=this.open;n>=0;n--)if(this.nodes[n]==e)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(a,l)=>{for(;a>=0;a--){let u=n[a];if(u==""){if(a==n.length-1||a==0)continue;for(;l>=o;l--)if(s(a-1,l))return!0;return!1}else{let c=l>0||l==0&&i?this.nodes[l].type:r&&l>=o?r.node(l-o).type:null;if(!c||c.name!=u&&c.groups.indexOf(u)==-1)return!1;l--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(e){let n=Lue(e,this.top.pendingMarks);n&&this.top.stashMarks.push(n),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,n){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let s=i.popFromStashMark(e);s&&i.type&&i.type.allowsMarkType(s.type)&&(i.activeMarks=s.addToSet(i.activeMarks))}if(i==n)break}}}function Iue(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&SI.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function Rue(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function N_(t){let e={};for(let n in t)e[n]=t[n];return e}function Fue(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],s=a=>{o.push(a);for(let l=0;l{if(o.length||s.marks.length){let a=0,l=0;for(;a=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&E0(Xb(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null){return E0(e,n,r)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new yE(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=$_(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return $_(e.marks)}}function $_(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Xb(t){return t.document||window.document}const I_=new WeakMap;function Bue(t){let e=I_.get(t);return e===void 0&&I_.set(t,e=Pue(t)),e}function Pue(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=i.indexOf(" ");s>0&&(n=i.slice(0,s),i=i.slice(s+1));let a,l=n?t.createElementNS(n,i):t.createElement(i),u=e[1],c=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){c=2;for(let f in u)if(u[f]!=null){let d=f.indexOf(" ");d>0?l.setAttributeNS(f.slice(0,d),f.slice(d+1),u[f]):l.setAttribute(f,u[f])}}for(let f=c;fc)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:h,contentDOM:p}=E0(t,d,n,r);if(l.appendChild(h),p){if(a)throw new RangeError("Multiple content holes");a=p}}}return{dom:l,contentDOM:a}}const CI=65535,_I=Math.pow(2,16);function zue(t,e){return t+e*_I}function R_(t){return t&CI}function jue(t){return(t-(t&CI))/_I}const AI=1,TI=2,S0=4,MI=8;class F_{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&MI)>0}get deletedBefore(){return(this.delInfo&(AI|S0))>0}get deletedAfter(){return(this.delInfo&(TI|S0))>0}get deletedAcross(){return(this.delInfo&S0)>0}}class Fr{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Fr.empty)return Fr.empty}recover(e){let n=0,r=R_(e);if(!this.inverted)for(let i=0;ie)break;let u=this.ranges[a+o],c=this.ranges[a+s],f=l+u;if(e<=f){let d=u?e==l?-1:e==f?1:n:n,h=l+i+(d<0?0:c);if(r)return h;let p=e==(n<0?l:f)?null:zue(a/3,e-l),m=e==l?TI:e==f?AI:S0;return(n<0?e!=l:e!=f)&&(m|=MI),new F_(h,m,p)}i+=c-u}return r?e+i:new F_(e+i,0,null)}touches(e,n){let r=0,i=R_(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;ae)break;let u=this.ranges[a+o],c=l+u;if(e<=c&&a==i*3)return!0;r+=this.ranges[a+s]-u}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return Zt.fromReplace(e,this.from,this.to,o)}invert(){return new rl(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new nl(n.pos,r.pos,this.mark)}merge(e){return e instanceof nl&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new nl(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new nl(n.from,n.to,e.markFromJSON(n.mark))}}Gn.jsonID("addMark",nl);class rl extends Gn{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new Me(bE(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return Zt.fromReplace(e,this.from,this.to,r)}invert(){return new nl(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new rl(n.pos,r.pos,this.mark)}merge(e){return e instanceof rl&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new rl(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new rl(n.from,n.to,e.markFromJSON(n.mark))}}Gn.jsonID("removeMark",rl);class il extends Gn{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Zt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Zt.fromReplace(e,this.pos,this.pos+1,new Me(ue.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;ir.pos?null:new Cr(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Cr(n.from,n.to,n.gapFrom,n.gapTo,Me.fromJSON(e,n.slice),n.insert,!!n.structure)}}Gn.jsonID("replaceAround",Cr);function ak(t,e,n){let r=t.resolve(e),i=n-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function que(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function qc(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let i=t.$from.node(r),o=t.$from.index(r),s=t.$to.indexAfter(r);if(ro;u--,c--){let f=i.node(u),d=i.index(u);if(f.type.spec.isolating)return!1;let h=f.content.cutByIndex(d,f.childCount),p=r&&r[c+1];p&&(h=h.replaceChild(0,p.type.create(p.attrs)));let m=r&&r[c]||f;if(!f.canReplace(d+1,f.childCount)||!m.type.validContent(h))return!1}let a=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type)}function Pl(t,e){let n=t.resolve(e),r=n.index();return DI(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function DI(t,e){return!!(t&&e&&!t.isLeaf&&t.canAppend(e))}function Wg(t,e,n=-1){let r=t.resolve(e);for(let i=r.depth;;i--){let o,s,a=r.index(i);if(i==r.depth?(o=r.nodeBefore,s=r.nodeAfter):n>0?(o=r.node(i+1),a++,s=r.node(i).maybeChild(a)):(o=r.node(i).maybeChild(a-1),s=r.node(i+1)),o&&!o.isTextblock&&DI(o,s)&&r.node(i).canReplace(a,a+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}function vE(t,e,n=e,r=Me.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),o=t.resolve(n);return Hue(i,o,r)?new Rr(e,n,r):new Wue(i,o,r).fit()}function Hue(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class Wue{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=ue.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=ue.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,a=i.depth;for(;s&&a&&o.childCount==1;)o=o.firstChild.content,s--,a--;let l=new Me(o,s,a);return e>-1?new Cr(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new Rr(r.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=t2(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:u}=this.frontier[a],c,f=null;if(n==1&&(s?u.matchType(s.type)||(f=u.fillBefore(ue.from(s),!1)):o&&l.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:a,parent:o,inject:f};if(n==2&&s&&(c=u.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:o,wrap:c};if(o&&u.matchType(o.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=t2(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new Me(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=t2(e,n);if(i.childCount<=1&&n>0){let o=e.size-n<=n+i.size;this.unplaced=new Me(Bf(e,n-1,1),n-1,o?n-1:r)}else this.unplaced=new Me(Bf(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let m=0;m1||l==0||m.content.size)&&(f=b,c.push(NI(m.mark(d.allowedMarks(m.marks)),u==1?l:0,u==a.childCount?h:-1)))}let p=u==a.childCount;p||(h=-1),this.placed=Pf(this.placed,n,ue.from(c)),this.frontier[n].match=f,p&&h<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,b=a;m1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n=0;a--){let{match:l,type:u}=this.frontier[a],c=n2(e,a,u,l,!0);if(!c||c.childCount)continue e}return{depth:n,fit:s,move:o?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Pf(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=Pf(this.placed,this.depth,ue.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(ue.empty,!0);n.childCount&&(this.placed=Pf(this.placed,this.frontier.length,n))}}function Bf(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Bf(t.firstChild.content,e-1,n)))}function Pf(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Pf(t.lastChild.content,e-1,n)))}function t2(t,e){for(let n=0;n1&&(r=r.replaceChild(0,NI(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(ue.empty,!0)))),t.copy(r)}function n2(t,e,n,r,i){let o=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!Jue(n,o.content,s)?a:null}function Jue(t,e,n){for(let r=n;r=0;o--){let s=n<0?hu(e.node(0),e.node(o),e.before(o+1),e.index(o),n,r):hu(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,n,r);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new yo(e.node(0))}static atStart(e){return hu(e,e,0,0,1)||new yo(e)}static atEnd(e){return hu(e,e,e.content.size,e.childCount,-1)||new yo(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=r2[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in r2)throw new RangeError("Duplicate use of selection JSON ID "+e);return r2[e]=n,n.prototype.jsonID=e,n}getBookmark(){return Mt.between(this.$anchor,this.$head).getBookmark()}}pt.prototype.visible=!0;class Kue{constructor(e,n){this.$from=e,this.$to=n}}let B_=!1;function P_(t){!B_&&!t.parent.inlineContent&&(B_=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Mt extends pt{constructor(e,n=e){P_(e),P_(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return pt.near(r);let i=e.resolve(n.map(this.anchor));return new Mt(i.parent.inlineContent?i:r,r)}replace(e,n=Me.empty){if(super.replace(e,n),n==Me.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof Mt&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Jg(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Mt(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=pt.findFrom(n,r,!0)||pt.findFrom(n,-r,!0);if(o)n=o.$head;else return pt.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(pt.findFrom(e,-r,!0)||pt.findFrom(e,r,!0)).$anchor,e.pos0?0:1);i>0?s=0;s+=i){let a=e.child(s);if(a.isAtom){if(!o&&St.isSelectable(a))return St.create(t,n-(i<0?a.nodeSize:0))}else{let l=hu(t,a,n+i,i<0?a.childCount:0,i,o);if(l)return l}n+=a.nodeSize*i}return null}function z_(t,e,n){let r=t.steps.length-1;if(r{s==null&&(s=c)}),t.setSelection(pt.near(t.doc.resolve(s),n))}function j_(t,e){return!e||!t?t:t.bind(e)}class $p{constructor(e,n,r){this.name=e,this.init=j_(n.init,r),this.apply=j_(n.apply,r)}}new $p("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new $p("selection",{init(t,e){return t.selection||pt.atStart(e.doc)},apply(t){return t.selection}}),new $p("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new $p("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}});function $I(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=$I(i,e,{})),n[r]=i}return n}class Uc{constructor(e){this.spec=e,this.props={},e.props&&$I(e.props,this,this.props),this.key=e.key?e.key.key:II("plugin")}getState(e){return e[this.key]}}const i2=Object.create(null);function II(t){return t in i2?t+"$"+ ++i2[t]:(i2[t]=0,t+"$")}class Vc{constructor(e="key"){this.key=II(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Zue=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function RI(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const Yue=(t,e,n)=>{let r=RI(t,n);if(!r)return!1;let i=kE(r);if(!i){let s=r.blockRange(),a=s&&qc(s);return a==null?!1:(e&&e(t.tr.lift(s,a).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&PI(t,i,e))return!0;if(r.parent.content.size==0&&(Sc(o,"end")||St.isSelectable(o))){let s=vE(t.doc,r.before(),r.after(),Me.empty);if(s&&s.slice.size{let r=RI(t,n);if(!r)return!1;let i=kE(r);return i?FI(t,i,e):!1},Xue=(t,e,n)=>{let r=LI(t,n);if(!r)return!1;let i=xE(r);return i?FI(t,i,e):!1};function FI(t,e,n){let r=e.nodeBefore,i=r,o=e.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let c=i.lastChild;if(!c)return!1;i=c}let s=e.nodeAfter,a=s,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let c=a.firstChild;if(!c)return!1;a=c}let u=vE(t.doc,o,l,Me.empty);if(!u||u.from!=o||u instanceof Rr&&u.slice.size>=l-o)return!1;if(n){let c=t.tr.step(u);c.setSelection(Mt.create(c.doc,o)),n(c.scrollIntoView())}return!0}function Sc(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const ece=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;o=kE(r)}let s=o&&o.nodeBefore;return!s||!St.isSelectable(s)?!1:(e&&e(t.tr.setSelection(St.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function kE(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function LI(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset{let r=LI(t,n);if(!r)return!1;let i=xE(r);if(!i)return!1;let o=i.nodeAfter;if(PI(t,i,e))return!0;if(r.parent.content.size==0&&(Sc(o,"start")||St.isSelectable(o))){let s=vE(t.doc,r.before(),r.after(),Me.empty);if(s&&s.slice.size{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset=0;e--){let n=t.node(e);if(t.index(e)+1{let n=t.selection,r=n instanceof St,i;if(r){if(n.node.isTextblock||!Pl(t.doc,n.from))return!1;i=n.from}else if(i=Wg(t.doc,n.from,-1),i==null)return!1;if(e){let o=t.tr.join(i);r&&o.setSelection(St.create(o.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},ice=(t,e)=>{let n=t.selection,r;if(n instanceof St){if(n.node.isTextblock||!Pl(t.doc,n.to))return!1;r=n.to}else if(r=Wg(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},oce=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),o=i&&qc(i);return o==null?!1:(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},sce=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(` +`).scrollIntoView()),!0)};function BI(t){for(let e=0;e{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=BI(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let a=n.after(),l=t.tr.replaceWith(a,a,s.createAndFill());l.setSelection(pt.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},lce=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof yo||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=BI(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!r.parentOffset&&i.index(){let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(Vu(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&qc(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)},cce=(t,e)=>{let{$from:n,to:r}=t.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),e&&e(t.tr.setSelection(St.create(t.doc,i))),!0)};function fce(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||Pl(t.doc,e.pos))?!1:(n&&n(t.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0)}function PI(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o,s;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(fce(t,e,n))return!0;let a=e.parent.canReplace(e.index(),e.index()+1);if(a&&(o=(s=r.contentMatchAt(r.childCount)).findWrapping(i.type))&&s.matchType(o[0]||i.type).validEnd){if(n){let f=e.pos+i.nodeSize,d=ue.empty;for(let m=o.length-1;m>=0;m--)d=ue.from(o[m].create(null,d));d=ue.from(r.copy(d));let h=t.tr.step(new Cr(e.pos-1,f,e.pos,f,new Me(d,1,0),o.length,!0)),p=f+2*o.length;Pl(h.doc,p)&&h.join(p),n(h.scrollIntoView())}return!0}let l=pt.findFrom(e,1),u=l&&l.$from.blockRange(l.$to),c=u&&qc(u);if(c!=null&&c>=e.depth)return n&&n(t.tr.lift(u,c).scrollIntoView()),!0;if(a&&Sc(i,"start",!0)&&Sc(r,"end")){let f=r,d=[];for(;d.push(f),!f.isTextblock;)f=f.lastChild;let h=i,p=1;for(;!h.isTextblock;h=h.firstChild)p++;if(f.canReplace(f.childCount,f.childCount,h.content)){if(n){let m=ue.empty;for(let y=d.length-1;y>=0;y--)m=ue.from(d[y].copy(m));let b=t.tr.step(new Cr(e.pos-d.length,e.pos+i.nodeSize,e.pos+p,e.pos+i.nodeSize-p,new Me(m,d.length,0),0,!0));n(b.scrollIntoView())}return!0}}return!1}function zI(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(n&&n(e.tr.setSelection(Mt.create(e.doc,t<0?i.start(o):i.end(o)))),!0):!1}}const dce=zI(-1),hce=zI(1);function pce(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=s&&OI(s,t,e);return a?(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0):!1}}function q_(t,e=null){return function(n,r){let i=!1;for(let o=0;o{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)i=!0;else{let c=n.doc.resolve(u),f=c.index();i=c.parent.canReplaceWith(f,f+1,t)}})}if(!i)return!1;if(r){let o=n.tr;for(let s=0;s=2&&i.node(s.depth-1).type.compatibleContent(t)&&s.startIndex==0){if(i.index(s.depth-1)==0)return!1;let c=n.doc.resolve(s.start-2);l=new p1(c,c,s.depth),s.endIndex=0;c--)o=ue.from(n[c].type.create(n[c].attrs,o));t.step(new Cr(e.start-(r?2:0),e.end,e.start,e.end,new Me(o,0,0),n.length,!0));let s=0;for(let c=0;cs.childCount>0&&s.firstChild.type==t);return o?n?r.node(o.depth-1).type==t?bce(e,n,t,o):vce(e,n,o):!0:!1}}function bce(t,e,n,r){let i=t.tr,o=r.end,s=r.$to.end(r.depth);om;p--)h-=i.child(p).nodeSize,r.delete(h-1,h+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==i.childCount,u=o.node(-1),c=o.index(-1);if(!u.canReplace(c+(a?0:1),c+1,s.content.append(l?ue.empty:ue.from(i))))return!1;let f=o.pos,d=f+s.nodeSize;return r.step(new Cr(f-(a?1:0),d+(l?1:0),f+1,d-1,new Me((a?ue.empty:ue.from(i.copy(ue.empty))).append(l?ue.empty:ue.from(i.copy(ue.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function wce(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,u=>u.childCount>0&&u.firstChild.type==t);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let a=o.parent,l=a.child(s-1);if(l.type!=t)return!1;if(n){let u=l.lastChild&&l.lastChild.type==a.type,c=ue.from(u?t.create():null),f=new Me(ue.from(t.create(null,ue.from(a.type.create(null,c)))),u?3:1,0),d=o.start,h=o.end;n(e.tr.step(new Cr(d-(u?3:1),h,d,h,f,1,!0)).scrollIntoView())}return!0}}function jI(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}class kce{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:n,state:r}=this,{view:i}=n,{tr:o}=r,s=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...c)=>{const f=l(...c)(s);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),f}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i,a=[],l=!!e,u=e||o.tr,c=()=>(!l&&n&&!u.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(u),a.every(d=>d===!0)),f={...Object.fromEntries(Object.entries(r).map(([d,h])=>[d,(...m)=>{const b=this.buildProps(u,n),y=h(...m)(b);return a.push(y),f}])),run:c};return f}createCan(e){const{rawCommands:n,state:r}=this,i=!1,o=e||r.tr,s=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(n).map(([l,u])=>[l,(...c)=>u(...c)({...s,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(e,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i,a={tr:e,editor:i,view:s,state:jI({state:o,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([l,u])=>[l,(...c)=>u(...c)(a)]))}};return a}}function rr(t,e,n){return t.config[e]===void 0&&t.parent?rr(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?rr(t.parent,e,n):null}):t.config[e]}function xce(t){const e=t.filter(i=>i.type==="extension"),n=t.filter(i=>i.type==="node"),r=t.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function Wn(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function Ece(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){const a=o?o.split(" "):[],l=r[i]?r[i].split(" "):[],u=a.filter(c=>!l.includes(c));r[i]=[...l,...u].join(" ")}else i==="style"?r[i]=[r[i],o].join("; "):r[i]=o}),r},{})}function Sce(t){return typeof t=="function"}function Pr(t,e=void 0,...n){return Sce(t)?e?t.bind(e)(...n):t(...n):t}function Cce(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function _ce(t){return Object.prototype.toString.call(t).slice(8,-1)}function Ip(t){return _ce(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function Kg(t,e){const n={...t};return Ip(t)&&Ip(e)&&Object.keys(e).forEach(r=>{Ip(e[r])&&Ip(t[r])?n[r]=Kg(t[r],e[r]):n[r]=e[r]}),n}class yi{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Pr(rr(this,"addOptions",{name:this.name}))),this.storage=Pr(rr(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new yi(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Kg(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new yi({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Pr(rr(n,"addOptions",{name:n.name})),n.storage=Pr(rr(n,"addStorage",{name:n.name,options:n.options})),n}}function Ace(t,e,n){const{from:r,to:i}=e,{blockSeparator:o=` -`,textSerializers:s={}}=n||{};let a="";return t.nodesBetween(r,i,(l,u,c,f)=>{var d;l.isBlock&&u>r&&(a+=o);const h=s==null?void 0:s[l.type.name];if(h)return c&&(a+=h({node:l,pos:u,parent:c,index:f,range:e})),!1;l.isText&&(a+=(d=l==null?void 0:l.text)===null||d===void 0?void 0:d.slice(Math.max(r,u)-u,i-u))}),a}function Sce(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const Cce=yi.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Vc({key:new Uc("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,{ranges:o}=i,s=Math.min(...o.map(c=>c.$from.pos)),a=Math.max(...o.map(c=>c.$to.pos)),l=Sce(n);return Ece(r,{from:s,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),_ce=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),Ace=(t=!1)=>({commands:e})=>e.setContent("",t),Tce=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:s})=>{t.doc.nodesBetween(o.pos,s.pos,(a,l)=>{if(a.type.isText)return;const{doc:u,mapping:c}=e,f=u.resolve(c.map(l)),d=u.resolve(c.map(l+a.nodeSize)),h=f.blockRange(d);if(!h)return;const p=qc(h);if(a.type.isTextblock){const{defaultType:m}=f.parent.contentMatchAt(f.index());e.setNodeMarkup(h.start,m)}(p||p===0)&&e.lift(h,p)})}),!0},Mce=t=>e=>t(e),Oce=()=>({state:t,dispatch:e})=>ice(t,e),Dce=(t,e)=>({editor:n,tr:r})=>{const{state:i}=n,o=i.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const s=r.mapping.map(e);return r.insert(s,o.content),r.setSelection(new Mt(r.doc.resolve(s-1))),!0},Nce=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const i=t.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(e){const a=i.before(o),l=i.after(o);t.delete(a,l).scrollIntoView()}return!0}return!1},$ce=t=>({tr:e,state:n,dispatch:r})=>{const i=Hn(t,n.schema),o=e.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===i){if(r){const l=o.before(s),u=o.after(s);e.delete(l,u).scrollIntoView()}return!0}return!1},Ice=t=>({tr:e,dispatch:n})=>{const{from:r,to:i}=t;return n&&e.delete(r,i),!0},Rce=()=>({state:t,dispatch:e})=>Wue(t,e),Fce=()=>({commands:t})=>t.keyboardShortcut("Enter"),Lce=()=>({state:t,dispatch:e})=>rce(t,e);function w1(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:kce(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function lk(t,e,n={}){return t.find(r=>r.type===e&&w1(r.attrs,n))}function Bce(t,e,n={}){return!!lk(t,e,n)}function qI(t,e,n={}){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if(t.parentOffset===r.offset&&r.offset!==0&&(r=t.parent.childBefore(t.parentOffset)),!r.node)return;const i=lk([...r.node.marks],e,n);if(!i)return;let o=r.index,s=t.start()+r.offset,a=o+1,l=s+r.node.nodeSize;for(lk([...r.node.marks],e,n);o>0&&i.isInSet(t.parent.child(o-1).marks);)o-=1,s-=t.parent.child(o).nodeSize;for(;a({tr:n,state:r,dispatch:i})=>{const o=Na(t,r.schema),{doc:s,selection:a}=n,{$from:l,from:u,to:c}=a;if(i){const f=qI(l,o,e);if(f&&f.from<=u&&f.to>=c){const d=Mt.create(s,f.from,f.to);n.setSelection(d)}}return!0},zce=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r({editor:n,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const s=()=>{EE()&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&t===null||t===!1)return!0;if(o&&t===null&&!VI(n.state.selection))return s(),!0;const a=jce(i.doc,t)||n.state.selection,l=n.state.selection.eq(a);return o&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},Vce=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),Uce=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),UI=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&UI(r)}return t};function V_(t){const e=`${t}`,n=new window.DOMParser().parseFromString(e,"text/html").body;return UI(n)}function k1(t,e,n){n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,i=typeof t=="string";if(r)try{return Array.isArray(t)&&t.length>0?ue.fromArray(t.map(s=>e.nodeFromJSON(s))):e.nodeFromJSON(t)}catch(o){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",o),k1("",e,n)}if(i){let o=e,s=!1,a="";n.errorOnInvalidContent&&(o=new xI({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(s=!0,a=typeof c=="string"?c:c.outerHTML,null)}]}})}));const l=eh.fromSchema(o),u=n.slice?l.parseSlice(V_(t),n.parseOptions).content:l.parse(V_(t),n.parseOptions);if(n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)});return u}return k1("",e,n)}function Hce(t,e,n){const r=t.steps.length-1;if(r{s===0&&(s=c)}),t.setSelection(pt.near(t.doc.resolve(s),n))}const Wce=t=>!("type"in t),Jce=(t,e,n)=>({tr:r,dispatch:i,editor:o})=>{var s;if(i){n={parseOptions:{},updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let a;try{a=k1(e,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:(s=n.errorOnInvalidContent)!==null&&s!==void 0?s:o.options.enableContentCheck})}catch{return!1}let{from:l,to:u}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},c=!0,f=!0;if((Wce(a)?a:[a]).forEach(p=>{p.check(),c=c?p.isText&&p.marks.length===0:!1,f=f?p.isBlock:!1}),l===u&&f){const{parent:p}=r.doc.resolve(l);p.isTextblock&&!p.type.spec.code&&!p.childCount&&(l-=1,u+=1)}let h;c?(Array.isArray(e)?h=e.map(p=>p.text||"").join(""):typeof e=="object"&&e&&e.text?h=e.text:h=e,r.insertText(h,l,u)):(h=a,r.replaceWith(l,u,h)),n.updateSelection&&Hce(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:l,text:h}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:l,text:h})}return!0},Kce=()=>({state:t,dispatch:e})=>Xue(t,e),Gce=()=>({state:t,dispatch:e})=>ece(t,e),Zce=()=>({state:t,dispatch:e})=>Jue(t,e),Yce=()=>({state:t,dispatch:e})=>Yue(t,e),Qce=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Wg(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},Xce=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Wg(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},efe=()=>({state:t,dispatch:e})=>Kue(t,e),tfe=()=>({state:t,dispatch:e})=>Gue(t,e);function HI(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function nfe(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,i,o,s;for(let a=0;a({editor:e,view:n,tr:r,dispatch:i})=>{const o=nfe(t).split(/-(?!$)/),s=o.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),a=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{n.someProp("handleKeyDown",u=>u(n,a))});return l==null||l.steps.forEach(u=>{const c=u.map(r.mapping);c&&i&&r.maybeStep(c)}),!0};function SE(t,e,n={}){const{from:r,to:i,empty:o}=t.selection,s=e?Hn(e,t.schema):null,a=[];t.doc.nodesBetween(r,i,(f,d)=>{if(f.isText)return;const h=Math.max(r,d),p=Math.min(i,d+f.nodeSize);a.push({node:f,from:h,to:p})});const l=i-r,u=a.filter(f=>s?s.name===f.node.type.name:!0).filter(f=>w1(f.node.attrs,n,{strict:!1}));return o?!!u.length:u.reduce((f,d)=>f+d.to-d.from,0)>=l}const ife=(t,e={})=>({state:n,dispatch:r})=>{const i=Hn(t,n.schema);return SE(n,i,e)?tce(n,r):!1},ofe=()=>({state:t,dispatch:e})=>oce(t,e),sfe=t=>({state:e,dispatch:n})=>{const r=Hn(t,e.schema);return hce(r)(e,n)},afe=()=>({state:t,dispatch:e})=>nce(t,e);function WI(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function U_(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,i)=>(n.includes(i)||(r[i]=t[i]),r),{})}const lfe=(t,e)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=WI(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(o=Hn(t,r.schema)),a==="mark"&&(s=Na(t,r.schema)),i&&n.selection.ranges.forEach(l=>{r.doc.nodesBetween(l.$from.pos,l.$to.pos,(u,c)=>{o&&o===u.type&&n.setNodeMarkup(c,void 0,U_(u.attrs,e)),s&&u.marks.length&&u.marks.forEach(f=>{s===f.type&&n.addMark(c,c+u.nodeSize,s.create(U_(f.attrs,e)))})})}),!0):!1},ufe=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),cfe=()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size}),ffe=()=>({state:t,dispatch:e})=>Zue(t,e),dfe=()=>({state:t,dispatch:e})=>Que(t,e),hfe=()=>({state:t,dispatch:e})=>sce(t,e),pfe=()=>({state:t,dispatch:e})=>uce(t,e),mfe=()=>({state:t,dispatch:e})=>lce(t,e);function gfe(t,e,n={},r={}){return k1(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const yfe=(t,e=!1,n={},r={})=>({editor:i,tr:o,dispatch:s,commands:a})=>{var l,u;const{doc:c}=o;if(n.preserveWhitespace!=="full"){const f=gfe(t,i.schema,n,{errorOnInvalidContent:(l=r.errorOnInvalidContent)!==null&&l!==void 0?l:i.options.enableContentCheck});return s&&o.replaceWith(0,c.content.size,f).setMeta("preventUpdate",!e),!0}return s&&o.setMeta("preventUpdate",!e),a.insertContentAt({from:0,to:c.content.size},t,{parseOptions:n,errorOnInvalidContent:(u=r.errorOnInvalidContent)!==null&&u!==void 0?u:i.options.enableContentCheck})};function bfe(t,e){const n=Na(e,t.schema),{from:r,to:i,empty:o}=t.selection,s=[];o?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,i,l=>{s.push(...l.marks)});const a=s.find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function vfe(t){for(let e=0;e0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function CE(t){return e=>wfe(e.$from,t)}function JI(t,e){const n=yE.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function S0(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=t.find(o=>o.type===e&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function kfe(t,e,n={}){const{empty:r,ranges:i}=t.selection,o=e?Na(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(f=>o?o.name===f.type.name:!0).find(f=>w1(f.attrs,n,{strict:!1}));let s=0;const a=[];if(i.forEach(({$from:f,$to:d})=>{const h=f.pos,p=d.pos;t.doc.nodesBetween(h,p,(m,b)=>{if(!m.isText&&!m.marks.length)return;const y=Math.max(h,b),v=Math.min(p,b+m.nodeSize),w=v-y;s+=w,a.push(...m.marks.map(g=>({mark:g,from:y,to:v})))})}),s===0)return!1;const l=a.filter(f=>o?o.name===f.mark.type.name:!0).filter(f=>w1(f.mark.attrs,n,{strict:!1})).reduce((f,d)=>f+d.to-d.from,0),u=a.filter(f=>o?f.mark.type!==o&&f.mark.type.excludes(o):!0).reduce((f,d)=>f+d.to-d.from,0);return(l>0?l+u:l)>=s}function H_(t,e){const{nodeExtensions:n}=bce(e),r=n.find(s=>s.name===t);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=Pr(rr(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function xfe(t,e,n){var r;const{selection:i}=e;let o=null;if(VI(i)&&(o=i.$cursor),o){const a=(r=t.storedMarks)!==null&&r!==void 0?r:o.marks();return!!n.isInSet(a)||!a.some(l=>l.type.excludes(n))}const{ranges:s}=i;return s.some(({$from:a,$to:l})=>{let u=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.pos,l.pos,(c,f,d)=>{if(u)return!1;if(c.isInline){const h=!d||d.type.allowsMarkType(n),p=!!n.isInSet(c.marks)||!c.marks.some(m=>m.type.excludes(n));u=h&&p}return!u}),u})}const Efe=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:s,ranges:a}=o,l=Na(t,r.schema);if(i)if(s){const u=bfe(r,l);n.addStoredMark(l.create({...u,...e}))}else a.forEach(u=>{const c=u.$from.pos,f=u.$to.pos;r.doc.nodesBetween(c,f,(d,h)=>{const p=Math.max(h,c),m=Math.min(h+d.nodeSize,f);d.marks.find(y=>y.type===l)?d.marks.forEach(y=>{l===y.type&&n.addMark(p,m,l.create({...y.attrs,...e}))}):n.addMark(p,m,l.create(e))})});return xfe(r,n,l)},Sfe=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),Cfe=(t,e={})=>({state:n,dispatch:r,chain:i})=>{const o=Hn(t,n.schema);return o.isTextblock?i().command(({commands:s})=>q_(o,e)(n)?!0:s.clearNodes()).command(({state:s})=>q_(o,e)(s,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},_fe=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,i=ol(t,0,r.content.size),o=St.create(r,i);e.setSelection(o)}return!0},Afe=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:i,to:o}=typeof t=="number"?{from:t,to:t}:t,s=Mt.atStart(r).from,a=Mt.atEnd(r).to,l=ol(i,s,a),u=ol(o,s,a),c=Mt.create(r,l,u);e.setSelection(c)}return!0},Tfe=t=>({state:e,dispatch:n})=>{const r=Hn(t,e.schema);return gce(r)(e,n)};function W_(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(i=>e==null?void 0:e.includes(i.type.name));t.tr.ensureMarks(r)}}const Mfe=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{const{selection:o,doc:s}=e,{$from:a,$to:l}=o,u=i.extensionManager.attributes,c=S0(u,a.node().type.name,a.node().attrs);if(o instanceof St&&o.node.isBlock)return!a.parentOffset||!Uu(s,a.pos)?!1:(r&&(t&&W_(n,i.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;if(r){const f=l.parentOffset===l.parent.content.size;o instanceof Mt&&e.deleteSelection();const d=a.depth===0?void 0:vfe(a.node(-1).contentMatchAt(a.indexAfter(-1)));let h=f&&d?[{type:d,attrs:c}]:void 0,p=Uu(e.doc,e.mapping.map(a.pos),1,h);if(!h&&!p&&Uu(e.doc,e.mapping.map(a.pos),1,d?[{type:d}]:void 0)&&(p=!0,h=d?[{type:d,attrs:c}]:void 0),p&&(e.split(e.mapping.map(a.pos),1,h),d&&!f&&!a.parentOffset&&a.parent.type!==d)){const m=e.mapping.map(a.before()),b=e.doc.resolve(m);a.node(-1).canReplaceWith(b.index(),b.index()+1,d)&&e.setNodeMarkup(e.mapping.map(a.before()),d)}t&&W_(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},Ofe=t=>({tr:e,state:n,dispatch:r,editor:i})=>{var o;const s=Hn(t,n.schema),{$from:a,$to:l}=n.selection,u=n.selection.node;if(u&&u.isBlock||a.depth<2||!a.sameParent(l))return!1;const c=a.node(-1);if(c.type!==s)return!1;const f=i.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==s||a.index(-2)!==a.node(-2).childCount-1)return!1;if(r){let b=ue.empty;const y=a.index(-1)?1:a.index(-2)?2:3;for(let E=a.depth-y;E>=a.depth-3;E-=1)b=ue.from(a.node(E).copy(b));const v=a.indexAfter(-1){if(k>-1)return!1;E.isTextblock&&E.content.size===0&&(k=D+1)}),k>-1&&e.setSelection(Mt.near(e.doc.resolve(k))),e.scrollIntoView()}return!0}const d=l.pos===a.end()?c.contentMatchAt(0).defaultType:null,h=S0(f,c.type.name,c.attrs),p=S0(f,a.node().type.name,a.node().attrs);e.delete(a.pos,l.pos);const m=d?[{type:s,attrs:h},{type:d,attrs:p}]:[{type:s,attrs:h}];if(!Uu(e.doc,a.pos,2))return!1;if(r){const{selection:b,storedMarks:y}=n,{splittableMarks:v}=i.extensionManager,w=y||b.$to.parentOffset&&b.$from.marks();if(e.split(a.pos,2,m).scrollIntoView(),!w||!r)return!0;const g=w.filter(x=>v.includes(x.type.name));e.ensureMarks(g)}return!0},o2=(t,e)=>{const n=CE(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&Pl(t.doc,n.pos)&&t.join(n.pos),!0},s2=(t,e)=>{const n=CE(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&Pl(t.doc,r)&&t.join(r),!0},Dfe=(t,e,n,r={})=>({editor:i,tr:o,state:s,dispatch:a,chain:l,commands:u,can:c})=>{const{extensions:f,splittableMarks:d}=i.extensionManager,h=Hn(t,s.schema),p=Hn(e,s.schema),{selection:m,storedMarks:b}=s,{$from:y,$to:v}=m,w=y.blockRange(v),g=b||m.$to.parentOffset&&m.$from.marks();if(!w)return!1;const x=CE(k=>H_(k.type.name,f))(m);if(w.depth>=1&&x&&w.depth-x.depth<=1){if(x.node.type===h)return u.liftListItem(p);if(H_(x.node.type.name,f)&&h.validContent(x.node.content)&&a)return l().command(()=>(o.setNodeMarkup(x.pos,h),!0)).command(()=>o2(o,h)).command(()=>s2(o,h)).run()}return!n||!g||!a?l().command(()=>c().wrapInList(h,r)?!0:u.clearNodes()).wrapInList(h,r).command(()=>o2(o,h)).command(()=>s2(o,h)).run():l().command(()=>{const k=c().wrapInList(h,r),E=g.filter(D=>d.includes(D.type.name));return o.ensureMarks(E),k?!0:u.clearNodes()}).wrapInList(h,r).command(()=>o2(o,h)).command(()=>s2(o,h)).run()},Nfe=(t,e={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,s=Na(t,r.schema);return kfe(r,s,e)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,e)},$fe=(t,e,n={})=>({state:r,commands:i})=>{const o=Hn(t,r.schema),s=Hn(e,r.schema);return SE(r,o,n)?i.setNode(s):i.setNode(o,n)},Ife=(t,e={})=>({state:n,commands:r})=>{const i=Hn(t,n.schema);return SE(n,i,e)?r.lift(i):r.wrapIn(i,e)},Rfe=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r=0;l-=1)s.step(a.steps[l].invert(a.docs[l]));if(o.text){const l=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,t.schema.text(o.text,l))}else s.delete(o.from,o.to)}return!0}}return!1},Ffe=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:i}=n;return r||e&&i.forEach(o=>{t.removeMark(o.$from.pos,o.$to.pos)}),!0},Lfe=(t,e={})=>({tr:n,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:s=!1}=e,{selection:a}=n,l=Na(t,r.schema),{$from:u,empty:c,ranges:f}=a;if(!i)return!0;if(c&&s){let{from:d,to:h}=a;const p=(o=u.marks().find(b=>b.type===l))===null||o===void 0?void 0:o.attrs,m=qI(u,l,p);m&&(d=m.from,h=m.to),n.removeMark(d,h,l)}else f.forEach(d=>{n.removeMark(d.$from.pos,d.$to.pos,l)});return n.removeStoredMark(l),!0},Bfe=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=WI(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(o=Hn(t,r.schema)),a==="mark"&&(s=Na(t,r.schema)),i&&n.selection.ranges.forEach(l=>{const u=l.$from.pos,c=l.$to.pos;r.doc.nodesBetween(u,c,(f,d)=>{o&&o===f.type&&n.setNodeMarkup(d,void 0,{...f.attrs,...e}),s&&f.marks.length&&f.marks.forEach(h=>{if(s===h.type){const p=Math.max(d,u),m=Math.min(d+f.nodeSize,c);n.addMark(p,m,s.create({...h.attrs,...e}))}})})}),!0):!1},Pfe=(t,e={})=>({state:n,dispatch:r})=>{const i=Hn(t,n.schema);return cce(i,e)(n,r)},zfe=(t,e={})=>({state:n,dispatch:r})=>{const i=Hn(t,n.schema);return fce(i,e)(n,r)};var jfe=Object.freeze({__proto__:null,blur:_ce,clearContent:Ace,clearNodes:Tce,command:Mce,createParagraphNear:Oce,cut:Dce,deleteCurrentNode:Nce,deleteNode:$ce,deleteRange:Ice,deleteSelection:Rce,enter:Fce,exitCode:Lce,extendMarkRange:Pce,first:zce,focus:qce,forEach:Vce,insertContent:Uce,insertContentAt:Jce,joinBackward:Zce,joinDown:Gce,joinForward:Yce,joinItemBackward:Qce,joinItemForward:Xce,joinTextblockBackward:efe,joinTextblockForward:tfe,joinUp:Kce,keyboardShortcut:rfe,lift:ife,liftEmptyBlock:ofe,liftListItem:sfe,newlineInCode:afe,resetAttributes:lfe,scrollIntoView:ufe,selectAll:cfe,selectNodeBackward:ffe,selectNodeForward:dfe,selectParentNode:hfe,selectTextblockEnd:pfe,selectTextblockStart:mfe,setContent:yfe,setMark:Efe,setMeta:Sfe,setNode:Cfe,setNodeSelection:_fe,setTextSelection:Afe,sinkListItem:Tfe,splitBlock:Mfe,splitListItem:Ofe,toggleList:Dfe,toggleMark:Nfe,toggleNode:$fe,toggleWrap:Ife,undoInputRule:Rfe,unsetAllMarks:Ffe,unsetMark:Lfe,updateAttributes:Bfe,wrapIn:Pfe,wrapInList:zfe});const qfe=yi.create({name:"commands",addCommands(){return{...jfe}}}),Vfe=yi.create({name:"editable",addProseMirrorPlugins(){return[new Vc({key:new Uc("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Ufe=yi.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new Vc({key:new Uc("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),Hfe=yi.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:a})=>{const{selection:l,doc:u}=a,{empty:c,$anchor:f}=l,{pos:d,parent:h}=f,p=f.parent.isTextblock&&d>0?a.doc.resolve(d-1):f,m=p.parent.type.spec.isolating,b=f.pos-f.parentOffset,y=m&&p.parent.childCount===1?b===f.pos:pt.atStart(u).from===d;return!c||!h.type.isTextblock||h.textContent.length||!y||y&&f.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return EE()||HI()?o:i},addProseMirrorPlugins(){return[new Vc({key:new Uc("clearDocument"),appendTransaction:(t,e,n)=>{if(!(t.some(p=>p.docChanged)&&!e.doc.eq(n.doc)))return;const{empty:i,from:o,to:s}=e.selection,a=pt.atStart(e.doc).from,l=pt.atEnd(e.doc).to;if(i||!(o===a&&s===l)||!(n.doc.textBetween(0,n.doc.content.size," "," ").length===0))return;const f=n.tr,d=jI({state:n,transaction:f}),{commands:h}=new yce({editor:this.editor,state:d});if(h.clearNodes(),!!f.steps.length)return f}})]}}),Wfe=yi.create({name:"tabindex",addProseMirrorPlugins(){return[new Vc({key:new Uc("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});var Jfe=Object.freeze({__proto__:null,ClipboardTextSerializer:Cce,Commands:qfe,Editable:Vfe,FocusEvents:Ufe,Keymap:Hfe,Tabindex:Wfe});class Xo{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Pr(rr(this,"addOptions",{name:this.name}))),this.storage=Pr(rr(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Xo(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Kg(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Xo(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Pr(rr(n,"addOptions",{name:n.name})),n.storage=Pr(rr(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const s=i.marks();if(!!!s.find(u=>(u==null?void 0:u.type.name)===n.name))return!1;const l=s.find(u=>(u==null?void 0:u.type.name)===n.name);return l&&r.removeStoredMark(l),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}}let bn=class uk{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Pr(rr(this,"addOptions",{name:this.name}))),this.storage=Pr(rr(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new uk(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Kg(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new uk(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Pr(rr(n,"addOptions",{name:n.name})),n.storage=Pr(rr(n,"addStorage",{name:n.name,options:n.options})),n}};const J_={};function Kfe(t){let e=J_[t];if(e)return e;e=J_[t]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);e.push(r)}for(let n=0;n=55296&&c<=57343?i+="���":i+=String.fromCharCode(c),o+=6;continue}}if((a&248)===240&&o+91114111?i+="����":(f-=65536,i+=String.fromCharCode(55296+(f>>10),56320+(f&1023))),o+=9;continue}}i+="�"}return i})}Cc.defaultChars=";/?:@&=+$,#";Cc.componentChars="";const K_={};function Gfe(t){let e=K_[t];if(e)return e;e=K_[t]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);/^[0-9a-z]$/i.test(r)?e.push(r):e.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n"u"&&(n=!0);const r=Gfe(e);let i="";for(let o=0,s=t.length;o=55296&&a<=57343){if(a>=55296&&a<=56319&&o+1=56320&&l<=57343){i+=encodeURIComponent(t[o]+t[o+1]),o++;continue}}i+="%EF%BF%BD";continue}i+=encodeURIComponent(t[o])}return i}Dh.defaultChars=";/?:@&=+$,-_.!~*'()#";Dh.componentChars="-_.!~*'()";function _E(t){let e="";return e+=t.protocol||"",e+=t.slashes?"//":"",e+=t.auth?t.auth+"@":"",t.hostname&&t.hostname.indexOf(":")!==-1?e+="["+t.hostname+"]":e+=t.hostname||"",e+=t.port?":"+t.port:"",e+=t.pathname||"",e+=t.search||"",e+=t.hash||"",e}function x1(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const Zfe=/^([a-z0-9.+-]+:)/i,Yfe=/:[0-9]*$/,Qfe=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Xfe=["<",">",'"',"`"," ","\r",` -`," "],ede=["{","}","|","\\","^","`"].concat(Xfe),tde=["'"].concat(ede),G_=["%","/","?",";","#"].concat(tde),Z_=["/","?","#"],nde=255,Y_=/^[+a-z0-9A-Z_-]{0,63}$/,rde=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Q_={javascript:!0,"javascript:":!0},X_={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function AE(t,e){if(t&&t instanceof x1)return t;const n=new x1;return n.parse(t,e),n}x1.prototype.parse=function(t,e){let n,r,i,o=t;if(o=o.trim(),!e&&t.split("#").length===1){const u=Qfe.exec(o);if(u)return this.pathname=u[1],u[2]&&(this.search=u[2]),this}let s=Zfe.exec(o);if(s&&(s=s[0],n=s.toLowerCase(),this.protocol=s,o=o.substr(s.length)),(e||s||o.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i=o.substr(0,2)==="//",i&&!(s&&Q_[s])&&(o=o.substr(2),this.slashes=!0)),!Q_[s]&&(i||s&&!X_[s])){let u=-1;for(let p=0;p127?v+="x":v+=y[w];if(!v.match(Y_)){const w=p.slice(0,m),g=p.slice(m+1),x=y.match(rde);x&&(w.push(x[1]),g.unshift(x[2])),g.length&&(o=g.join(".")+o),this.hostname=w.join(".");break}}}}this.hostname.length>nde&&(this.hostname=""),h&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const a=o.indexOf("#");a!==-1&&(this.hash=o.substr(a),o=o.slice(0,a));const l=o.indexOf("?");return l!==-1&&(this.search=o.substr(l),o=o.slice(0,l)),o&&(this.pathname=o),X_[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};x1.prototype.parseHost=function(t){let e=Yfe.exec(t);e&&(e=e[0],e!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};const ide=Object.freeze(Object.defineProperty({__proto__:null,decode:Cc,encode:Dh,format:_E,parse:AE},Symbol.toStringTag,{value:"Module"})),KI=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,GI=/[\0-\x1F\x7F-\x9F]/,ode=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,TE=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,ZI=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,YI=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,sde=Object.freeze(Object.defineProperty({__proto__:null,Any:KI,Cc:GI,Cf:ode,P:TE,S:ZI,Z:YI},Symbol.toStringTag,{value:"Module"})),ade=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(t=>t.charCodeAt(0))),lde=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(t=>t.charCodeAt(0)));var a2;const ude=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),cde=(a2=String.fromCodePoint)!==null&&a2!==void 0?a2:function(t){let e="";return t>65535&&(t-=65536,e+=String.fromCharCode(t>>>10&1023|55296),t=56320|t&1023),e+=String.fromCharCode(t),e};function fde(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=ude.get(t))!==null&&e!==void 0?e:t}var fn;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(fn||(fn={}));const dde=32;var Ks;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(Ks||(Ks={}));function ck(t){return t>=fn.ZERO&&t<=fn.NINE}function hde(t){return t>=fn.UPPER_A&&t<=fn.UPPER_F||t>=fn.LOWER_A&&t<=fn.LOWER_F}function pde(t){return t>=fn.UPPER_A&&t<=fn.UPPER_Z||t>=fn.LOWER_A&&t<=fn.LOWER_Z||ck(t)}function mde(t){return t===fn.EQUALS||pde(t)}var sn;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(sn||(sn={}));var zs;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(zs||(zs={}));class gde{constructor(e,n,r){this.decodeTree=e,this.emitCodePoint=n,this.errors=r,this.state=sn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=zs.Strict}startEntity(e){this.decodeMode=e,this.state=sn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case sn.EntityStart:return e.charCodeAt(n)===fn.NUM?(this.state=sn.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=sn.NamedEntity,this.stateNamedEntity(e,n));case sn.NumericStart:return this.stateNumericStart(e,n);case sn.NumericDecimal:return this.stateNumericDecimal(e,n);case sn.NumericHex:return this.stateNumericHex(e,n);case sn.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|dde)===fn.LOWER_X?(this.state=sn.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=sn.NumericDecimal,this.stateNumericDecimal(e,n))}addToNumericResult(e,n,r,i){if(n!==r){const o=r-n;this.result=this.result*Math.pow(i,o)+parseInt(e.substr(n,o),i),this.consumed+=o}}stateNumericHex(e,n){const r=n;for(;n>14;for(;n>14,o!==0){if(s===fn.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==zs.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:n,decodeTree:r}=this,i=(r[n]&Ks.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[e]&~Ks.VALUE_LENGTH:i[e+1],r),n===3&&this.emitCodePoint(i[e+2],r),r}end(){var e;switch(this.state){case sn.NamedEntity:return this.result!==0&&(this.decodeMode!==zs.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case sn.NumericDecimal:return this.emitNumericEntity(0,2);case sn.NumericHex:return this.emitNumericEntity(0,3);case sn.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case sn.EntityStart:return 0}}}function QI(t){let e="";const n=new gde(t,r=>e+=cde(r));return function(i,o){let s=0,a=0;for(;(a=i.indexOf("&",a))>=0;){e+=i.slice(s,a),n.startEntity(o);const u=n.write(i,a+1);if(u<0){s=a+n.end();break}s=a+u,a=u===0?s+1:s}const l=e+i.slice(s);return e="",l}}function yde(t,e,n,r){const i=(e&Ks.BRANCH_LENGTH)>>7,o=e&Ks.JUMP_TABLE;if(i===0)return o!==0&&r===o?n:-1;if(o){const l=r-o;return l<0||l>=i?-1:t[n+l]-1}let s=n,a=s+i-1;for(;s<=a;){const l=s+a>>>1,u=t[l];if(ur)a=l-1;else return t[l+i]}return-1}const bde=QI(ade);QI(lde);function XI(t,e=zs.Legacy){return bde(t,e)}function vde(t){return Object.prototype.toString.call(t)}function ME(t){return vde(t)==="[object String]"}const wde=Object.prototype.hasOwnProperty;function kde(t,e){return wde.call(t,e)}function Gg(t){return Array.prototype.slice.call(arguments,1).forEach(function(n){if(n){if(typeof n!="object")throw new TypeError(n+"must be object");Object.keys(n).forEach(function(r){t[r]=n[r]})}}),t}function e7(t,e,n){return[].concat(t.slice(0,e),n,t.slice(e+1))}function OE(t){return!(t>=55296&&t<=57343||t>=64976&&t<=65007||(t&65535)===65535||(t&65535)===65534||t>=0&&t<=8||t===11||t>=14&&t<=31||t>=127&&t<=159||t>1114111)}function E1(t){if(t>65535){t-=65536;const e=55296+(t>>10),n=56320+(t&1023);return String.fromCharCode(e,n)}return String.fromCharCode(t)}const t7=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,xde=/&([a-z#][a-z0-9]{1,31});/gi,Ede=new RegExp(t7.source+"|"+xde.source,"gi"),Sde=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Cde(t,e){if(e.charCodeAt(0)===35&&Sde.test(e)){const r=e[1].toLowerCase()==="x"?parseInt(e.slice(2),16):parseInt(e.slice(1),10);return OE(r)?E1(r):t}const n=XI(t);return n!==t?n:t}function _de(t){return t.indexOf("\\")<0?t:t.replace(t7,"$1")}function _c(t){return t.indexOf("\\")<0&&t.indexOf("&")<0?t:t.replace(Ede,function(e,n,r){return n||Cde(e,r)})}const Ade=/[&<>"]/,Tde=/[&<>"]/g,Mde={"&":"&","<":"<",">":">",'"':"""};function Ode(t){return Mde[t]}function ga(t){return Ade.test(t)?t.replace(Tde,Ode):t}const Dde=/[.?*+^$[\]\\(){}|-]/g;function Nde(t){return t.replace(Dde,"\\$&")}function kt(t){switch(t){case 9:case 32:return!0}return!1}function rh(t){if(t>=8192&&t<=8202)return!0;switch(t){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function ih(t){return TE.test(t)||ZI.test(t)}function oh(t){switch(t){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function Zg(t){return t=t.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(t=t.replace(/ẞ/g,"ß")),t.toLowerCase().toUpperCase()}const $de={mdurl:ide,ucmicro:sde},Ide=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:e7,assign:Gg,escapeHtml:ga,escapeRE:Nde,fromCodePoint:E1,has:kde,isMdAsciiPunct:oh,isPunctChar:ih,isSpace:kt,isString:ME,isValidEntityCode:OE,isWhiteSpace:rh,lib:$de,normalizeReference:Zg,unescapeAll:_c,unescapeMd:_de},Symbol.toStringTag,{value:"Module"}));function Rde(t,e,n){let r,i,o,s;const a=t.posMax,l=t.pos;for(t.pos=e+1,r=1;t.pos32))return o;if(r===41){if(s===0)break;s--}i++}return e===i||s!==0||(o.str=_c(t.slice(e,i)),o.pos=i,o.ok=!0),o}function Lde(t,e,n,r){let i,o=e;const s={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(r)s.str=r.str,s.marker=r.marker;else{if(o>=n)return s;let a=t.charCodeAt(o);if(a!==34&&a!==39&&a!==40)return s;e++,o++,a===40&&(a=41),s.marker=a}for(;o"+ga(o.content)+""};_o.code_block=function(t,e,n,r,i){const o=t[e];return""+ga(t[e].content)+` +`,textSerializers:s={}}=n||{};let a="";return t.nodesBetween(r,i,(l,u,c,f)=>{var d;l.isBlock&&u>r&&(a+=o);const h=s==null?void 0:s[l.type.name];if(h)return c&&(a+=h({node:l,pos:u,parent:c,index:f,range:e})),!1;l.isText&&(a+=(d=l==null?void 0:l.text)===null||d===void 0?void 0:d.slice(Math.max(r,u)-u,i-u))}),a}function Tce(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const Mce=yi.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Uc({key:new Vc("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,{ranges:o}=i,s=Math.min(...o.map(c=>c.$from.pos)),a=Math.max(...o.map(c=>c.$to.pos)),l=Tce(n);return Ace(r,{from:s,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),Oce=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),Dce=(t=!1)=>({commands:e})=>e.setContent("",t),Nce=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:s})=>{t.doc.nodesBetween(o.pos,s.pos,(a,l)=>{if(a.type.isText)return;const{doc:u,mapping:c}=e,f=u.resolve(c.map(l)),d=u.resolve(c.map(l+a.nodeSize)),h=f.blockRange(d);if(!h)return;const p=qc(h);if(a.type.isTextblock){const{defaultType:m}=f.parent.contentMatchAt(f.index());e.setNodeMarkup(h.start,m)}(p||p===0)&&e.lift(h,p)})}),!0},$ce=t=>e=>t(e),Ice=()=>({state:t,dispatch:e})=>lce(t,e),Rce=(t,e)=>({editor:n,tr:r})=>{const{state:i}=n,o=i.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const s=r.mapping.map(e);return r.insert(s,o.content),r.setSelection(new Mt(r.doc.resolve(s-1))),!0},Fce=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const i=t.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(e){const a=i.before(o),l=i.after(o);t.delete(a,l).scrollIntoView()}return!0}return!1},Lce=t=>({tr:e,state:n,dispatch:r})=>{const i=Wn(t,n.schema),o=e.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===i){if(r){const l=o.before(s),u=o.after(s);e.delete(l,u).scrollIntoView()}return!0}return!1},Bce=t=>({tr:e,dispatch:n})=>{const{from:r,to:i}=t;return n&&e.delete(r,i),!0},Pce=()=>({state:t,dispatch:e})=>Zue(t,e),zce=()=>({commands:t})=>t.keyboardShortcut("Enter"),jce=()=>({state:t,dispatch:e})=>ace(t,e);function w1(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:Cce(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function lk(t,e,n={}){return t.find(r=>r.type===e&&w1(r.attrs,n))}function qce(t,e,n={}){return!!lk(t,e,n)}function qI(t,e,n={}){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if(t.parentOffset===r.offset&&r.offset!==0&&(r=t.parent.childBefore(t.parentOffset)),!r.node)return;const i=lk([...r.node.marks],e,n);if(!i)return;let o=r.index,s=t.start()+r.offset,a=o+1,l=s+r.node.nodeSize;for(lk([...r.node.marks],e,n);o>0&&i.isInSet(t.parent.child(o-1).marks);)o-=1,s-=t.parent.child(o).nodeSize;for(;a({tr:n,state:r,dispatch:i})=>{const o=Na(t,r.schema),{doc:s,selection:a}=n,{$from:l,from:u,to:c}=a;if(i){const f=qI(l,o,e);if(f&&f.from<=u&&f.to>=c){const d=Mt.create(s,f.from,f.to);n.setSelection(d)}}return!0},Vce=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r({editor:n,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const s=()=>{EE()&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&t===null||t===!1)return!0;if(o&&t===null&&!UI(n.state.selection))return s(),!0;const a=Hce(i.doc,t)||n.state.selection,l=n.state.selection.eq(a);return o&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},Jce=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),Kce=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),VI=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&VI(r)}return t};function U_(t){const e=`${t}`,n=new window.DOMParser().parseFromString(e,"text/html").body;return VI(n)}function k1(t,e,n){n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,i=typeof t=="string";if(r)try{return Array.isArray(t)&&t.length>0?ue.fromArray(t.map(s=>e.nodeFromJSON(s))):e.nodeFromJSON(t)}catch(o){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",o),k1("",e,n)}if(i){let o=e,s=!1,a="";n.errorOnInvalidContent&&(o=new xI({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(s=!0,a=typeof c=="string"?c:c.outerHTML,null)}]}})}));const l=th.fromSchema(o),u=n.slice?l.parseSlice(U_(t),n.parseOptions).content:l.parse(U_(t),n.parseOptions);if(n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)});return u}return k1("",e,n)}function Gce(t,e,n){const r=t.steps.length-1;if(r{s===0&&(s=c)}),t.setSelection(pt.near(t.doc.resolve(s),n))}const Zce=t=>!("type"in t),Yce=(t,e,n)=>({tr:r,dispatch:i,editor:o})=>{var s;if(i){n={parseOptions:{},updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let a;try{a=k1(e,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:(s=n.errorOnInvalidContent)!==null&&s!==void 0?s:o.options.enableContentCheck})}catch{return!1}let{from:l,to:u}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},c=!0,f=!0;if((Zce(a)?a:[a]).forEach(p=>{p.check(),c=c?p.isText&&p.marks.length===0:!1,f=f?p.isBlock:!1}),l===u&&f){const{parent:p}=r.doc.resolve(l);p.isTextblock&&!p.type.spec.code&&!p.childCount&&(l-=1,u+=1)}let h;c?(Array.isArray(e)?h=e.map(p=>p.text||"").join(""):typeof e=="object"&&e&&e.text?h=e.text:h=e,r.insertText(h,l,u)):(h=a,r.replaceWith(l,u,h)),n.updateSelection&&Gce(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:l,text:h}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:l,text:h})}return!0},Qce=()=>({state:t,dispatch:e})=>rce(t,e),Xce=()=>({state:t,dispatch:e})=>ice(t,e),efe=()=>({state:t,dispatch:e})=>Yue(t,e),tfe=()=>({state:t,dispatch:e})=>tce(t,e),nfe=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Wg(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},rfe=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Wg(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},ife=()=>({state:t,dispatch:e})=>Que(t,e),ofe=()=>({state:t,dispatch:e})=>Xue(t,e);function HI(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function sfe(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,i,o,s;for(let a=0;a({editor:e,view:n,tr:r,dispatch:i})=>{const o=sfe(t).split(/-(?!$)/),s=o.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),a=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{n.someProp("handleKeyDown",u=>u(n,a))});return l==null||l.steps.forEach(u=>{const c=u.map(r.mapping);c&&i&&r.maybeStep(c)}),!0};function SE(t,e,n={}){const{from:r,to:i,empty:o}=t.selection,s=e?Wn(e,t.schema):null,a=[];t.doc.nodesBetween(r,i,(f,d)=>{if(f.isText)return;const h=Math.max(r,d),p=Math.min(i,d+f.nodeSize);a.push({node:f,from:h,to:p})});const l=i-r,u=a.filter(f=>s?s.name===f.node.type.name:!0).filter(f=>w1(f.node.attrs,n,{strict:!1}));return o?!!u.length:u.reduce((f,d)=>f+d.to-d.from,0)>=l}const lfe=(t,e={})=>({state:n,dispatch:r})=>{const i=Wn(t,n.schema);return SE(n,i,e)?oce(n,r):!1},ufe=()=>({state:t,dispatch:e})=>uce(t,e),cfe=t=>({state:e,dispatch:n})=>{const r=Wn(t,e.schema);return yce(r)(e,n)},ffe=()=>({state:t,dispatch:e})=>sce(t,e);function WI(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function V_(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,i)=>(n.includes(i)||(r[i]=t[i]),r),{})}const dfe=(t,e)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=WI(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(o=Wn(t,r.schema)),a==="mark"&&(s=Na(t,r.schema)),i&&n.selection.ranges.forEach(l=>{r.doc.nodesBetween(l.$from.pos,l.$to.pos,(u,c)=>{o&&o===u.type&&n.setNodeMarkup(c,void 0,V_(u.attrs,e)),s&&u.marks.length&&u.marks.forEach(f=>{s===f.type&&n.addMark(c,c+u.nodeSize,s.create(V_(f.attrs,e)))})})}),!0):!1},hfe=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),pfe=()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size}),mfe=()=>({state:t,dispatch:e})=>ece(t,e),gfe=()=>({state:t,dispatch:e})=>nce(t,e),yfe=()=>({state:t,dispatch:e})=>cce(t,e),bfe=()=>({state:t,dispatch:e})=>hce(t,e),vfe=()=>({state:t,dispatch:e})=>dce(t,e);function wfe(t,e,n={},r={}){return k1(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const kfe=(t,e=!1,n={},r={})=>({editor:i,tr:o,dispatch:s,commands:a})=>{var l,u;const{doc:c}=o;if(n.preserveWhitespace!=="full"){const f=wfe(t,i.schema,n,{errorOnInvalidContent:(l=r.errorOnInvalidContent)!==null&&l!==void 0?l:i.options.enableContentCheck});return s&&o.replaceWith(0,c.content.size,f).setMeta("preventUpdate",!e),!0}return s&&o.setMeta("preventUpdate",!e),a.insertContentAt({from:0,to:c.content.size},t,{parseOptions:n,errorOnInvalidContent:(u=r.errorOnInvalidContent)!==null&&u!==void 0?u:i.options.enableContentCheck})};function xfe(t,e){const n=Na(e,t.schema),{from:r,to:i,empty:o}=t.selection,s=[];o?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,i,l=>{s.push(...l.marks)});const a=s.find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function Efe(t){for(let e=0;e0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function CE(t){return e=>Sfe(e.$from,t)}function JI(t,e){const n=yE.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function C0(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=t.find(o=>o.type===e&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function Cfe(t,e,n={}){const{empty:r,ranges:i}=t.selection,o=e?Na(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(f=>o?o.name===f.type.name:!0).find(f=>w1(f.attrs,n,{strict:!1}));let s=0;const a=[];if(i.forEach(({$from:f,$to:d})=>{const h=f.pos,p=d.pos;t.doc.nodesBetween(h,p,(m,b)=>{if(!m.isText&&!m.marks.length)return;const y=Math.max(h,b),v=Math.min(p,b+m.nodeSize),w=v-y;s+=w,a.push(...m.marks.map(g=>({mark:g,from:y,to:v})))})}),s===0)return!1;const l=a.filter(f=>o?o.name===f.mark.type.name:!0).filter(f=>w1(f.mark.attrs,n,{strict:!1})).reduce((f,d)=>f+d.to-d.from,0),u=a.filter(f=>o?f.mark.type!==o&&f.mark.type.excludes(o):!0).reduce((f,d)=>f+d.to-d.from,0);return(l>0?l+u:l)>=s}function H_(t,e){const{nodeExtensions:n}=xce(e),r=n.find(s=>s.name===t);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=Pr(rr(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function _fe(t,e,n){var r;const{selection:i}=e;let o=null;if(UI(i)&&(o=i.$cursor),o){const a=(r=t.storedMarks)!==null&&r!==void 0?r:o.marks();return!!n.isInSet(a)||!a.some(l=>l.type.excludes(n))}const{ranges:s}=i;return s.some(({$from:a,$to:l})=>{let u=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.pos,l.pos,(c,f,d)=>{if(u)return!1;if(c.isInline){const h=!d||d.type.allowsMarkType(n),p=!!n.isInSet(c.marks)||!c.marks.some(m=>m.type.excludes(n));u=h&&p}return!u}),u})}const Afe=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:s,ranges:a}=o,l=Na(t,r.schema);if(i)if(s){const u=xfe(r,l);n.addStoredMark(l.create({...u,...e}))}else a.forEach(u=>{const c=u.$from.pos,f=u.$to.pos;r.doc.nodesBetween(c,f,(d,h)=>{const p=Math.max(h,c),m=Math.min(h+d.nodeSize,f);d.marks.find(y=>y.type===l)?d.marks.forEach(y=>{l===y.type&&n.addMark(p,m,l.create({...y.attrs,...e}))}):n.addMark(p,m,l.create(e))})});return _fe(r,n,l)},Tfe=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),Mfe=(t,e={})=>({state:n,dispatch:r,chain:i})=>{const o=Wn(t,n.schema);return o.isTextblock?i().command(({commands:s})=>q_(o,e)(n)?!0:s.clearNodes()).command(({state:s})=>q_(o,e)(s,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},Ofe=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,i=ol(t,0,r.content.size),o=St.create(r,i);e.setSelection(o)}return!0},Dfe=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:i,to:o}=typeof t=="number"?{from:t,to:t}:t,s=Mt.atStart(r).from,a=Mt.atEnd(r).to,l=ol(i,s,a),u=ol(o,s,a),c=Mt.create(r,l,u);e.setSelection(c)}return!0},Nfe=t=>({state:e,dispatch:n})=>{const r=Wn(t,e.schema);return wce(r)(e,n)};function W_(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(i=>e==null?void 0:e.includes(i.type.name));t.tr.ensureMarks(r)}}const $fe=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{const{selection:o,doc:s}=e,{$from:a,$to:l}=o,u=i.extensionManager.attributes,c=C0(u,a.node().type.name,a.node().attrs);if(o instanceof St&&o.node.isBlock)return!a.parentOffset||!Vu(s,a.pos)?!1:(r&&(t&&W_(n,i.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;if(r){const f=l.parentOffset===l.parent.content.size;o instanceof Mt&&e.deleteSelection();const d=a.depth===0?void 0:Efe(a.node(-1).contentMatchAt(a.indexAfter(-1)));let h=f&&d?[{type:d,attrs:c}]:void 0,p=Vu(e.doc,e.mapping.map(a.pos),1,h);if(!h&&!p&&Vu(e.doc,e.mapping.map(a.pos),1,d?[{type:d}]:void 0)&&(p=!0,h=d?[{type:d,attrs:c}]:void 0),p&&(e.split(e.mapping.map(a.pos),1,h),d&&!f&&!a.parentOffset&&a.parent.type!==d)){const m=e.mapping.map(a.before()),b=e.doc.resolve(m);a.node(-1).canReplaceWith(b.index(),b.index()+1,d)&&e.setNodeMarkup(e.mapping.map(a.before()),d)}t&&W_(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},Ife=t=>({tr:e,state:n,dispatch:r,editor:i})=>{var o;const s=Wn(t,n.schema),{$from:a,$to:l}=n.selection,u=n.selection.node;if(u&&u.isBlock||a.depth<2||!a.sameParent(l))return!1;const c=a.node(-1);if(c.type!==s)return!1;const f=i.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==s||a.index(-2)!==a.node(-2).childCount-1)return!1;if(r){let b=ue.empty;const y=a.index(-1)?1:a.index(-2)?2:3;for(let E=a.depth-y;E>=a.depth-3;E-=1)b=ue.from(a.node(E).copy(b));const v=a.indexAfter(-1){if(k>-1)return!1;E.isTextblock&&E.content.size===0&&(k=D+1)}),k>-1&&e.setSelection(Mt.near(e.doc.resolve(k))),e.scrollIntoView()}return!0}const d=l.pos===a.end()?c.contentMatchAt(0).defaultType:null,h=C0(f,c.type.name,c.attrs),p=C0(f,a.node().type.name,a.node().attrs);e.delete(a.pos,l.pos);const m=d?[{type:s,attrs:h},{type:d,attrs:p}]:[{type:s,attrs:h}];if(!Vu(e.doc,a.pos,2))return!1;if(r){const{selection:b,storedMarks:y}=n,{splittableMarks:v}=i.extensionManager,w=y||b.$to.parentOffset&&b.$from.marks();if(e.split(a.pos,2,m).scrollIntoView(),!w||!r)return!0;const g=w.filter(x=>v.includes(x.type.name));e.ensureMarks(g)}return!0},o2=(t,e)=>{const n=CE(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&Pl(t.doc,n.pos)&&t.join(n.pos),!0},s2=(t,e)=>{const n=CE(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&Pl(t.doc,r)&&t.join(r),!0},Rfe=(t,e,n,r={})=>({editor:i,tr:o,state:s,dispatch:a,chain:l,commands:u,can:c})=>{const{extensions:f,splittableMarks:d}=i.extensionManager,h=Wn(t,s.schema),p=Wn(e,s.schema),{selection:m,storedMarks:b}=s,{$from:y,$to:v}=m,w=y.blockRange(v),g=b||m.$to.parentOffset&&m.$from.marks();if(!w)return!1;const x=CE(k=>H_(k.type.name,f))(m);if(w.depth>=1&&x&&w.depth-x.depth<=1){if(x.node.type===h)return u.liftListItem(p);if(H_(x.node.type.name,f)&&h.validContent(x.node.content)&&a)return l().command(()=>(o.setNodeMarkup(x.pos,h),!0)).command(()=>o2(o,h)).command(()=>s2(o,h)).run()}return!n||!g||!a?l().command(()=>c().wrapInList(h,r)?!0:u.clearNodes()).wrapInList(h,r).command(()=>o2(o,h)).command(()=>s2(o,h)).run():l().command(()=>{const k=c().wrapInList(h,r),E=g.filter(D=>d.includes(D.type.name));return o.ensureMarks(E),k?!0:u.clearNodes()}).wrapInList(h,r).command(()=>o2(o,h)).command(()=>s2(o,h)).run()},Ffe=(t,e={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,s=Na(t,r.schema);return Cfe(r,s,e)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,e)},Lfe=(t,e,n={})=>({state:r,commands:i})=>{const o=Wn(t,r.schema),s=Wn(e,r.schema);return SE(r,o,n)?i.setNode(s):i.setNode(o,n)},Bfe=(t,e={})=>({state:n,commands:r})=>{const i=Wn(t,n.schema);return SE(n,i,e)?r.lift(i):r.wrapIn(i,e)},Pfe=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r=0;l-=1)s.step(a.steps[l].invert(a.docs[l]));if(o.text){const l=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,t.schema.text(o.text,l))}else s.delete(o.from,o.to)}return!0}}return!1},zfe=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:i}=n;return r||e&&i.forEach(o=>{t.removeMark(o.$from.pos,o.$to.pos)}),!0},jfe=(t,e={})=>({tr:n,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:s=!1}=e,{selection:a}=n,l=Na(t,r.schema),{$from:u,empty:c,ranges:f}=a;if(!i)return!0;if(c&&s){let{from:d,to:h}=a;const p=(o=u.marks().find(b=>b.type===l))===null||o===void 0?void 0:o.attrs,m=qI(u,l,p);m&&(d=m.from,h=m.to),n.removeMark(d,h,l)}else f.forEach(d=>{n.removeMark(d.$from.pos,d.$to.pos,l)});return n.removeStoredMark(l),!0},qfe=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=WI(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(o=Wn(t,r.schema)),a==="mark"&&(s=Na(t,r.schema)),i&&n.selection.ranges.forEach(l=>{const u=l.$from.pos,c=l.$to.pos;r.doc.nodesBetween(u,c,(f,d)=>{o&&o===f.type&&n.setNodeMarkup(d,void 0,{...f.attrs,...e}),s&&f.marks.length&&f.marks.forEach(h=>{if(s===h.type){const p=Math.max(d,u),m=Math.min(d+f.nodeSize,c);n.addMark(p,m,s.create({...h.attrs,...e}))}})})}),!0):!1},Ufe=(t,e={})=>({state:n,dispatch:r})=>{const i=Wn(t,n.schema);return pce(i,e)(n,r)},Vfe=(t,e={})=>({state:n,dispatch:r})=>{const i=Wn(t,n.schema);return mce(i,e)(n,r)};var Hfe=Object.freeze({__proto__:null,blur:Oce,clearContent:Dce,clearNodes:Nce,command:$ce,createParagraphNear:Ice,cut:Rce,deleteCurrentNode:Fce,deleteNode:Lce,deleteRange:Bce,deleteSelection:Pce,enter:zce,exitCode:jce,extendMarkRange:Uce,first:Vce,focus:Wce,forEach:Jce,insertContent:Kce,insertContentAt:Yce,joinBackward:efe,joinDown:Xce,joinForward:tfe,joinItemBackward:nfe,joinItemForward:rfe,joinTextblockBackward:ife,joinTextblockForward:ofe,joinUp:Qce,keyboardShortcut:afe,lift:lfe,liftEmptyBlock:ufe,liftListItem:cfe,newlineInCode:ffe,resetAttributes:dfe,scrollIntoView:hfe,selectAll:pfe,selectNodeBackward:mfe,selectNodeForward:gfe,selectParentNode:yfe,selectTextblockEnd:bfe,selectTextblockStart:vfe,setContent:kfe,setMark:Afe,setMeta:Tfe,setNode:Mfe,setNodeSelection:Ofe,setTextSelection:Dfe,sinkListItem:Nfe,splitBlock:$fe,splitListItem:Ife,toggleList:Rfe,toggleMark:Ffe,toggleNode:Lfe,toggleWrap:Bfe,undoInputRule:Pfe,unsetAllMarks:zfe,unsetMark:jfe,updateAttributes:qfe,wrapIn:Ufe,wrapInList:Vfe});const Wfe=yi.create({name:"commands",addCommands(){return{...Hfe}}}),Jfe=yi.create({name:"editable",addProseMirrorPlugins(){return[new Uc({key:new Vc("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Kfe=yi.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new Uc({key:new Vc("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),Gfe=yi.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:a})=>{const{selection:l,doc:u}=a,{empty:c,$anchor:f}=l,{pos:d,parent:h}=f,p=f.parent.isTextblock&&d>0?a.doc.resolve(d-1):f,m=p.parent.type.spec.isolating,b=f.pos-f.parentOffset,y=m&&p.parent.childCount===1?b===f.pos:pt.atStart(u).from===d;return!c||!h.type.isTextblock||h.textContent.length||!y||y&&f.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return EE()||HI()?o:i},addProseMirrorPlugins(){return[new Uc({key:new Vc("clearDocument"),appendTransaction:(t,e,n)=>{if(!(t.some(p=>p.docChanged)&&!e.doc.eq(n.doc)))return;const{empty:i,from:o,to:s}=e.selection,a=pt.atStart(e.doc).from,l=pt.atEnd(e.doc).to;if(i||!(o===a&&s===l)||!(n.doc.textBetween(0,n.doc.content.size," "," ").length===0))return;const f=n.tr,d=jI({state:n,transaction:f}),{commands:h}=new kce({editor:this.editor,state:d});if(h.clearNodes(),!!f.steps.length)return f}})]}}),Zfe=yi.create({name:"tabindex",addProseMirrorPlugins(){return[new Uc({key:new Vc("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});var Yfe=Object.freeze({__proto__:null,ClipboardTextSerializer:Mce,Commands:Wfe,Editable:Jfe,FocusEvents:Kfe,Keymap:Gfe,Tabindex:Zfe});class Xo{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Pr(rr(this,"addOptions",{name:this.name}))),this.storage=Pr(rr(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Xo(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Kg(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Xo(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Pr(rr(n,"addOptions",{name:n.name})),n.storage=Pr(rr(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const s=i.marks();if(!!!s.find(u=>(u==null?void 0:u.type.name)===n.name))return!1;const l=s.find(u=>(u==null?void 0:u.type.name)===n.name);return l&&r.removeStoredMark(l),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}}let bn=class uk{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Pr(rr(this,"addOptions",{name:this.name}))),this.storage=Pr(rr(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new uk(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Kg(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new uk(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Pr(rr(n,"addOptions",{name:n.name})),n.storage=Pr(rr(n,"addStorage",{name:n.name,options:n.options})),n}};const J_={};function Qfe(t){let e=J_[t];if(e)return e;e=J_[t]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);e.push(r)}for(let n=0;n=55296&&c<=57343?i+="���":i+=String.fromCharCode(c),o+=6;continue}}if((a&248)===240&&o+91114111?i+="����":(f-=65536,i+=String.fromCharCode(55296+(f>>10),56320+(f&1023))),o+=9;continue}}i+="�"}return i})}Cc.defaultChars=";/?:@&=+$,#";Cc.componentChars="";const K_={};function Xfe(t){let e=K_[t];if(e)return e;e=K_[t]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);/^[0-9a-z]$/i.test(r)?e.push(r):e.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n"u"&&(n=!0);const r=Xfe(e);let i="";for(let o=0,s=t.length;o=55296&&a<=57343){if(a>=55296&&a<=56319&&o+1=56320&&l<=57343){i+=encodeURIComponent(t[o]+t[o+1]),o++;continue}}i+="%EF%BF%BD";continue}i+=encodeURIComponent(t[o])}return i}Nh.defaultChars=";/?:@&=+$,-_.!~*'()#";Nh.componentChars="-_.!~*'()";function _E(t){let e="";return e+=t.protocol||"",e+=t.slashes?"//":"",e+=t.auth?t.auth+"@":"",t.hostname&&t.hostname.indexOf(":")!==-1?e+="["+t.hostname+"]":e+=t.hostname||"",e+=t.port?":"+t.port:"",e+=t.pathname||"",e+=t.search||"",e+=t.hash||"",e}function x1(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const ede=/^([a-z0-9.+-]+:)/i,tde=/:[0-9]*$/,nde=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,rde=["<",">",'"',"`"," ","\r",` +`," "],ide=["{","}","|","\\","^","`"].concat(rde),ode=["'"].concat(ide),G_=["%","/","?",";","#"].concat(ode),Z_=["/","?","#"],sde=255,Y_=/^[+a-z0-9A-Z_-]{0,63}$/,ade=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Q_={javascript:!0,"javascript:":!0},X_={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function AE(t,e){if(t&&t instanceof x1)return t;const n=new x1;return n.parse(t,e),n}x1.prototype.parse=function(t,e){let n,r,i,o=t;if(o=o.trim(),!e&&t.split("#").length===1){const u=nde.exec(o);if(u)return this.pathname=u[1],u[2]&&(this.search=u[2]),this}let s=ede.exec(o);if(s&&(s=s[0],n=s.toLowerCase(),this.protocol=s,o=o.substr(s.length)),(e||s||o.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i=o.substr(0,2)==="//",i&&!(s&&Q_[s])&&(o=o.substr(2),this.slashes=!0)),!Q_[s]&&(i||s&&!X_[s])){let u=-1;for(let p=0;p127?v+="x":v+=y[w];if(!v.match(Y_)){const w=p.slice(0,m),g=p.slice(m+1),x=y.match(ade);x&&(w.push(x[1]),g.unshift(x[2])),g.length&&(o=g.join(".")+o),this.hostname=w.join(".");break}}}}this.hostname.length>sde&&(this.hostname=""),h&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const a=o.indexOf("#");a!==-1&&(this.hash=o.substr(a),o=o.slice(0,a));const l=o.indexOf("?");return l!==-1&&(this.search=o.substr(l),o=o.slice(0,l)),o&&(this.pathname=o),X_[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};x1.prototype.parseHost=function(t){let e=tde.exec(t);e&&(e=e[0],e!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};const lde=Object.freeze(Object.defineProperty({__proto__:null,decode:Cc,encode:Nh,format:_E,parse:AE},Symbol.toStringTag,{value:"Module"})),KI=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,GI=/[\0-\x1F\x7F-\x9F]/,ude=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,TE=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,ZI=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,YI=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,cde=Object.freeze(Object.defineProperty({__proto__:null,Any:KI,Cc:GI,Cf:ude,P:TE,S:ZI,Z:YI},Symbol.toStringTag,{value:"Module"})),fde=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(t=>t.charCodeAt(0))),dde=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(t=>t.charCodeAt(0)));var a2;const hde=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),pde=(a2=String.fromCodePoint)!==null&&a2!==void 0?a2:function(t){let e="";return t>65535&&(t-=65536,e+=String.fromCharCode(t>>>10&1023|55296),t=56320|t&1023),e+=String.fromCharCode(t),e};function mde(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=hde.get(t))!==null&&e!==void 0?e:t}var fn;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(fn||(fn={}));const gde=32;var Ks;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(Ks||(Ks={}));function ck(t){return t>=fn.ZERO&&t<=fn.NINE}function yde(t){return t>=fn.UPPER_A&&t<=fn.UPPER_F||t>=fn.LOWER_A&&t<=fn.LOWER_F}function bde(t){return t>=fn.UPPER_A&&t<=fn.UPPER_Z||t>=fn.LOWER_A&&t<=fn.LOWER_Z||ck(t)}function vde(t){return t===fn.EQUALS||bde(t)}var sn;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(sn||(sn={}));var zs;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(zs||(zs={}));class wde{constructor(e,n,r){this.decodeTree=e,this.emitCodePoint=n,this.errors=r,this.state=sn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=zs.Strict}startEntity(e){this.decodeMode=e,this.state=sn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case sn.EntityStart:return e.charCodeAt(n)===fn.NUM?(this.state=sn.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=sn.NamedEntity,this.stateNamedEntity(e,n));case sn.NumericStart:return this.stateNumericStart(e,n);case sn.NumericDecimal:return this.stateNumericDecimal(e,n);case sn.NumericHex:return this.stateNumericHex(e,n);case sn.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|gde)===fn.LOWER_X?(this.state=sn.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=sn.NumericDecimal,this.stateNumericDecimal(e,n))}addToNumericResult(e,n,r,i){if(n!==r){const o=r-n;this.result=this.result*Math.pow(i,o)+parseInt(e.substr(n,o),i),this.consumed+=o}}stateNumericHex(e,n){const r=n;for(;n>14;for(;n>14,o!==0){if(s===fn.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==zs.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:n,decodeTree:r}=this,i=(r[n]&Ks.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[e]&~Ks.VALUE_LENGTH:i[e+1],r),n===3&&this.emitCodePoint(i[e+2],r),r}end(){var e;switch(this.state){case sn.NamedEntity:return this.result!==0&&(this.decodeMode!==zs.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case sn.NumericDecimal:return this.emitNumericEntity(0,2);case sn.NumericHex:return this.emitNumericEntity(0,3);case sn.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case sn.EntityStart:return 0}}}function QI(t){let e="";const n=new wde(t,r=>e+=pde(r));return function(i,o){let s=0,a=0;for(;(a=i.indexOf("&",a))>=0;){e+=i.slice(s,a),n.startEntity(o);const u=n.write(i,a+1);if(u<0){s=a+n.end();break}s=a+u,a=u===0?s+1:s}const l=e+i.slice(s);return e="",l}}function kde(t,e,n,r){const i=(e&Ks.BRANCH_LENGTH)>>7,o=e&Ks.JUMP_TABLE;if(i===0)return o!==0&&r===o?n:-1;if(o){const l=r-o;return l<0||l>=i?-1:t[n+l]-1}let s=n,a=s+i-1;for(;s<=a;){const l=s+a>>>1,u=t[l];if(ur)a=l-1;else return t[l+i]}return-1}const xde=QI(fde);QI(dde);function XI(t,e=zs.Legacy){return xde(t,e)}function Ede(t){return Object.prototype.toString.call(t)}function ME(t){return Ede(t)==="[object String]"}const Sde=Object.prototype.hasOwnProperty;function Cde(t,e){return Sde.call(t,e)}function Gg(t){return Array.prototype.slice.call(arguments,1).forEach(function(n){if(n){if(typeof n!="object")throw new TypeError(n+"must be object");Object.keys(n).forEach(function(r){t[r]=n[r]})}}),t}function e7(t,e,n){return[].concat(t.slice(0,e),n,t.slice(e+1))}function OE(t){return!(t>=55296&&t<=57343||t>=64976&&t<=65007||(t&65535)===65535||(t&65535)===65534||t>=0&&t<=8||t===11||t>=14&&t<=31||t>=127&&t<=159||t>1114111)}function E1(t){if(t>65535){t-=65536;const e=55296+(t>>10),n=56320+(t&1023);return String.fromCharCode(e,n)}return String.fromCharCode(t)}const t7=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,_de=/&([a-z#][a-z0-9]{1,31});/gi,Ade=new RegExp(t7.source+"|"+_de.source,"gi"),Tde=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Mde(t,e){if(e.charCodeAt(0)===35&&Tde.test(e)){const r=e[1].toLowerCase()==="x"?parseInt(e.slice(2),16):parseInt(e.slice(1),10);return OE(r)?E1(r):t}const n=XI(t);return n!==t?n:t}function Ode(t){return t.indexOf("\\")<0?t:t.replace(t7,"$1")}function _c(t){return t.indexOf("\\")<0&&t.indexOf("&")<0?t:t.replace(Ade,function(e,n,r){return n||Mde(e,r)})}const Dde=/[&<>"]/,Nde=/[&<>"]/g,$de={"&":"&","<":"<",">":">",'"':"""};function Ide(t){return $de[t]}function ga(t){return Dde.test(t)?t.replace(Nde,Ide):t}const Rde=/[.?*+^$[\]\\(){}|-]/g;function Fde(t){return t.replace(Rde,"\\$&")}function kt(t){switch(t){case 9:case 32:return!0}return!1}function ih(t){if(t>=8192&&t<=8202)return!0;switch(t){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function oh(t){return TE.test(t)||ZI.test(t)}function sh(t){switch(t){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function Zg(t){return t=t.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(t=t.replace(/ẞ/g,"ß")),t.toLowerCase().toUpperCase()}const Lde={mdurl:lde,ucmicro:cde},Bde=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:e7,assign:Gg,escapeHtml:ga,escapeRE:Fde,fromCodePoint:E1,has:Cde,isMdAsciiPunct:sh,isPunctChar:oh,isSpace:kt,isString:ME,isValidEntityCode:OE,isWhiteSpace:ih,lib:Lde,normalizeReference:Zg,unescapeAll:_c,unescapeMd:Ode},Symbol.toStringTag,{value:"Module"}));function Pde(t,e,n){let r,i,o,s;const a=t.posMax,l=t.pos;for(t.pos=e+1,r=1;t.pos32))return o;if(r===41){if(s===0)break;s--}i++}return e===i||s!==0||(o.str=_c(t.slice(e,i)),o.pos=i,o.ok=!0),o}function jde(t,e,n,r){let i,o=e;const s={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(r)s.str=r.str,s.marker=r.marker;else{if(o>=n)return s;let a=t.charCodeAt(o);if(a!==34&&a!==39&&a!==40)return s;e++,o++,a===40&&(a=41),s.marker=a}for(;o"+ga(o.content)+""};_o.code_block=function(t,e,n,r,i){const o=t[e];return""+ga(t[e].content)+` `};_o.fence=function(t,e,n,r,i){const o=t[e],s=o.info?_c(o.info).trim():"";let a="",l="";if(s){const c=s.split(/(\s+)/g);a=c[0],l=c.slice(2).join("")}let u;if(n.highlight?u=n.highlight(o.content,a,l)||ga(o.content):u=ga(o.content),u.indexOf("${u} `}return`
${u}
@@ -261,31 +261,31 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `};_o.text=function(t,e){return ga(t[e].content)};_o.html_block=function(t,e){return t[e].content};_o.html_inline=function(t,e){return t[e].content};function Hc(){this.rules=Gg({},_o)}Hc.prototype.renderAttrs=function(e){let n,r,i;if(!e.attrs)return"";for(i="",n=0,r=e.attrs.length;n `:">",o};Hc.prototype.renderInline=function(t,e,n){let r="";const i=this.rules;for(let o=0,s=t.length;o=0&&(r=this.attrs[n][1]),r};zi.prototype.attrJoin=function(e,n){const r=this.attrIndex(e);r<0?this.attrPush([e,n]):this.attrs[r][1]=this.attrs[r][1]+" "+n};function n7(t,e,n){this.src=t,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=e}n7.prototype.Token=zi;const Pde=/\r\n?|\n/g,zde=/\0/g;function jde(t){let e;e=t.src.replace(Pde,` -`),e=e.replace(zde,"�"),t.src=e}function qde(t){let e;t.inlineMode?(e=new t.Token("inline","",0),e.content=t.src,e.map=[0,1],e.children=[],t.tokens.push(e)):t.md.block.parse(t.src,t.md,t.env,t.tokens)}function Vde(t){const e=t.tokens;for(let n=0,r=e.length;n\s]/i.test(t)}function Hde(t){return/^<\/a\s*>/i.test(t)}function Wde(t){const e=t.tokens;if(t.md.options.linkify)for(let n=0,r=e.length;n=0;s--){const a=i[s];if(a.type==="link_close"){for(s--;i[s].level!==a.level&&i[s].type!=="link_open";)s--;continue}if(a.type==="html_inline"&&(Ude(a.content)&&o>0&&o--,Hde(a.content)&&o++),!(o>0)&&a.type==="text"&&t.md.linkify.test(a.content)){const l=a.content;let u=t.md.linkify.match(l);const c=[];let f=a.level,d=0;u.length>0&&u[0].index===0&&s>0&&i[s-1].type==="text_special"&&(u=u.slice(1));for(let h=0;hd){const x=new t.Token("text","",0);x.content=l.slice(d,y),x.level=f,c.push(x)}const v=new t.Token("link_open","a",1);v.attrs=[["href",m]],v.level=f++,v.markup="linkify",v.info="auto",c.push(v);const w=new t.Token("text","",0);w.content=b,w.level=f,c.push(w);const g=new t.Token("link_close","a",-1);g.level=--f,g.markup="linkify",g.info="auto",c.push(g),d=u[h].lastIndex}if(d=0;n--){const r=t[n];r.type==="text"&&!e&&(r.content=r.content.replace(Kde,Zde)),r.type==="link_open"&&r.info==="auto"&&e--,r.type==="link_close"&&r.info==="auto"&&e++}}function Qde(t){let e=0;for(let n=t.length-1;n>=0;n--){const r=t[n];r.type==="text"&&!e&&r7.test(r.content)&&(r.content=r.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),r.type==="link_open"&&r.info==="auto"&&e--,r.type==="link_close"&&r.info==="auto"&&e++}}function Xde(t){let e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)t.tokens[e].type==="inline"&&(Jde.test(t.tokens[e].content)&&Yde(t.tokens[e].children),r7.test(t.tokens[e].content)&&Qde(t.tokens[e].children))}const ehe=/['"]/,eA=/['"]/g,tA="’";function Ip(t,e,n){return t.slice(0,e)+n+t.slice(e+1)}function the(t,e){let n;const r=[];for(let i=0;i=0&&!(r[n].level<=s);n--);if(r.length=n+1,o.type!=="text")continue;let a=o.content,l=0,u=a.length;e:for(;l=0)p=a.charCodeAt(c.index-1);else for(n=i-1;n>=0&&!(t[n].type==="softbreak"||t[n].type==="hardbreak");n--)if(t[n].content){p=t[n].content.charCodeAt(t[n].content.length-1);break}let m=32;if(l=48&&p<=57&&(d=f=!1),f&&d&&(f=b,d=y),!f&&!d){h&&(o.content=Ip(o.content,c.index,tA));continue}if(d)for(n=r.length-1;n>=0;n--){let g=r[n];if(r[n].level=0;e--)t.tokens[e].type!=="inline"||!ehe.test(t.tokens[e].content)||the(t.tokens[e].children,t)}function rhe(t){let e,n;const r=t.tokens,i=r.length;for(let o=0;o0&&this.level++,this.tokens.push(r),r};Ao.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]};Ao.prototype.skipEmptyLines=function(e){for(let n=this.lineMax;en;)if(!kt(this.src.charCodeAt(--e)))return e+1;return e};Ao.prototype.skipChars=function(e,n){for(let r=this.src.length;er;)if(n!==this.src.charCodeAt(--e))return e+1;return e};Ao.prototype.getLines=function(e,n,r,i){if(e>=n)return"";const o=new Array(n-e);for(let s=0,a=e;ar?o[s]=new Array(l-r+1).join(" ")+this.src.slice(c,f):o[s]=this.src.slice(c,f)}return o.join("")};Ao.prototype.Token=zi;const ihe=65536;function u2(t,e){const n=t.bMarks[e]+t.tShift[e],r=t.eMarks[e];return t.src.slice(n,r)}function nA(t){const e=[],n=t.length;let r=0,i=t.charCodeAt(r),o=!1,s=0,a="";for(;rn)return!1;let i=e+1;if(t.sCount[i]=4)return!1;let o=t.bMarks[i]+t.tShift[i];if(o>=t.eMarks[i])return!1;const s=t.src.charCodeAt(o++);if(s!==124&&s!==45&&s!==58||o>=t.eMarks[i])return!1;const a=t.src.charCodeAt(o++);if(a!==124&&a!==45&&a!==58&&!kt(a)||s===45&&kt(a))return!1;for(;o=4)return!1;u=nA(l),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop();const f=u.length;if(f===0||f!==c.length)return!1;if(r)return!0;const d=t.parentType;t.parentType="table";const h=t.md.block.ruler.getRules("blockquote"),p=t.push("table_open","table",1),m=[e,0];p.map=m;const b=t.push("thead_open","thead",1);b.map=[e,e+1];const y=t.push("tr_open","tr",1);y.map=[e,e+1];for(let g=0;g=4||(u=nA(l),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop(),w+=f-u.length,w>ihe))break;if(i===e+2){const k=t.push("tbody_open","tbody",1);k.map=v=[e+2,0]}const x=t.push("tr_open","tr",1);x.map=[i,i+1];for(let k=0;k=4){r++,i=r;continue}break}t.line=i;const o=t.push("code_block","code",0);return o.content=t.getLines(e,i,4+t.blkIndent,!1)+` -`,o.map=[e,t.line],!0}function ahe(t,e,n,r){let i=t.bMarks[e]+t.tShift[e],o=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||i+3>o)return!1;const s=t.src.charCodeAt(i);if(s!==126&&s!==96)return!1;let a=i;i=t.skipChars(i,s);let l=i-a;if(l<3)return!1;const u=t.src.slice(a,i),c=t.src.slice(i,o);if(s===96&&c.indexOf(String.fromCharCode(s))>=0)return!1;if(r)return!0;let f=e,d=!1;for(;f++,!(f>=n||(i=a=t.bMarks[f]+t.tShift[f],o=t.eMarks[f],i=4)&&(i=t.skipChars(i,s),!(i-a=4||t.src.charCodeAt(i)!==62)return!1;if(r)return!0;const a=[],l=[],u=[],c=[],f=t.md.block.ruler.getRules("blockquote"),d=t.parentType;t.parentType="blockquote";let h=!1,p;for(p=e;p=o)break;if(t.src.charCodeAt(i++)===62&&!w){let x=t.sCount[p]+1,k,E;t.src.charCodeAt(i)===32?(i++,x++,E=!1,k=!0):t.src.charCodeAt(i)===9?(k=!0,(t.bsCount[p]+x)%4===3?(i++,x++,E=!1):E=!0):k=!1;let D=x;for(a.push(t.bMarks[p]),t.bMarks[p]=i;i=o,l.push(t.bsCount[p]),t.bsCount[p]=t.sCount[p]+1+(k?1:0),u.push(t.sCount[p]),t.sCount[p]=D-x,c.push(t.tShift[p]),t.tShift[p]=i-t.bMarks[p];continue}if(h)break;let g=!1;for(let x=0,k=f.length;x";const y=[e,0];b.map=y,t.md.block.tokenize(t,e,p);const v=t.push("blockquote_close","blockquote",-1);v.markup=">",t.lineMax=s,t.parentType=d,y[1]=t.line;for(let w=0;w=4)return!1;let o=t.bMarks[e]+t.tShift[e];const s=t.src.charCodeAt(o++);if(s!==42&&s!==45&&s!==95)return!1;let a=1;for(;o=r)return-1;let o=t.src.charCodeAt(i++);if(o<48||o>57)return-1;for(;;){if(i>=r)return-1;if(o=t.src.charCodeAt(i++),o>=48&&o<=57){if(i-n>=10)return-1;continue}if(o===41||o===46)break;return-1}return i=4||t.listIndent>=0&&t.sCount[l]-t.listIndent>=4&&t.sCount[l]=t.blkIndent&&(c=!0);let f,d,h;if((h=iA(t,l))>=0){if(f=!0,s=t.bMarks[l]+t.tShift[l],d=Number(t.src.slice(s,h-1)),c&&d!==1)return!1}else if((h=rA(t,l))>=0)f=!1;else return!1;if(c&&t.skipSpaces(h)>=t.eMarks[l])return!1;if(r)return!0;const p=t.src.charCodeAt(h-1),m=t.tokens.length;f?(a=t.push("ordered_list_open","ol",1),d!==1&&(a.attrs=[["start",d]])):a=t.push("bullet_list_open","ul",1);const b=[l,0];a.map=b,a.markup=String.fromCharCode(p);let y=!1;const v=t.md.block.ruler.getRules("list"),w=t.parentType;for(t.parentType="list";l=i?E=1:E=x-g,E>4&&(E=1);const D=g+E;a=t.push("list_item_open","li",1),a.markup=String.fromCharCode(p);const O=[l,0];a.map=O,f&&(a.info=t.src.slice(s,h-1));const N=t.tight,C=t.tShift[l],R=t.sCount[l],T=t.listIndent;if(t.listIndent=t.blkIndent,t.blkIndent=D,t.tight=!0,t.tShift[l]=k-t.bMarks[l],t.sCount[l]=x,k>=i&&t.isEmpty(l+1)?t.line=Math.min(t.line+2,n):t.md.block.tokenize(t,l,n,!0),(!t.tight||y)&&(u=!1),y=t.line-l>1&&t.isEmpty(t.line-1),t.blkIndent=t.listIndent,t.listIndent=T,t.tShift[l]=C,t.sCount[l]=R,t.tight=N,a=t.push("list_item_close","li",-1),a.markup=String.fromCharCode(p),l=t.line,O[1]=l,l>=n||t.sCount[l]=4)break;let q=!1;for(let A=0,S=v.length;A=4||t.src.charCodeAt(i)!==91)return!1;function a(v){const w=t.lineMax;if(v>=w||t.isEmpty(v))return null;let g=!1;if(t.sCount[v]-t.blkIndent>3&&(g=!0),t.sCount[v]<0&&(g=!0),!g){const E=t.md.block.ruler.getRules("reference"),D=t.parentType;t.parentType="reference";let O=!1;for(let N=0,C=E.length;N"u"&&(t.env.references={}),typeof t.env.references[y]>"u"&&(t.env.references[y]={title:b,href:f}),t.line=s),!0):!1}const hhe=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],phe="[a-zA-Z_:][a-zA-Z0-9:._-]*",mhe="[^\"'=<>`\\x00-\\x20]+",ghe="'[^']*'",yhe='"[^"]*"',bhe="(?:"+mhe+"|"+ghe+"|"+yhe+")",vhe="(?:\\s+"+phe+"(?:\\s*=\\s*"+bhe+")?)",i7="<[A-Za-z][A-Za-z0-9\\-]*"+vhe+"*\\s*\\/?>",o7="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",whe="",khe="<[?][\\s\\S]*?[?]>",xhe="]*>",Ehe="",She=new RegExp("^(?:"+i7+"|"+o7+"|"+whe+"|"+khe+"|"+xhe+"|"+Ehe+")"),Che=new RegExp("^(?:"+i7+"|"+o7+")"),eu=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(Che.source+"\\s*$"),/^$/,!1]];function _he(t,e,n,r){let i=t.bMarks[e]+t.tShift[e],o=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||!t.md.options.html||t.src.charCodeAt(i)!==60)return!1;let s=t.src.slice(i,o),a=0;for(;a=4)return!1;let s=t.src.charCodeAt(i);if(s!==35||i>=o)return!1;let a=1;for(s=t.src.charCodeAt(++i);s===35&&i6||ii&&kt(t.src.charCodeAt(l-1))&&(o=l),t.line=e+1;const u=t.push("heading_open","h"+String(a),1);u.markup="########".slice(0,a),u.map=[e,t.line];const c=t.push("inline","",0);c.content=t.src.slice(i,o).trim(),c.map=[e,t.line],c.children=[];const f=t.push("heading_close","h"+String(a),-1);return f.markup="########".slice(0,a),!0}function The(t,e,n){const r=t.md.block.ruler.getRules("paragraph");if(t.sCount[e]-t.blkIndent>=4)return!1;const i=t.parentType;t.parentType="paragraph";let o=0,s,a=e+1;for(;a3)continue;if(t.sCount[a]>=t.blkIndent){let h=t.bMarks[a]+t.tShift[a];const p=t.eMarks[a];if(h=p))){o=s===61?1:2;break}}if(t.sCount[a]<0)continue;let d=!1;for(let h=0,p=r.length;h3||t.sCount[o]<0)continue;let u=!1;for(let c=0,f=r.length;c=n||t.sCount[s]=o){t.line=n;break}const l=t.line;let u=!1;for(let c=0;c=t.line)throw new Error("block rule didn't increment state.line");break}if(!u)throw new Error("none of the block rules matched");t.tight=!a,t.isEmpty(t.line-1)&&(a=!0),s=t.line,s0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(i),r};Nh.prototype.scanDelims=function(t,e){const n=this.posMax,r=this.src.charCodeAt(t),i=t>0?this.src.charCodeAt(t-1):32;let o=t;for(;o0)return!1;const n=t.pos,r=t.posMax;if(n+3>r||t.src.charCodeAt(n)!==58||t.src.charCodeAt(n+1)!==47||t.src.charCodeAt(n+2)!==47)return!1;const i=t.pending.match(Nhe);if(!i)return!1;const o=i[1],s=t.md.linkify.matchAtStart(t.src.slice(n-o.length));if(!s)return!1;let a=s.url;if(a.length<=o.length)return!1;a=a.replace(/\*+$/,"");const l=t.md.normalizeLink(a);if(!t.md.validateLink(l))return!1;if(!e){t.pending=t.pending.slice(0,-o.length);const u=t.push("link_open","a",1);u.attrs=[["href",l]],u.markup="linkify",u.info="auto";const c=t.push("text","",0);c.content=t.md.normalizeLinkText(a);const f=t.push("link_close","a",-1);f.markup="linkify",f.info="auto"}return t.pos+=a.length-o.length,!0}function Ihe(t,e){let n=t.pos;if(t.src.charCodeAt(n)!==10)return!1;const r=t.pending.length-1,i=t.posMax;if(!e)if(r>=0&&t.pending.charCodeAt(r)===32)if(r>=1&&t.pending.charCodeAt(r-1)===32){let o=r-1;for(;o>=1&&t.pending.charCodeAt(o-1)===32;)o--;t.pending=t.pending.slice(0,o),t.push("hardbreak","br",0)}else t.pending=t.pending.slice(0,-1),t.push("softbreak","br",0);else t.push("softbreak","br",0);for(n++;n?@[]^_`{|}~-".split("").forEach(function(t){NE[t.charCodeAt(0)]=1});function Rhe(t,e){let n=t.pos;const r=t.posMax;if(t.src.charCodeAt(n)!==92||(n++,n>=r))return!1;let i=t.src.charCodeAt(n);if(i===10){for(e||t.push("hardbreak","br",0),n++;n=55296&&i<=56319&&n+1=56320&&a<=57343&&(o+=t.src[n+1],n++)}const s="\\"+o;if(!e){const a=t.push("text_special","",0);i<256&&NE[i]!==0?a.content=o:a.content=s,a.markup=s,a.info="escape"}return t.pos=n+1,!0}function Fhe(t,e){let n=t.pos;if(t.src.charCodeAt(n)!==96)return!1;const i=n;n++;const o=t.posMax;for(;n=0;r--){const i=e[r];if(i.marker!==95&&i.marker!==42||i.end===-1)continue;const o=e[i.end],s=r>0&&e[r-1].end===i.end+1&&e[r-1].marker===i.marker&&e[r-1].token===i.token-1&&e[i.end+1].token===o.token+1,a=String.fromCharCode(i.marker),l=t.tokens[i.token];l.type=s?"strong_open":"em_open",l.tag=s?"strong":"em",l.nesting=1,l.markup=s?a+a:a,l.content="";const u=t.tokens[o.token];u.type=s?"strong_close":"em_close",u.tag=s?"strong":"em",u.nesting=-1,u.markup=s?a+a:a,u.content="",s&&(t.tokens[e[r-1].token].content="",t.tokens[e[i.end+1].token].content="",r--)}}function zhe(t){const e=t.tokens_meta,n=t.tokens_meta.length;sA(t,t.delimiters);for(let r=0;r=f)return!1;if(l=p,i=t.md.helpers.parseLinkDestination(t.src,p,t.posMax),i.ok){for(s=t.md.normalizeLink(i.str),t.md.validateLink(s)?p=i.pos:s="",l=p;p=f||t.src.charCodeAt(p)!==41)&&(u=!0),p++}if(u){if(typeof t.env.references>"u")return!1;if(p=0?r=t.src.slice(l,p++):p=h+1):p=h+1,r||(r=t.src.slice(d,h)),o=t.env.references[Zg(r)],!o)return t.pos=c,!1;s=o.href,a=o.title}if(!e){t.pos=d,t.posMax=h;const m=t.push("link_open","a",1),b=[["href",s]];m.attrs=b,a&&b.push(["title",a]),t.linkLevel++,t.md.inline.tokenize(t),t.linkLevel--,t.push("link_close","a",-1)}return t.pos=p,t.posMax=f,!0}function qhe(t,e){let n,r,i,o,s,a,l,u,c="";const f=t.pos,d=t.posMax;if(t.src.charCodeAt(t.pos)!==33||t.src.charCodeAt(t.pos+1)!==91)return!1;const h=t.pos+2,p=t.md.helpers.parseLinkLabel(t,t.pos+1,!1);if(p<0)return!1;if(o=p+1,o=d)return!1;for(u=o,a=t.md.helpers.parseLinkDestination(t.src,o,t.posMax),a.ok&&(c=t.md.normalizeLink(a.str),t.md.validateLink(c)?o=a.pos:c=""),u=o;o=d||t.src.charCodeAt(o)!==41)return t.pos=f,!1;o++}else{if(typeof t.env.references>"u")return!1;if(o=0?i=t.src.slice(u,o++):o=p+1):o=p+1,i||(i=t.src.slice(h,p)),s=t.env.references[Zg(i)],!s)return t.pos=f,!1;c=s.href,l=s.title}if(!e){r=t.src.slice(h,p);const m=[];t.md.inline.parse(r,t.md,t.env,m);const b=t.push("image","img",0),y=[["src",c],["alt",""]];b.attrs=y,b.children=m,b.content=r,l&&y.push(["title",l])}return t.pos=o,t.posMax=d,!0}const Vhe=/^([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])?)*)$/,Uhe=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function Hhe(t,e){let n=t.pos;if(t.src.charCodeAt(n)!==60)return!1;const r=t.pos,i=t.posMax;for(;;){if(++n>=i)return!1;const s=t.src.charCodeAt(n);if(s===60)return!1;if(s===62)break}const o=t.src.slice(r+1,n);if(Uhe.test(o)){const s=t.md.normalizeLink(o);if(!t.md.validateLink(s))return!1;if(!e){const a=t.push("link_open","a",1);a.attrs=[["href",s]],a.markup="autolink",a.info="auto";const l=t.push("text","",0);l.content=t.md.normalizeLinkText(o);const u=t.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return t.pos+=o.length+2,!0}if(Vhe.test(o)){const s=t.md.normalizeLink("mailto:"+o);if(!t.md.validateLink(s))return!1;if(!e){const a=t.push("link_open","a",1);a.attrs=[["href",s]],a.markup="autolink",a.info="auto";const l=t.push("text","",0);l.content=t.md.normalizeLinkText(o);const u=t.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return t.pos+=o.length+2,!0}return!1}function Whe(t){return/^\s]/i.test(t)}function Jhe(t){return/^<\/a\s*>/i.test(t)}function Khe(t){const e=t|32;return e>=97&&e<=122}function Ghe(t,e){if(!t.md.options.html)return!1;const n=t.posMax,r=t.pos;if(t.src.charCodeAt(r)!==60||r+2>=n)return!1;const i=t.src.charCodeAt(r+1);if(i!==33&&i!==63&&i!==47&&!Khe(i))return!1;const o=t.src.slice(r).match(She);if(!o)return!1;if(!e){const s=t.push("html_inline","",0);s.content=o[0],Whe(s.content)&&t.linkLevel++,Jhe(s.content)&&t.linkLevel--}return t.pos+=o[0].length,!0}const Zhe=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,Yhe=/^&([a-z][a-z0-9]{1,31});/i;function Qhe(t,e){const n=t.pos,r=t.posMax;if(t.src.charCodeAt(n)!==38||n+1>=r)return!1;if(t.src.charCodeAt(n+1)===35){const o=t.src.slice(n).match(Zhe);if(o){if(!e){const s=o[1][0].toLowerCase()==="x"?parseInt(o[1].slice(1),16):parseInt(o[1],10),a=t.push("text_special","",0);a.content=OE(s)?E1(s):E1(65533),a.markup=o[0],a.info="entity"}return t.pos+=o[0].length,!0}}else{const o=t.src.slice(n).match(Yhe);if(o){const s=XI(o[0]);if(s!==o[0]){if(!e){const a=t.push("text_special","",0);a.content=s,a.markup=o[0],a.info="entity"}return t.pos+=o[0].length,!0}}}return!1}function aA(t){const e={},n=t.length;if(!n)return;let r=0,i=-2;const o=[];for(let s=0;sl;u-=o[u]+1){const f=t[u];if(f.marker===a.marker&&f.open&&f.end<0){let d=!1;if((f.close||a.open)&&(f.length+a.length)%3===0&&(f.length%3!==0||a.length%3!==0)&&(d=!0),!d){const h=u>0&&!t[u-1].open?o[u-1]+1:0;o[s]=s-u+h,o[u]=h,a.open=!1,f.end=s,f.close=!1,c=-1,i=-2;break}}}c!==-1&&(e[a.marker][(a.open?3:0)+(a.length||0)%3]=c)}}function Xhe(t){const e=t.tokens_meta,n=t.tokens_meta.length;aA(t.delimiters);for(let r=0;r0&&r++,i[e].type==="text"&&e+1=t.pos)throw new Error("inline rule didn't increment state.pos");break}}else t.pos=t.posMax;s||t.pos++,o[e]=t.pos};$h.prototype.tokenize=function(t){const e=this.ruler.getRules(""),n=e.length,r=t.posMax,i=t.md.options.maxNesting;for(;t.pos=t.pos)throw new Error("inline rule didn't increment state.pos");break}}if(s){if(t.pos>=r)break;continue}t.pending+=t.src[t.pos++]}t.pending&&t.pushPending()};$h.prototype.parse=function(t,e,n,r){const i=new this.State(t,e,n,r);this.tokenize(i);const o=this.ruler2.getRules(""),s=o.length;for(let a=0;a|$))",e.tpl_email_fuzzy="(^|"+n+'|"|\\(|'+e.src_ZCc+")("+e.src_email_name+"@"+e.tpl_host_fuzzy_strict+")",e.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_fuzzy_strict+e.src_path+")",e.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_no_ip_fuzzy_strict+e.src_path+")",e}function fk(t){return Array.prototype.slice.call(arguments,1).forEach(function(n){n&&Object.keys(n).forEach(function(r){t[r]=n[r]})}),t}function Qg(t){return Object.prototype.toString.call(t)}function npe(t){return Qg(t)==="[object String]"}function rpe(t){return Qg(t)==="[object Object]"}function ipe(t){return Qg(t)==="[object RegExp]"}function lA(t){return Qg(t)==="[object Function]"}function ope(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const l7={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function spe(t){return Object.keys(t||{}).reduce(function(e,n){return e||l7.hasOwnProperty(n)},!1)}const ape={"http:":{validate:function(t,e,n){const r=t.slice(e);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(t,e,n){const r=t.slice(e);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(r)?e>=3&&t[e-3]===":"||e>=3&&t[e-3]==="/"?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(t,e,n){const r=t.slice(e);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},lpe="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",upe="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function cpe(t){t.__index__=-1,t.__text_cache__=""}function fpe(t){return function(e,n){const r=e.slice(n);return t.test(r)?r.match(t)[0].length:0}}function uA(){return function(t,e){e.normalize(t)}}function S1(t){const e=t.re=tpe(t.__opts__),n=t.__tlds__.slice();t.onCompile(),t.__tlds_replaced__||n.push(lpe),n.push(e.src_xn),e.src_tlds=n.join("|");function r(a){return a.replace("%TLDS%",e.src_tlds)}e.email_fuzzy=RegExp(r(e.tpl_email_fuzzy),"i"),e.link_fuzzy=RegExp(r(e.tpl_link_fuzzy),"i"),e.link_no_ip_fuzzy=RegExp(r(e.tpl_link_no_ip_fuzzy),"i"),e.host_fuzzy_test=RegExp(r(e.tpl_host_fuzzy_test),"i");const i=[];t.__compiled__={};function o(a,l){throw new Error('(LinkifyIt) Invalid schema "'+a+'": '+l)}Object.keys(t.__schemas__).forEach(function(a){const l=t.__schemas__[a];if(l===null)return;const u={validate:null,link:null};if(t.__compiled__[a]=u,rpe(l)){ipe(l.validate)?u.validate=fpe(l.validate):lA(l.validate)?u.validate=l.validate:o(a,l),lA(l.normalize)?u.normalize=l.normalize:l.normalize?o(a,l):u.normalize=uA();return}if(npe(l)){i.push(a);return}o(a,l)}),i.forEach(function(a){t.__compiled__[t.__schemas__[a]]&&(t.__compiled__[a].validate=t.__compiled__[t.__schemas__[a]].validate,t.__compiled__[a].normalize=t.__compiled__[t.__schemas__[a]].normalize)}),t.__compiled__[""]={validate:null,normalize:uA()};const s=Object.keys(t.__compiled__).filter(function(a){return a.length>0&&t.__compiled__[a]}).map(ope).join("|");t.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+s+")","i"),t.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+s+")","ig"),t.re.schema_at_start=RegExp("^"+t.re.schema_search.source,"i"),t.re.pretest=RegExp("("+t.re.schema_test.source+")|("+t.re.host_fuzzy_test.source+")|@","i"),cpe(t)}function dpe(t,e){const n=t.__index__,r=t.__last_index__,i=t.__text_cache__.slice(n,r);this.schema=t.__schema__.toLowerCase(),this.index=n+e,this.lastIndex=r+e,this.raw=i,this.text=i,this.url=i}function dk(t,e){const n=new dpe(t,e);return t.__compiled__[n.schema].normalize(n,t),n}function Hr(t,e){if(!(this instanceof Hr))return new Hr(t,e);e||spe(t)&&(e=t,t={}),this.__opts__=fk({},l7,e),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=fk({},ape,t),this.__compiled__={},this.__tlds__=upe,this.__tlds_replaced__=!1,this.re={},S1(this)}Hr.prototype.add=function(e,n){return this.__schemas__[e]=n,S1(this),this};Hr.prototype.set=function(e){return this.__opts__=fk(this.__opts__,e),this};Hr.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;let n,r,i,o,s,a,l,u,c;if(this.re.schema_test.test(e)){for(l=this.re.schema_search,l.lastIndex=0;(n=l.exec(e))!==null;)if(o=this.testSchemaAt(e,n[2],l.lastIndex),o){this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+o;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(u=e.search(this.re.host_fuzzy_test),u>=0&&(this.__index__<0||u=0&&(i=e.match(this.re.email_fuzzy))!==null&&(s=i.index+i[1].length,a=i.index+i[0].length,(this.__index__<0||sthis.__last_index__)&&(this.__schema__="mailto:",this.__index__=s,this.__last_index__=a))),this.__index__>=0};Hr.prototype.pretest=function(e){return this.re.pretest.test(e)};Hr.prototype.testSchemaAt=function(e,n,r){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(e,r,this):0};Hr.prototype.match=function(e){const n=[];let r=0;this.__index__>=0&&this.__text_cache__===e&&(n.push(dk(this,r)),r=this.__last_index__);let i=r?e.slice(r):e;for(;this.test(i);)n.push(dk(this,r)),i=i.slice(this.__last_index__),r+=this.__last_index__;return n.length?n:null};Hr.prototype.matchAtStart=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return null;const n=this.re.schema_at_start.exec(e);if(!n)return null;const r=this.testSchemaAt(e,n[2],n[0].length);return r?(this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+r,dk(this,0)):null};Hr.prototype.tlds=function(e,n){return e=Array.isArray(e)?e:[e],n?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(r,i,o){return r!==o[i-1]}).reverse(),S1(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,S1(this),this)};Hr.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url="mailto:"+e.url)};Hr.prototype.onCompile=function(){};const Hu=2147483647,fo=36,$E=1,sh=26,hpe=38,ppe=700,u7=72,c7=128,f7="-",mpe=/^xn--/,gpe=/[^\0-\x7F]/,ype=/[\x2E\u3002\uFF0E\uFF61]/g,bpe={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d2=fo-$E,ho=Math.floor,h2=String.fromCharCode;function $s(t){throw new RangeError(bpe[t])}function vpe(t,e){const n=[];let r=t.length;for(;r--;)n[r]=e(t[r]);return n}function d7(t,e){const n=t.split("@");let r="";n.length>1&&(r=n[0]+"@",t=n[1]),t=t.replace(ype,".");const i=t.split("."),o=vpe(i,e).join(".");return r+o}function h7(t){const e=[];let n=0;const r=t.length;for(;n=55296&&i<=56319&&nString.fromCodePoint(...t),kpe=function(t){return t>=48&&t<58?26+(t-48):t>=65&&t<91?t-65:t>=97&&t<123?t-97:fo},cA=function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},p7=function(t,e,n){let r=0;for(t=n?ho(t/ppe):t>>1,t+=ho(t/e);t>d2*sh>>1;r+=fo)t=ho(t/d2);return ho(r+(d2+1)*t/(t+hpe))},m7=function(t){const e=[],n=t.length;let r=0,i=c7,o=u7,s=t.lastIndexOf(f7);s<0&&(s=0);for(let a=0;a=128&&$s("not-basic"),e.push(t.charCodeAt(a));for(let a=s>0?s+1:0;a=n&&$s("invalid-input");const d=kpe(t.charCodeAt(a++));d>=fo&&$s("invalid-input"),d>ho((Hu-r)/c)&&$s("overflow"),r+=d*c;const h=f<=o?$E:f>=o+sh?sh:f-o;if(dho(Hu/p)&&$s("overflow"),c*=p}const u=e.length+1;o=p7(r-l,u,l==0),ho(r/u)>Hu-i&&$s("overflow"),i+=ho(r/u),r%=u,e.splice(r++,0,i)}return String.fromCodePoint(...e)},g7=function(t){const e=[];t=h7(t);const n=t.length;let r=c7,i=0,o=u7;for(const l of t)l<128&&e.push(h2(l));const s=e.length;let a=s;for(s&&e.push(f7);a=r&&cho((Hu-i)/u)&&$s("overflow"),i+=(l-r)*u,r=l;for(const c of t)if(cHu&&$s("overflow"),c===r){let f=i;for(let d=fo;;d+=fo){const h=d<=o?$E:d>=o+sh?sh:d-o;if(f=0))try{e.hostname=y7.toASCII(e.hostname)}catch{}return Dh(_E(e))}function Npe(t){const e=AE(t,!0);if(e.hostname&&(!e.protocol||b7.indexOf(e.protocol)>=0))try{e.hostname=y7.toUnicode(e.hostname)}catch{}return Cc(_E(e),Cc.defaultChars+"%")}function Or(t,e){if(!(this instanceof Or))return new Or(t,e);e||ME(t)||(e=t||{},t="default"),this.inline=new $h,this.block=new Yg,this.core=new DE,this.renderer=new Hc,this.linkify=new Hr,this.validateLink=Ope,this.normalizeLink=Dpe,this.normalizeLinkText=Npe,this.utils=Ide,this.helpers=Gg({},Bde),this.options={},this.configure(t),e&&this.set(e)}Or.prototype.set=function(t){return Gg(this.options,t),this};Or.prototype.configure=function(t){const e=this;if(ME(t)){const n=t;if(t=Ape[n],!t)throw new Error('Wrong `markdown-it` preset "'+n+'", check name')}if(!t)throw new Error("Wrong `markdown-it` preset, can't be empty");return t.options&&e.set(t.options),t.components&&Object.keys(t.components).forEach(function(n){t.components[n].rules&&e[n].ruler.enableOnly(t.components[n].rules),t.components[n].rules2&&e[n].ruler2.enableOnly(t.components[n].rules2)}),this};Or.prototype.enable=function(t,e){let n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(i){n=n.concat(this[i].ruler.enable(t,!0))},this),n=n.concat(this.inline.ruler2.enable(t,!0));const r=t.filter(function(i){return n.indexOf(i)<0});if(r.length&&!e)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this};Or.prototype.disable=function(t,e){let n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(i){n=n.concat(this[i].ruler.disable(t,!0))},this),n=n.concat(this.inline.ruler2.disable(t,!0));const r=t.filter(function(i){return n.indexOf(i)<0});if(r.length&&!e)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this};Or.prototype.use=function(t){const e=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,e),this};Or.prototype.parse=function(t,e){if(typeof t!="string")throw new Error("Input data should be a String");const n=new this.core.State(t,this,e);return this.core.process(n),n.tokens};Or.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)};Or.prototype.parseInline=function(t,e){const n=new this.core.State(t,this,e);return n.inlineMode=!0,this.core.process(n),n.tokens};Or.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)};const $pe=new xI({nodes:{doc:{content:"block+"},paragraph:{content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM(){return["p",0]}},blockquote:{content:"block+",group:"block",parseDOM:[{tag:"blockquote"}],toDOM(){return["blockquote",0]}},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM(){return["div",["hr"]]}},heading:{attrs:{level:{default:1}},content:"(text | image)*",group:"block",defining:!0,parseDOM:[{tag:"h1",attrs:{level:1}},{tag:"h2",attrs:{level:2}},{tag:"h3",attrs:{level:3}},{tag:"h4",attrs:{level:4}},{tag:"h5",attrs:{level:5}},{tag:"h6",attrs:{level:6}}],toDOM(t){return["h"+t.attrs.level,0]}},code_block:{content:"text*",group:"block",code:!0,defining:!0,marks:"",attrs:{params:{default:""}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:t=>({params:t.getAttribute("data-params")||""})}],toDOM(t){return["pre",t.attrs.params?{"data-params":t.attrs.params}:{},["code",0]]}},ordered_list:{content:"list_item+",group:"block",attrs:{order:{default:1},tight:{default:!1}},parseDOM:[{tag:"ol",getAttrs(t){return{order:t.hasAttribute("start")?+t.getAttribute("start"):1,tight:t.hasAttribute("data-tight")}}}],toDOM(t){return["ol",{start:t.attrs.order==1?null:t.attrs.order,"data-tight":t.attrs.tight?"true":null},0]}},bullet_list:{content:"list_item+",group:"block",attrs:{tight:{default:!1}},parseDOM:[{tag:"ul",getAttrs:t=>({tight:t.hasAttribute("data-tight")})}],toDOM(t){return["ul",{"data-tight":t.attrs.tight?"true":null},0]}},list_item:{content:"block+",defining:!0,parseDOM:[{tag:"li"}],toDOM(){return["li",0]}},text:{group:"inline"},image:{inline:!0,attrs:{src:{},alt:{default:null},title:{default:null}},group:"inline",draggable:!0,parseDOM:[{tag:"img[src]",getAttrs(t){return{src:t.getAttribute("src"),title:t.getAttribute("title"),alt:t.getAttribute("alt")}}}],toDOM(t){return["img",t.attrs]}},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM(){return["br"]}}},marks:{em:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"},{style:"font-style=normal",clearMark:t=>t.type.name=="em"}],toDOM(){return["em"]}},strong:{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name=="strong"},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}],toDOM(){return["strong"]}},link:{attrs:{href:{},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs(t){return{href:t.getAttribute("href"),title:t.getAttribute("title")}}}],toDOM(t){return["a",t.attrs]}},code:{parseDOM:[{tag:"code"}],toDOM(){return["code"]}}}});function Ipe(t,e){if(t.isText&&e.isText&&yt.sameSet(t.marks,e.marks))return t.withText(t.text+e.text)}class Rpe{constructor(e,n){this.schema=e,this.tokenHandlers=n,this.stack=[{type:e.topNodeType,attrs:null,content:[],marks:yt.none}]}top(){return this.stack[this.stack.length-1]}push(e){this.stack.length&&this.top().content.push(e)}addText(e){if(!e)return;let n=this.top(),r=n.content,i=r[r.length-1],o=this.schema.text(e,n.marks),s;i&&(s=Ipe(i,o))?r[r.length-1]=s:r.push(o)}openMark(e){let n=this.top();n.marks=e.addToSet(n.marks)}closeMark(e){let n=this.top();n.marks=e.removeFromSet(n.marks)}parseTokens(e){for(let n=0;n{s.openNode(o,df(i,a,l,u)),s.addText(fA(a.content)),s.closeNode()}:(n[r+"_open"]=(s,a,l,u)=>s.openNode(o,df(i,a,l,u)),n[r+"_close"]=s=>s.closeNode())}else if(i.node){let o=t.nodeType(i.node);n[r]=(s,a,l,u)=>s.addNode(o,df(i,a,l,u))}else if(i.mark){let o=t.marks[i.mark];p2(i,r)?n[r]=(s,a,l,u)=>{s.openMark(o.create(df(i,a,l,u))),s.addText(fA(a.content)),s.closeMark(o)}:(n[r+"_open"]=(s,a,l,u)=>s.openMark(o.create(df(i,a,l,u))),n[r+"_close"]=s=>s.closeMark(o))}else if(i.ignore)p2(i,r)?n[r]=m2:(n[r+"_open"]=m2,n[r+"_close"]=m2);else throw new RangeError("Unrecognized parsing spec "+JSON.stringify(i))}return n.text=(r,i)=>r.addText(i.content),n.inline=(r,i)=>r.parseTokens(i.children),n.softbreak=n.softbreak||(r=>r.addText(" ")),n}let Lpe=class{constructor(e,n,r){this.schema=e,this.tokenizer=n,this.tokens=r,this.tokenHandlers=Fpe(e,r)}parse(e,n={}){let r=new Rpe(this.schema,this.tokenHandlers),i;r.parseTokens(this.tokenizer.parse(e,n));do i=r.closeNode();while(r.stack.length);return i||this.schema.topNodeType.createAndFill()}};function dA(t,e){for(;++e({tight:dA(e,n)})},ordered_list:{block:"ordered_list",getAttrs:(t,e,n)=>({order:+t.attrGet("start")||1,tight:dA(e,n)})},heading:{block:"heading",getAttrs:t=>({level:+t.tag.slice(1)})},code_block:{block:"code_block",noCloseToken:!0},fence:{block:"code_block",getAttrs:t=>({params:t.info||""}),noCloseToken:!0},hr:{node:"horizontal_rule"},image:{node:"image",getAttrs:t=>({src:t.attrGet("src"),title:t.attrGet("title")||null,alt:t.children[0]&&t.children[0].content||null})},hardbreak:{node:"hard_break"},em:{mark:"em"},strong:{mark:"strong"},link:{mark:"link",getAttrs:t=>({href:t.attrGet("href"),title:t.attrGet("title")||null})},code_inline:{mark:"code",noCloseToken:!0}});const Bpe={open:"",close:"",mixable:!0};let Ppe=class{constructor(e,n,r={}){this.nodes=e,this.marks=n,this.options=r}serialize(e,n={}){n=Object.assign({},this.options,n);let r=new v7(this.nodes,this.marks,n);return r.renderContent(e),r.out}};const To=new Ppe({blockquote(t,e){t.wrapBlock("> ",null,e,()=>t.renderContent(e))},code_block(t,e){const n=e.textContent.match(/`{3,}/gm),r=n?n.sort().slice(-1)[0]+"`":"```";t.write(r+(e.attrs.params||"")+` +`;break}return r};Hc.prototype.render=function(t,e,n){let r="";const i=this.rules;for(let o=0,s=t.length;o=0&&(r=this.attrs[n][1]),r};zi.prototype.attrJoin=function(e,n){const r=this.attrIndex(e);r<0?this.attrPush([e,n]):this.attrs[r][1]=this.attrs[r][1]+" "+n};function n7(t,e,n){this.src=t,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=e}n7.prototype.Token=zi;const Ude=/\r\n?|\n/g,Vde=/\0/g;function Hde(t){let e;e=t.src.replace(Ude,` +`),e=e.replace(Vde,"�"),t.src=e}function Wde(t){let e;t.inlineMode?(e=new t.Token("inline","",0),e.content=t.src,e.map=[0,1],e.children=[],t.tokens.push(e)):t.md.block.parse(t.src,t.md,t.env,t.tokens)}function Jde(t){const e=t.tokens;for(let n=0,r=e.length;n\s]/i.test(t)}function Gde(t){return/^<\/a\s*>/i.test(t)}function Zde(t){const e=t.tokens;if(t.md.options.linkify)for(let n=0,r=e.length;n=0;s--){const a=i[s];if(a.type==="link_close"){for(s--;i[s].level!==a.level&&i[s].type!=="link_open";)s--;continue}if(a.type==="html_inline"&&(Kde(a.content)&&o>0&&o--,Gde(a.content)&&o++),!(o>0)&&a.type==="text"&&t.md.linkify.test(a.content)){const l=a.content;let u=t.md.linkify.match(l);const c=[];let f=a.level,d=0;u.length>0&&u[0].index===0&&s>0&&i[s-1].type==="text_special"&&(u=u.slice(1));for(let h=0;hd){const x=new t.Token("text","",0);x.content=l.slice(d,y),x.level=f,c.push(x)}const v=new t.Token("link_open","a",1);v.attrs=[["href",m]],v.level=f++,v.markup="linkify",v.info="auto",c.push(v);const w=new t.Token("text","",0);w.content=b,w.level=f,c.push(w);const g=new t.Token("link_close","a",-1);g.level=--f,g.markup="linkify",g.info="auto",c.push(g),d=u[h].lastIndex}if(d=0;n--){const r=t[n];r.type==="text"&&!e&&(r.content=r.content.replace(Qde,ehe)),r.type==="link_open"&&r.info==="auto"&&e--,r.type==="link_close"&&r.info==="auto"&&e++}}function nhe(t){let e=0;for(let n=t.length-1;n>=0;n--){const r=t[n];r.type==="text"&&!e&&r7.test(r.content)&&(r.content=r.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),r.type==="link_open"&&r.info==="auto"&&e--,r.type==="link_close"&&r.info==="auto"&&e++}}function rhe(t){let e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)t.tokens[e].type==="inline"&&(Yde.test(t.tokens[e].content)&&the(t.tokens[e].children),r7.test(t.tokens[e].content)&&nhe(t.tokens[e].children))}const ihe=/['"]/,eA=/['"]/g,tA="’";function Rp(t,e,n){return t.slice(0,e)+n+t.slice(e+1)}function ohe(t,e){let n;const r=[];for(let i=0;i=0&&!(r[n].level<=s);n--);if(r.length=n+1,o.type!=="text")continue;let a=o.content,l=0,u=a.length;e:for(;l=0)p=a.charCodeAt(c.index-1);else for(n=i-1;n>=0&&!(t[n].type==="softbreak"||t[n].type==="hardbreak");n--)if(t[n].content){p=t[n].content.charCodeAt(t[n].content.length-1);break}let m=32;if(l=48&&p<=57&&(d=f=!1),f&&d&&(f=b,d=y),!f&&!d){h&&(o.content=Rp(o.content,c.index,tA));continue}if(d)for(n=r.length-1;n>=0;n--){let g=r[n];if(r[n].level=0;e--)t.tokens[e].type!=="inline"||!ihe.test(t.tokens[e].content)||ohe(t.tokens[e].children,t)}function ahe(t){let e,n;const r=t.tokens,i=r.length;for(let o=0;o0&&this.level++,this.tokens.push(r),r};Ao.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]};Ao.prototype.skipEmptyLines=function(e){for(let n=this.lineMax;en;)if(!kt(this.src.charCodeAt(--e)))return e+1;return e};Ao.prototype.skipChars=function(e,n){for(let r=this.src.length;er;)if(n!==this.src.charCodeAt(--e))return e+1;return e};Ao.prototype.getLines=function(e,n,r,i){if(e>=n)return"";const o=new Array(n-e);for(let s=0,a=e;ar?o[s]=new Array(l-r+1).join(" ")+this.src.slice(c,f):o[s]=this.src.slice(c,f)}return o.join("")};Ao.prototype.Token=zi;const lhe=65536;function u2(t,e){const n=t.bMarks[e]+t.tShift[e],r=t.eMarks[e];return t.src.slice(n,r)}function nA(t){const e=[],n=t.length;let r=0,i=t.charCodeAt(r),o=!1,s=0,a="";for(;rn)return!1;let i=e+1;if(t.sCount[i]=4)return!1;let o=t.bMarks[i]+t.tShift[i];if(o>=t.eMarks[i])return!1;const s=t.src.charCodeAt(o++);if(s!==124&&s!==45&&s!==58||o>=t.eMarks[i])return!1;const a=t.src.charCodeAt(o++);if(a!==124&&a!==45&&a!==58&&!kt(a)||s===45&&kt(a))return!1;for(;o=4)return!1;u=nA(l),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop();const f=u.length;if(f===0||f!==c.length)return!1;if(r)return!0;const d=t.parentType;t.parentType="table";const h=t.md.block.ruler.getRules("blockquote"),p=t.push("table_open","table",1),m=[e,0];p.map=m;const b=t.push("thead_open","thead",1);b.map=[e,e+1];const y=t.push("tr_open","tr",1);y.map=[e,e+1];for(let g=0;g=4||(u=nA(l),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop(),w+=f-u.length,w>lhe))break;if(i===e+2){const k=t.push("tbody_open","tbody",1);k.map=v=[e+2,0]}const x=t.push("tr_open","tr",1);x.map=[i,i+1];for(let k=0;k=4){r++,i=r;continue}break}t.line=i;const o=t.push("code_block","code",0);return o.content=t.getLines(e,i,4+t.blkIndent,!1)+` +`,o.map=[e,t.line],!0}function fhe(t,e,n,r){let i=t.bMarks[e]+t.tShift[e],o=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||i+3>o)return!1;const s=t.src.charCodeAt(i);if(s!==126&&s!==96)return!1;let a=i;i=t.skipChars(i,s);let l=i-a;if(l<3)return!1;const u=t.src.slice(a,i),c=t.src.slice(i,o);if(s===96&&c.indexOf(String.fromCharCode(s))>=0)return!1;if(r)return!0;let f=e,d=!1;for(;f++,!(f>=n||(i=a=t.bMarks[f]+t.tShift[f],o=t.eMarks[f],i=4)&&(i=t.skipChars(i,s),!(i-a=4||t.src.charCodeAt(i)!==62)return!1;if(r)return!0;const a=[],l=[],u=[],c=[],f=t.md.block.ruler.getRules("blockquote"),d=t.parentType;t.parentType="blockquote";let h=!1,p;for(p=e;p=o)break;if(t.src.charCodeAt(i++)===62&&!w){let x=t.sCount[p]+1,k,E;t.src.charCodeAt(i)===32?(i++,x++,E=!1,k=!0):t.src.charCodeAt(i)===9?(k=!0,(t.bsCount[p]+x)%4===3?(i++,x++,E=!1):E=!0):k=!1;let D=x;for(a.push(t.bMarks[p]),t.bMarks[p]=i;i=o,l.push(t.bsCount[p]),t.bsCount[p]=t.sCount[p]+1+(k?1:0),u.push(t.sCount[p]),t.sCount[p]=D-x,c.push(t.tShift[p]),t.tShift[p]=i-t.bMarks[p];continue}if(h)break;let g=!1;for(let x=0,k=f.length;x";const y=[e,0];b.map=y,t.md.block.tokenize(t,e,p);const v=t.push("blockquote_close","blockquote",-1);v.markup=">",t.lineMax=s,t.parentType=d,y[1]=t.line;for(let w=0;w=4)return!1;let o=t.bMarks[e]+t.tShift[e];const s=t.src.charCodeAt(o++);if(s!==42&&s!==45&&s!==95)return!1;let a=1;for(;o=r)return-1;let o=t.src.charCodeAt(i++);if(o<48||o>57)return-1;for(;;){if(i>=r)return-1;if(o=t.src.charCodeAt(i++),o>=48&&o<=57){if(i-n>=10)return-1;continue}if(o===41||o===46)break;return-1}return i=4||t.listIndent>=0&&t.sCount[l]-t.listIndent>=4&&t.sCount[l]=t.blkIndent&&(c=!0);let f,d,h;if((h=iA(t,l))>=0){if(f=!0,s=t.bMarks[l]+t.tShift[l],d=Number(t.src.slice(s,h-1)),c&&d!==1)return!1}else if((h=rA(t,l))>=0)f=!1;else return!1;if(c&&t.skipSpaces(h)>=t.eMarks[l])return!1;if(r)return!0;const p=t.src.charCodeAt(h-1),m=t.tokens.length;f?(a=t.push("ordered_list_open","ol",1),d!==1&&(a.attrs=[["start",d]])):a=t.push("bullet_list_open","ul",1);const b=[l,0];a.map=b,a.markup=String.fromCharCode(p);let y=!1;const v=t.md.block.ruler.getRules("list"),w=t.parentType;for(t.parentType="list";l=i?E=1:E=x-g,E>4&&(E=1);const D=g+E;a=t.push("list_item_open","li",1),a.markup=String.fromCharCode(p);const O=[l,0];a.map=O,f&&(a.info=t.src.slice(s,h-1));const N=t.tight,C=t.tShift[l],R=t.sCount[l],T=t.listIndent;if(t.listIndent=t.blkIndent,t.blkIndent=D,t.tight=!0,t.tShift[l]=k-t.bMarks[l],t.sCount[l]=x,k>=i&&t.isEmpty(l+1)?t.line=Math.min(t.line+2,n):t.md.block.tokenize(t,l,n,!0),(!t.tight||y)&&(u=!1),y=t.line-l>1&&t.isEmpty(t.line-1),t.blkIndent=t.listIndent,t.listIndent=T,t.tShift[l]=C,t.sCount[l]=R,t.tight=N,a=t.push("list_item_close","li",-1),a.markup=String.fromCharCode(p),l=t.line,O[1]=l,l>=n||t.sCount[l]=4)break;let q=!1;for(let A=0,S=v.length;A=4||t.src.charCodeAt(i)!==91)return!1;function a(v){const w=t.lineMax;if(v>=w||t.isEmpty(v))return null;let g=!1;if(t.sCount[v]-t.blkIndent>3&&(g=!0),t.sCount[v]<0&&(g=!0),!g){const E=t.md.block.ruler.getRules("reference"),D=t.parentType;t.parentType="reference";let O=!1;for(let N=0,C=E.length;N"u"&&(t.env.references={}),typeof t.env.references[y]>"u"&&(t.env.references[y]={title:b,href:f}),t.line=s),!0):!1}const yhe=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],bhe="[a-zA-Z_:][a-zA-Z0-9:._-]*",vhe="[^\"'=<>`\\x00-\\x20]+",whe="'[^']*'",khe='"[^"]*"',xhe="(?:"+vhe+"|"+whe+"|"+khe+")",Ehe="(?:\\s+"+bhe+"(?:\\s*=\\s*"+xhe+")?)",i7="<[A-Za-z][A-Za-z0-9\\-]*"+Ehe+"*\\s*\\/?>",o7="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",She="",Che="<[?][\\s\\S]*?[?]>",_he="]*>",Ahe="",The=new RegExp("^(?:"+i7+"|"+o7+"|"+She+"|"+Che+"|"+_he+"|"+Ahe+")"),Mhe=new RegExp("^(?:"+i7+"|"+o7+")"),eu=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(Mhe.source+"\\s*$"),/^$/,!1]];function Ohe(t,e,n,r){let i=t.bMarks[e]+t.tShift[e],o=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||!t.md.options.html||t.src.charCodeAt(i)!==60)return!1;let s=t.src.slice(i,o),a=0;for(;a=4)return!1;let s=t.src.charCodeAt(i);if(s!==35||i>=o)return!1;let a=1;for(s=t.src.charCodeAt(++i);s===35&&i6||ii&&kt(t.src.charCodeAt(l-1))&&(o=l),t.line=e+1;const u=t.push("heading_open","h"+String(a),1);u.markup="########".slice(0,a),u.map=[e,t.line];const c=t.push("inline","",0);c.content=t.src.slice(i,o).trim(),c.map=[e,t.line],c.children=[];const f=t.push("heading_close","h"+String(a),-1);return f.markup="########".slice(0,a),!0}function Nhe(t,e,n){const r=t.md.block.ruler.getRules("paragraph");if(t.sCount[e]-t.blkIndent>=4)return!1;const i=t.parentType;t.parentType="paragraph";let o=0,s,a=e+1;for(;a3)continue;if(t.sCount[a]>=t.blkIndent){let h=t.bMarks[a]+t.tShift[a];const p=t.eMarks[a];if(h=p))){o=s===61?1:2;break}}if(t.sCount[a]<0)continue;let d=!1;for(let h=0,p=r.length;h3||t.sCount[o]<0)continue;let u=!1;for(let c=0,f=r.length;c=n||t.sCount[s]=o){t.line=n;break}const l=t.line;let u=!1;for(let c=0;c=t.line)throw new Error("block rule didn't increment state.line");break}if(!u)throw new Error("none of the block rules matched");t.tight=!a,t.isEmpty(t.line-1)&&(a=!0),s=t.line,s0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(i),r};$h.prototype.scanDelims=function(t,e){const n=this.posMax,r=this.src.charCodeAt(t),i=t>0?this.src.charCodeAt(t-1):32;let o=t;for(;o0)return!1;const n=t.pos,r=t.posMax;if(n+3>r||t.src.charCodeAt(n)!==58||t.src.charCodeAt(n+1)!==47||t.src.charCodeAt(n+2)!==47)return!1;const i=t.pending.match(Fhe);if(!i)return!1;const o=i[1],s=t.md.linkify.matchAtStart(t.src.slice(n-o.length));if(!s)return!1;let a=s.url;if(a.length<=o.length)return!1;a=a.replace(/\*+$/,"");const l=t.md.normalizeLink(a);if(!t.md.validateLink(l))return!1;if(!e){t.pending=t.pending.slice(0,-o.length);const u=t.push("link_open","a",1);u.attrs=[["href",l]],u.markup="linkify",u.info="auto";const c=t.push("text","",0);c.content=t.md.normalizeLinkText(a);const f=t.push("link_close","a",-1);f.markup="linkify",f.info="auto"}return t.pos+=a.length-o.length,!0}function Bhe(t,e){let n=t.pos;if(t.src.charCodeAt(n)!==10)return!1;const r=t.pending.length-1,i=t.posMax;if(!e)if(r>=0&&t.pending.charCodeAt(r)===32)if(r>=1&&t.pending.charCodeAt(r-1)===32){let o=r-1;for(;o>=1&&t.pending.charCodeAt(o-1)===32;)o--;t.pending=t.pending.slice(0,o),t.push("hardbreak","br",0)}else t.pending=t.pending.slice(0,-1),t.push("softbreak","br",0);else t.push("softbreak","br",0);for(n++;n?@[]^_`{|}~-".split("").forEach(function(t){NE[t.charCodeAt(0)]=1});function Phe(t,e){let n=t.pos;const r=t.posMax;if(t.src.charCodeAt(n)!==92||(n++,n>=r))return!1;let i=t.src.charCodeAt(n);if(i===10){for(e||t.push("hardbreak","br",0),n++;n=55296&&i<=56319&&n+1=56320&&a<=57343&&(o+=t.src[n+1],n++)}const s="\\"+o;if(!e){const a=t.push("text_special","",0);i<256&&NE[i]!==0?a.content=o:a.content=s,a.markup=s,a.info="escape"}return t.pos=n+1,!0}function zhe(t,e){let n=t.pos;if(t.src.charCodeAt(n)!==96)return!1;const i=n;n++;const o=t.posMax;for(;n=0;r--){const i=e[r];if(i.marker!==95&&i.marker!==42||i.end===-1)continue;const o=e[i.end],s=r>0&&e[r-1].end===i.end+1&&e[r-1].marker===i.marker&&e[r-1].token===i.token-1&&e[i.end+1].token===o.token+1,a=String.fromCharCode(i.marker),l=t.tokens[i.token];l.type=s?"strong_open":"em_open",l.tag=s?"strong":"em",l.nesting=1,l.markup=s?a+a:a,l.content="";const u=t.tokens[o.token];u.type=s?"strong_close":"em_close",u.tag=s?"strong":"em",u.nesting=-1,u.markup=s?a+a:a,u.content="",s&&(t.tokens[e[r-1].token].content="",t.tokens[e[i.end+1].token].content="",r--)}}function Vhe(t){const e=t.tokens_meta,n=t.tokens_meta.length;sA(t,t.delimiters);for(let r=0;r=f)return!1;if(l=p,i=t.md.helpers.parseLinkDestination(t.src,p,t.posMax),i.ok){for(s=t.md.normalizeLink(i.str),t.md.validateLink(s)?p=i.pos:s="",l=p;p=f||t.src.charCodeAt(p)!==41)&&(u=!0),p++}if(u){if(typeof t.env.references>"u")return!1;if(p=0?r=t.src.slice(l,p++):p=h+1):p=h+1,r||(r=t.src.slice(d,h)),o=t.env.references[Zg(r)],!o)return t.pos=c,!1;s=o.href,a=o.title}if(!e){t.pos=d,t.posMax=h;const m=t.push("link_open","a",1),b=[["href",s]];m.attrs=b,a&&b.push(["title",a]),t.linkLevel++,t.md.inline.tokenize(t),t.linkLevel--,t.push("link_close","a",-1)}return t.pos=p,t.posMax=f,!0}function Whe(t,e){let n,r,i,o,s,a,l,u,c="";const f=t.pos,d=t.posMax;if(t.src.charCodeAt(t.pos)!==33||t.src.charCodeAt(t.pos+1)!==91)return!1;const h=t.pos+2,p=t.md.helpers.parseLinkLabel(t,t.pos+1,!1);if(p<0)return!1;if(o=p+1,o=d)return!1;for(u=o,a=t.md.helpers.parseLinkDestination(t.src,o,t.posMax),a.ok&&(c=t.md.normalizeLink(a.str),t.md.validateLink(c)?o=a.pos:c=""),u=o;o=d||t.src.charCodeAt(o)!==41)return t.pos=f,!1;o++}else{if(typeof t.env.references>"u")return!1;if(o=0?i=t.src.slice(u,o++):o=p+1):o=p+1,i||(i=t.src.slice(h,p)),s=t.env.references[Zg(i)],!s)return t.pos=f,!1;c=s.href,l=s.title}if(!e){r=t.src.slice(h,p);const m=[];t.md.inline.parse(r,t.md,t.env,m);const b=t.push("image","img",0),y=[["src",c],["alt",""]];b.attrs=y,b.children=m,b.content=r,l&&y.push(["title",l])}return t.pos=o,t.posMax=d,!0}const Jhe=/^([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])?)*)$/,Khe=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function Ghe(t,e){let n=t.pos;if(t.src.charCodeAt(n)!==60)return!1;const r=t.pos,i=t.posMax;for(;;){if(++n>=i)return!1;const s=t.src.charCodeAt(n);if(s===60)return!1;if(s===62)break}const o=t.src.slice(r+1,n);if(Khe.test(o)){const s=t.md.normalizeLink(o);if(!t.md.validateLink(s))return!1;if(!e){const a=t.push("link_open","a",1);a.attrs=[["href",s]],a.markup="autolink",a.info="auto";const l=t.push("text","",0);l.content=t.md.normalizeLinkText(o);const u=t.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return t.pos+=o.length+2,!0}if(Jhe.test(o)){const s=t.md.normalizeLink("mailto:"+o);if(!t.md.validateLink(s))return!1;if(!e){const a=t.push("link_open","a",1);a.attrs=[["href",s]],a.markup="autolink",a.info="auto";const l=t.push("text","",0);l.content=t.md.normalizeLinkText(o);const u=t.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return t.pos+=o.length+2,!0}return!1}function Zhe(t){return/^\s]/i.test(t)}function Yhe(t){return/^<\/a\s*>/i.test(t)}function Qhe(t){const e=t|32;return e>=97&&e<=122}function Xhe(t,e){if(!t.md.options.html)return!1;const n=t.posMax,r=t.pos;if(t.src.charCodeAt(r)!==60||r+2>=n)return!1;const i=t.src.charCodeAt(r+1);if(i!==33&&i!==63&&i!==47&&!Qhe(i))return!1;const o=t.src.slice(r).match(The);if(!o)return!1;if(!e){const s=t.push("html_inline","",0);s.content=o[0],Zhe(s.content)&&t.linkLevel++,Yhe(s.content)&&t.linkLevel--}return t.pos+=o[0].length,!0}const epe=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,tpe=/^&([a-z][a-z0-9]{1,31});/i;function npe(t,e){const n=t.pos,r=t.posMax;if(t.src.charCodeAt(n)!==38||n+1>=r)return!1;if(t.src.charCodeAt(n+1)===35){const o=t.src.slice(n).match(epe);if(o){if(!e){const s=o[1][0].toLowerCase()==="x"?parseInt(o[1].slice(1),16):parseInt(o[1],10),a=t.push("text_special","",0);a.content=OE(s)?E1(s):E1(65533),a.markup=o[0],a.info="entity"}return t.pos+=o[0].length,!0}}else{const o=t.src.slice(n).match(tpe);if(o){const s=XI(o[0]);if(s!==o[0]){if(!e){const a=t.push("text_special","",0);a.content=s,a.markup=o[0],a.info="entity"}return t.pos+=o[0].length,!0}}}return!1}function aA(t){const e={},n=t.length;if(!n)return;let r=0,i=-2;const o=[];for(let s=0;sl;u-=o[u]+1){const f=t[u];if(f.marker===a.marker&&f.open&&f.end<0){let d=!1;if((f.close||a.open)&&(f.length+a.length)%3===0&&(f.length%3!==0||a.length%3!==0)&&(d=!0),!d){const h=u>0&&!t[u-1].open?o[u-1]+1:0;o[s]=s-u+h,o[u]=h,a.open=!1,f.end=s,f.close=!1,c=-1,i=-2;break}}}c!==-1&&(e[a.marker][(a.open?3:0)+(a.length||0)%3]=c)}}function rpe(t){const e=t.tokens_meta,n=t.tokens_meta.length;aA(t.delimiters);for(let r=0;r0&&r++,i[e].type==="text"&&e+1=t.pos)throw new Error("inline rule didn't increment state.pos");break}}else t.pos=t.posMax;s||t.pos++,o[e]=t.pos};Ih.prototype.tokenize=function(t){const e=this.ruler.getRules(""),n=e.length,r=t.posMax,i=t.md.options.maxNesting;for(;t.pos=t.pos)throw new Error("inline rule didn't increment state.pos");break}}if(s){if(t.pos>=r)break;continue}t.pending+=t.src[t.pos++]}t.pending&&t.pushPending()};Ih.prototype.parse=function(t,e,n,r){const i=new this.State(t,e,n,r);this.tokenize(i);const o=this.ruler2.getRules(""),s=o.length;for(let a=0;a|$))",e.tpl_email_fuzzy="(^|"+n+'|"|\\(|'+e.src_ZCc+")("+e.src_email_name+"@"+e.tpl_host_fuzzy_strict+")",e.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_fuzzy_strict+e.src_path+")",e.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_no_ip_fuzzy_strict+e.src_path+")",e}function fk(t){return Array.prototype.slice.call(arguments,1).forEach(function(n){n&&Object.keys(n).forEach(function(r){t[r]=n[r]})}),t}function Qg(t){return Object.prototype.toString.call(t)}function spe(t){return Qg(t)==="[object String]"}function ape(t){return Qg(t)==="[object Object]"}function lpe(t){return Qg(t)==="[object RegExp]"}function lA(t){return Qg(t)==="[object Function]"}function upe(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const l7={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function cpe(t){return Object.keys(t||{}).reduce(function(e,n){return e||l7.hasOwnProperty(n)},!1)}const fpe={"http:":{validate:function(t,e,n){const r=t.slice(e);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(t,e,n){const r=t.slice(e);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(r)?e>=3&&t[e-3]===":"||e>=3&&t[e-3]==="/"?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(t,e,n){const r=t.slice(e);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},dpe="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",hpe="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function ppe(t){t.__index__=-1,t.__text_cache__=""}function mpe(t){return function(e,n){const r=e.slice(n);return t.test(r)?r.match(t)[0].length:0}}function uA(){return function(t,e){e.normalize(t)}}function S1(t){const e=t.re=ope(t.__opts__),n=t.__tlds__.slice();t.onCompile(),t.__tlds_replaced__||n.push(dpe),n.push(e.src_xn),e.src_tlds=n.join("|");function r(a){return a.replace("%TLDS%",e.src_tlds)}e.email_fuzzy=RegExp(r(e.tpl_email_fuzzy),"i"),e.link_fuzzy=RegExp(r(e.tpl_link_fuzzy),"i"),e.link_no_ip_fuzzy=RegExp(r(e.tpl_link_no_ip_fuzzy),"i"),e.host_fuzzy_test=RegExp(r(e.tpl_host_fuzzy_test),"i");const i=[];t.__compiled__={};function o(a,l){throw new Error('(LinkifyIt) Invalid schema "'+a+'": '+l)}Object.keys(t.__schemas__).forEach(function(a){const l=t.__schemas__[a];if(l===null)return;const u={validate:null,link:null};if(t.__compiled__[a]=u,ape(l)){lpe(l.validate)?u.validate=mpe(l.validate):lA(l.validate)?u.validate=l.validate:o(a,l),lA(l.normalize)?u.normalize=l.normalize:l.normalize?o(a,l):u.normalize=uA();return}if(spe(l)){i.push(a);return}o(a,l)}),i.forEach(function(a){t.__compiled__[t.__schemas__[a]]&&(t.__compiled__[a].validate=t.__compiled__[t.__schemas__[a]].validate,t.__compiled__[a].normalize=t.__compiled__[t.__schemas__[a]].normalize)}),t.__compiled__[""]={validate:null,normalize:uA()};const s=Object.keys(t.__compiled__).filter(function(a){return a.length>0&&t.__compiled__[a]}).map(upe).join("|");t.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+s+")","i"),t.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+s+")","ig"),t.re.schema_at_start=RegExp("^"+t.re.schema_search.source,"i"),t.re.pretest=RegExp("("+t.re.schema_test.source+")|("+t.re.host_fuzzy_test.source+")|@","i"),ppe(t)}function gpe(t,e){const n=t.__index__,r=t.__last_index__,i=t.__text_cache__.slice(n,r);this.schema=t.__schema__.toLowerCase(),this.index=n+e,this.lastIndex=r+e,this.raw=i,this.text=i,this.url=i}function dk(t,e){const n=new gpe(t,e);return t.__compiled__[n.schema].normalize(n,t),n}function Hr(t,e){if(!(this instanceof Hr))return new Hr(t,e);e||cpe(t)&&(e=t,t={}),this.__opts__=fk({},l7,e),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=fk({},fpe,t),this.__compiled__={},this.__tlds__=hpe,this.__tlds_replaced__=!1,this.re={},S1(this)}Hr.prototype.add=function(e,n){return this.__schemas__[e]=n,S1(this),this};Hr.prototype.set=function(e){return this.__opts__=fk(this.__opts__,e),this};Hr.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;let n,r,i,o,s,a,l,u,c;if(this.re.schema_test.test(e)){for(l=this.re.schema_search,l.lastIndex=0;(n=l.exec(e))!==null;)if(o=this.testSchemaAt(e,n[2],l.lastIndex),o){this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+o;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(u=e.search(this.re.host_fuzzy_test),u>=0&&(this.__index__<0||u=0&&(i=e.match(this.re.email_fuzzy))!==null&&(s=i.index+i[1].length,a=i.index+i[0].length,(this.__index__<0||sthis.__last_index__)&&(this.__schema__="mailto:",this.__index__=s,this.__last_index__=a))),this.__index__>=0};Hr.prototype.pretest=function(e){return this.re.pretest.test(e)};Hr.prototype.testSchemaAt=function(e,n,r){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(e,r,this):0};Hr.prototype.match=function(e){const n=[];let r=0;this.__index__>=0&&this.__text_cache__===e&&(n.push(dk(this,r)),r=this.__last_index__);let i=r?e.slice(r):e;for(;this.test(i);)n.push(dk(this,r)),i=i.slice(this.__last_index__),r+=this.__last_index__;return n.length?n:null};Hr.prototype.matchAtStart=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return null;const n=this.re.schema_at_start.exec(e);if(!n)return null;const r=this.testSchemaAt(e,n[2],n[0].length);return r?(this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+r,dk(this,0)):null};Hr.prototype.tlds=function(e,n){return e=Array.isArray(e)?e:[e],n?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(r,i,o){return r!==o[i-1]}).reverse(),S1(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,S1(this),this)};Hr.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url="mailto:"+e.url)};Hr.prototype.onCompile=function(){};const Hu=2147483647,fo=36,$E=1,ah=26,ype=38,bpe=700,u7=72,c7=128,f7="-",vpe=/^xn--/,wpe=/[^\0-\x7F]/,kpe=/[\x2E\u3002\uFF0E\uFF61]/g,xpe={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d2=fo-$E,ho=Math.floor,h2=String.fromCharCode;function $s(t){throw new RangeError(xpe[t])}function Epe(t,e){const n=[];let r=t.length;for(;r--;)n[r]=e(t[r]);return n}function d7(t,e){const n=t.split("@");let r="";n.length>1&&(r=n[0]+"@",t=n[1]),t=t.replace(kpe,".");const i=t.split("."),o=Epe(i,e).join(".");return r+o}function h7(t){const e=[];let n=0;const r=t.length;for(;n=55296&&i<=56319&&nString.fromCodePoint(...t),Cpe=function(t){return t>=48&&t<58?26+(t-48):t>=65&&t<91?t-65:t>=97&&t<123?t-97:fo},cA=function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},p7=function(t,e,n){let r=0;for(t=n?ho(t/bpe):t>>1,t+=ho(t/e);t>d2*ah>>1;r+=fo)t=ho(t/d2);return ho(r+(d2+1)*t/(t+ype))},m7=function(t){const e=[],n=t.length;let r=0,i=c7,o=u7,s=t.lastIndexOf(f7);s<0&&(s=0);for(let a=0;a=128&&$s("not-basic"),e.push(t.charCodeAt(a));for(let a=s>0?s+1:0;a=n&&$s("invalid-input");const d=Cpe(t.charCodeAt(a++));d>=fo&&$s("invalid-input"),d>ho((Hu-r)/c)&&$s("overflow"),r+=d*c;const h=f<=o?$E:f>=o+ah?ah:f-o;if(dho(Hu/p)&&$s("overflow"),c*=p}const u=e.length+1;o=p7(r-l,u,l==0),ho(r/u)>Hu-i&&$s("overflow"),i+=ho(r/u),r%=u,e.splice(r++,0,i)}return String.fromCodePoint(...e)},g7=function(t){const e=[];t=h7(t);const n=t.length;let r=c7,i=0,o=u7;for(const l of t)l<128&&e.push(h2(l));const s=e.length;let a=s;for(s&&e.push(f7);a=r&&cho((Hu-i)/u)&&$s("overflow"),i+=(l-r)*u,r=l;for(const c of t)if(cHu&&$s("overflow"),c===r){let f=i;for(let d=fo;;d+=fo){const h=d<=o?$E:d>=o+ah?ah:d-o;if(f=0))try{e.hostname=y7.toASCII(e.hostname)}catch{}return Nh(_E(e))}function Fpe(t){const e=AE(t,!0);if(e.hostname&&(!e.protocol||b7.indexOf(e.protocol)>=0))try{e.hostname=y7.toUnicode(e.hostname)}catch{}return Cc(_E(e),Cc.defaultChars+"%")}function Or(t,e){if(!(this instanceof Or))return new Or(t,e);e||ME(t)||(e=t||{},t="default"),this.inline=new Ih,this.block=new Yg,this.core=new DE,this.renderer=new Hc,this.linkify=new Hr,this.validateLink=Ipe,this.normalizeLink=Rpe,this.normalizeLinkText=Fpe,this.utils=Bde,this.helpers=Gg({},qde),this.options={},this.configure(t),e&&this.set(e)}Or.prototype.set=function(t){return Gg(this.options,t),this};Or.prototype.configure=function(t){const e=this;if(ME(t)){const n=t;if(t=Dpe[n],!t)throw new Error('Wrong `markdown-it` preset "'+n+'", check name')}if(!t)throw new Error("Wrong `markdown-it` preset, can't be empty");return t.options&&e.set(t.options),t.components&&Object.keys(t.components).forEach(function(n){t.components[n].rules&&e[n].ruler.enableOnly(t.components[n].rules),t.components[n].rules2&&e[n].ruler2.enableOnly(t.components[n].rules2)}),this};Or.prototype.enable=function(t,e){let n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(i){n=n.concat(this[i].ruler.enable(t,!0))},this),n=n.concat(this.inline.ruler2.enable(t,!0));const r=t.filter(function(i){return n.indexOf(i)<0});if(r.length&&!e)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this};Or.prototype.disable=function(t,e){let n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(i){n=n.concat(this[i].ruler.disable(t,!0))},this),n=n.concat(this.inline.ruler2.disable(t,!0));const r=t.filter(function(i){return n.indexOf(i)<0});if(r.length&&!e)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this};Or.prototype.use=function(t){const e=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,e),this};Or.prototype.parse=function(t,e){if(typeof t!="string")throw new Error("Input data should be a String");const n=new this.core.State(t,this,e);return this.core.process(n),n.tokens};Or.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)};Or.prototype.parseInline=function(t,e){const n=new this.core.State(t,this,e);return n.inlineMode=!0,this.core.process(n),n.tokens};Or.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)};const Lpe=new xI({nodes:{doc:{content:"block+"},paragraph:{content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM(){return["p",0]}},blockquote:{content:"block+",group:"block",parseDOM:[{tag:"blockquote"}],toDOM(){return["blockquote",0]}},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM(){return["div",["hr"]]}},heading:{attrs:{level:{default:1}},content:"(text | image)*",group:"block",defining:!0,parseDOM:[{tag:"h1",attrs:{level:1}},{tag:"h2",attrs:{level:2}},{tag:"h3",attrs:{level:3}},{tag:"h4",attrs:{level:4}},{tag:"h5",attrs:{level:5}},{tag:"h6",attrs:{level:6}}],toDOM(t){return["h"+t.attrs.level,0]}},code_block:{content:"text*",group:"block",code:!0,defining:!0,marks:"",attrs:{params:{default:""}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:t=>({params:t.getAttribute("data-params")||""})}],toDOM(t){return["pre",t.attrs.params?{"data-params":t.attrs.params}:{},["code",0]]}},ordered_list:{content:"list_item+",group:"block",attrs:{order:{default:1},tight:{default:!1}},parseDOM:[{tag:"ol",getAttrs(t){return{order:t.hasAttribute("start")?+t.getAttribute("start"):1,tight:t.hasAttribute("data-tight")}}}],toDOM(t){return["ol",{start:t.attrs.order==1?null:t.attrs.order,"data-tight":t.attrs.tight?"true":null},0]}},bullet_list:{content:"list_item+",group:"block",attrs:{tight:{default:!1}},parseDOM:[{tag:"ul",getAttrs:t=>({tight:t.hasAttribute("data-tight")})}],toDOM(t){return["ul",{"data-tight":t.attrs.tight?"true":null},0]}},list_item:{content:"block+",defining:!0,parseDOM:[{tag:"li"}],toDOM(){return["li",0]}},text:{group:"inline"},image:{inline:!0,attrs:{src:{},alt:{default:null},title:{default:null}},group:"inline",draggable:!0,parseDOM:[{tag:"img[src]",getAttrs(t){return{src:t.getAttribute("src"),title:t.getAttribute("title"),alt:t.getAttribute("alt")}}}],toDOM(t){return["img",t.attrs]}},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM(){return["br"]}}},marks:{em:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"},{style:"font-style=normal",clearMark:t=>t.type.name=="em"}],toDOM(){return["em"]}},strong:{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name=="strong"},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}],toDOM(){return["strong"]}},link:{attrs:{href:{},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs(t){return{href:t.getAttribute("href"),title:t.getAttribute("title")}}}],toDOM(t){return["a",t.attrs]}},code:{parseDOM:[{tag:"code"}],toDOM(){return["code"]}}}});function Bpe(t,e){if(t.isText&&e.isText&&yt.sameSet(t.marks,e.marks))return t.withText(t.text+e.text)}class Ppe{constructor(e,n){this.schema=e,this.tokenHandlers=n,this.stack=[{type:e.topNodeType,attrs:null,content:[],marks:yt.none}]}top(){return this.stack[this.stack.length-1]}push(e){this.stack.length&&this.top().content.push(e)}addText(e){if(!e)return;let n=this.top(),r=n.content,i=r[r.length-1],o=this.schema.text(e,n.marks),s;i&&(s=Bpe(i,o))?r[r.length-1]=s:r.push(o)}openMark(e){let n=this.top();n.marks=e.addToSet(n.marks)}closeMark(e){let n=this.top();n.marks=e.removeFromSet(n.marks)}parseTokens(e){for(let n=0;n{s.openNode(o,df(i,a,l,u)),s.addText(fA(a.content)),s.closeNode()}:(n[r+"_open"]=(s,a,l,u)=>s.openNode(o,df(i,a,l,u)),n[r+"_close"]=s=>s.closeNode())}else if(i.node){let o=t.nodeType(i.node);n[r]=(s,a,l,u)=>s.addNode(o,df(i,a,l,u))}else if(i.mark){let o=t.marks[i.mark];p2(i,r)?n[r]=(s,a,l,u)=>{s.openMark(o.create(df(i,a,l,u))),s.addText(fA(a.content)),s.closeMark(o)}:(n[r+"_open"]=(s,a,l,u)=>s.openMark(o.create(df(i,a,l,u))),n[r+"_close"]=s=>s.closeMark(o))}else if(i.ignore)p2(i,r)?n[r]=m2:(n[r+"_open"]=m2,n[r+"_close"]=m2);else throw new RangeError("Unrecognized parsing spec "+JSON.stringify(i))}return n.text=(r,i)=>r.addText(i.content),n.inline=(r,i)=>r.parseTokens(i.children),n.softbreak=n.softbreak||(r=>r.addText(" ")),n}let jpe=class{constructor(e,n,r){this.schema=e,this.tokenizer=n,this.tokens=r,this.tokenHandlers=zpe(e,r)}parse(e,n={}){let r=new Ppe(this.schema,this.tokenHandlers),i;r.parseTokens(this.tokenizer.parse(e,n));do i=r.closeNode();while(r.stack.length);return i||this.schema.topNodeType.createAndFill()}};function dA(t,e){for(;++e({tight:dA(e,n)})},ordered_list:{block:"ordered_list",getAttrs:(t,e,n)=>({order:+t.attrGet("start")||1,tight:dA(e,n)})},heading:{block:"heading",getAttrs:t=>({level:+t.tag.slice(1)})},code_block:{block:"code_block",noCloseToken:!0},fence:{block:"code_block",getAttrs:t=>({params:t.info||""}),noCloseToken:!0},hr:{node:"horizontal_rule"},image:{node:"image",getAttrs:t=>({src:t.attrGet("src"),title:t.attrGet("title")||null,alt:t.children[0]&&t.children[0].content||null})},hardbreak:{node:"hard_break"},em:{mark:"em"},strong:{mark:"strong"},link:{mark:"link",getAttrs:t=>({href:t.attrGet("href"),title:t.attrGet("title")||null})},code_inline:{mark:"code",noCloseToken:!0}});const qpe={open:"",close:"",mixable:!0};let Upe=class{constructor(e,n,r={}){this.nodes=e,this.marks=n,this.options=r}serialize(e,n={}){n=Object.assign({},this.options,n);let r=new v7(this.nodes,this.marks,n);return r.renderContent(e),r.out}};const To=new Upe({blockquote(t,e){t.wrapBlock("> ",null,e,()=>t.renderContent(e))},code_block(t,e){const n=e.textContent.match(/`{3,}/gm),r=n?n.sort().slice(-1)[0]+"`":"```";t.write(r+(e.attrs.params||"")+` `),t.text(e.textContent,!1),t.write(` `),t.write(r),t.closeBlock(e)},heading(t,e){t.write(t.repeat("#",e.attrs.level)+" "),t.renderInline(e,!1),t.closeBlock(e)},horizontal_rule(t,e){t.write(e.attrs.markup||"---"),t.closeBlock(e)},bullet_list(t,e){t.renderList(e," ",()=>(e.attrs.bullet||"*")+" ")},ordered_list(t,e){let n=e.attrs.order||1,r=String(n+e.childCount-1).length,i=t.repeat(" ",r+2);t.renderList(e,i,o=>{let s=String(n+o);return t.repeat(" ",r-s.length)+s+". "})},list_item(t,e){t.renderContent(e)},paragraph(t,e){t.renderInline(e),t.closeBlock(e)},image(t,e){t.write("!["+t.esc(e.attrs.alt||"")+"]("+e.attrs.src.replace(/[\(\)]/g,"\\$&")+(e.attrs.title?' "'+e.attrs.title.replace(/"/g,'\\"')+'"':"")+")")},hard_break(t,e,n,r){for(let i=r+1;i":"]("+e.attrs.href.replace(/[\(\)"]/g,"\\$&")+(e.attrs.title?` "${e.attrs.title.replace(/"/g,'\\"')}"`:"")+")"},mixable:!0},code:{open(t,e,n,r){return hA(n.child(r),-1)},close(t,e,n,r){return hA(n.child(r-1),1)},escape:!1}});function hA(t,e){let n=/`+/g,r,i=0;if(t.isText)for(;r=n.exec(t.text);)i=Math.max(i,r[0].length);let o=i>0&&e>0?" `":"`";for(let s=0;s0&&e<0&&(o+=" "),o}function zpe(t,e,n){if(t.attrs.title||!/^\w+:/.test(t.attrs.href))return!1;let r=e.child(n);return!r.isText||r.text!=t.attrs.href||r.marks[r.marks.length-1]!=t?!1:n==e.childCount-1||!t.isInSet(e.child(n+1).marks)}let v7=class{constructor(e,n,r){this.nodes=e,this.marks=n,this.options=r,this.delim="",this.out="",this.closed=null,this.inAutolink=void 0,this.atBlockStart=!1,this.inTightList=!1,typeof this.options.tightLists>"u"&&(this.options.tightLists=!1),typeof this.options.hardBreakNodeName>"u"&&(this.options.hardBreakNodeName="hard_break")}flushClose(e=2){if(this.closed){if(this.atBlank()||(this.out+=` +`);return}},text(t,e){t.text(e.text,!t.inAutolink)}},{em:{open:"*",close:"*",mixable:!0,expelEnclosingWhitespace:!0},strong:{open:"**",close:"**",mixable:!0,expelEnclosingWhitespace:!0},link:{open(t,e,n,r){return t.inAutolink=Vpe(e,n,r),t.inAutolink?"<":"["},close(t,e,n,r){let{inAutolink:i}=t;return t.inAutolink=void 0,i?">":"]("+e.attrs.href.replace(/[\(\)"]/g,"\\$&")+(e.attrs.title?` "${e.attrs.title.replace(/"/g,'\\"')}"`:"")+")"},mixable:!0},code:{open(t,e,n,r){return hA(n.child(r),-1)},close(t,e,n,r){return hA(n.child(r-1),1)},escape:!1}});function hA(t,e){let n=/`+/g,r,i=0;if(t.isText)for(;r=n.exec(t.text);)i=Math.max(i,r[0].length);let o=i>0&&e>0?" `":"`";for(let s=0;s0&&e<0&&(o+=" "),o}function Vpe(t,e,n){if(t.attrs.title||!/^\w+:/.test(t.attrs.href))return!1;let r=e.child(n);return!r.isText||r.text!=t.attrs.href||r.marks[r.marks.length-1]!=t?!1:n==e.childCount-1||!t.isInSet(e.child(n+1).marks)}let v7=class{constructor(e,n,r){this.nodes=e,this.marks=n,this.options=r,this.delim="",this.out="",this.closed=null,this.inAutolink=void 0,this.atBlockStart=!1,this.inTightList=!1,typeof this.options.tightLists>"u"&&(this.options.tightLists=!1),typeof this.options.hardBreakNodeName>"u"&&(this.options.hardBreakNodeName="hard_break")}flushClose(e=2){if(this.closed){if(this.atBlank()||(this.out+=` `),e>1){let n=this.delim,r=/\s+$/.exec(n);r&&(n=n.slice(0,n.length-r[0].length));for(let i=1;ithis.render(n,e,i))}renderInline(e,n=!0){this.atBlockStart=n;let r=[],i="",o=(s,a,l)=>{let u=s?s.marks:[];s&&s.type.name===this.options.hardBreakNodeName&&(u=u.filter(m=>{if(l+1==e.childCount)return!1;let b=e.child(l+1);return m.isInSet(b.marks)&&(!b.isText||/\S/.test(b.text))}));let c=i;if(i="",s&&s.isText&&u.some(m=>{let b=this.getMark(m.type.name);return b&&b.expelEnclosingWhitespace&&!m.isInSet(r)})){let[m,b,y]=/^(\s*)(.*)$/m.exec(s.text);b&&(c+=b,s=y?s.withText(y):null,s||(u=r))}if(s&&s.isText&&u.some(m=>{let b=this.getMark(m.type.name);return b&&b.expelEnclosingWhitespace&&(l==e.childCount-1||!m.isInSet(e.child(l+1).marks))})){let[m,b,y]=/^(.*?)(\s*)$/m.exec(s.text);y&&(i=y,s=b?s.withText(b):null,s||(u=r))}let f=u.length?u[u.length-1]:null,d=f&&this.getMark(f.type.name).escape===!1,h=u.length-(d?1:0);e:for(let m=0;my?u=u.slice(0,y).concat(b).concat(u.slice(y,m)).concat(u.slice(m+1,h)):y>m&&(u=u.slice(0,m).concat(u.slice(m+1,y)).concat(b).concat(u.slice(y,h)));continue e}}}let p=0;for(;p0&&(this.atBlockStart=!1)};e.forEach(o),o(null,0,e.childCount),this.atBlockStart=!1}renderList(e,n,r){this.closed&&this.closed.type==e.type?this.flushClose(3):this.inTightList&&this.flushClose(1);let i=typeof e.attrs.tight<"u"?e.attrs.tight:this.options.tightLists,o=this.inTightList;this.inTightList=i,e.forEach((s,a,l)=>{l&&i&&this.flushClose(1),this.wrapBlock(n,r(l),e,()=>this.render(s,e,l))}),this.inTightList=o}esc(e,n=!1){return e=e.replace(/[`*\\~\[\]_]/g,(r,i)=>r=="_"&&i>0&&i+1])/,"\\$&").replace(/^(\s*)(#{1,6})(\s|$)/,"$1\\$2$3").replace(/^(\s*\d+)\.\s/,"$1\\. ")),this.options.escapeExtraCharacters&&(e=e.replace(this.options.escapeExtraCharacters,"\\$&")),e}quote(e){let n=e.indexOf('"')==-1?'""':e.indexOf("'")==-1?"''":"()";return n[0]+e+n[1]}repeat(e,n){let r="";for(let i=0;i=0;r--)if(t[r].level===n)return r;return-1}function Vpe(t,e){return Gpe(t[e])&&Zpe(t[e-1])&&Ype(t[e-2])&&Qpe(t[e])}function Upe(t,e){if(t.children.unshift(Hpe(t,e)),t.children[1].content=t.children[1].content.slice(3),t.content=t.content.slice(3),w7)if(k7){t.children.pop();var n="task-item-"+Math.ceil(Math.random()*(1e4*1e3)-1e3);t.children[0].content=t.children[0].content.slice(0,-1)+' id="'+n+'">',t.children.push(Kpe(t.content,n,e))}else t.children.unshift(Wpe(e)),t.children.push(Jpe(e))}function Hpe(t,e){var n=new e("html_inline","",0),r=hk?' disabled="" ':"";return t.content.indexOf("[ ] ")===0?n.content='':(t.content.indexOf("[x] ")===0||t.content.indexOf("[X] ")===0)&&(n.content=''),n}function Wpe(t){var e=new t("html_inline","",0);return e.content="",e}function Kpe(t,e,n){var r=new n("html_inline","",0);return r.content='",r.attrs=[{for:e}],r}function Gpe(t){return t.type==="inline"}function Zpe(t){return t.type==="paragraph_open"}function Ype(t){return t.type==="list_item_open"}function Qpe(t){return t.content.indexOf("[ ] ")===0||t.content.indexOf("[x] ")===0||t.content.indexOf("[X] ")===0}const Xpe=D1(jpe);var e0e=Object.defineProperty,t0e=(t,e,n)=>e in t?e0e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,C1=(t,e,n)=>(t0e(t,typeof e!="symbol"?e+"":e,n),n);const n0e=yi.create({name:"markdownTightLists",addOptions:()=>({tight:!0,tightClass:"tight",listTypes:["bulletList","orderedList"]}),addGlobalAttributes(){return[{types:this.options.listTypes,attributes:{tight:{default:this.options.tight,parseHTML:t=>t.getAttribute("data-tight")==="true"||!t.querySelector("p"),renderHTML:t=>({class:t.tight?this.options.tightClass:null,"data-tight":t.tight?"true":null})}}}]},addCommands(){var t=this;return{toggleTight:function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return n=>{let{editor:r,commands:i}=n;function o(s){if(!r.isActive(s))return!1;const a=r.getAttributes(s);return i.updateAttributes(s,{tight:e??!(a!=null&&a.tight)})}return t.options.listTypes.some(s=>o(s))}}}}}),mA=Or();function x7(t,e){return mA.inline.State.prototype.scanDelims.call({src:t,posMax:t.length}),new mA.inline.State(t,null,null,[]).scanDelims(e,!0)}function E7(t,e,n,r){let i=t.substring(0,n)+t.substring(n+e.length);return i=i.substring(0,n+r)+e+i.substring(n+r),i}function r0e(t,e,n,r){let i=n,o=t;for(;in&&!x7(o,i).can_close;)o=E7(o,e,i,-1),i--;return{text:o,from:n,to:i}}function o0e(t,e,n,r){let i={text:t,from:n,to:r};return i=r0e(i.text,e,i.from,i.to),i=i0e(i.text,e,i.from,i.to),i.to-i.from) (<\/.*?>)$/);return i?[i[1],i[2]]:null}function IE(t){const e=`${t}`;return new window.DOMParser().parseFromString(e,"text/html").body}function a0e(t){return t==null?void 0:t.replace(//g,">")}function l0e(t){const e=t.parentElement,n=e.cloneNode();for(;e.firstChild&&e.firstChild!==t;)n.appendChild(e.firstChild);n.childNodes.length>0&&e.parentElement.insertBefore(n,e),e.parentElement.insertBefore(t,e),e.childNodes.length===0&&e.remove()}function u0e(t){const e=t.parentNode;for(;t.firstChild;)e.insertBefore(t.firstChild,t);e.removeChild(t)}const Xg=bn.create({name:"markdownHTMLNode",addStorage(){return{markdown:{serialize(t,e,n){this.editor.storage.markdown.options.html?t.write(c0e(e,n)):(console.warn(`Tiptap Markdown: "${e.type.name}" node is only available in html mode`),t.write(`[${e.type.name}]`)),e.isBlock&&t.closeBlock(e)},parse:{}}}}});function c0e(t,e){const n=t.type.schema,r=JI(ue.from(t),n);return t.isBlock&&(e instanceof ue||e.type.name===n.topNodeType.name)?f0e(r):r}function f0e(t){const n=IE(t).firstElementChild;return n.innerHTML=n.innerHTML.trim()?` +`)}render(e,n,r){if(this.nodes[e.type.name])this.nodes[e.type.name](this,e,n,r);else{if(this.options.strict!==!1)throw new Error("Token type `"+e.type.name+"` not supported by Markdown renderer");e.type.isLeaf||(e.type.inlineContent?this.renderInline(e):this.renderContent(e),e.isBlock&&this.closeBlock(e))}}renderContent(e){e.forEach((n,r,i)=>this.render(n,e,i))}renderInline(e,n=!0){this.atBlockStart=n;let r=[],i="",o=(s,a,l)=>{let u=s?s.marks:[];s&&s.type.name===this.options.hardBreakNodeName&&(u=u.filter(m=>{if(l+1==e.childCount)return!1;let b=e.child(l+1);return m.isInSet(b.marks)&&(!b.isText||/\S/.test(b.text))}));let c=i;if(i="",s&&s.isText&&u.some(m=>{let b=this.getMark(m.type.name);return b&&b.expelEnclosingWhitespace&&!m.isInSet(r)})){let[m,b,y]=/^(\s*)(.*)$/m.exec(s.text);b&&(c+=b,s=y?s.withText(y):null,s||(u=r))}if(s&&s.isText&&u.some(m=>{let b=this.getMark(m.type.name);return b&&b.expelEnclosingWhitespace&&(l==e.childCount-1||!m.isInSet(e.child(l+1).marks))})){let[m,b,y]=/^(.*?)(\s*)$/m.exec(s.text);y&&(i=y,s=b?s.withText(b):null,s||(u=r))}let f=u.length?u[u.length-1]:null,d=f&&this.getMark(f.type.name).escape===!1,h=u.length-(d?1:0);e:for(let m=0;my?u=u.slice(0,y).concat(b).concat(u.slice(y,m)).concat(u.slice(m+1,h)):y>m&&(u=u.slice(0,m).concat(u.slice(m+1,y)).concat(b).concat(u.slice(y,h)));continue e}}}let p=0;for(;p0&&(this.atBlockStart=!1)};e.forEach(o),o(null,0,e.childCount),this.atBlockStart=!1}renderList(e,n,r){this.closed&&this.closed.type==e.type?this.flushClose(3):this.inTightList&&this.flushClose(1);let i=typeof e.attrs.tight<"u"?e.attrs.tight:this.options.tightLists,o=this.inTightList;this.inTightList=i,e.forEach((s,a,l)=>{l&&i&&this.flushClose(1),this.wrapBlock(n,r(l),e,()=>this.render(s,e,l))}),this.inTightList=o}esc(e,n=!1){return e=e.replace(/[`*\\~\[\]_]/g,(r,i)=>r=="_"&&i>0&&i+1])/,"\\$&").replace(/^(\s*)(#{1,6})(\s|$)/,"$1\\$2$3").replace(/^(\s*\d+)\.\s/,"$1\\. ")),this.options.escapeExtraCharacters&&(e=e.replace(this.options.escapeExtraCharacters,"\\$&")),e}quote(e){let n=e.indexOf('"')==-1?'""':e.indexOf("'")==-1?"''":"()";return n[0]+e+n[1]}repeat(e,n){let r="";for(let i=0;i=0;r--)if(t[r].level===n)return r;return-1}function Jpe(t,e){return Xpe(t[e])&&e0e(t[e-1])&&t0e(t[e-2])&&n0e(t[e])}function Kpe(t,e){if(t.children.unshift(Gpe(t,e)),t.children[1].content=t.children[1].content.slice(3),t.content=t.content.slice(3),w7)if(k7){t.children.pop();var n="task-item-"+Math.ceil(Math.random()*(1e4*1e3)-1e3);t.children[0].content=t.children[0].content.slice(0,-1)+' id="'+n+'">',t.children.push(Qpe(t.content,n,e))}else t.children.unshift(Zpe(e)),t.children.push(Ype(e))}function Gpe(t,e){var n=new e("html_inline","",0),r=hk?' disabled="" ':"";return t.content.indexOf("[ ] ")===0?n.content='':(t.content.indexOf("[x] ")===0||t.content.indexOf("[X] ")===0)&&(n.content=''),n}function Zpe(t){var e=new t("html_inline","",0);return e.content="",e}function Qpe(t,e,n){var r=new n("html_inline","",0);return r.content='",r.attrs=[{for:e}],r}function Xpe(t){return t.type==="inline"}function e0e(t){return t.type==="paragraph_open"}function t0e(t){return t.type==="list_item_open"}function n0e(t){return t.content.indexOf("[ ] ")===0||t.content.indexOf("[x] ")===0||t.content.indexOf("[X] ")===0}const r0e=D1(Hpe);var i0e=Object.defineProperty,o0e=(t,e,n)=>e in t?i0e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,C1=(t,e,n)=>(o0e(t,typeof e!="symbol"?e+"":e,n),n);const s0e=yi.create({name:"markdownTightLists",addOptions:()=>({tight:!0,tightClass:"tight",listTypes:["bulletList","orderedList"]}),addGlobalAttributes(){return[{types:this.options.listTypes,attributes:{tight:{default:this.options.tight,parseHTML:t=>t.getAttribute("data-tight")==="true"||!t.querySelector("p"),renderHTML:t=>({class:t.tight?this.options.tightClass:null,"data-tight":t.tight?"true":null})}}}]},addCommands(){var t=this;return{toggleTight:function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return n=>{let{editor:r,commands:i}=n;function o(s){if(!r.isActive(s))return!1;const a=r.getAttributes(s);return i.updateAttributes(s,{tight:e??!(a!=null&&a.tight)})}return t.options.listTypes.some(s=>o(s))}}}}}),mA=Or();function x7(t,e){return mA.inline.State.prototype.scanDelims.call({src:t,posMax:t.length}),new mA.inline.State(t,null,null,[]).scanDelims(e,!0)}function E7(t,e,n,r){let i=t.substring(0,n)+t.substring(n+e.length);return i=i.substring(0,n+r)+e+i.substring(n+r),i}function a0e(t,e,n,r){let i=n,o=t;for(;in&&!x7(o,i).can_close;)o=E7(o,e,i,-1),i--;return{text:o,from:n,to:i}}function u0e(t,e,n,r){let i={text:t,from:n,to:r};return i=a0e(i.text,e,i.from,i.to),i=l0e(i.text,e,i.from,i.to),i.to-i.from) (<\/.*?>)$/);return i?[i[1],i[2]]:null}function IE(t){const e=`${t}`;return new window.DOMParser().parseFromString(e,"text/html").body}function f0e(t){return t==null?void 0:t.replace(//g,">")}function d0e(t){const e=t.parentElement,n=e.cloneNode();for(;e.firstChild&&e.firstChild!==t;)n.appendChild(e.firstChild);n.childNodes.length>0&&e.parentElement.insertBefore(n,e),e.parentElement.insertBefore(t,e),e.childNodes.length===0&&e.remove()}function h0e(t){const e=t.parentNode;for(;t.firstChild;)e.insertBefore(t.firstChild,t);e.removeChild(t)}const Xg=bn.create({name:"markdownHTMLNode",addStorage(){return{markdown:{serialize(t,e,n){this.editor.storage.markdown.options.html?t.write(p0e(e,n)):(console.warn(`Tiptap Markdown: "${e.type.name}" node is only available in html mode`),t.write(`[${e.type.name}]`)),e.isBlock&&t.closeBlock(e)},parse:{}}}}});function p0e(t,e){const n=t.type.schema,r=JI(ue.from(t),n);return t.isBlock&&(e instanceof ue||e.type.name===n.topNodeType.name)?m0e(r):r}function m0e(t){const n=IE(t).firstElementChild;return n.innerHTML=n.innerHTML.trim()?` ${n.innerHTML} `:` -`,n.outerHTML}const d0e=bn.create({name:"blockquote"}),h0e=d0e.extend({addStorage(){return{markdown:{serialize:To.nodes.blockquote,parse:{}}}}}),p0e=bn.create({name:"bulletList"}),C7=p0e.extend({addStorage(){return{markdown:{serialize(t,e){return t.renderList(e," ",()=>(this.editor.storage.markdown.options.bulletListMarker||"-")+" ")},parse:{}}}}}),m0e=bn.create({name:"codeBlock"}),g0e=m0e.extend({addStorage(){return{markdown:{serialize(t,e){t.write("```"+(e.attrs.language||"")+` -`),t.text(e.textContent,!1),t.ensureNewLine(),t.write("```"),t.closeBlock(e)},parse:{setup(t){var e;t.set({langPrefix:(e=this.options.languageClassPrefix)!==null&&e!==void 0?e:"language-"})},updateDOM(t){t.innerHTML=t.innerHTML.replace(/\n<\/code><\/pre>/g,"")}}}}}}),y0e=bn.create({name:"hardBreak"}),_7=y0e.extend({addStorage(){return{markdown:{serialize(t,e,n,r){for(let i=r+1;i0&&e.child(n-r-1).type.name===t.type.name;r++);return r}const T0e=_0e.extend({addStorage(){return{markdown:{serialize(t,e,n,r){const i=e.attrs.start||1,o=String(i+e.childCount-1).length,s=t.repeat(" ",o+2),l=A0e(e,n,r)%2?") ":". ";t.renderList(e,s,u=>{const c=String(i+u);return t.repeat(" ",o-c.length)+c+l})},parse:{}}}}}),M0e=bn.create({name:"paragraph"}),O0e=M0e.extend({addStorage(){return{markdown:{serialize:To.nodes.paragraph,parse:{}}}}});function g2(t){var e,n;return(e=t==null||(n=t.content)===null||n===void 0?void 0:n.content)!==null&&e!==void 0?e:[]}const D0e=bn.create({name:"table"}),N0e=D0e.extend({addStorage(){return{markdown:{serialize(t,e,n){if(!$0e(e)){Xg.storage.markdown.serialize.call(this,t,e,n);return}t.inTable=!0,e.forEach((r,i,o)=>{if(t.write("| "),r.forEach((s,a,l)=>{l&&t.write(" | ");const u=s.firstChild;u.textContent.trim()&&t.renderInline(u)}),t.write(" |"),t.ensureNewLine(),!o){const s=Array.from({length:r.childCount}).map(()=>"---").join(" | ");t.write(`| ${s} |`),t.ensureNewLine()}}),t.closeBlock(e),t.inTable=!1},parse:{}}}}});function yA(t){return t.attrs.colspan>1||t.attrs.rowspan>1}function $0e(t){const e=g2(t),n=e[0],r=e.slice(1);return!(g2(n).some(i=>i.type.name!=="tableHeader"||yA(i)||i.childCount>1)||r.some(i=>g2(i).some(o=>o.type.name==="tableHeader"||yA(o)||o.childCount>1)))}const I0e=bn.create({name:"taskItem"}),R0e=I0e.extend({addStorage(){return{markdown:{serialize(t,e){const n=e.attrs.checked?"[x]":"[ ]";t.write(`${n} `),t.renderContent(e)},parse:{updateDOM(t){[...t.querySelectorAll(".task-list-item")].forEach(e=>{const n=e.querySelector("input");e.setAttribute("data-type","taskItem"),n&&(e.setAttribute("data-checked",n.checked),n.remove())})}}}}}}),F0e=bn.create({name:"taskList"}),L0e=F0e.extend({addStorage(){return{markdown:{serialize:C7.storage.markdown.serialize,parse:{setup(t){t.use(Xpe)},updateDOM(t){[...t.querySelectorAll(".contains-task-list")].forEach(e=>{e.setAttribute("data-type","taskList")})}}}}}}),B0e=bn.create({name:"text"}),P0e=B0e.extend({addStorage(){return{markdown:{serialize(t,e){t.text(a0e(e.text))},parse:{}}}}}),z0e=Xo.create({name:"bold"}),j0e=z0e.extend({addStorage(){return{markdown:{serialize:To.marks.strong,parse:{}}}}}),q0e=Xo.create({name:"code"}),V0e=q0e.extend({addStorage(){return{markdown:{serialize:To.marks.code,parse:{}}}}}),U0e=Xo.create({name:"italic"}),H0e=U0e.extend({addStorage(){return{markdown:{serialize:To.marks.em,parse:{}}}}}),W0e=Xo.create({name:"link"}),J0e=W0e.extend({addStorage(){return{markdown:{serialize:To.marks.link,parse:{}}}}}),K0e=Xo.create({name:"strike"}),G0e=K0e.extend({addStorage(){return{markdown:{serialize:{open:"~~",close:"~~",expelEnclosingWhitespace:!0},parse:{}}}}}),Z0e=[h0e,C7,g0e,_7,v0e,k0e,Xg,E0e,C0e,T0e,O0e,N0e,R0e,L0e,P0e,j0e,V0e,S7,H0e,J0e,G0e];function _1(t){var e,n;const r=(e=t.storage)===null||e===void 0?void 0:e.markdown,i=(n=Z0e.find(o=>o.name===t.name))===null||n===void 0?void 0:n.storage.markdown;return r||i?{...i,...r}:null}class Y0e{constructor(e){C1(this,"editor",null),this.editor=e}serialize(e){const n=new s0e(this.nodes,this.marks,{hardBreakNodeName:_7.name});return n.renderContent(e),n.out}get nodes(){var e;return{...Object.fromEntries(Object.keys(this.editor.schema.nodes).map(n=>[n,this.serializeNode(Xg)])),...Object.fromEntries((e=this.editor.extensionManager.extensions.filter(n=>n.type==="node"&&this.serializeNode(n)).map(n=>[n.name,this.serializeNode(n)]))!==null&&e!==void 0?e:[])}}get marks(){var e;return{...Object.fromEntries(Object.keys(this.editor.schema.marks).map(n=>[n,this.serializeMark(S7)])),...Object.fromEntries((e=this.editor.extensionManager.extensions.filter(n=>n.type==="mark"&&this.serializeMark(n)).map(n=>[n.name,this.serializeMark(n)]))!==null&&e!==void 0?e:[])}}serializeNode(e){var n;return(n=_1(e))===null||n===void 0||(n=n.serialize)===null||n===void 0?void 0:n.bind({editor:this.editor,options:e.options})}serializeMark(e){var n;const r=(n=_1(e))===null||n===void 0?void 0:n.serialize;return r?{...r,open:typeof r.open=="function"?r.open.bind({editor:this.editor,options:e.options}):r.open,close:typeof r.close=="function"?r.close.bind({editor:this.editor,options:e.options}):r.close}:null}}class Q0e{constructor(e,n){C1(this,"editor",null),C1(this,"md",null);let{html:r,linkify:i,breaks:o}=n;this.editor=e,this.md=this.withPatchedRenderer(Or({html:r,linkify:i,breaks:o}))}parse(e){let{inline:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(typeof e=="string"){this.editor.extensionManager.extensions.forEach(o=>{var s;return(s=_1(o))===null||s===void 0||(s=s.parse)===null||s===void 0||(s=s.setup)===null||s===void 0?void 0:s.call({editor:this.editor,options:o.options},this.md)});const r=this.md.render(e),i=IE(r);return this.editor.extensionManager.extensions.forEach(o=>{var s;return(s=_1(o))===null||s===void 0||(s=s.parse)===null||s===void 0||(s=s.updateDOM)===null||s===void 0?void 0:s.call({editor:this.editor,options:o.options},i)}),this.normalizeDOM(i,{inline:n,content:e}),i.innerHTML}return e}normalizeDOM(e,n){let{inline:r,content:i}=n;return this.normalizeBlocks(e),e.querySelectorAll("*").forEach(o=>{var s;((s=o.nextSibling)===null||s===void 0?void 0:s.nodeType)===Node.TEXT_NODE&&!o.closest("pre")&&(o.nextSibling.textContent=o.nextSibling.textContent.replace(/^\n/,""))}),r&&this.normalizeInline(e,i),e}normalizeBlocks(e){const r=Object.values(this.editor.schema.nodes).filter(i=>i.isBlock).map(i=>{var o;return(o=i.spec.parseDOM)===null||o===void 0?void 0:o.map(s=>s.tag)}).flat().filter(Boolean).join(",");r&&[...e.querySelectorAll(r)].forEach(i=>{i.parentElement.matches("p")&&l0e(i)})}normalizeInline(e,n){var r;if((r=e.firstElementChild)!==null&&r!==void 0&&r.matches("p")){var i,o,s,a;const l=e.firstElementChild,{nextElementSibling:u}=l,c=(i=(o=n.match(/^\s+/))===null||o===void 0?void 0:o[0])!==null&&i!==void 0?i:"",f=u?"":(s=(a=n.match(/\s+$/))===null||a===void 0?void 0:a[0])!==null&&s!==void 0?s:"";if(n.match(/^\n\n/)){l.innerHTML=`${l.innerHTML}${f}`;return}u0e(l),e.innerHTML=`${c}${e.innerHTML}${f}`}}withPatchedRenderer(e){const n=r=>function(){const i=r(...arguments);return i===` +`,n.outerHTML}const g0e=bn.create({name:"blockquote"}),y0e=g0e.extend({addStorage(){return{markdown:{serialize:To.nodes.blockquote,parse:{}}}}}),b0e=bn.create({name:"bulletList"}),C7=b0e.extend({addStorage(){return{markdown:{serialize(t,e){return t.renderList(e," ",()=>(this.editor.storage.markdown.options.bulletListMarker||"-")+" ")},parse:{}}}}}),v0e=bn.create({name:"codeBlock"}),w0e=v0e.extend({addStorage(){return{markdown:{serialize(t,e){t.write("```"+(e.attrs.language||"")+` +`),t.text(e.textContent,!1),t.ensureNewLine(),t.write("```"),t.closeBlock(e)},parse:{setup(t){var e;t.set({langPrefix:(e=this.options.languageClassPrefix)!==null&&e!==void 0?e:"language-"})},updateDOM(t){t.innerHTML=t.innerHTML.replace(/\n<\/code><\/pre>/g,"")}}}}}}),k0e=bn.create({name:"hardBreak"}),_7=k0e.extend({addStorage(){return{markdown:{serialize(t,e,n,r){for(let i=r+1;i0&&e.child(n-r-1).type.name===t.type.name;r++);return r}const N0e=O0e.extend({addStorage(){return{markdown:{serialize(t,e,n,r){const i=e.attrs.start||1,o=String(i+e.childCount-1).length,s=t.repeat(" ",o+2),l=D0e(e,n,r)%2?") ":". ";t.renderList(e,s,u=>{const c=String(i+u);return t.repeat(" ",o-c.length)+c+l})},parse:{}}}}}),$0e=bn.create({name:"paragraph"}),I0e=$0e.extend({addStorage(){return{markdown:{serialize:To.nodes.paragraph,parse:{}}}}});function g2(t){var e,n;return(e=t==null||(n=t.content)===null||n===void 0?void 0:n.content)!==null&&e!==void 0?e:[]}const R0e=bn.create({name:"table"}),F0e=R0e.extend({addStorage(){return{markdown:{serialize(t,e,n){if(!L0e(e)){Xg.storage.markdown.serialize.call(this,t,e,n);return}t.inTable=!0,e.forEach((r,i,o)=>{if(t.write("| "),r.forEach((s,a,l)=>{l&&t.write(" | ");const u=s.firstChild;u.textContent.trim()&&t.renderInline(u)}),t.write(" |"),t.ensureNewLine(),!o){const s=Array.from({length:r.childCount}).map(()=>"---").join(" | ");t.write(`| ${s} |`),t.ensureNewLine()}}),t.closeBlock(e),t.inTable=!1},parse:{}}}}});function yA(t){return t.attrs.colspan>1||t.attrs.rowspan>1}function L0e(t){const e=g2(t),n=e[0],r=e.slice(1);return!(g2(n).some(i=>i.type.name!=="tableHeader"||yA(i)||i.childCount>1)||r.some(i=>g2(i).some(o=>o.type.name==="tableHeader"||yA(o)||o.childCount>1)))}const B0e=bn.create({name:"taskItem"}),P0e=B0e.extend({addStorage(){return{markdown:{serialize(t,e){const n=e.attrs.checked?"[x]":"[ ]";t.write(`${n} `),t.renderContent(e)},parse:{updateDOM(t){[...t.querySelectorAll(".task-list-item")].forEach(e=>{const n=e.querySelector("input");e.setAttribute("data-type","taskItem"),n&&(e.setAttribute("data-checked",n.checked),n.remove())})}}}}}}),z0e=bn.create({name:"taskList"}),j0e=z0e.extend({addStorage(){return{markdown:{serialize:C7.storage.markdown.serialize,parse:{setup(t){t.use(r0e)},updateDOM(t){[...t.querySelectorAll(".contains-task-list")].forEach(e=>{e.setAttribute("data-type","taskList")})}}}}}}),q0e=bn.create({name:"text"}),U0e=q0e.extend({addStorage(){return{markdown:{serialize(t,e){t.text(f0e(e.text))},parse:{}}}}}),V0e=Xo.create({name:"bold"}),H0e=V0e.extend({addStorage(){return{markdown:{serialize:To.marks.strong,parse:{}}}}}),W0e=Xo.create({name:"code"}),J0e=W0e.extend({addStorage(){return{markdown:{serialize:To.marks.code,parse:{}}}}}),K0e=Xo.create({name:"italic"}),G0e=K0e.extend({addStorage(){return{markdown:{serialize:To.marks.em,parse:{}}}}}),Z0e=Xo.create({name:"link"}),Y0e=Z0e.extend({addStorage(){return{markdown:{serialize:To.marks.link,parse:{}}}}}),Q0e=Xo.create({name:"strike"}),X0e=Q0e.extend({addStorage(){return{markdown:{serialize:{open:"~~",close:"~~",expelEnclosingWhitespace:!0},parse:{}}}}}),eme=[y0e,C7,w0e,_7,E0e,C0e,Xg,A0e,M0e,N0e,I0e,F0e,P0e,j0e,U0e,H0e,J0e,S7,G0e,Y0e,X0e];function _1(t){var e,n;const r=(e=t.storage)===null||e===void 0?void 0:e.markdown,i=(n=eme.find(o=>o.name===t.name))===null||n===void 0?void 0:n.storage.markdown;return r||i?{...i,...r}:null}class tme{constructor(e){C1(this,"editor",null),this.editor=e}serialize(e){const n=new c0e(this.nodes,this.marks,{hardBreakNodeName:_7.name});return n.renderContent(e),n.out}get nodes(){var e;return{...Object.fromEntries(Object.keys(this.editor.schema.nodes).map(n=>[n,this.serializeNode(Xg)])),...Object.fromEntries((e=this.editor.extensionManager.extensions.filter(n=>n.type==="node"&&this.serializeNode(n)).map(n=>[n.name,this.serializeNode(n)]))!==null&&e!==void 0?e:[])}}get marks(){var e;return{...Object.fromEntries(Object.keys(this.editor.schema.marks).map(n=>[n,this.serializeMark(S7)])),...Object.fromEntries((e=this.editor.extensionManager.extensions.filter(n=>n.type==="mark"&&this.serializeMark(n)).map(n=>[n.name,this.serializeMark(n)]))!==null&&e!==void 0?e:[])}}serializeNode(e){var n;return(n=_1(e))===null||n===void 0||(n=n.serialize)===null||n===void 0?void 0:n.bind({editor:this.editor,options:e.options})}serializeMark(e){var n;const r=(n=_1(e))===null||n===void 0?void 0:n.serialize;return r?{...r,open:typeof r.open=="function"?r.open.bind({editor:this.editor,options:e.options}):r.open,close:typeof r.close=="function"?r.close.bind({editor:this.editor,options:e.options}):r.close}:null}}class nme{constructor(e,n){C1(this,"editor",null),C1(this,"md",null);let{html:r,linkify:i,breaks:o}=n;this.editor=e,this.md=this.withPatchedRenderer(Or({html:r,linkify:i,breaks:o}))}parse(e){let{inline:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(typeof e=="string"){this.editor.extensionManager.extensions.forEach(o=>{var s;return(s=_1(o))===null||s===void 0||(s=s.parse)===null||s===void 0||(s=s.setup)===null||s===void 0?void 0:s.call({editor:this.editor,options:o.options},this.md)});const r=this.md.render(e),i=IE(r);return this.editor.extensionManager.extensions.forEach(o=>{var s;return(s=_1(o))===null||s===void 0||(s=s.parse)===null||s===void 0||(s=s.updateDOM)===null||s===void 0?void 0:s.call({editor:this.editor,options:o.options},i)}),this.normalizeDOM(i,{inline:n,content:e}),i.innerHTML}return e}normalizeDOM(e,n){let{inline:r,content:i}=n;return this.normalizeBlocks(e),e.querySelectorAll("*").forEach(o=>{var s;((s=o.nextSibling)===null||s===void 0?void 0:s.nodeType)===Node.TEXT_NODE&&!o.closest("pre")&&(o.nextSibling.textContent=o.nextSibling.textContent.replace(/^\n/,""))}),r&&this.normalizeInline(e,i),e}normalizeBlocks(e){const r=Object.values(this.editor.schema.nodes).filter(i=>i.isBlock).map(i=>{var o;return(o=i.spec.parseDOM)===null||o===void 0?void 0:o.map(s=>s.tag)}).flat().filter(Boolean).join(",");r&&[...e.querySelectorAll(r)].forEach(i=>{i.parentElement.matches("p")&&d0e(i)})}normalizeInline(e,n){var r;if((r=e.firstElementChild)!==null&&r!==void 0&&r.matches("p")){var i,o,s,a;const l=e.firstElementChild,{nextElementSibling:u}=l,c=(i=(o=n.match(/^\s+/))===null||o===void 0?void 0:o[0])!==null&&i!==void 0?i:"",f=u?"":(s=(a=n.match(/\s+$/))===null||a===void 0?void 0:a[0])!==null&&s!==void 0?s:"";if(n.match(/^\n\n/)){l.innerHTML=`${l.innerHTML}${f}`;return}h0e(l),e.innerHTML=`${c}${e.innerHTML}${f}`}}withPatchedRenderer(e){const n=r=>function(){const i=r(...arguments);return i===` `?i:i[i.length-1]===` -`?i.slice(0,-1):i};return e.renderer.rules.hardbreak=n(e.renderer.rules.hardbreak),e.renderer.rules.softbreak=n(e.renderer.rules.softbreak),e.renderer.rules.fence=n(e.renderer.rules.fence),e.renderer.rules.code_block=n(e.renderer.rules.code_block),e.renderer.renderToken=n(e.renderer.renderToken.bind(e.renderer)),e}}const X0e=yi.create({name:"markdownClipboard",addOptions(){return{transformPastedText:!1,transformCopiedText:!1}},addProseMirrorPlugins(){return[new Vc({key:new Uc("markdownClipboard"),props:{clipboardTextParser:(t,e,n)=>{if(n||!this.options.transformPastedText)return null;const r=this.editor.storage.markdown.parser.parse(t,{inline:!0});return eh.fromSchema(this.editor.schema).parseSlice(IE(r),{preserveWhitespace:!0,context:e})},clipboardTextSerializer:t=>this.options.transformCopiedText?this.editor.storage.markdown.serializer.serialize(t.content):null}})]}}),A7=yi.create({name:"markdown",priority:50,addOptions(){return{html:!0,tightLists:!0,tightListClass:"tight",bulletListMarker:"-",linkify:!1,breaks:!1,transformPastedText:!1,transformCopiedText:!1}},addCommands(){const t=Jfe.Commands.config.addCommands();return{setContent:(e,n,r)=>i=>t.setContent(i.editor.storage.markdown.parser.parse(e),n,r)(i),insertContentAt:(e,n,r)=>i=>t.insertContentAt(e,i.editor.storage.markdown.parser.parse(n,{inline:!0}),r)(i)}},onBeforeCreate(){this.editor.storage.markdown={options:{...this.options},parser:new Q0e(this.editor,this.options),serializer:new Y0e(this.editor),getMarkdown:()=>this.editor.storage.markdown.serializer.serialize(this.editor.state.doc)},this.editor.options.initialContent=this.editor.options.content,this.editor.options.content=this.editor.storage.markdown.parser.parse(this.editor.options.content)},onCreate(){this.editor.options.content=this.editor.options.initialContent,delete this.editor.options.initialContent},addStorage(){return{}},addExtensions(){return[n0e.configure({tight:this.options.tightLists,tightClass:this.options.tightListClass}),X0e.configure({transformPastedText:this.options.transformPastedText,transformCopiedText:this.options.transformCopiedText})]}});function T7(t){const[e,n]=ee.useState(!1);return _.jsxs(_.Fragment,{children:[_.jsx("div",{className:`absolute transition-all ease-in duration-100 z-40 flex left-0 top-0 right-0 bottom-0 text-center items-center justify-center rounded-lg ${e?"bg-black/70":""} text-white ${e?"":"pointer-events-none"}`,children:e&&_.jsx("textarea",{autoFocus:!0,value:t.value,className:"bg-transparent mx-4 w-full outline-none text-sm h-28 mt-14 resize-none",placeholder:"Alt description",onChange:r=>t.onChange(r.currentTarget.value)})}),_.jsx("div",{className:"w-full",children:_.jsx("button",{onClick:()=>n(r=>!r),className:`relative py-1 px-2 bg-black/80 border border-white/20 rounded-full ${e?"text-white":"text-gray-200"} z-50 text-xs`,children:"Alt"})})]})}function ey(t){return _.jsx("button",{className:"absolute bg-black/80 p-1 right-2 top-2 rounded-full text-white z-10",onClick:()=>t.onClick(),children:_.jsx(WB,{strokeWidth:"2.0",size:18})})}function M7(t){return _.jsx("div",{className:"absolute bottom-0 left-0 right-0 top-0 flex flex-row items-end justify-between p-2",children:t.children})}function O7(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}var D7=typeof window<"u"&&typeof document<"u";function pk(t,e){t&&(typeof t=="function"&&t(e),{}.hasOwnProperty.call(t,"current")&&(t.current=e))}function bA(){return D7&&document.createElement("div")}function eme(t){var e={"data-placement":t.placement};return t.referenceHidden&&(e["data-reference-hidden"]=""),t.escaped&&(e["data-escaped"]=""),e}function N7(t,e){if(t===e)return!0;if(typeof t=="object"&&t!=null&&typeof e=="object"&&e!=null){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var n in t)if(e.hasOwnProperty(n)){if(!N7(t[n],e[n]))return!1}else return!1;return!0}else return!1}function tme(t){var e=[];return t.forEach(function(n){e.find(function(r){return N7(n,r)})||e.push(n)}),e}function nme(t,e){var n,r;return Object.assign({},e,{popperOptions:Object.assign({},t.popperOptions,e.popperOptions,{modifiers:tme([].concat(((n=t.popperOptions)==null?void 0:n.modifiers)||[],((r=e.popperOptions)==null?void 0:r.modifiers)||[]))})})}var y2=D7?ee.useLayoutEffect:ee.useEffect;function rme(t){var e=ee.useRef();return e.current||(e.current=typeof t=="function"?t():t),e.current}function vA(t,e,n){n.split(/\s+/).forEach(function(r){r&&t.classList[e](r)})}var ime={name:"className",defaultValue:"",fn:function(e){var n=e.popper.firstElementChild,r=function(){var a;return!!((a=e.props.render)!=null&&a.$$tippy)};function i(){e.props.className&&!r()||vA(n,"add",e.props.className)}function o(){r()&&vA(n,"remove",e.props.className)}return{onCreate:i,onBeforeUpdate:o,onAfterUpdate:i}}};function ome(t){function e(n){var r=n.children,i=n.content,o=n.visible,s=n.singleton,a=n.render,l=n.reference,u=n.disabled,c=u===void 0?!1:u,f=n.ignoreAttributes,d=f===void 0?!0:f;n.__source,n.__self;var h=O7(n,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"]),p=o!==void 0,m=s!==void 0,b=ee.useState(!1),y=b[0],v=b[1],w=ee.useState({}),g=w[0],x=w[1],k=ee.useState(),E=k[0],D=k[1],O=rme(function(){return{container:bA(),renders:1}}),N=Object.assign({ignoreAttributes:d},h,{content:O.container});p&&(N.trigger="manual",N.hideOnClick=!1),m&&(c=!0);var C=N,R=N.plugins||[];a&&(C=Object.assign({},N,{plugins:m&&s.data!=null?[].concat(R,[{fn:function(){return{onTrigger:function(S,P){var B=s.data.children.find(function(j){var z=j.instance;return z.reference===P.currentTarget});S.state.$$activeSingletonInstance=B.instance,D(B.content)}}}}]):R,render:function(){return{popper:O.container}}}));var T=[l].concat(r?[r.type]:[]);return y2(function(){var q=l;l&&l.hasOwnProperty("current")&&(q=l.current);var A=t(q||O.ref||bA(),Object.assign({},C,{plugins:[ime].concat(N.plugins||[])}));return O.instance=A,c&&A.disable(),o&&A.show(),m&&s.hook({instance:A,content:i,props:C,setSingletonContent:D}),v(!0),function(){A.destroy(),s==null||s.cleanup(A)}},T),y2(function(){var q;if(O.renders===1){O.renders++;return}var A=O.instance;A.setProps(nme(A.props,C)),(q=A.popperInstance)==null||q.forceUpdate(),c?A.disable():A.enable(),p&&(o?A.show():A.hide()),m&&s.hook({instance:A,content:i,props:C,setSingletonContent:D})}),y2(function(){var q;if(a){var A=O.instance;A.setProps({popperOptions:Object.assign({},A.props.popperOptions,{modifiers:[].concat((((q=A.props.popperOptions)==null?void 0:q.modifiers)||[]).filter(function(S){var P=S.name;return P!=="$$tippyReact"}),[{name:"$$tippyReact",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(P){var B,j=P.state,z=(B=j.modifiersData)==null?void 0:B.hide;(g.placement!==j.placement||g.referenceHidden!==(z==null?void 0:z.isReferenceHidden)||g.escaped!==(z==null?void 0:z.hasPopperEscaped))&&x({placement:j.placement,referenceHidden:z==null?void 0:z.isReferenceHidden,escaped:z==null?void 0:z.hasPopperEscaped}),j.attributes.popper={}}}])})})}},[g.placement,g.referenceHidden,g.escaped].concat(T)),tt.createElement(tt.Fragment,null,r?ee.cloneElement(r,{ref:function(A){O.ref=A,pk(r.ref,A)}}):null,y&&K1.createPortal(a?a(eme(g),E,O.instance):i,O.container))}return e}var sme=function(t,e){return ee.forwardRef(function(r,i){var o=r.children,s=O7(r,["children"]);return tt.createElement(t,Object.assign({},e,s),o?ee.cloneElement(o,{ref:function(l){pk(i,l),pk(o.ref,l)}}):null)})},ame=sme(ome($c));const lme=["https://nostr.build","https://nostrcheck.me","https://nostrage.com"];function wA(t){const{url:e,onClick:n}=t;return _.jsx("li",{className:"cursor-pointer w-full py-1 pl-2 hover:bg-white/10",onClick:()=>n(),children:e},e)}function $7(t){const[e,n]=ee.useState(!1),{uploadUrl:r,onChange:i}=t,o=ee.useMemo(()=>new URL(r),[r]).hostname;return _.jsx(_.Fragment,{children:_.jsx(ame,{interactive:!0,placement:"bottom-end",visible:e,className:"relative",onClickOutside:()=>n(!1),content:_.jsxs("div",{className:"pt-2 bg-black text-white text-sm rounded-lg min-h-12 w-48 z-50 relative",style:{zIndex:1e6,position:"relative"},children:[_.jsx("span",{className:"p-2 font-bold",children:"NIP-96 Servers"}),_.jsx("ul",{className:"m-0 mb-1 list-none",children:lme.map(s=>_.jsx(wA,{url:s,onClick:()=>{i("nip96",s),n(!1)}},s))}),_.jsx("span",{className:"p-2 font-bold",children:"Blossom Servers:"}),_.jsx("ul",{className:"m-0 mb-1 list-none",children:_.jsx(wA,{url:"http://localhost:3000",onClick:()=>{i("blossom","http://localhost:3000"),n(!1)}})})]}),children:_.jsx("button",{className:"py-1 px-2 rounded-full border border-white/20 bg-black text-white",onClick:s=>{n(!e),s.preventDefault()},children:_.jsxs("span",{className:"text-sm flex flex-row items-center text-ellipsis overflow-hidden max-w-28",children:[o," ",_.jsx(wT,{size:16})]})})})})}function I7(t){const{uploading:e=!0}=t;return _.jsx("div",{className:`absolute top-0 bottom-0 left-0 right-0 bg-black/50 flex items-center justify-center pointer-events-none rounded-lg ease-in transition-opacity ${e?"opacity-100":"opacity-0"}`,children:_.jsxs("svg",{className:"animate-spin -ml-1 mr-3 h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[_.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),_.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})})}function R7(t){const{src:e}=t;return _.jsx(_.Fragment,{children:_.jsx("img",{src:e,className:"max-h-80 rounded-lg my-2"})})}function ume(t){const{src:e,alt:n,uploadUrl:r,uploading:i,uploadError:o,sha256:s}=t.node.attrs;return _.jsxs(_a,{"data-drag-handle":"",draggable:t.node.type.spec.draggable,className:`relative my-2 [&>img]:m-0 w-fit h-fit ${t.selected?"opacity-90":""}`,children:[_.jsx(ey,{onClick:()=>t.deleteNode()}),_.jsx(I7,{uploading:i}),_.jsx(R7,{src:e}),_.jsxs(M7,{children:[s?_.jsx("div",{}):_.jsx(T7,{value:n,onChange:a=>t.updateAttributes({alt:a})}),!s&&_.jsx($7,{uploadUrl:r,onChange:(a,l)=>{t.updateAttributes({uploadType:a,uploadUrl:l})}}),s&&_.jsx("span",{"data-tooltip":e,children:_.jsx(G1,{size:26,strokeWidth:"2.5",className:"p-1 flex flex-row justify-between rounded-full border border-white/20 bg-black text-green-300 text-xs right-2 bottom-2 z-50"})}),o&&_.jsx("span",{"data-tooltip":o,className:"",children:_.jsx(xT,{size:28,strokeWidth:"1.5",className:"border border-white/20 bg-black rounded-full py-1 ml-1 text-red-500 relative top-0"})})]})]})}const cme=function(e){const{bolt11:n,lnbc:r}=e.node.attrs,[i,o]=ee.useState(!1),s=ee.useMemo(()=>{var u;return(((u=n.sections.find(c=>c.name==="amount"))==null?void 0:u.value)||0)/1e3},[n]),a=ee.useMemo(()=>{var c;const u=(c=n.sections.find(f=>f.name==="timestamp"))==null?void 0:c.value;return Date.now()>(u+n.expiry)*1e3},[n]),l=ee.useCallback(()=>{navigator.clipboard.writeText(r).then(()=>{o(!0),setTimeout(()=>{o(!1)},2e3)})},[r]);return _.jsx(_a,{"data-drag-handle":"",draggable:e.node.type.spec.draggable,children:_.jsxs("div",{className:`relative my-2 bg-gray-100 border-gray-200 border border-solid py-8 px-8 rounded-xl ${e.selected?"opacity-60":""}`,children:[_.jsxs("button",{className:"absolute right-4 top-4",onClick:()=>l(),children:[i&&_.jsx(G1,{size:20,strokeWidth:"2.5",className:"text-green-600"}),!i&&_.jsx(kT,{size:20})]}),_.jsxs("h3",{className:"flex flex-row items-center",children:[_.jsx(UB,{strokeWidth:"1.4",size:34,className:"mr-4 bg-gray-200 rounded-full p-1 text-purple-500"}),"Lightning Invoice"]}),_.jsxs("h1",{className:"mt-12",children:[s," SATS"]}),a&&"expired"]})})};var ja=Symbol("verified"),fme=t=>t instanceof Object;function dme(t){if(!fme(t)||typeof t.kind!="number"||typeof t.content!="string"||typeof t.created_at!="number"||typeof t.pubkey!="string"||!t.pubkey.match(/^[a-f0-9]{64}$/)||!Array.isArray(t.tags))return!1;for(let e=0;eo===n.slice(1)&&i.indexOf(s)!==-1))return!1}return!(t.since&&e.created_att.until)}function kme(t,e){for(let n=0;n{const e=new MessageChannel,n=()=>{e.port1.removeEventListener("message",n),t()};e.port1.addEventListener("message",n),e.port2.postMessage(0),e.port1.start()})}var _me=t=>(t[ja]=!0,!0),F7=class{constructor(t,e){Te(this,"url");Te(this,"_connected",!1);Te(this,"onclose",null);Te(this,"onnotice",t=>console.debug(`NOTICE from ${this.url}: ${t}`));Te(this,"_onauth",null);Te(this,"baseEoseTimeout",4400);Te(this,"connectionTimeout",4400);Te(this,"openSubs",new Map);Te(this,"connectionTimeoutHandle");Te(this,"connectionPromise");Te(this,"openCountRequests",new Map);Te(this,"openEventPublishes",new Map);Te(this,"ws");Te(this,"incomingMessageQueue",new mme);Te(this,"queueRunning",!1);Te(this,"challenge");Te(this,"serial",0);Te(this,"verifyEvent");Te(this,"_WebSocket");this.url=zf(t),this.verifyEvent=e.verifyEvent,this._WebSocket=e.websocketImplementation||WebSocket}static async connect(t,e){const n=new F7(t,e);return await n.connect(),n}closeAllSubscriptions(t){for(let[e,n]of this.openSubs)n.close(t);this.openSubs.clear();for(let[e,n]of this.openEventPublishes)n.reject(new Error(t));this.openEventPublishes.clear();for(let[e,n]of this.openCountRequests)n.reject(new Error(t));this.openCountRequests.clear()}get connected(){return this._connected}async connect(){return this.connectionPromise?this.connectionPromise:(this.challenge=void 0,this.connectionPromise=new Promise((t,e)=>{this.connectionTimeoutHandle=setTimeout(()=>{var n;e("connection timed out"),this.connectionPromise=void 0,(n=this.onclose)==null||n.call(this),this.closeAllSubscriptions("relay connection timed out")},this.connectionTimeout);try{this.ws=new this._WebSocket(this.url)}catch(n){e(n);return}this.ws.onopen=()=>{clearTimeout(this.connectionTimeoutHandle),this._connected=!0,t()},this.ws.onerror=n=>{var r;e(n.message||"websocket error"),this._connected&&(this._connected=!1,this.connectionPromise=void 0,(r=this.onclose)==null||r.call(this),this.closeAllSubscriptions("relay connection errored"))},this.ws.onclose=async()=>{var n;this._connected&&(this._connected=!1,this.connectionPromise=void 0,(n=this.onclose)==null||n.call(this),this.closeAllSubscriptions("relay connection closed"))},this.ws.onmessage=this._onmessage.bind(this)}),this.connectionPromise)}async runQueue(){for(this.queueRunning=!0;this.handleNext()!==!1;)await Cme();this.queueRunning=!1}handleNext(){var n,r,i;const t=this.incomingMessageQueue.dequeue();if(!t)return!1;const e=Eme(t);if(e){const o=this.openSubs.get(e);if(!o)return;const s=xme(t,"id"),a=(n=o.alreadyHaveEvent)==null?void 0:n.call(o,s);if((r=o.receivedEvent)==null||r.call(o,this,s),a)return}try{let o=JSON.parse(t);switch(o[0]){case"EVENT":{const s=this.openSubs.get(o[1]),a=o[2];this.verifyEvent(a)&&kme(s.filters,a)&&s.onevent(a);return}case"COUNT":{const s=o[1],a=o[2],l=this.openCountRequests.get(s);l&&(l.resolve(a.count),this.openCountRequests.delete(s));return}case"EOSE":{const s=this.openSubs.get(o[1]);if(!s)return;s.receivedEose();return}case"OK":{const s=o[1],a=o[2],l=o[3],u=this.openEventPublishes.get(s);a?u.resolve(l):u.reject(new Error(l)),this.openEventPublishes.delete(s);return}case"CLOSED":{const s=o[1],a=this.openSubs.get(s);if(!a)return;a.closed=!0,a.close(o[2]);return}case"NOTICE":this.onnotice(o[1]);return;case"AUTH":{this.challenge=o[1],(i=this._onauth)==null||i.call(this,o[1]);return}}}catch{return}}async send(t){if(!this.connectionPromise)throw new Error("sending on closed connection");this.connectionPromise.then(()=>{var e;(e=this.ws)==null||e.send(t)})}async auth(t){if(!this.challenge)throw new Error("can't perform auth, no challenge was received");const e=await t(Sme(this.url,this.challenge)),n=new Promise((r,i)=>{this.openEventPublishes.set(e.id,{resolve:r,reject:i})});return this.send('["AUTH",'+JSON.stringify(e)+"]"),n}async publish(t){const e=new Promise((n,r)=>{this.openEventPublishes.set(t.id,{resolve:n,reject:r})});return this.send('["EVENT",'+JSON.stringify(t)+"]"),e}async count(t,e){this.serial++;const n=(e==null?void 0:e.id)||"count:"+this.serial,r=new Promise((i,o)=>{this.openCountRequests.set(n,{resolve:i,reject:o})});return this.send('["COUNT","'+n+'",'+JSON.stringify(t).substring(1)),r}subscribe(t,e){const n=this.prepareSubscription(t,e);return n.fire(),n}prepareSubscription(t,e){this.serial++;const n=e.id||"sub:"+this.serial,r=new Ame(this,n,t,e);return this.openSubs.set(n,r),r}close(){var t;this.closeAllSubscriptions("relay connection closed by us"),this._connected=!1,(t=this.ws)==null||t.close()}_onmessage(t){this.incomingMessageQueue.enqueue(t.data),this.queueRunning||this.runQueue()}},Ame=class{constructor(t,e,n,r){Te(this,"relay");Te(this,"id");Te(this,"closed",!1);Te(this,"eosed",!1);Te(this,"filters");Te(this,"alreadyHaveEvent");Te(this,"receivedEvent");Te(this,"onevent");Te(this,"oneose");Te(this,"onclose");Te(this,"eoseTimeout");Te(this,"eoseTimeoutHandle");this.relay=t,this.filters=n,this.id=e,this.alreadyHaveEvent=r.alreadyHaveEvent,this.receivedEvent=r.receivedEvent,this.eoseTimeout=r.eoseTimeout||t.baseEoseTimeout,this.oneose=r.oneose,this.onclose=r.onclose,this.onevent=r.onevent||(i=>{console.warn(`onevent() callback not defined for subscription '${this.id}' in relay ${this.relay.url}. event received:`,i)})}fire(){this.relay.send('["REQ","'+this.id+'",'+JSON.stringify(this.filters).substring(1)),this.eoseTimeoutHandle=setTimeout(this.receivedEose.bind(this),this.eoseTimeout)}receivedEose(){var t;this.eosed||(clearTimeout(this.eoseTimeoutHandle),this.eosed=!0,(t=this.oneose)==null||t.call(this))}close(t="closed by caller"){var e;!this.closed&&this.relay.connected&&(this.relay.send('["CLOSE",'+JSON.stringify(this.id)+"]"),this.closed=!0),this.relay.openSubs.delete(this.id),(e=this.onclose)==null||e.call(this,t)}},Tme=class{constructor(t){Te(this,"relays",new Map);Te(this,"seenOn",new Map);Te(this,"trackRelays",!1);Te(this,"verifyEvent");Te(this,"trustedRelayURLs",new Set);Te(this,"_WebSocket");this.verifyEvent=t.verifyEvent,this._WebSocket=t.websocketImplementation}async ensureRelay(t,e){t=zf(t);let n=this.relays.get(t);return n||(n=new F7(t,{verifyEvent:this.trustedRelayURLs.has(t)?_me:this.verifyEvent,websocketImplementation:this._WebSocket}),e!=null&&e.connectionTimeout&&(n.connectionTimeout=e.connectionTimeout),this.relays.set(t,n)),await n.connect(),n}close(t){t.map(zf).forEach(e=>{var n;(n=this.relays.get(e))==null||n.close()})}subscribeMany(t,e,n){return this.subscribeManyMap(Object.fromEntries(t.map(r=>[r,e])),n)}subscribeManyMap(t,e){this.trackRelays&&(e.receivedEvent=(f,d)=>{let h=this.seenOn.get(d);h||(h=new Set,this.seenOn.set(d,h)),h.add(f)});const n=new Set,r=[],i=Object.keys(t).length,o=[];let s=f=>{var d;o[f]=!0,o.filter(h=>h).length===i&&((d=e.oneose)==null||d.call(e),s=()=>{})};const a=[];let l=(f,d)=>{var h;s(f),a[f]=d,a.filter(p=>p).length===i&&((h=e.onclose)==null||h.call(e,a),l=()=>{})};const u=f=>{var h;if((h=e.alreadyHaveEvent)!=null&&h.call(e,f))return!0;const d=n.has(f);return n.add(f),d},c=Promise.all(Object.entries(t).map(async(f,d,h)=>{if(h.indexOf(f)!==d){l(d,"duplicate url");return}let[p,m]=f;p=zf(p);let b;try{b=await this.ensureRelay(p,{connectionTimeout:e.maxWait?Math.max(e.maxWait*.8,e.maxWait-1e3):void 0})}catch(v){l(d,(v==null?void 0:v.message)||String(v));return}let y=b.subscribe(m,{...e,oneose:()=>s(d),onclose:v=>l(d,v),alreadyHaveEvent:u,eoseTimeout:e.maxWait});r.push(y)}));return{async close(){await c,r.forEach(f=>{f.close()})}}}subscribeManyEose(t,e,n){const r=this.subscribeMany(t,e,{...n,oneose(){r.close()}});return r}async querySync(t,e,n){return new Promise(async r=>{const i=[];this.subscribeManyEose(t,[e],{...n,onevent(o){i.push(o)},onclose(o){r(i)}})})}async get(t,e,n){e.limit=1;const r=await this.querySync(t,e,n);return r.sort((i,o)=>o.created_at-i.created_at),r[0]||null}publish(t,e){return t.map(zf).map(async(n,r,i)=>i.indexOf(n)!==r?Promise.reject("duplicate url"):(await this.ensureRelay(n)).publish(e))}listConnectionStatus(){const t=new Map;return this.relays.forEach((e,n)=>t.set(n,e.connected)),t}destroy(){this.relays.forEach(t=>t.close()),this.relays=new Map}},L7;try{L7=WebSocket}catch{}var Mme=class extends Tme{constructor(){super({verifyEvent:bme,websocketImplementation:L7})}};const RE=new Mme;function FE(t,e=[]){const[n,r]=ee.useState(),i=(n==null?void 0:n.created_at)||0;return ee.useEffect(()=>{if(t){const o=RE.subscribeMany([...e,"wss://purplepag.es"],[{kinds:[0],authors:[t]}],{onevent(s){s.created_at>=i&&r(s)}});return()=>o.close()}},[t,e,i]),n}function LE(t){return ee.useMemo(()=>{if(t)return JSON.parse(t.content||"{}")||{}},[t])}function B7(t){const{pubkey:e,relays:n}=t,r=FE(e,n),i=LE(r);return _.jsxs("span",{"data-tooltip":` +`?i.slice(0,-1):i};return e.renderer.rules.hardbreak=n(e.renderer.rules.hardbreak),e.renderer.rules.softbreak=n(e.renderer.rules.softbreak),e.renderer.rules.fence=n(e.renderer.rules.fence),e.renderer.rules.code_block=n(e.renderer.rules.code_block),e.renderer.renderToken=n(e.renderer.renderToken.bind(e.renderer)),e}}const rme=yi.create({name:"markdownClipboard",addOptions(){return{transformPastedText:!1,transformCopiedText:!1}},addProseMirrorPlugins(){return[new Uc({key:new Vc("markdownClipboard"),props:{clipboardTextParser:(t,e,n)=>{if(n||!this.options.transformPastedText)return null;const r=this.editor.storage.markdown.parser.parse(t,{inline:!0});return th.fromSchema(this.editor.schema).parseSlice(IE(r),{preserveWhitespace:!0,context:e})},clipboardTextSerializer:t=>this.options.transformCopiedText?this.editor.storage.markdown.serializer.serialize(t.content):null}})]}}),A7=yi.create({name:"markdown",priority:50,addOptions(){return{html:!0,tightLists:!0,tightListClass:"tight",bulletListMarker:"-",linkify:!1,breaks:!1,transformPastedText:!1,transformCopiedText:!1}},addCommands(){const t=Yfe.Commands.config.addCommands();return{setContent:(e,n,r)=>i=>t.setContent(i.editor.storage.markdown.parser.parse(e),n,r)(i),insertContentAt:(e,n,r)=>i=>t.insertContentAt(e,i.editor.storage.markdown.parser.parse(n,{inline:!0}),r)(i)}},onBeforeCreate(){this.editor.storage.markdown={options:{...this.options},parser:new nme(this.editor,this.options),serializer:new tme(this.editor),getMarkdown:()=>this.editor.storage.markdown.serializer.serialize(this.editor.state.doc)},this.editor.options.initialContent=this.editor.options.content,this.editor.options.content=this.editor.storage.markdown.parser.parse(this.editor.options.content)},onCreate(){this.editor.options.content=this.editor.options.initialContent,delete this.editor.options.initialContent},addStorage(){return{}},addExtensions(){return[s0e.configure({tight:this.options.tightLists,tightClass:this.options.tightListClass}),rme.configure({transformPastedText:this.options.transformPastedText,transformCopiedText:this.options.transformCopiedText})]}});function T7(t){const[e,n]=ee.useState(!1);return _.jsxs(_.Fragment,{children:[_.jsx("div",{className:`absolute transition-all ease-in duration-100 z-40 flex left-0 top-0 right-0 bottom-0 text-center items-center justify-center rounded-lg ${e?"bg-black/70":""} text-white ${e?"":"pointer-events-none"}`,children:e&&_.jsx("textarea",{autoFocus:!0,value:t.value,className:"bg-transparent mx-4 w-full outline-none text-sm h-28 mt-14 resize-none",placeholder:"Alt description",onChange:r=>t.onChange(r.currentTarget.value)})}),_.jsx("div",{className:"w-full",children:_.jsx("button",{onClick:()=>n(r=>!r),className:`relative py-1 px-2 bg-black/80 border border-white/20 rounded-full ${e?"text-white":"text-gray-200"} z-50 text-xs`,children:"Alt"})})]})}function ey(t){return _.jsx("button",{className:"absolute bg-black/80 p-1 right-2 top-2 rounded-full text-white z-10",onClick:()=>t.onClick(),children:_.jsx(WB,{strokeWidth:"2.0",size:18})})}function M7(t){return _.jsx("div",{className:"absolute bottom-0 left-0 right-0 top-0 flex flex-row items-end justify-between p-2",children:t.children})}function O7(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}var D7=typeof window<"u"&&typeof document<"u";function pk(t,e){t&&(typeof t=="function"&&t(e),{}.hasOwnProperty.call(t,"current")&&(t.current=e))}function bA(){return D7&&document.createElement("div")}function ime(t){var e={"data-placement":t.placement};return t.referenceHidden&&(e["data-reference-hidden"]=""),t.escaped&&(e["data-escaped"]=""),e}function N7(t,e){if(t===e)return!0;if(typeof t=="object"&&t!=null&&typeof e=="object"&&e!=null){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var n in t)if(e.hasOwnProperty(n)){if(!N7(t[n],e[n]))return!1}else return!1;return!0}else return!1}function ome(t){var e=[];return t.forEach(function(n){e.find(function(r){return N7(n,r)})||e.push(n)}),e}function sme(t,e){var n,r;return Object.assign({},e,{popperOptions:Object.assign({},t.popperOptions,e.popperOptions,{modifiers:ome([].concat(((n=t.popperOptions)==null?void 0:n.modifiers)||[],((r=e.popperOptions)==null?void 0:r.modifiers)||[]))})})}var y2=D7?ee.useLayoutEffect:ee.useEffect;function ame(t){var e=ee.useRef();return e.current||(e.current=typeof t=="function"?t():t),e.current}function vA(t,e,n){n.split(/\s+/).forEach(function(r){r&&t.classList[e](r)})}var lme={name:"className",defaultValue:"",fn:function(e){var n=e.popper.firstElementChild,r=function(){var a;return!!((a=e.props.render)!=null&&a.$$tippy)};function i(){e.props.className&&!r()||vA(n,"add",e.props.className)}function o(){r()&&vA(n,"remove",e.props.className)}return{onCreate:i,onBeforeUpdate:o,onAfterUpdate:i}}};function ume(t){function e(n){var r=n.children,i=n.content,o=n.visible,s=n.singleton,a=n.render,l=n.reference,u=n.disabled,c=u===void 0?!1:u,f=n.ignoreAttributes,d=f===void 0?!0:f;n.__source,n.__self;var h=O7(n,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"]),p=o!==void 0,m=s!==void 0,b=ee.useState(!1),y=b[0],v=b[1],w=ee.useState({}),g=w[0],x=w[1],k=ee.useState(),E=k[0],D=k[1],O=ame(function(){return{container:bA(),renders:1}}),N=Object.assign({ignoreAttributes:d},h,{content:O.container});p&&(N.trigger="manual",N.hideOnClick=!1),m&&(c=!0);var C=N,R=N.plugins||[];a&&(C=Object.assign({},N,{plugins:m&&s.data!=null?[].concat(R,[{fn:function(){return{onTrigger:function(S,P){var B=s.data.children.find(function(j){var z=j.instance;return z.reference===P.currentTarget});S.state.$$activeSingletonInstance=B.instance,D(B.content)}}}}]):R,render:function(){return{popper:O.container}}}));var T=[l].concat(r?[r.type]:[]);return y2(function(){var q=l;l&&l.hasOwnProperty("current")&&(q=l.current);var A=t(q||O.ref||bA(),Object.assign({},C,{plugins:[lme].concat(N.plugins||[])}));return O.instance=A,c&&A.disable(),o&&A.show(),m&&s.hook({instance:A,content:i,props:C,setSingletonContent:D}),v(!0),function(){A.destroy(),s==null||s.cleanup(A)}},T),y2(function(){var q;if(O.renders===1){O.renders++;return}var A=O.instance;A.setProps(sme(A.props,C)),(q=A.popperInstance)==null||q.forceUpdate(),c?A.disable():A.enable(),p&&(o?A.show():A.hide()),m&&s.hook({instance:A,content:i,props:C,setSingletonContent:D})}),y2(function(){var q;if(a){var A=O.instance;A.setProps({popperOptions:Object.assign({},A.props.popperOptions,{modifiers:[].concat((((q=A.props.popperOptions)==null?void 0:q.modifiers)||[]).filter(function(S){var P=S.name;return P!=="$$tippyReact"}),[{name:"$$tippyReact",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(P){var B,j=P.state,z=(B=j.modifiersData)==null?void 0:B.hide;(g.placement!==j.placement||g.referenceHidden!==(z==null?void 0:z.isReferenceHidden)||g.escaped!==(z==null?void 0:z.hasPopperEscaped))&&x({placement:j.placement,referenceHidden:z==null?void 0:z.isReferenceHidden,escaped:z==null?void 0:z.hasPopperEscaped}),j.attributes.popper={}}}])})})}},[g.placement,g.referenceHidden,g.escaped].concat(T)),tt.createElement(tt.Fragment,null,r?ee.cloneElement(r,{ref:function(A){O.ref=A,pk(r.ref,A)}}):null,y&&K1.createPortal(a?a(ime(g),E,O.instance):i,O.container))}return e}var cme=function(t,e){return ee.forwardRef(function(r,i){var o=r.children,s=O7(r,["children"]);return tt.createElement(t,Object.assign({},e,s),o?ee.cloneElement(o,{ref:function(l){pk(i,l),pk(o.ref,l)}}):null)})},fme=cme(ume($c));const dme=["https://nostr.build","https://nostrcheck.me","https://nostrage.com"];function wA(t){const{url:e,onClick:n}=t;return _.jsx("li",{className:"cursor-pointer w-full py-1 pl-2 hover:bg-white/10",onClick:()=>n(),children:e},e)}function $7(t){const[e,n]=ee.useState(!1),{uploadUrl:r,onChange:i}=t,o=ee.useMemo(()=>new URL(r),[r]).hostname;return _.jsx(_.Fragment,{children:_.jsx(fme,{interactive:!0,placement:"bottom-end",visible:e,className:"relative",onClickOutside:()=>n(!1),content:_.jsxs("div",{className:"pt-2 bg-black text-white text-sm rounded-lg min-h-12 w-48 z-50 relative",style:{zIndex:1e6,position:"relative"},children:[_.jsx("span",{className:"p-2 font-bold",children:"NIP-96 Servers"}),_.jsx("ul",{className:"m-0 mb-1 list-none",children:dme.map(s=>_.jsx(wA,{url:s,onClick:()=>{i("nip96",s),n(!1)}},s))}),_.jsx("span",{className:"p-2 font-bold",children:"Blossom Servers:"}),_.jsx("ul",{className:"m-0 mb-1 list-none",children:_.jsx(wA,{url:"http://localhost:3000",onClick:()=>{i("blossom","http://localhost:3000"),n(!1)}})})]}),children:_.jsx("button",{className:"py-1 px-2 rounded-full border border-white/20 bg-black text-white",onClick:s=>{n(!e),s.preventDefault()},children:_.jsxs("span",{className:"text-sm flex flex-row items-center text-ellipsis overflow-hidden max-w-28",children:[o," ",_.jsx(wT,{size:16})]})})})})}function I7(t){const{uploading:e=!0}=t;return _.jsx("div",{className:`absolute top-0 bottom-0 left-0 right-0 bg-black/50 flex items-center justify-center pointer-events-none rounded-lg ease-in transition-opacity ${e?"opacity-100":"opacity-0"}`,children:_.jsxs("svg",{className:"animate-spin -ml-1 mr-3 h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[_.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),_.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})})}function R7(t){const{src:e}=t;return _.jsx(_.Fragment,{children:_.jsx("img",{src:e,className:"max-h-80 rounded-lg my-2"})})}function hme(t){const{src:e,alt:n,uploadUrl:r,uploading:i,uploadError:o,sha256:s}=t.node.attrs;return _.jsxs(_a,{"data-drag-handle":"",draggable:t.node.type.spec.draggable,className:`relative my-2 [&>img]:m-0 w-fit h-fit ${t.selected?"opacity-90":""}`,children:[_.jsx(ey,{onClick:()=>t.deleteNode()}),_.jsx(I7,{uploading:i}),_.jsx(R7,{src:e}),_.jsxs(M7,{children:[s?_.jsx("div",{}):_.jsx(T7,{value:n,onChange:a=>t.updateAttributes({alt:a})}),!s&&_.jsx($7,{uploadUrl:r,onChange:(a,l)=>{t.updateAttributes({uploadType:a,uploadUrl:l})}}),s&&_.jsx("span",{"data-tooltip":e,children:_.jsx(G1,{size:26,strokeWidth:"2.5",className:"p-1 flex flex-row justify-between rounded-full border border-white/20 bg-black text-green-300 text-xs right-2 bottom-2 z-50"})}),o&&_.jsx("span",{"data-tooltip":o,className:"",children:_.jsx(xT,{size:28,strokeWidth:"1.5",className:"border border-white/20 bg-black rounded-full py-1 ml-1 text-red-500 relative top-0"})})]})]})}const pme=function(e){const{bolt11:n,lnbc:r}=e.node.attrs,[i,o]=ee.useState(!1),s=ee.useMemo(()=>{var u;return(((u=n.sections.find(c=>c.name==="amount"))==null?void 0:u.value)||0)/1e3},[n]),a=ee.useMemo(()=>{var c;const u=(c=n.sections.find(f=>f.name==="timestamp"))==null?void 0:c.value;return Date.now()>(u+n.expiry)*1e3},[n]),l=ee.useCallback(()=>{navigator.clipboard.writeText(r).then(()=>{o(!0),setTimeout(()=>{o(!1)},2e3)})},[r]);return _.jsx(_a,{"data-drag-handle":"",draggable:e.node.type.spec.draggable,children:_.jsxs("div",{className:`relative my-2 bg-gray-100 border-gray-200 border border-solid py-8 px-8 rounded-xl ${e.selected?"opacity-60":""}`,children:[_.jsxs("button",{className:"absolute right-4 top-4",onClick:()=>l(),children:[i&&_.jsx(G1,{size:20,strokeWidth:"2.5",className:"text-green-600"}),!i&&_.jsx(kT,{size:20})]}),_.jsxs("h3",{className:"flex flex-row items-center",children:[_.jsx(VB,{strokeWidth:"1.4",size:34,className:"mr-4 bg-gray-200 rounded-full p-1 text-purple-500"}),"Lightning Invoice"]}),_.jsxs("h1",{className:"mt-12",children:[s," SATS"]}),a&&"expired"]})})};var ja=Symbol("verified"),mme=t=>t instanceof Object;function gme(t){if(!mme(t)||typeof t.kind!="number"||typeof t.content!="string"||typeof t.created_at!="number"||typeof t.pubkey!="string"||!t.pubkey.match(/^[a-f0-9]{64}$/)||!Array.isArray(t.tags))return!1;for(let e=0;eo===n.slice(1)&&i.indexOf(s)!==-1))return!1}return!(t.since&&e.created_att.until)}function Cme(t,e){for(let n=0;n{const e=new MessageChannel,n=()=>{e.port1.removeEventListener("message",n),t()};e.port1.addEventListener("message",n),e.port2.postMessage(0),e.port1.start()})}var Ome=t=>(t[ja]=!0,!0),F7=class{constructor(t,e){Te(this,"url");Te(this,"_connected",!1);Te(this,"onclose",null);Te(this,"onnotice",t=>console.debug(`NOTICE from ${this.url}: ${t}`));Te(this,"_onauth",null);Te(this,"baseEoseTimeout",4400);Te(this,"connectionTimeout",4400);Te(this,"openSubs",new Map);Te(this,"connectionTimeoutHandle");Te(this,"connectionPromise");Te(this,"openCountRequests",new Map);Te(this,"openEventPublishes",new Map);Te(this,"ws");Te(this,"incomingMessageQueue",new vme);Te(this,"queueRunning",!1);Te(this,"challenge");Te(this,"serial",0);Te(this,"verifyEvent");Te(this,"_WebSocket");this.url=zf(t),this.verifyEvent=e.verifyEvent,this._WebSocket=e.websocketImplementation||WebSocket}static async connect(t,e){const n=new F7(t,e);return await n.connect(),n}closeAllSubscriptions(t){for(let[e,n]of this.openSubs)n.close(t);this.openSubs.clear();for(let[e,n]of this.openEventPublishes)n.reject(new Error(t));this.openEventPublishes.clear();for(let[e,n]of this.openCountRequests)n.reject(new Error(t));this.openCountRequests.clear()}get connected(){return this._connected}async connect(){return this.connectionPromise?this.connectionPromise:(this.challenge=void 0,this.connectionPromise=new Promise((t,e)=>{this.connectionTimeoutHandle=setTimeout(()=>{var n;e("connection timed out"),this.connectionPromise=void 0,(n=this.onclose)==null||n.call(this),this.closeAllSubscriptions("relay connection timed out")},this.connectionTimeout);try{this.ws=new this._WebSocket(this.url)}catch(n){e(n);return}this.ws.onopen=()=>{clearTimeout(this.connectionTimeoutHandle),this._connected=!0,t()},this.ws.onerror=n=>{var r;e(n.message||"websocket error"),this._connected&&(this._connected=!1,this.connectionPromise=void 0,(r=this.onclose)==null||r.call(this),this.closeAllSubscriptions("relay connection errored"))},this.ws.onclose=async()=>{var n;this._connected&&(this._connected=!1,this.connectionPromise=void 0,(n=this.onclose)==null||n.call(this),this.closeAllSubscriptions("relay connection closed"))},this.ws.onmessage=this._onmessage.bind(this)}),this.connectionPromise)}async runQueue(){for(this.queueRunning=!0;this.handleNext()!==!1;)await Mme();this.queueRunning=!1}handleNext(){var n,r,i;const t=this.incomingMessageQueue.dequeue();if(!t)return!1;const e=Ame(t);if(e){const o=this.openSubs.get(e);if(!o)return;const s=_me(t,"id"),a=(n=o.alreadyHaveEvent)==null?void 0:n.call(o,s);if((r=o.receivedEvent)==null||r.call(o,this,s),a)return}try{let o=JSON.parse(t);switch(o[0]){case"EVENT":{const s=this.openSubs.get(o[1]),a=o[2];this.verifyEvent(a)&&Cme(s.filters,a)&&s.onevent(a);return}case"COUNT":{const s=o[1],a=o[2],l=this.openCountRequests.get(s);l&&(l.resolve(a.count),this.openCountRequests.delete(s));return}case"EOSE":{const s=this.openSubs.get(o[1]);if(!s)return;s.receivedEose();return}case"OK":{const s=o[1],a=o[2],l=o[3],u=this.openEventPublishes.get(s);a?u.resolve(l):u.reject(new Error(l)),this.openEventPublishes.delete(s);return}case"CLOSED":{const s=o[1],a=this.openSubs.get(s);if(!a)return;a.closed=!0,a.close(o[2]);return}case"NOTICE":this.onnotice(o[1]);return;case"AUTH":{this.challenge=o[1],(i=this._onauth)==null||i.call(this,o[1]);return}}}catch{return}}async send(t){if(!this.connectionPromise)throw new Error("sending on closed connection");this.connectionPromise.then(()=>{var e;(e=this.ws)==null||e.send(t)})}async auth(t){if(!this.challenge)throw new Error("can't perform auth, no challenge was received");const e=await t(Tme(this.url,this.challenge)),n=new Promise((r,i)=>{this.openEventPublishes.set(e.id,{resolve:r,reject:i})});return this.send('["AUTH",'+JSON.stringify(e)+"]"),n}async publish(t){const e=new Promise((n,r)=>{this.openEventPublishes.set(t.id,{resolve:n,reject:r})});return this.send('["EVENT",'+JSON.stringify(t)+"]"),e}async count(t,e){this.serial++;const n=(e==null?void 0:e.id)||"count:"+this.serial,r=new Promise((i,o)=>{this.openCountRequests.set(n,{resolve:i,reject:o})});return this.send('["COUNT","'+n+'",'+JSON.stringify(t).substring(1)),r}subscribe(t,e){const n=this.prepareSubscription(t,e);return n.fire(),n}prepareSubscription(t,e){this.serial++;const n=e.id||"sub:"+this.serial,r=new Dme(this,n,t,e);return this.openSubs.set(n,r),r}close(){var t;this.closeAllSubscriptions("relay connection closed by us"),this._connected=!1,(t=this.ws)==null||t.close()}_onmessage(t){this.incomingMessageQueue.enqueue(t.data),this.queueRunning||this.runQueue()}},Dme=class{constructor(t,e,n,r){Te(this,"relay");Te(this,"id");Te(this,"closed",!1);Te(this,"eosed",!1);Te(this,"filters");Te(this,"alreadyHaveEvent");Te(this,"receivedEvent");Te(this,"onevent");Te(this,"oneose");Te(this,"onclose");Te(this,"eoseTimeout");Te(this,"eoseTimeoutHandle");this.relay=t,this.filters=n,this.id=e,this.alreadyHaveEvent=r.alreadyHaveEvent,this.receivedEvent=r.receivedEvent,this.eoseTimeout=r.eoseTimeout||t.baseEoseTimeout,this.oneose=r.oneose,this.onclose=r.onclose,this.onevent=r.onevent||(i=>{console.warn(`onevent() callback not defined for subscription '${this.id}' in relay ${this.relay.url}. event received:`,i)})}fire(){this.relay.send('["REQ","'+this.id+'",'+JSON.stringify(this.filters).substring(1)),this.eoseTimeoutHandle=setTimeout(this.receivedEose.bind(this),this.eoseTimeout)}receivedEose(){var t;this.eosed||(clearTimeout(this.eoseTimeoutHandle),this.eosed=!0,(t=this.oneose)==null||t.call(this))}close(t="closed by caller"){var e;!this.closed&&this.relay.connected&&(this.relay.send('["CLOSE",'+JSON.stringify(this.id)+"]"),this.closed=!0),this.relay.openSubs.delete(this.id),(e=this.onclose)==null||e.call(this,t)}},Nme=class{constructor(t){Te(this,"relays",new Map);Te(this,"seenOn",new Map);Te(this,"trackRelays",!1);Te(this,"verifyEvent");Te(this,"trustedRelayURLs",new Set);Te(this,"_WebSocket");this.verifyEvent=t.verifyEvent,this._WebSocket=t.websocketImplementation}async ensureRelay(t,e){t=zf(t);let n=this.relays.get(t);return n||(n=new F7(t,{verifyEvent:this.trustedRelayURLs.has(t)?Ome:this.verifyEvent,websocketImplementation:this._WebSocket}),e!=null&&e.connectionTimeout&&(n.connectionTimeout=e.connectionTimeout),this.relays.set(t,n)),await n.connect(),n}close(t){t.map(zf).forEach(e=>{var n;(n=this.relays.get(e))==null||n.close()})}subscribeMany(t,e,n){return this.subscribeManyMap(Object.fromEntries(t.map(r=>[r,e])),n)}subscribeManyMap(t,e){this.trackRelays&&(e.receivedEvent=(f,d)=>{let h=this.seenOn.get(d);h||(h=new Set,this.seenOn.set(d,h)),h.add(f)});const n=new Set,r=[],i=Object.keys(t).length,o=[];let s=f=>{var d;o[f]=!0,o.filter(h=>h).length===i&&((d=e.oneose)==null||d.call(e),s=()=>{})};const a=[];let l=(f,d)=>{var h;s(f),a[f]=d,a.filter(p=>p).length===i&&((h=e.onclose)==null||h.call(e,a),l=()=>{})};const u=f=>{var h;if((h=e.alreadyHaveEvent)!=null&&h.call(e,f))return!0;const d=n.has(f);return n.add(f),d},c=Promise.all(Object.entries(t).map(async(f,d,h)=>{if(h.indexOf(f)!==d){l(d,"duplicate url");return}let[p,m]=f;p=zf(p);let b;try{b=await this.ensureRelay(p,{connectionTimeout:e.maxWait?Math.max(e.maxWait*.8,e.maxWait-1e3):void 0})}catch(v){l(d,(v==null?void 0:v.message)||String(v));return}let y=b.subscribe(m,{...e,oneose:()=>s(d),onclose:v=>l(d,v),alreadyHaveEvent:u,eoseTimeout:e.maxWait});r.push(y)}));return{async close(){await c,r.forEach(f=>{f.close()})}}}subscribeManyEose(t,e,n){const r=this.subscribeMany(t,e,{...n,oneose(){r.close()}});return r}async querySync(t,e,n){return new Promise(async r=>{const i=[];this.subscribeManyEose(t,[e],{...n,onevent(o){i.push(o)},onclose(o){r(i)}})})}async get(t,e,n){e.limit=1;const r=await this.querySync(t,e,n);return r.sort((i,o)=>o.created_at-i.created_at),r[0]||null}publish(t,e){return t.map(zf).map(async(n,r,i)=>i.indexOf(n)!==r?Promise.reject("duplicate url"):(await this.ensureRelay(n)).publish(e))}listConnectionStatus(){const t=new Map;return this.relays.forEach((e,n)=>t.set(n,e.connected)),t}destroy(){this.relays.forEach(t=>t.close()),this.relays=new Map}},L7;try{L7=WebSocket}catch{}var $me=class extends Nme{constructor(){super({verifyEvent:xme,websocketImplementation:L7})}};const RE=new $me;function FE(t,e=[]){const[n,r]=ee.useState(),i=(n==null?void 0:n.created_at)||0;return ee.useEffect(()=>{if(t){const o=RE.subscribeMany([...e,"wss://purplepag.es"],[{kinds:[0],authors:[t]}],{onevent(s){s.created_at>=i&&r(s)}});return()=>o.close()}},[t,e,i]),n}function LE(t){return ee.useMemo(()=>{if(t)return JSON.parse(t.content||"{}")||{}},[t])}function B7(t){const{pubkey:e,relays:n}=t,r=FE(e,n),i=LE(r);return _.jsxs("span",{"data-tooltip":` Pubkey: ${e} . Relays: ${JSON.stringify(n)} - `,children:[i&&_.jsxs("a",{children:["@",i.display_name||i.name||""]}),!i&&_.jsx("span",{className:"text-gray-600",children:"loading"})]})}function Ome(t){return _.jsx(_.Fragment,{children:_.jsx(_a,{as:"span",children:_.jsx(B7,{...t.node.attrs})})})}function Dme(t){const{pubkey:e,identifier:n}=t,r=FE(e),i=LE(r);return _.jsxs("div",{className:"border rounded-md p-2 pt-4 my-2",children:[_.jsxs("div",{className:"flex flex-row",children:[_.jsx("img",{src:i==null?void 0:i.picture,className:"size-8 rounded-full"}),_.jsx("span",{className:"ml-4",children:(i==null?void 0:i.display_name)||(i==null?void 0:i.name)})]}),_.jsx("div",{className:"border rounded-md p-2 mt-2",children:_.jsx("h6",{children:n})})]})}function Nme(t){return _.jsx(_a,{"data-drag-handle":"",draggable:t.node.type.spec.draggable,children:_.jsx("div",{className:`select-none rounded-md ${t.selected?"bg-blue-100":""}`,children:_.jsx(Dme,{...t.node.attrs})})})}const $me=bn.create({name:"doc",topNode:!0,content:"block+"}),Ime=bn.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",vce(this.options.HTMLAttributes,t)]},renderText(){return` -`},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:i,storedMarks:o}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:a}=r.extensionManager,l=o||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:u,dispatch:c})=>{if(c&&l&&s){const f=l.filter(d=>a.includes(d.type.name));u.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Rme=bn.create({name:"text",group:"inline"});class zl extends Error{}class Fme extends zl{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class Lme extends zl{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class Bme extends zl{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Ou extends zl{}class P7 extends zl{constructor(e){super(`Invalid unit ${e}`)}}class pr extends zl{}class Ss extends zl{constructor(){super("Zone is an abstract class")}}const le="numeric",Bi="short",jr="long",A1={year:le,month:le,day:le},z7={year:le,month:Bi,day:le},Pme={year:le,month:Bi,day:le,weekday:Bi},j7={year:le,month:jr,day:le},q7={year:le,month:jr,day:le,weekday:jr},V7={hour:le,minute:le},U7={hour:le,minute:le,second:le},H7={hour:le,minute:le,second:le,timeZoneName:Bi},W7={hour:le,minute:le,second:le,timeZoneName:jr},J7={hour:le,minute:le,hourCycle:"h23"},K7={hour:le,minute:le,second:le,hourCycle:"h23"},G7={hour:le,minute:le,second:le,hourCycle:"h23",timeZoneName:Bi},Z7={hour:le,minute:le,second:le,hourCycle:"h23",timeZoneName:jr},Y7={year:le,month:le,day:le,hour:le,minute:le},Q7={year:le,month:le,day:le,hour:le,minute:le,second:le},X7={year:le,month:Bi,day:le,hour:le,minute:le},eR={year:le,month:Bi,day:le,hour:le,minute:le,second:le},zme={year:le,month:Bi,day:le,weekday:Bi,hour:le,minute:le},tR={year:le,month:jr,day:le,hour:le,minute:le,timeZoneName:Bi},nR={year:le,month:jr,day:le,hour:le,minute:le,second:le,timeZoneName:Bi},rR={year:le,month:jr,day:le,weekday:jr,hour:le,minute:le,timeZoneName:jr},iR={year:le,month:jr,day:le,weekday:jr,hour:le,minute:le,second:le,timeZoneName:jr};class Ih{get type(){throw new Ss}get name(){throw new Ss}get ianaName(){return this.name}get isUniversal(){throw new Ss}offsetName(e,n){throw new Ss}formatOffset(e,n){throw new Ss}offset(e){throw new Ss}equals(e){throw new Ss}get isValid(){throw new Ss}}let v2=null;class ny extends Ih{static get instance(){return v2===null&&(v2=new ny),v2}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:n,locale:r}){return hR(e,n,r)}formatOffset(e,n){return pd(this.offset(e),n)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let C0={};function jme(t){return C0[t]||(C0[t]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),C0[t]}const qme={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Vme(t,e){const n=t.format(e).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,i,o,s,a,l,u,c]=r;return[s,i,o,a,l,u,c]}function Ume(t,e){const n=t.formatToParts(e),r=[];for(let i=0;i=0?p:1e3+p,(d-h)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let kA={};function Hme(t,e={}){const n=JSON.stringify([t,e]);let r=kA[n];return r||(r=new Intl.ListFormat(t,e),kA[n]=r),r}let mk={};function gk(t,e={}){const n=JSON.stringify([t,e]);let r=mk[n];return r||(r=new Intl.DateTimeFormat(t,e),mk[n]=r),r}let yk={};function Wme(t,e={}){const n=JSON.stringify([t,e]);let r=yk[n];return r||(r=new Intl.NumberFormat(t,e),yk[n]=r),r}let bk={};function Jme(t,e={}){const{base:n,...r}=e,i=JSON.stringify([t,r]);let o=bk[i];return o||(o=new Intl.RelativeTimeFormat(t,e),bk[i]=o),o}let jf=null;function Kme(){return jf||(jf=new Intl.DateTimeFormat().resolvedOptions().locale,jf)}let xA={};function Gme(t){let e=xA[t];if(!e){const n=new Intl.Locale(t);e="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,xA[t]=e}return e}function Zme(t){const e=t.indexOf("-x-");e!==-1&&(t=t.substring(0,e));const n=t.indexOf("-u-");if(n===-1)return[t];{let r,i;try{r=gk(t).resolvedOptions(),i=t}catch{const l=t.substring(0,n);r=gk(l).resolvedOptions(),i=l}const{numberingSystem:o,calendar:s}=r;return[i,o,s]}}function Yme(t,e,n){return(n||e)&&(t.includes("-u-")||(t+="-u"),n&&(t+=`-ca-${n}`),e&&(t+=`-nu-${e}`)),t}function Qme(t){const e=[];for(let n=1;n<=12;n++){const r=Re.utc(2009,n,1);e.push(t(r))}return e}function Xme(t){const e=[];for(let n=1;n<=7;n++){const r=Re.utc(2016,11,13+n);e.push(t(r))}return e}function Lp(t,e,n,r){const i=t.listingMode();return i==="error"?null:i==="en"?n(e):r(e)}function e1e(t){return t.numberingSystem&&t.numberingSystem!=="latn"?!1:t.numberingSystem==="latn"||!t.locale||t.locale.startsWith("en")||new Intl.DateTimeFormat(t.intl).resolvedOptions().numberingSystem==="latn"}class t1e{constructor(e,n,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:i,floor:o,...s}=r;if(!n||Object.keys(s).length>0){const a={useGrouping:!1,...r};r.padTo>0&&(a.minimumIntegerDigits=r.padTo),this.inf=Wme(e,a)}}format(e){if(this.inf){const n=this.floor?Math.floor(e):e;return this.inf.format(n)}else{const n=this.floor?Math.floor(e):jE(e,3);return Jt(n,this.padTo)}}}class n1e{constructor(e,n,r){this.opts=r,this.originalZone=void 0;let i;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){const s=-1*(e.offset/60),a=s>=0?`Etc/GMT+${s}`:`Etc/GMT${s}`;e.offset!==0&&es.create(a).valid?(i=a,this.dt=e):(i="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,i=e.zone.name):(i="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const o={...this.opts};o.timeZone=o.timeZone||i,this.dtf=gk(n,o)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(n=>{if(n.type==="timeZoneName"){const r=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...n,value:r}}else return n}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class r1e{constructor(e,n,r){this.opts={style:"long",...r},!n&&fR()&&(this.rtf=Jme(e,r))}format(e,n){return this.rtf?this.rtf.format(e,n):E1e(n,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,n){return this.rtf?this.rtf.formatToParts(e,n):[]}}const i1e={firstDay:1,minimalDays:4,weekend:[6,7]};class ct{static fromOpts(e){return ct.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,n,r,i,o=!1){const s=e||zt.defaultLocale,a=s||(o?"en-US":Kme()),l=n||zt.defaultNumberingSystem,u=r||zt.defaultOutputCalendar,c=vk(i)||zt.defaultWeekSettings;return new ct(a,l,u,c,s)}static resetCache(){jf=null,mk={},yk={},bk={}}static fromObject({locale:e,numberingSystem:n,outputCalendar:r,weekSettings:i}={}){return ct.create(e,n,r,i)}constructor(e,n,r,i,o){const[s,a,l]=Zme(e);this.locale=s,this.numberingSystem=n||a||null,this.outputCalendar=r||l||null,this.weekSettings=i,this.intl=Yme(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=o,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=e1e(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&n?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:ct.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,vk(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,n=!1){return Lp(this,e,gR,()=>{const r=n?{month:e,day:"numeric"}:{month:e},i=n?"format":"standalone";return this.monthsCache[i][e]||(this.monthsCache[i][e]=Qme(o=>this.extract(o,r,"month"))),this.monthsCache[i][e]})}weekdays(e,n=!1){return Lp(this,e,vR,()=>{const r=n?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},i=n?"format":"standalone";return this.weekdaysCache[i][e]||(this.weekdaysCache[i][e]=Xme(o=>this.extract(o,r,"weekday"))),this.weekdaysCache[i][e]})}meridiems(){return Lp(this,void 0,()=>wR,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Re.utc(2016,11,13,9),Re.utc(2016,11,13,19)].map(n=>this.extract(n,e,"dayperiod"))}return this.meridiemCache})}eras(e){return Lp(this,e,kR,()=>{const n={era:e};return this.eraCache[e]||(this.eraCache[e]=[Re.utc(-40,1,1),Re.utc(2017,1,1)].map(r=>this.extract(r,n,"era"))),this.eraCache[e]})}extract(e,n,r){const i=this.dtFormatter(e,n),o=i.formatToParts(),s=o.find(a=>a.type.toLowerCase()===r);return s?s.value:null}numberFormatter(e={}){return new t1e(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,n={}){return new n1e(e,this.intl,n)}relFormatter(e={}){return new r1e(this.intl,this.isEnglish(),e)}listFormatter(e={}){return Hme(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:dR()?Gme(this.locale):i1e}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}}let w2=null;class ir extends Ih{static get utcInstance(){return w2===null&&(w2=new ir(0)),w2}static instance(e){return e===0?ir.utcInstance:new ir(e)}static parseSpecifier(e){if(e){const n=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new ir(oy(n[1],n[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${pd(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${pd(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,n){return pd(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class o1e extends Ih{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function js(t,e){if($e(t)||t===null)return e;if(t instanceof Ih)return t;if(l1e(t)){const n=t.toLowerCase();return n==="default"?e:n==="local"||n==="system"?ny.instance:n==="utc"||n==="gmt"?ir.utcInstance:ir.parseSpecifier(n)||es.create(t)}else return kl(t)?ir.instance(t):typeof t=="object"&&"offset"in t&&typeof t.offset=="function"?t:new o1e(t)}let EA=()=>Date.now(),SA="system",CA=null,_A=null,AA=null,TA=60,MA,OA=null;class zt{static get now(){return EA}static set now(e){EA=e}static set defaultZone(e){SA=e}static get defaultZone(){return js(SA,ny.instance)}static get defaultLocale(){return CA}static set defaultLocale(e){CA=e}static get defaultNumberingSystem(){return _A}static set defaultNumberingSystem(e){_A=e}static get defaultOutputCalendar(){return AA}static set defaultOutputCalendar(e){AA=e}static get defaultWeekSettings(){return OA}static set defaultWeekSettings(e){OA=vk(e)}static get twoDigitCutoffYear(){return TA}static set twoDigitCutoffYear(e){TA=e%100}static get throwOnInvalid(){return MA}static set throwOnInvalid(e){MA=e}static resetCaches(){ct.resetCache(),es.resetCache()}}class Ti{constructor(e,n){this.reason=e,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const oR=[0,31,59,90,120,151,181,212,243,273,304,334],sR=[0,31,60,91,121,152,182,213,244,274,305,335];function ai(t,e){return new Ti("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`)}function BE(t,e,n){const r=new Date(Date.UTC(t,e-1,n));t<100&&t>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const i=r.getUTCDay();return i===0?7:i}function aR(t,e,n){return n+(Rh(t)?sR:oR)[e-1]}function lR(t,e){const n=Rh(t)?sR:oR,r=n.findIndex(o=>oah(r,e,n)?(u=r+1,l=1):u=r,{weekYear:u,weekNumber:l,weekday:a,...sy(t)}}function DA(t,e=4,n=1){const{weekYear:r,weekNumber:i,weekday:o}=t,s=PE(BE(r,1,e),n),a=Wu(r);let l=i*7+o-s-7+e,u;l<1?(u=r-1,l+=Wu(u)):l>a?(u=r+1,l-=Wu(r)):u=r;const{month:c,day:f}=lR(u,l);return{year:u,month:c,day:f,...sy(t)}}function k2(t){const{year:e,month:n,day:r}=t,i=aR(e,n,r);return{year:e,ordinal:i,...sy(t)}}function NA(t){const{year:e,ordinal:n}=t,{month:r,day:i}=lR(e,n);return{year:e,month:r,day:i,...sy(t)}}function $A(t,e){if(!$e(t.localWeekday)||!$e(t.localWeekNumber)||!$e(t.localWeekYear)){if(!$e(t.weekday)||!$e(t.weekNumber)||!$e(t.weekYear))throw new Ou("Cannot mix locale-based week fields with ISO-based week fields");return $e(t.localWeekday)||(t.weekday=t.localWeekday),$e(t.localWeekNumber)||(t.weekNumber=t.localWeekNumber),$e(t.localWeekYear)||(t.weekYear=t.localWeekYear),delete t.localWeekday,delete t.localWeekNumber,delete t.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function s1e(t,e=4,n=1){const r=ry(t.weekYear),i=li(t.weekNumber,1,ah(t.weekYear,e,n)),o=li(t.weekday,1,7);return r?i?o?!1:ai("weekday",t.weekday):ai("week",t.weekNumber):ai("weekYear",t.weekYear)}function a1e(t){const e=ry(t.year),n=li(t.ordinal,1,Wu(t.year));return e?n?!1:ai("ordinal",t.ordinal):ai("year",t.year)}function uR(t){const e=ry(t.year),n=li(t.month,1,12),r=li(t.day,1,M1(t.year,t.month));return e?n?r?!1:ai("day",t.day):ai("month",t.month):ai("year",t.year)}function cR(t){const{hour:e,minute:n,second:r,millisecond:i}=t,o=li(e,0,23)||e===24&&n===0&&r===0&&i===0,s=li(n,0,59),a=li(r,0,59),l=li(i,0,999);return o?s?a?l?!1:ai("millisecond",i):ai("second",r):ai("minute",n):ai("hour",e)}function $e(t){return typeof t>"u"}function kl(t){return typeof t=="number"}function ry(t){return typeof t=="number"&&t%1===0}function l1e(t){return typeof t=="string"}function u1e(t){return Object.prototype.toString.call(t)==="[object Date]"}function fR(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function dR(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function c1e(t){return Array.isArray(t)?t:[t]}function IA(t,e,n){if(t.length!==0)return t.reduce((r,i)=>{const o=[e(i),i];return r&&n(r[0],o[0])===r[0]?r:o},null)[1]}function f1e(t,e){return e.reduce((n,r)=>(n[r]=t[r],n),{})}function Ac(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function vk(t){if(t==null)return null;if(typeof t!="object")throw new pr("Week settings must be an object");if(!li(t.firstDay,1,7)||!li(t.minimalDays,1,7)||!Array.isArray(t.weekend)||t.weekend.some(e=>!li(e,1,7)))throw new pr("Invalid week settings");return{firstDay:t.firstDay,minimalDays:t.minimalDays,weekend:Array.from(t.weekend)}}function li(t,e,n){return ry(t)&&t>=e&&t<=n}function d1e(t,e){return t-e*Math.floor(t/e)}function Jt(t,e=2){const n=t<0;let r;return n?r="-"+(""+-t).padStart(e,"0"):r=(""+t).padStart(e,"0"),r}function Is(t){if(!($e(t)||t===null||t===""))return parseInt(t,10)}function $a(t){if(!($e(t)||t===null||t===""))return parseFloat(t)}function zE(t){if(!($e(t)||t===null||t==="")){const e=parseFloat("0."+t)*1e3;return Math.floor(e)}}function jE(t,e,n=!1){const r=10**e;return(n?Math.trunc:Math.round)(t*r)/r}function Rh(t){return t%4===0&&(t%100!==0||t%400===0)}function Wu(t){return Rh(t)?366:365}function M1(t,e){const n=d1e(e-1,12)+1,r=t+(e-n)/12;return n===2?Rh(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function iy(t){let e=Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second,t.millisecond);return t.year<100&&t.year>=0&&(e=new Date(e),e.setUTCFullYear(t.year,t.month-1,t.day)),+e}function RA(t,e,n){return-PE(BE(t,1,e),n)+e-1}function ah(t,e=4,n=1){const r=RA(t,e,n),i=RA(t+1,e,n);return(Wu(t)-r+i)/7}function wk(t){return t>99?t:t>zt.twoDigitCutoffYear?1900+t:2e3+t}function hR(t,e,n,r=null){const i=new Date(t),o={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(o.timeZone=r);const s={timeZoneName:e,...o},a=new Intl.DateTimeFormat(n,s).formatToParts(i).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function oy(t,e){let n=parseInt(t,10);Number.isNaN(n)&&(n=0);const r=parseInt(e,10)||0,i=n<0||Object.is(n,-0)?-r:r;return n*60+i}function pR(t){const e=Number(t);if(typeof t=="boolean"||t===""||Number.isNaN(e))throw new pr(`Invalid unit value ${t}`);return e}function O1(t,e){const n={};for(const r in t)if(Ac(t,r)){const i=t[r];if(i==null)continue;n[e(r)]=pR(i)}return n}function pd(t,e){const n=Math.trunc(Math.abs(t/60)),r=Math.trunc(Math.abs(t%60)),i=t>=0?"+":"-";switch(e){case"short":return`${i}${Jt(n,2)}:${Jt(r,2)}`;case"narrow":return`${i}${n}${r>0?`:${r}`:""}`;case"techie":return`${i}${Jt(n,2)}${Jt(r,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function sy(t){return f1e(t,["hour","minute","second","millisecond"])}const h1e=["January","February","March","April","May","June","July","August","September","October","November","December"],mR=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],p1e=["J","F","M","A","M","J","J","A","S","O","N","D"];function gR(t){switch(t){case"narrow":return[...p1e];case"short":return[...mR];case"long":return[...h1e];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const yR=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],bR=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],m1e=["M","T","W","T","F","S","S"];function vR(t){switch(t){case"narrow":return[...m1e];case"short":return[...bR];case"long":return[...yR];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const wR=["AM","PM"],g1e=["Before Christ","Anno Domini"],y1e=["BC","AD"],b1e=["B","A"];function kR(t){switch(t){case"narrow":return[...b1e];case"short":return[...y1e];case"long":return[...g1e];default:return null}}function v1e(t){return wR[t.hour<12?0:1]}function w1e(t,e){return vR(e)[t.weekday-1]}function k1e(t,e){return gR(e)[t.month-1]}function x1e(t,e){return kR(e)[t.year<0?0:1]}function E1e(t,e,n="always",r=!1){const i={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},o=["hours","minutes","seconds"].indexOf(t)===-1;if(n==="auto"&&o){const f=t==="days";switch(e){case 1:return f?"tomorrow":`next ${i[t][0]}`;case-1:return f?"yesterday":`last ${i[t][0]}`;case 0:return f?"today":`this ${i[t][0]}`}}const s=Object.is(e,-0)||e<0,a=Math.abs(e),l=a===1,u=i[t],c=r?l?u[1]:u[2]||u[1]:l?i[t][0]:t;return s?`${a} ${c} ago`:`in ${a} ${c}`}function FA(t,e){let n="";for(const r of t)r.literal?n+=r.val:n+=e(r.val);return n}const S1e={D:A1,DD:z7,DDD:j7,DDDD:q7,t:V7,tt:U7,ttt:H7,tttt:W7,T:J7,TT:K7,TTT:G7,TTTT:Z7,f:Y7,ff:X7,fff:tR,ffff:rR,F:Q7,FF:eR,FFF:nR,FFFF:iR};class jn{static create(e,n={}){return new jn(e,n)}static parseFormat(e){let n=null,r="",i=!1;const o=[];for(let s=0;s0&&o.push({literal:i||/^\s+$/.test(r),val:r}),n=null,r="",i=!i):i||a===n?r+=a:(r.length>0&&o.push({literal:/^\s+$/.test(r),val:r}),r=a,n=a)}return r.length>0&&o.push({literal:i||/^\s+$/.test(r),val:r}),o}static macroTokenToFormatOpts(e){return S1e[e]}constructor(e,n){this.opts=n,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...n}).format()}dtFormatter(e,n={}){return this.loc.dtFormatter(e,{...this.opts,...n})}formatDateTime(e,n){return this.dtFormatter(e,n).format()}formatDateTimeParts(e,n){return this.dtFormatter(e,n).formatToParts()}formatInterval(e,n){return this.dtFormatter(e.start,n).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,n){return this.dtFormatter(e,n).resolvedOptions()}num(e,n=0){if(this.opts.forceSimple)return Jt(e,n);const r={...this.opts};return n>0&&(r.padTo=n),this.loc.numberFormatter(r).format(e)}formatDateTimeFromString(e,n){const r=this.loc.listingMode()==="en",i=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",o=(h,p)=>this.loc.extract(e,h,p),s=h=>e.isOffsetFixed&&e.offset===0&&h.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,h.format):"",a=()=>r?v1e(e):o({hour:"numeric",hourCycle:"h12"},"dayperiod"),l=(h,p)=>r?k1e(e,h):o(p?{month:h}:{month:h,day:"numeric"},"month"),u=(h,p)=>r?w1e(e,h):o(p?{weekday:h}:{weekday:h,month:"long",day:"numeric"},"weekday"),c=h=>{const p=jn.macroTokenToFormatOpts(h);return p?this.formatWithSystemDefault(e,p):h},f=h=>r?x1e(e,h):o({era:h},"era"),d=h=>{switch(h){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return s({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return s({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return s({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return a();case"d":return i?o({day:"numeric"},"day"):this.num(e.day);case"dd":return i?o({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return i?o({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return i?o({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return l("short",!0);case"LLLL":return l("long",!0);case"LLLLL":return l("narrow",!0);case"M":return i?o({month:"numeric"},"month"):this.num(e.month);case"MM":return i?o({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return l("short",!1);case"MMMM":return l("long",!1);case"MMMMM":return l("narrow",!1);case"y":return i?o({year:"numeric"},"year"):this.num(e.year);case"yy":return i?o({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return i?o({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return i?o({year:"numeric"},"year"):this.num(e.year,6);case"G":return f("short");case"GG":return f("long");case"GGGGG":return f("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return c(h)}};return FA(jn.parseFormat(n),d)}formatDurationFromString(e,n){const r=l=>{switch(l[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},i=l=>u=>{const c=r(u);return c?this.num(l.get(c),u.length):u},o=jn.parseFormat(n),s=o.reduce((l,{literal:u,val:c})=>u?l:l.concat(c),[]),a=e.shiftTo(...s.map(r).filter(l=>l));return FA(o,i(a))}}const xR=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Wc(...t){const e=t.reduce((n,r)=>n+r.source,"");return RegExp(`^${e}$`)}function Jc(...t){return e=>t.reduce(([n,r,i],o)=>{const[s,a,l]=o(e,i);return[{...n,...s},a||r,l]},[{},null,1]).slice(0,2)}function Kc(t,...e){if(t==null)return[null,null];for(const[n,r]of e){const i=n.exec(t);if(i)return r(i)}return[null,null]}function ER(...t){return(e,n)=>{const r={};let i;for(i=0;ih!==void 0&&(p||h&&c)?-h:h;return[{years:d($a(n)),months:d($a(r)),weeks:d($a(i)),days:d($a(o)),hours:d($a(s)),minutes:d($a(a)),seconds:d($a(l),l==="-0"),milliseconds:d(zE(u),f)}]}const L1e={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function UE(t,e,n,r,i,o,s){const a={year:e.length===2?wk(Is(e)):Is(e),month:mR.indexOf(n)+1,day:Is(r),hour:Is(i),minute:Is(o)};return s&&(a.second=Is(s)),t&&(a.weekday=t.length>3?yR.indexOf(t)+1:bR.indexOf(t)+1),a}const B1e=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function P1e(t){const[,e,n,r,i,o,s,a,l,u,c,f]=t,d=UE(e,i,r,n,o,s,a);let h;return l?h=L1e[l]:u?h=0:h=oy(c,f),[d,new ir(h)]}function z1e(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const j1e=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,q1e=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,V1e=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function LA(t){const[,e,n,r,i,o,s,a]=t;return[UE(e,i,r,n,o,s,a),ir.utcInstance]}function U1e(t){const[,e,n,r,i,o,s,a]=t;return[UE(e,a,n,r,i,o,s),ir.utcInstance]}const H1e=Wc(_1e,VE),W1e=Wc(A1e,VE),J1e=Wc(T1e,VE),K1e=Wc(CR),AR=Jc($1e,Gc,Fh,Lh),G1e=Jc(M1e,Gc,Fh,Lh),Z1e=Jc(O1e,Gc,Fh,Lh),Y1e=Jc(Gc,Fh,Lh);function Q1e(t){return Kc(t,[H1e,AR],[W1e,G1e],[J1e,Z1e],[K1e,Y1e])}function X1e(t){return Kc(z1e(t),[B1e,P1e])}function ege(t){return Kc(t,[j1e,LA],[q1e,LA],[V1e,U1e])}function tge(t){return Kc(t,[R1e,F1e])}const nge=Jc(Gc);function rge(t){return Kc(t,[I1e,nge])}const ige=Wc(D1e,N1e),oge=Wc(_R),sge=Jc(Gc,Fh,Lh);function age(t){return Kc(t,[ige,AR],[oge,sge])}const BA="Invalid Duration",TR={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},lge={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...TR},ei=146097/400,tu=146097/4800,uge={years:{quarters:4,months:12,weeks:ei/7,days:ei,hours:ei*24,minutes:ei*24*60,seconds:ei*24*60*60,milliseconds:ei*24*60*60*1e3},quarters:{months:3,weeks:ei/28,days:ei/4,hours:ei*24/4,minutes:ei*24*60/4,seconds:ei*24*60*60/4,milliseconds:ei*24*60*60*1e3/4},months:{weeks:tu/7,days:tu,hours:tu*24,minutes:tu*24*60,seconds:tu*24*60*60,milliseconds:tu*24*60*60*1e3},...TR},sl=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],cge=sl.slice(0).reverse();function Cs(t,e,n=!1){const r={values:n?e.values:{...t.values,...e.values||{}},loc:t.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||t.conversionAccuracy,matrix:e.matrix||t.matrix};return new Je(r)}function MR(t,e){let n=e.milliseconds??0;for(const r of cge.slice(1))e[r]&&(n+=e[r]*t[r].milliseconds);return n}function PA(t,e){const n=MR(t,e)<0?-1:1;sl.reduceRight((r,i)=>{if($e(e[i]))return r;if(r){const o=e[r]*n,s=t[i][r],a=Math.floor(o/s);e[i]+=a*n,e[r]-=a*s*n}return i},null),sl.reduce((r,i)=>{if($e(e[i]))return r;if(r){const o=e[r]%1;e[r]-=o,e[i]+=o*t[r][i]}return i},null)}function fge(t){const e={};for(const[n,r]of Object.entries(t))r!==0&&(e[n]=r);return e}class Je{constructor(e){const n=e.conversionAccuracy==="longterm"||!1;let r=n?uge:lge;e.matrix&&(r=e.matrix),this.values=e.values,this.loc=e.loc||ct.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(e,n){return Je.fromObject({milliseconds:e},n)}static fromObject(e,n={}){if(e==null||typeof e!="object")throw new pr(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new Je({values:O1(e,Je.normalizeUnit),loc:ct.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(e){if(kl(e))return Je.fromMillis(e);if(Je.isDuration(e))return e;if(typeof e=="object")return Je.fromObject(e);throw new pr(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,n){const[r]=tge(e);return r?Je.fromObject(r,n):Je.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,n){const[r]=rge(e);return r?Je.fromObject(r,n):Je.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,n=null){if(!e)throw new pr("need to specify a reason the Duration is invalid");const r=e instanceof Ti?e:new Ti(e,n);if(zt.throwOnInvalid)throw new Bme(r);return new Je({invalid:r})}static normalizeUnit(e){const n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!n)throw new P7(e);return n}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,n={}){const r={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?jn.create(this.loc,r).formatDurationFromString(this,e):BA}toHuman(e={}){if(!this.isValid)return BA;const n=sl.map(r=>{const i=this.values[r];return $e(i)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:r.slice(0,-1)}).format(i)}).filter(r=>r);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=jE(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const n=this.toMillis();return n<0||n>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},Re.fromMillis(n,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?MR(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const n=Je.fromDurationLike(e),r={};for(const i of sl)(Ac(n.values,i)||Ac(this.values,i))&&(r[i]=n.get(i)+this.get(i));return Cs(this,{values:r},!0)}minus(e){if(!this.isValid)return this;const n=Je.fromDurationLike(e);return this.plus(n.negate())}mapUnits(e){if(!this.isValid)return this;const n={};for(const r of Object.keys(this.values))n[r]=pR(e(this.values[r],r));return Cs(this,{values:n},!0)}get(e){return this[Je.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const n={...this.values,...O1(e,Je.normalizeUnit)};return Cs(this,{values:n})}reconfigure({locale:e,numberingSystem:n,conversionAccuracy:r,matrix:i}={}){const s={loc:this.loc.clone({locale:e,numberingSystem:n}),matrix:i,conversionAccuracy:r};return Cs(this,s)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return PA(this.matrix,e),Cs(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=fge(this.normalize().shiftToAll().toObject());return Cs(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(s=>Je.normalizeUnit(s));const n={},r={},i=this.toObject();let o;for(const s of sl)if(e.indexOf(s)>=0){o=s;let a=0;for(const u in r)a+=this.matrix[u][s]*r[u],r[u]=0;kl(i[s])&&(a+=i[s]);const l=Math.trunc(a);n[s]=l,r[s]=(a*1e3-l*1e3)/1e3}else kl(i[s])&&(r[s]=i[s]);for(const s in r)r[s]!==0&&(n[o]+=s===o?r[s]:r[s]/this.matrix[o][s]);return PA(this.matrix,n),Cs(this,{values:n},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const n of Object.keys(this.values))e[n]=this.values[n]===0?0:-this.values[n];return Cs(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function n(r,i){return r===void 0||r===0?i===void 0||i===0:r===i}for(const r of sl)if(!n(this.values[r],e.values[r]))return!1;return!0}}const nu="Invalid Interval";function dge(t,e){return!t||!t.isValid?$t.invalid("missing or invalid start"):!e||!e.isValid?$t.invalid("missing or invalid end"):ee:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:n}={}){return this.isValid?$t.fromDateTimes(e||this.s,n||this.e):this}splitAt(...e){if(!this.isValid)return[];const n=e.map(pf).filter(s=>this.contains(s)).sort((s,a)=>s.toMillis()-a.toMillis()),r=[];let{s:i}=this,o=0;for(;i+this.e?this.e:s;r.push($t.fromDateTimes(i,a)),i=a,o+=1}return r}splitBy(e){const n=Je.fromDurationLike(e);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:r}=this,i=1,o;const s=[];for(;rl*i));o=+a>+this.e?this.e:a,s.push($t.fromDateTimes(r,o)),r=o,i+=1}return s}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const n=this.s>e.s?this.s:e.s,r=this.e=r?null:$t.fromDateTimes(n,r)}union(e){if(!this.isValid)return this;const n=this.se.e?this.e:e.e;return $t.fromDateTimes(n,r)}static merge(e){const[n,r]=e.sort((i,o)=>i.s-o.s).reduce(([i,o],s)=>o?o.overlaps(s)||o.abutsStart(s)?[i,o.union(s)]:[i.concat([o]),s]:[i,s],[[],null]);return r&&n.push(r),n}static xor(e){let n=null,r=0;const i=[],o=e.map(l=>[{time:l.s,type:"s"},{time:l.e,type:"e"}]),s=Array.prototype.concat(...o),a=s.sort((l,u)=>l.time-u.time);for(const l of a)r+=l.type==="s"?1:-1,r===1?n=l.time:(n&&+n!=+l.time&&i.push($t.fromDateTimes(n,l.time)),n=null);return $t.merge(i)}difference(...e){return $t.xor([this].concat(e)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:nu}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=A1,n={}){return this.isValid?jn.create(this.s.loc.clone(n),e).formatInterval(this):nu}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:nu}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:nu}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:nu}toFormat(e,{separator:n=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${n}${this.e.toFormat(e)}`:nu}toDuration(e,n){return this.isValid?this.e.diff(this.s,e,n):Je.invalid(this.invalidReason)}mapEndpoints(e){return $t.fromDateTimes(e(this.s),e(this.e))}}class Bp{static hasDST(e=zt.defaultZone){const n=Re.now().setZone(e).set({month:12});return!e.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(e){return es.isValidZone(e)}static normalizeZone(e){return js(e,zt.defaultZone)}static getStartOfWeek({locale:e=null,locObj:n=null}={}){return(n||ct.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:n=null}={}){return(n||ct.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:n=null}={}){return(n||ct.create(e)).getWeekendDays().slice()}static months(e="long",{locale:n=null,numberingSystem:r=null,locObj:i=null,outputCalendar:o="gregory"}={}){return(i||ct.create(n,r,o)).months(e)}static monthsFormat(e="long",{locale:n=null,numberingSystem:r=null,locObj:i=null,outputCalendar:o="gregory"}={}){return(i||ct.create(n,r,o)).months(e,!0)}static weekdays(e="long",{locale:n=null,numberingSystem:r=null,locObj:i=null}={}){return(i||ct.create(n,r,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:n=null,numberingSystem:r=null,locObj:i=null}={}){return(i||ct.create(n,r,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return ct.create(e).meridiems()}static eras(e="short",{locale:n=null}={}){return ct.create(n,null,"gregory").eras(e)}static features(){return{relative:fR(),localeWeek:dR()}}}function zA(t,e){const n=i=>i.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(e)-n(t);return Math.floor(Je.fromMillis(r).as("days"))}function hge(t,e,n){const r=[["years",(l,u)=>u.year-l.year],["quarters",(l,u)=>u.quarter-l.quarter+(u.year-l.year)*4],["months",(l,u)=>u.month-l.month+(u.year-l.year)*12],["weeks",(l,u)=>{const c=zA(l,u);return(c-c%7)/7}],["days",zA]],i={},o=t;let s,a;for(const[l,u]of r)n.indexOf(l)>=0&&(s=l,i[l]=u(t,e),a=o.plus(i),a>e?(i[l]--,t=o.plus(i),t>e&&(a=t,i[l]--,t=o.plus(i))):t=a);return[t,i,a,s]}function pge(t,e,n,r){let[i,o,s,a]=hge(t,e,n);const l=e-i,u=n.filter(f=>["hours","minutes","seconds","milliseconds"].indexOf(f)>=0);u.length===0&&(s0?Je.fromMillis(l,r).shiftTo(...u).plus(c):c}const HE={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},jA={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},mge=HE.hanidec.replace(/[\[|\]]/g,"").split("");function gge(t){let e=parseInt(t,10);if(isNaN(e)){e="";for(let n=0;n=o&&r<=s&&(e+=r-o)}}return parseInt(e,10)}else return e}function vi({numberingSystem:t},e=""){return new RegExp(`${HE[t||"latn"]}${e}`)}const yge="missing Intl.DateTimeFormat.formatToParts support";function et(t,e=n=>n){return{regex:t,deser:([n])=>e(gge(n))}}const bge=" ",OR=`[ ${bge}]`,DR=new RegExp(OR,"g");function vge(t){return t.replace(/\./g,"\\.?").replace(DR,OR)}function qA(t){return t.replace(/\./g,"").replace(DR," ").toLowerCase()}function wi(t,e){return t===null?null:{regex:RegExp(t.map(vge).join("|")),deser:([n])=>t.findIndex(r=>qA(n)===qA(r))+e}}function VA(t,e){return{regex:t,deser:([,n,r])=>oy(n,r),groups:e}}function Pp(t){return{regex:t,deser:([e])=>e}}function wge(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function kge(t,e){const n=vi(e),r=vi(e,"{2}"),i=vi(e,"{3}"),o=vi(e,"{4}"),s=vi(e,"{6}"),a=vi(e,"{1,2}"),l=vi(e,"{1,3}"),u=vi(e,"{1,6}"),c=vi(e,"{1,9}"),f=vi(e,"{2,4}"),d=vi(e,"{4,6}"),h=b=>({regex:RegExp(wge(b.val)),deser:([y])=>y,literal:!0}),m=(b=>{if(t.literal)return h(b);switch(b.val){case"G":return wi(e.eras("short"),0);case"GG":return wi(e.eras("long"),0);case"y":return et(u);case"yy":return et(f,wk);case"yyyy":return et(o);case"yyyyy":return et(d);case"yyyyyy":return et(s);case"M":return et(a);case"MM":return et(r);case"MMM":return wi(e.months("short",!0),1);case"MMMM":return wi(e.months("long",!0),1);case"L":return et(a);case"LL":return et(r);case"LLL":return wi(e.months("short",!1),1);case"LLLL":return wi(e.months("long",!1),1);case"d":return et(a);case"dd":return et(r);case"o":return et(l);case"ooo":return et(i);case"HH":return et(r);case"H":return et(a);case"hh":return et(r);case"h":return et(a);case"mm":return et(r);case"m":return et(a);case"q":return et(a);case"qq":return et(r);case"s":return et(a);case"ss":return et(r);case"S":return et(l);case"SSS":return et(i);case"u":return Pp(c);case"uu":return Pp(a);case"uuu":return et(n);case"a":return wi(e.meridiems(),0);case"kkkk":return et(o);case"kk":return et(f,wk);case"W":return et(a);case"WW":return et(r);case"E":case"c":return et(n);case"EEE":return wi(e.weekdays("short",!1),1);case"EEEE":return wi(e.weekdays("long",!1),1);case"ccc":return wi(e.weekdays("short",!0),1);case"cccc":return wi(e.weekdays("long",!0),1);case"Z":case"ZZ":return VA(new RegExp(`([+-]${a.source})(?::(${r.source}))?`),2);case"ZZZ":return VA(new RegExp(`([+-]${a.source})(${r.source})?`),2);case"z":return Pp(/[a-z_+-/]{1,256}?/i);case" ":return Pp(/[^\S\n\r]/);default:return h(b)}})(t)||{invalidReason:yge};return m.token=t,m}const xge={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function Ege(t,e,n){const{type:r,value:i}=t;if(r==="literal"){const l=/^\s+$/.test(i);return{literal:!l,val:l?" ":i}}const o=e[r];let s=r;r==="hour"&&(e.hour12!=null?s=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?s="hour12":s="hour24":s=n.hour12?"hour12":"hour24");let a=xge[s];if(typeof a=="object"&&(a=a[o]),a)return{literal:!1,val:a}}function Sge(t){return[`^${t.map(n=>n.regex).reduce((n,r)=>`${n}(${r.source})`,"")}$`,t]}function Cge(t,e,n){const r=t.match(e);if(r){const i={};let o=1;for(const s in n)if(Ac(n,s)){const a=n[s],l=a.groups?a.groups+1:1;!a.literal&&a.token&&(i[a.token.val[0]]=a.deser(r.slice(o,o+l))),o+=l}return[r,i]}else return[r,{}]}function _ge(t){const e=o=>{switch(o){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let n=null,r;return $e(t.z)||(n=es.create(t.z)),$e(t.Z)||(n||(n=new ir(t.Z)),r=t.Z),$e(t.q)||(t.M=(t.q-1)*3+1),$e(t.h)||(t.h<12&&t.a===1?t.h+=12:t.h===12&&t.a===0&&(t.h=0)),t.G===0&&t.y&&(t.y=-t.y),$e(t.u)||(t.S=zE(t.u)),[Object.keys(t).reduce((o,s)=>{const a=e(s);return a&&(o[a]=t[s]),o},{}),n,r]}let x2=null;function Age(){return x2||(x2=Re.fromMillis(1555555555555)),x2}function Tge(t,e){if(t.literal)return t;const n=jn.macroTokenToFormatOpts(t.val),r=IR(n,e);return r==null||r.includes(void 0)?t:r}function NR(t,e){return Array.prototype.concat(...t.map(n=>Tge(n,e)))}function $R(t,e,n){const r=NR(jn.parseFormat(n),t),i=r.map(s=>kge(s,t)),o=i.find(s=>s.invalidReason);if(o)return{input:e,tokens:r,invalidReason:o.invalidReason};{const[s,a]=Sge(i),l=RegExp(s,"i"),[u,c]=Cge(e,l,a),[f,d,h]=c?_ge(c):[null,null,void 0];if(Ac(c,"a")&&Ac(c,"H"))throw new Ou("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:r,regex:l,rawMatches:u,matches:c,result:f,zone:d,specificOffset:h}}}function Mge(t,e,n){const{result:r,zone:i,specificOffset:o,invalidReason:s}=$R(t,e,n);return[r,i,o,s]}function IR(t,e){if(!t)return null;const r=jn.create(e,t).dtFormatter(Age()),i=r.formatToParts(),o=r.resolvedOptions();return i.map(s=>Ege(s,t,o))}const E2="Invalid DateTime",UA=864e13;function zp(t){return new Ti("unsupported zone",`the zone "${t.name}" is not supported`)}function S2(t){return t.weekData===null&&(t.weekData=T1(t.c)),t.weekData}function C2(t){return t.localWeekData===null&&(t.localWeekData=T1(t.c,t.loc.getMinDaysInFirstWeek(),t.loc.getStartOfWeek())),t.localWeekData}function Ia(t,e){const n={ts:t.ts,zone:t.zone,c:t.c,o:t.o,loc:t.loc,invalid:t.invalid};return new Re({...n,...e,old:n})}function RR(t,e,n){let r=t-e*60*1e3;const i=n.offset(r);if(e===i)return[r,e];r-=(i-e)*60*1e3;const o=n.offset(r);return i===o?[r,i]:[t-Math.min(i,o)*60*1e3,Math.max(i,o)]}function jp(t,e){t+=e*60*1e3;const n=new Date(t);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function _0(t,e,n){return RR(iy(t),e,n)}function HA(t,e){const n=t.o,r=t.c.year+Math.trunc(e.years),i=t.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,o={...t.c,year:r,month:i,day:Math.min(t.c.day,M1(r,i))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},s=Je.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),a=iy(o);let[l,u]=RR(a,n,t.zone);return s!==0&&(l+=s,u=t.zone.offset(l)),{ts:l,o:u}}function hf(t,e,n,r,i,o){const{setZone:s,zone:a}=n;if(t&&Object.keys(t).length!==0||e){const l=e||a,u=Re.fromObject(t,{...n,zone:l,specificOffset:o});return s?u:u.setZone(a)}else return Re.invalid(new Ti("unparsable",`the input "${i}" can't be parsed as ${r}`))}function qp(t,e,n=!0){return t.isValid?jn.create(ct.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(t,e):null}function _2(t,e){const n=t.c.year>9999||t.c.year<0;let r="";return n&&t.c.year>=0&&(r+="+"),r+=Jt(t.c.year,n?6:4),e?(r+="-",r+=Jt(t.c.month),r+="-",r+=Jt(t.c.day)):(r+=Jt(t.c.month),r+=Jt(t.c.day)),r}function WA(t,e,n,r,i,o){let s=Jt(t.c.hour);return e?(s+=":",s+=Jt(t.c.minute),(t.c.millisecond!==0||t.c.second!==0||!n)&&(s+=":")):s+=Jt(t.c.minute),(t.c.millisecond!==0||t.c.second!==0||!n)&&(s+=Jt(t.c.second),(t.c.millisecond!==0||!r)&&(s+=".",s+=Jt(t.c.millisecond,3))),i&&(t.isOffsetFixed&&t.offset===0&&!o?s+="Z":t.o<0?(s+="-",s+=Jt(Math.trunc(-t.o/60)),s+=":",s+=Jt(Math.trunc(-t.o%60))):(s+="+",s+=Jt(Math.trunc(t.o/60)),s+=":",s+=Jt(Math.trunc(t.o%60)))),o&&(s+="["+t.zone.ianaName+"]"),s}const FR={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Oge={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Dge={ordinal:1,hour:0,minute:0,second:0,millisecond:0},LR=["year","month","day","hour","minute","second","millisecond"],Nge=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],$ge=["year","ordinal","hour","minute","second","millisecond"];function Ige(t){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[t.toLowerCase()];if(!e)throw new P7(t);return e}function JA(t){switch(t.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return Ige(t)}}function KA(t,e){const n=js(e.zone,zt.defaultZone),r=ct.fromObject(e),i=zt.now();let o,s;if($e(t.year))o=i;else{for(const u of LR)$e(t[u])&&(t[u]=FR[u]);const a=uR(t)||cR(t);if(a)return Re.invalid(a);const l=n.offset(i);[o,s]=_0(t,l,n)}return new Re({ts:o,zone:n,loc:r,o:s})}function GA(t,e,n){const r=$e(n.round)?!0:n.round,i=(s,a)=>(s=jE(s,r||n.calendary?0:2,!0),e.loc.clone(n).relFormatter(n).format(s,a)),o=s=>n.calendary?e.hasSame(t,s)?0:e.startOf(s).diff(t.startOf(s),s).get(s):e.diff(t,s).get(s);if(n.unit)return i(o(n.unit),n.unit);for(const s of n.units){const a=o(s);if(Math.abs(a)>=1)return i(a,s)}return i(t>e?-0:0,n.units[n.units.length-1])}function ZA(t){let e={},n;return t.length>0&&typeof t[t.length-1]=="object"?(e=t[t.length-1],n=Array.from(t).slice(0,t.length-1)):n=Array.from(t),[e,n]}class Re{constructor(e){const n=e.zone||zt.defaultZone;let r=e.invalid||(Number.isNaN(e.ts)?new Ti("invalid input"):null)||(n.isValid?null:zp(n));this.ts=$e(e.ts)?zt.now():e.ts;let i=null,o=null;if(!r)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(n))[i,o]=[e.old.c,e.old.o];else{const a=n.offset(this.ts);i=jp(this.ts,a),r=Number.isNaN(i.year)?new Ti("invalid input"):null,i=r?null:i,o=r?null:a}this._zone=n,this.loc=e.loc||ct.create(),this.invalid=r,this.weekData=null,this.localWeekData=null,this.c=i,this.o=o,this.isLuxonDateTime=!0}static now(){return new Re({})}static local(){const[e,n]=ZA(arguments),[r,i,o,s,a,l,u]=n;return KA({year:r,month:i,day:o,hour:s,minute:a,second:l,millisecond:u},e)}static utc(){const[e,n]=ZA(arguments),[r,i,o,s,a,l,u]=n;return e.zone=ir.utcInstance,KA({year:r,month:i,day:o,hour:s,minute:a,second:l,millisecond:u},e)}static fromJSDate(e,n={}){const r=u1e(e)?e.valueOf():NaN;if(Number.isNaN(r))return Re.invalid("invalid input");const i=js(n.zone,zt.defaultZone);return i.isValid?new Re({ts:r,zone:i,loc:ct.fromObject(n)}):Re.invalid(zp(i))}static fromMillis(e,n={}){if(kl(e))return e<-UA||e>UA?Re.invalid("Timestamp out of range"):new Re({ts:e,zone:js(n.zone,zt.defaultZone),loc:ct.fromObject(n)});throw new pr(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,n={}){if(kl(e))return new Re({ts:e*1e3,zone:js(n.zone,zt.defaultZone),loc:ct.fromObject(n)});throw new pr("fromSeconds requires a numerical input")}static fromObject(e,n={}){e=e||{};const r=js(n.zone,zt.defaultZone);if(!r.isValid)return Re.invalid(zp(r));const i=ct.fromObject(n),o=O1(e,JA),{minDaysInFirstWeek:s,startOfWeek:a}=$A(o,i),l=zt.now(),u=$e(n.specificOffset)?r.offset(l):n.specificOffset,c=!$e(o.ordinal),f=!$e(o.year),d=!$e(o.month)||!$e(o.day),h=f||d,p=o.weekYear||o.weekNumber;if((h||c)&&p)throw new Ou("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(d&&c)throw new Ou("Can't mix ordinal dates with month/day");const m=p||o.weekday&&!h;let b,y,v=jp(l,u);m?(b=Nge,y=Oge,v=T1(v,s,a)):c?(b=$ge,y=Dge,v=k2(v)):(b=LR,y=FR);let w=!1;for(const N of b){const C=o[N];$e(C)?w?o[N]=y[N]:o[N]=v[N]:w=!0}const g=m?s1e(o,s,a):c?a1e(o):uR(o),x=g||cR(o);if(x)return Re.invalid(x);const k=m?DA(o,s,a):c?NA(o):o,[E,D]=_0(k,u,r),O=new Re({ts:E,zone:r,o:D,loc:i});return o.weekday&&h&&e.weekday!==O.weekday?Re.invalid("mismatched weekday",`you can't specify both a weekday of ${o.weekday} and a date of ${O.toISO()}`):O}static fromISO(e,n={}){const[r,i]=Q1e(e);return hf(r,i,n,"ISO 8601",e)}static fromRFC2822(e,n={}){const[r,i]=X1e(e);return hf(r,i,n,"RFC 2822",e)}static fromHTTP(e,n={}){const[r,i]=ege(e);return hf(r,i,n,"HTTP",n)}static fromFormat(e,n,r={}){if($e(e)||$e(n))throw new pr("fromFormat requires an input string and a format");const{locale:i=null,numberingSystem:o=null}=r,s=ct.fromOpts({locale:i,numberingSystem:o,defaultToEN:!0}),[a,l,u,c]=Mge(s,e,n);return c?Re.invalid(c):hf(a,l,r,`format ${n}`,e,u)}static fromString(e,n,r={}){return Re.fromFormat(e,n,r)}static fromSQL(e,n={}){const[r,i]=age(e);return hf(r,i,n,"SQL",e)}static invalid(e,n=null){if(!e)throw new pr("need to specify a reason the DateTime is invalid");const r=e instanceof Ti?e:new Ti(e,n);if(zt.throwOnInvalid)throw new Fme(r);return new Re({invalid:r})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,n={}){const r=IR(e,ct.fromObject(n));return r?r.map(i=>i?i.val:null).join(""):null}static expandFormat(e,n={}){return NR(jn.parseFormat(e),ct.fromObject(n)).map(i=>i.val).join("")}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?S2(this).weekYear:NaN}get weekNumber(){return this.isValid?S2(this).weekNumber:NaN}get weekday(){return this.isValid?S2(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?C2(this).weekday:NaN}get localWeekNumber(){return this.isValid?C2(this).weekNumber:NaN}get localWeekYear(){return this.isValid?C2(this).weekYear:NaN}get ordinal(){return this.isValid?k2(this.c).ordinal:NaN}get monthShort(){return this.isValid?Bp.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Bp.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Bp.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Bp.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const e=864e5,n=6e4,r=iy(this.c),i=this.zone.offset(r-e),o=this.zone.offset(r+e),s=this.zone.offset(r-i*n),a=this.zone.offset(r-o*n);if(s===a)return[this];const l=r-s*n,u=r-a*n,c=jp(l,s),f=jp(u,a);return c.hour===f.hour&&c.minute===f.minute&&c.second===f.second&&c.millisecond===f.millisecond?[Ia(this,{ts:l}),Ia(this,{ts:u})]:[this]}get isInLeapYear(){return Rh(this.year)}get daysInMonth(){return M1(this.year,this.month)}get daysInYear(){return this.isValid?Wu(this.year):NaN}get weeksInWeekYear(){return this.isValid?ah(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?ah(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:n,numberingSystem:r,calendar:i}=jn.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:n,numberingSystem:r,outputCalendar:i}}toUTC(e=0,n={}){return this.setZone(ir.instance(e),n)}toLocal(){return this.setZone(zt.defaultZone)}setZone(e,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(e=js(e,zt.defaultZone),e.equals(this.zone))return this;if(e.isValid){let i=this.ts;if(n||r){const o=e.offset(this.ts),s=this.toObject();[i]=_0(s,o,e)}return Ia(this,{ts:i,zone:e})}else return Re.invalid(zp(e))}reconfigure({locale:e,numberingSystem:n,outputCalendar:r}={}){const i=this.loc.clone({locale:e,numberingSystem:n,outputCalendar:r});return Ia(this,{loc:i})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const n=O1(e,JA),{minDaysInFirstWeek:r,startOfWeek:i}=$A(n,this.loc),o=!$e(n.weekYear)||!$e(n.weekNumber)||!$e(n.weekday),s=!$e(n.ordinal),a=!$e(n.year),l=!$e(n.month)||!$e(n.day),u=a||l,c=n.weekYear||n.weekNumber;if((u||s)&&c)throw new Ou("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&s)throw new Ou("Can't mix ordinal dates with month/day");let f;o?f=DA({...T1(this.c,r,i),...n},r,i):$e(n.ordinal)?(f={...this.toObject(),...n},$e(n.day)&&(f.day=Math.min(M1(f.year,f.month),f.day))):f=NA({...k2(this.c),...n});const[d,h]=_0(f,this.o,this.zone);return Ia(this,{ts:d,o:h})}plus(e){if(!this.isValid)return this;const n=Je.fromDurationLike(e);return Ia(this,HA(this,n))}minus(e){if(!this.isValid)return this;const n=Je.fromDurationLike(e).negate();return Ia(this,HA(this,n))}startOf(e,{useLocaleWeeks:n=!1}={}){if(!this.isValid)return this;const r={},i=Je.normalizeUnit(e);switch(i){case"years":r.month=1;case"quarters":case"months":r.day=1;case"weeks":case"days":r.hour=0;case"hours":r.minute=0;case"minutes":r.second=0;case"seconds":r.millisecond=0;break}if(i==="weeks")if(n){const o=this.loc.getStartOfWeek(),{weekday:s}=this;sthis.valueOf(),a=s?this:e,l=s?e:this,u=pge(a,l,o,i);return s?u.negate():u}diffNow(e="milliseconds",n={}){return this.diff(Re.now(),e,n)}until(e){return this.isValid?$t.fromDateTimes(this,e):this}hasSame(e,n,r){if(!this.isValid)return!1;const i=e.valueOf(),o=this.setZone(e.zone,{keepLocalTime:!0});return o.startOf(n,r)<=i&&i<=o.endOf(n,r)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const n=e.base||Re.fromObject({},{zone:this.zone}),r=e.padding?thisn.valueOf(),Math.min)}static max(...e){if(!e.every(Re.isDateTime))throw new pr("max requires all arguments be DateTimes");return IA(e,n=>n.valueOf(),Math.max)}static fromFormatExplain(e,n,r={}){const{locale:i=null,numberingSystem:o=null}=r,s=ct.fromOpts({locale:i,numberingSystem:o,defaultToEN:!0});return $R(s,e,n)}static fromStringExplain(e,n,r={}){return Re.fromFormatExplain(e,n,r)}static get DATE_SHORT(){return A1}static get DATE_MED(){return z7}static get DATE_MED_WITH_WEEKDAY(){return Pme}static get DATE_FULL(){return j7}static get DATE_HUGE(){return q7}static get TIME_SIMPLE(){return V7}static get TIME_WITH_SECONDS(){return U7}static get TIME_WITH_SHORT_OFFSET(){return H7}static get TIME_WITH_LONG_OFFSET(){return W7}static get TIME_24_SIMPLE(){return J7}static get TIME_24_WITH_SECONDS(){return K7}static get TIME_24_WITH_SHORT_OFFSET(){return G7}static get TIME_24_WITH_LONG_OFFSET(){return Z7}static get DATETIME_SHORT(){return Y7}static get DATETIME_SHORT_WITH_SECONDS(){return Q7}static get DATETIME_MED(){return X7}static get DATETIME_MED_WITH_SECONDS(){return eR}static get DATETIME_MED_WITH_WEEKDAY(){return zme}static get DATETIME_FULL(){return tR}static get DATETIME_FULL_WITH_SECONDS(){return nR}static get DATETIME_HUGE(){return rR}static get DATETIME_HUGE_WITH_SECONDS(){return iR}}function pf(t){if(Re.isDateTime(t))return t;if(t&&t.valueOf&&kl(t.valueOf()))return Re.fromJSDate(t);if(t&&typeof t=="object")return Re.fromObject(t);throw new pr(`Unknown datetime argument: ${t}, of type ${typeof t}`)}function Rge(t){const{text:e,marks:n=[]}=t.node;return _.jsx(_.Fragment,{children:n.reduce((r,i)=>{switch(i.type){case"bold":return _.jsx("b",{children:r});case"italic":return _.jsx("i",{children:r});case"strike":return _.jsx("s",{children:r});case"code":return _.jsx("span",{className:"px-2 rounded-lg text-nowrap bg-gray-200",children:r});case"tag":return _.jsx("a",{href:"#",children:r});case"link":return _.jsx("a",{href:i.attrs.href,children:r});default:return r}},_.jsx("span",{children:e}))})}function BR(t){var e;return _.jsx(_.Fragment,{children:(e=t.node.content)==null?void 0:e.map((n,r)=>_.jsxs(tt.Fragment,{children:[n.type==="nprofile"&&_.jsx(B7,{...n.attrs}),n.type==="text"&&_.jsx(Rge,{node:n}),n.type==="hardBreak"&&_.jsx("div",{className:"mt-4"})]},n.type+r))})}function WE(t){return _.jsx("div",{className:"mt-2 ml-2",children:_.jsx(BR,{node:t.node})})}function Fge(t){var e;return _.jsx("div",{className:"ml-2 my-4 px-2 py-1 border-l-4 border-gray-200 italic text-gray-600",children:(e=t.node.content)==null?void 0:e.map((n,r)=>_.jsx(tt.Fragment,{children:n.type==="paragraph"&&_.jsx(WE,{node:n})},n.type+r))})}function PR(t){const e=ee.useRef(null),[n,r]=ee.useState(!1),i=ee.useCallback(()=>{var o;e.current&&navigator.clipboard.writeText((o=e.current)==null?void 0:o.innerText).then(()=>{r(!0),setTimeout(()=>{r(!1)},2e3)})},[]);return _.jsxs("div",{className:"mx-2 pr-6 rounded-lg bg-gray-200 relative",children:[_.jsx("pre",{className:"my-1 py-2 px-2 overflow-scroll",ref:e,children:t.node.content.map((o,s)=>_.jsx(tt.Fragment,{children:o.type==="text"&&o.text},o.type+s))}),_.jsx("div",{className:"absolute top-0 right-0",children:_.jsx("button",{className:"p-4",onClick:i,children:n?_.jsx(G1,{size:20,strokeWidth:"1.5"}):_.jsx(kT,{size:20,strokeWidth:"1.5"})})})]})}const Lge={1:"text-3xl",2:"text-2xl",3:"text-xl",4:"text-lg",5:"text-lg",6:"text-lg"};function Bge(t){return _.jsx("div",{className:`mt-8 ml-2 ${Lge[t.node.attrs.level]||""}`,children:_.jsx(BR,{node:t.node})})}function YA(t){const{type:e,node:n}=t,r=e;return _.jsx(r,{className:"ml-10",children:n.content.map((i,o)=>_.jsx("li",{children:i.content.map((s,a)=>_.jsxs(tt.Fragment,{children:[s.type==="paragraph"&&_.jsx(WE,{node:s}),s.type==="codeBlock"&&_.jsx(PR,{node:s})]},s.type+a))},i.type+o))})}const Pge="_verified_lvyh0_1",JE={verified:Pge},zge=()=>_.jsx("svg",{viewBox:"0 0 24 24","aria-label":"Verified account",role:"img",className:JE.verified,children:_.jsx("g",{children:_.jsx("path",{d:"M22.25 12c0-1.43-.88-2.67-2.19-3.34.46-1.39.2-2.9-.81-3.91s-2.52-1.27-3.91-.81c-.66-1.31-1.91-2.19-3.34-2.19s-2.67.88-3.33 2.19c-1.4-.46-2.91-.2-3.92.81s-1.26 2.52-.8 3.91c-1.31.67-2.2 1.91-2.2 3.34s.89 2.67 2.2 3.34c-.46 1.39-.21 2.9.8 3.91s2.52 1.26 3.91.81c.67 1.31 1.91 2.19 3.34 2.19s2.68-.88 3.34-2.19c1.39.45 2.9.2 3.91-.81s1.27-2.52.81-3.91c1.31-.67 2.19-1.91 2.19-3.34zm-11.71 4.2L6.8 12.46l1.41-1.42 2.26 2.26 4.8-5.23 1.47 1.36-6.2 6.77z"})})}),jge=()=>_.jsx("svg",{viewBox:"0 0 22 22","aria-label":"Verified account",role:"img",className:JE.verified,children:_.jsxs("g",{children:[_.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"0-a",x1:"4.411",x2:"18.083",y1:"2.495",y2:"21.508",children:[_.jsx("stop",{offset:"0",stopColor:"#f4e72a"}),_.jsx("stop",{offset:".539",stopColor:"#cd8105"}),_.jsx("stop",{offset:".68",stopColor:"#cb7b00"}),_.jsx("stop",{offset:"1",stopColor:"#f4ec26"}),_.jsx("stop",{offset:"1",stopColor:"#f4e72a"})]}),_.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"0-b",x1:"5.355",x2:"16.361",y1:"3.395",y2:"19.133",children:[_.jsx("stop",{offset:"0",stopColor:"#f9e87f"}),_.jsx("stop",{offset:".406",stopColor:"#e2b719"}),_.jsx("stop",{offset:".989",stopColor:"#e2b719"})]}),_.jsxs("g",{clipRule:"evenodd",fillRule:"evenodd",children:[_.jsx("path",{d:"M13.324 3.848L11 1.6 8.676 3.848l-3.201-.453-.559 3.184L2.06 8.095 3.48 11l-1.42 2.904 2.856 1.516.559 3.184 3.201-.452L11 20.4l2.324-2.248 3.201.452.559-3.184 2.856-1.516L18.52 11l1.42-2.905-2.856-1.516-.559-3.184zm-7.09 7.575l3.428 3.428 5.683-6.206-1.347-1.247-4.4 4.795-2.072-2.072z",fill:"url(#0-a)"}),_.jsx("path",{d:"M13.101 4.533L11 2.5 8.899 4.533l-2.895-.41-.505 2.88-2.583 1.37L4.2 11l-1.284 2.627 2.583 1.37.505 2.88 2.895-.41L11 19.5l2.101-2.033 2.895.41.505-2.88 2.583-1.37L17.8 11l1.284-2.627-2.583-1.37-.505-2.88zm-6.868 6.89l3.429 3.428 5.683-6.206-1.347-1.247-4.4 4.795-2.072-2.072z",fill:"url(#0-b)"}),_.jsx("path",{d:"M6.233 11.423l3.429 3.428 5.65-6.17.038-.033-.005 1.398-5.683 6.206-3.429-3.429-.003-1.405.005.003z",fill:"#d18800"})]})]})}),qge=()=>_.jsx("svg",{viewBox:"0 0 22 22","aria-label":"Verified account",role:"img",className:JE.verified,children:_.jsx("g",{children:_.jsx("path",{clipRule:"evenodd",d:"M12.05 2.056c-.568-.608-1.532-.608-2.1 0l-1.393 1.49c-.284.303-.685.47-1.1.455L5.42 3.932c-.832-.028-1.514.654-1.486 1.486l.069 2.039c.014.415-.152.816-.456 1.1l-1.49 1.392c-.608.568-.608 1.533 0 2.101l1.49 1.393c.304.284.47.684.456 1.1l-.07 2.038c-.027.832.655 1.514 1.487 1.486l2.038-.069c.415-.014.816.152 1.1.455l1.392 1.49c.569.609 1.533.609 2.102 0l1.393-1.49c.283-.303.684-.47 1.099-.455l2.038.069c.832.028 1.515-.654 1.486-1.486L18 14.542c-.015-.415.152-.815.455-1.099l1.49-1.393c.608-.568.608-1.533 0-2.101l-1.49-1.393c-.303-.283-.47-.684-.455-1.1l.068-2.038c.029-.832-.654-1.514-1.486-1.486l-2.038.07c-.415.013-.816-.153-1.1-.456zm-5.817 9.367l3.429 3.428 5.683-6.206-1.347-1.247-4.4 4.795-2.072-2.072z",fillRule:"evenodd"})})});function zR(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e_.jsx("div",{className:ua("react-tweet-theme",QA.root,t),children:_.jsx("article",{className:QA.article,children:e})}),jR=t=>_.jsx("img",{...t}),Hge="_header_nqq4j_1",Wge="_avatar_nqq4j_11",Jge="_avatarOverflow_nqq4j_16",Kge="_avatarSquare_nqq4j_23",Gge="_avatarShadow_nqq4j_26",Zge="_author_nqq4j_37",Yge="_authorLink_nqq4j_44",Qge="_authorVerified_nqq4j_53",Xge="_authorLinkText_nqq4j_56",eye="_authorMeta_nqq4j_63",tye="_authorFollow_nqq4j_66",nye="_username_nqq4j_69",rye="_follow_nqq4j_74",iye="_separator_nqq4j_82",oye="_brand_nqq4j_86",sye="_twitterIcon_nqq4j_90",kn={header:Hge,avatar:Wge,avatarOverflow:Jge,avatarSquare:Kge,avatarShadow:Gge,author:Zge,authorLink:Yge,authorVerified:Qge,authorLinkText:Xge,authorMeta:eye,authorFollow:tye,username:nye,follow:rye,separator:iye,brand:oye,twitterIcon:sye},aye="_verifiedOld_lcna5_1",lye="_verifiedBlue_lcna5_4",uye="_verifiedGovernment_lcna5_7",A2={verifiedOld:aye,verifiedBlue:lye,verifiedGovernment:uye},qR=({user:t,className:e})=>{const n=t.verified||t.is_blue_verified||t.verified_type;let r=_.jsx(zge,{}),i=A2.verifiedBlue;if(n)switch(t.is_blue_verified||(i=A2.verifiedOld),t.verified_type){case"Government":r=_.jsx(qge,{}),i=A2.verifiedGovernment;break;case"Business":r=_.jsx(jge,{}),i=null;break}return n?_.jsx("div",{className:ua(e,i),children:r}):null},cye=({tweet:t,components:e})=>{var n;const r=(n=e==null?void 0:e.AvatarImg)!=null?n:jR,{user:i}=t;return _.jsxs("div",{className:kn.header,children:[_.jsxs("a",{href:t.url,className:kn.avatar,target:"_blank",rel:"noopener noreferrer",children:[_.jsx("div",{className:ua(kn.avatarOverflow,i.profile_image_shape==="Square"&&kn.avatarSquare),children:_.jsx(r,{src:i.profile_image_url_https,alt:i.name,width:48,height:48})}),_.jsx("div",{className:kn.avatarOverflow,children:_.jsx("div",{className:kn.avatarShadow})})]}),_.jsxs("div",{className:kn.author,children:[_.jsxs("a",{href:t.url,className:kn.authorLink,target:"_blank",rel:"noopener noreferrer",children:[_.jsx("div",{className:kn.authorLinkText,children:_.jsx("span",{title:i.name,children:i.name})}),_.jsx(qR,{user:i,className:kn.authorVerified})]}),_.jsxs("div",{className:kn.authorMeta,children:[_.jsx("a",{href:t.url,className:kn.username,target:"_blank",rel:"noopener noreferrer",children:_.jsxs("span",{title:`@${i.screen_name}`,children:["@",i.screen_name]})}),_.jsxs("div",{className:kn.authorFollow,children:[_.jsx("span",{className:kn.separator,children:"·"}),_.jsx("a",{href:i.follow_url,className:kn.follow,target:"_blank",rel:"noopener noreferrer",children:"Follow"})]})]})]}),_.jsx("a",{href:t.url,className:kn.brand,target:"_blank",rel:"noopener noreferrer","aria-label":"View on Twitter",children:_.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:kn.twitterIcon,children:_.jsx("g",{children:_.jsx("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})})})})]})},fye="_root_1ec15_1",dye={root:fye},hye=({tweet:t})=>_.jsxs("a",{href:t.in_reply_to_url,className:dye.root,target:"_blank",rel:"noopener noreferrer",children:["Replying to @",t.in_reply_to_screen_name]}),pye="_root_eihfa_1",mye={root:pye},gye=({href:t,children:e})=>_.jsx("a",{href:t,className:mye.root,target:"_blank",rel:"noopener noreferrer nofollow",children:e}),yye="_root_1xq52_1",bye={root:yye},vye=({tweet:t})=>_.jsx("p",{className:bye.root,children:t.entities.map((e,n)=>{switch(e.type){case"hashtag":case"mention":case"url":case"symbol":return _.jsx(gye,{href:e.href,children:e.text},n);case"media":return;default:return _.jsx("span",{dangerouslySetInnerHTML:{__html:e.text}},n)}})}),XA=t=>`https://twitter.com/${t.user.screen_name}/status/${t.id_str}`,VR=t=>`https://twitter.com/${typeof t=="string"?t:t.user.screen_name}`,wye=t=>`https://twitter.com/intent/like?tweet_id=${t.id_str}`,kye=t=>`https://twitter.com/intent/tweet?in_reply_to=${t.id_str}`,xye=t=>`https://twitter.com/intent/follow?screen_name=${t.user.screen_name}`,Eye=t=>`https://twitter.com/hashtag/${t.text}`,Sye=t=>`https://twitter.com/search?q=%24${t.text}`,Cye=t=>`https://twitter.com/${t.in_reply_to_screen_name}/status/${t.in_reply_to_status_id_str}`,UR=(t,e)=>{const n=new URL(t.media_url_https),r=n.pathname.split(".").pop();return r?(n.pathname=n.pathname.replace(`.${r}`,""),n.searchParams.set("format",r),n.searchParams.set("name",e),n.toString()):t.media_url_https},_ye=t=>{const{variants:e}=t.video_info;return e.filter(r=>r.content_type==="video/mp4").sort((r,i)=>{var o,s;return((o=i.bitrate)!=null?o:0)-((s=r.bitrate)!=null?s:0)})},Aye=t=>{const e=_ye(t);return e.length>1?e[1]:e[0]},kk=t=>t>999999?`${(t/1e6).toFixed(1)}M`:t>999?`${(t/1e3).toFixed(1)}K`:t.toString();function e5(t){const e=Array.from(t.text),n=[{indices:t.display_text_range,type:"text"}];return mf(n,"hashtag",t.entities.hashtags),mf(n,"mention",t.entities.user_mentions),mf(n,"url",t.entities.urls),mf(n,"symbol",t.entities.symbols),t.entities.media&&mf(n,"media",t.entities.media),Tye(t,n),n.map(r=>{const i=e.slice(r.indices[0],r.indices[1]).join("");switch(r.type){case"hashtag":return Object.assign(r,{href:Eye(r),text:i});case"mention":return Object.assign(r,{href:VR(r.screen_name),text:i});case"url":case"media":return Object.assign(r,{href:r.expanded_url,text:r.display_url});case"symbol":return Object.assign(r,{href:Sye(r),text:i});default:return Object.assign(r,{text:i})}})}function mf(t,e,n){for(const r of n)for(const[i,o]of t.entries()){if(o.indices[0]>r.indices[0]||o.indices[1]r.indices[1]&&s.push({indices:[r.indices[1],o.indices[1]],type:"text"}),t.splice(i,1,...s);break}}function Tye(t,e){t.entities.media&&t.entities.media[0].indices[0]t.display_text_range[1]&&(n.indices[1]=t.display_text_range[1])}const Mye=t=>({...t,url:XA(t),user:{...t.user,url:VR(t),follow_url:xye(t)},like_url:wye(t),reply_url:kye(t),in_reply_to_url:t.in_reply_to_screen_name?Cye(t):void 0,entities:e5(t),quoted_tweet:t.quoted_tweet?{...t.quoted_tweet,url:XA(t.quoted_tweet),entities:e5(t.quoted_tweet)}:void 0}),Oye="_root_g9tkv_1",Dye="_rounded_g9tkv_6",Nye="_mediaWrapper_g9tkv_10",$ye="_grid2Columns_g9tkv_17",Iye="_grid3_g9tkv_20",Rye="_grid2x2_g9tkv_23",Fye="_mediaContainer_g9tkv_26",Lye="_mediaLink_g9tkv_34",Bye="_skeleton_g9tkv_38",Pye="_image_g9tkv_43",$r={root:Oye,rounded:Dye,mediaWrapper:Nye,grid2Columns:$ye,grid3:Iye,grid2x2:Rye,mediaContainer:Fye,mediaLink:Lye,skeleton:Bye,image:Pye},zye="_anchor_fp31d_1",jye="_videoButton_fp31d_17",qye="_videoButtonIcon_fp31d_35",Vye="_watchOnTwitter_fp31d_44",Uye="_viewReplies_fp31d_60",ru={anchor:zye,videoButton:jye,videoButtonIcon:qye,watchOnTwitter:Vye,viewReplies:Uye},Hye=({tweet:t,media:e})=>{const[n,r]=ee.useState(!0),[i,o]=ee.useState(!1),[s,a]=ee.useState(!1),l=Aye(e);let u=0;return _.jsxs(_.Fragment,{children:[_.jsx("video",{className:$r.image,poster:UR(e,"small"),controls:!n,muted:!0,preload:"none",tabIndex:n?-1:0,onPlay:()=>{u&&window.clearTimeout(u),i||o(!0),s&&a(!1)},onPause:()=>{u&&window.clearTimeout(u),u=window.setTimeout(()=>{i&&o(!1),u=0},100)},onEnded:()=>{a(!0)},children:_.jsx("source",{src:l.url,type:l.content_type})}),n&&_.jsx("button",{type:"button",className:ru.videoButton,"aria-label":"View video on X",onClick:c=>{const f=c.currentTarget.previousSibling;c.preventDefault(),r(!1),o(!0),f.play(),f.focus()},children:_.jsx("svg",{viewBox:"0 0 24 24",className:ru.videoButtonIcon,"aria-hidden":"true",children:_.jsx("g",{children:_.jsx("path",{d:"M21 12L4 2v20l17-10z"})})})}),!i&&!s&&_.jsx("div",{className:ru.watchOnTwitter,children:_.jsx("a",{href:t.url,className:ru.anchor,target:"_blank",rel:"noopener noreferrer",children:n?"Watch on X":"Continue watching on X"})}),s&&_.jsx("a",{href:t.url,className:ua(ru.anchor,ru.viewReplies),target:"_blank",rel:"noopener noreferrer",children:"View replies"})]})},Wye=t=>_.jsx("img",{...t}),t5=(t,e)=>{let n=56.25;return e===1&&(n=100/t.original_info.width*t.original_info.height),e===2&&(n=n*2),{width:t.type==="photo"?void 0:"unset",paddingBottom:`${n}%`}},HR=({tweet:t,components:e,quoted:n})=>{var r,i,o;const s=(o=(r=t.mediaDetails)==null?void 0:r.length)!=null?o:0;var a;const l=(a=e==null?void 0:e.MediaImg)!=null?a:Wye;return _.jsx("div",{className:ua($r.root,!n&&$r.rounded),children:_.jsx("div",{className:ua($r.mediaWrapper,s>1&&$r.grid2Columns,s===3&&$r.grid3,s>4&&$r.grid2x2),children:(i=t.mediaDetails)==null?void 0:i.map(u=>_.jsx(ee.Fragment,{children:u.type==="photo"?_.jsxs("a",{href:t.url,className:ua($r.mediaContainer,$r.mediaLink),target:"_blank",rel:"noopener noreferrer",children:[_.jsx("div",{className:$r.skeleton,style:t5(u,s)}),_.jsx(l,{src:UR(u,"small"),alt:u.ext_alt_text||"Image",className:$r.image,draggable:!0})]},u.media_url_https):_.jsxs("div",{className:$r.mediaContainer,children:[_.jsx("div",{className:$r.skeleton,style:t5(u,s)}),_.jsx(Hye,{tweet:t,media:u})]},u.media_url_https)},u.media_url_https))})})},Jye={hour:"numeric",minute:"2-digit",hour12:!0,weekday:"short",month:"short",day:"numeric",year:"numeric"},Kye=new Intl.DateTimeFormat("en-US",Jye),Gye=t=>{const e={};for(const n of t)e[n.type]=n.value;return e},Zye=t=>{const e=Gye(Kye.formatToParts(t)),n=`${e.hour}:${e.minute} ${e.dayPeriod}`,r=`${e.month} ${e.day}, ${e.year}`;return`${n} · ${r}`},Yye="_root_i24yn_1",Qye={root:Yye},Xye=({tweet:t})=>{const e=new Date(t.created_at),n=Zye(e);return _.jsx("a",{className:Qye.root,href:t.url,target:"_blank",rel:"noopener noreferrer","aria-label":n,children:_.jsx("time",{dateTime:e.toISOString(),children:n})})},ebe="_info_19qcj_1",tbe="_infoLink_19qcj_10",nbe="_infoIcon_19qcj_30",T2={info:ebe,infoLink:tbe,infoIcon:nbe},rbe=({tweet:t})=>_.jsxs("div",{className:T2.info,children:[_.jsx(Xye,{tweet:t}),_.jsx("a",{className:T2.infoLink,href:"https://help.twitter.com/en/twitter-for-websites-ads-info-and-privacy",target:"_blank",rel:"noopener noreferrer","aria-label":"Twitter for Websites, Ads Information and Privacy",children:_.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:T2.infoIcon,children:_.jsx("g",{children:_.jsx("path",{d:"M13.5 8.5c0 .83-.67 1.5-1.5 1.5s-1.5-.67-1.5-1.5S11.17 7 12 7s1.5.67 1.5 1.5zM13 17v-5h-2v5h2zm-1 5.25c5.66 0 10.25-4.59 10.25-10.25S17.66 1.75 12 1.75 1.75 6.34 1.75 12 6.34 22.25 12 22.25zM20.25 12c0 4.56-3.69 8.25-8.25 8.25S3.75 16.56 3.75 12 7.44 3.75 12 3.75s8.25 3.69 8.25 8.25z"})})})})]}),ibe="_actions_n2anf_1",obe="_like_n2anf_13",sbe="_reply_n2anf_14",abe="_copy_n2anf_15",lbe="_likeIconWrapper_n2anf_27",ube="_likeCount_n2anf_30",cbe="_replyIconWrapper_n2anf_35",fbe="_copyIconWrapper_n2anf_36",dbe="_likeIcon_n2anf_27",hbe="_replyIcon_n2anf_35",pbe="_copyIcon_n2anf_36",mbe="_replyText_n2anf_56",gbe="_copyText_n2anf_57",fr={actions:ibe,like:obe,reply:sbe,copy:abe,likeIconWrapper:lbe,likeCount:ube,replyIconWrapper:cbe,copyIconWrapper:fbe,likeIcon:dbe,replyIcon:hbe,copyIcon:pbe,replyText:mbe,copyText:gbe},ybe=({tweet:t})=>{const[e,n]=ee.useState(!1),[r,i]=ee.useState(!1),o=()=>{navigator.clipboard.writeText(t.url),n(!0)};return ee.useEffect(()=>{if(e){const s=setTimeout(()=>{n(!1),i(!0)},6e3);return()=>clearTimeout(s)}},[e]),_.jsxs("button",{type:"button",className:fr.copy,"aria-label":"Copy link",onClick:o,children:[_.jsx("div",{className:fr.copyIconWrapper,children:e?_.jsx("svg",{viewBox:"0 0 24 24",className:fr.copyIcon,"aria-hidden":"true",children:_.jsx("g",{children:_.jsx("path",{d:"M9.64 18.952l-5.55-4.861 1.317-1.504 3.951 3.459 8.459-10.948L19.4 6.32 9.64 18.952z"})})}):_.jsx("svg",{viewBox:"0 0 24 24",className:fr.copyIcon,"aria-hidden":"true",children:_.jsx("g",{children:_.jsx("path",{d:"M18.36 5.64c-1.95-1.96-5.11-1.96-7.07 0L9.88 7.05 8.46 5.64l1.42-1.42c2.73-2.73 7.16-2.73 9.9 0 2.73 2.74 2.73 7.17 0 9.9l-1.42 1.42-1.41-1.42 1.41-1.41c1.96-1.96 1.96-5.12 0-7.07zm-2.12 3.53l-7.07 7.07-1.41-1.41 7.07-7.07 1.41 1.41zm-12.02.71l1.42-1.42 1.41 1.42-1.41 1.41c-1.96 1.96-1.96 5.12 0 7.07 1.95 1.96 5.11 1.96 7.07 0l1.41-1.41 1.42 1.41-1.42 1.42c-2.73 2.73-7.16 2.73-9.9 0-2.73-2.74-2.73-7.17 0-9.9z"})})})}),_.jsx("span",{className:fr.copyText,children:e?"Copied!":r?"Copy link to Tweet":"Copy link"})]})},bbe=({tweet:t})=>{const e=kk(t.favorite_count);return _.jsxs("div",{className:fr.actions,children:[_.jsxs("a",{className:fr.like,href:t.like_url,target:"_blank",rel:"noopener noreferrer","aria-label":`Like. This Tweet has ${e} likes`,children:[_.jsx("div",{className:fr.likeIconWrapper,children:_.jsx("svg",{viewBox:"0 0 24 24",className:fr.likeIcon,"aria-hidden":"true",children:_.jsx("g",{children:_.jsx("path",{d:"M20.884 13.19c-1.351 2.48-4.001 5.12-8.379 7.67l-.503.3-.504-.3c-4.379-2.55-7.029-5.19-8.382-7.67-1.36-2.5-1.41-4.86-.514-6.67.887-1.79 2.647-2.91 4.601-3.01 1.651-.09 3.368.56 4.798 2.01 1.429-1.45 3.146-2.1 4.796-2.01 1.954.1 3.714 1.22 4.601 3.01.896 1.81.846 4.17-.514 6.67z"})})})}),_.jsx("span",{className:fr.likeCount,children:e})]}),_.jsxs("a",{className:fr.reply,href:t.reply_url,target:"_blank",rel:"noopener noreferrer","aria-label":"Reply to this Tweet on Twitter",children:[_.jsx("div",{className:fr.replyIconWrapper,children:_.jsx("svg",{viewBox:"0 0 24 24",className:fr.replyIcon,"aria-hidden":"true",children:_.jsx("g",{children:_.jsx("path",{d:"M1.751 10c0-4.42 3.584-8 8.005-8h4.366c4.49 0 8.129 3.64 8.129 8.13 0 2.96-1.607 5.68-4.196 7.11l-8.054 4.46v-3.69h-.067c-4.49.1-8.183-3.51-8.183-8.01z"})})})}),_.jsx("span",{className:fr.replyText,children:"Reply"})]}),_.jsx(ybe,{tweet:t})]})},vbe="_replies_1cutb_1",wbe="_link_1cutb_4",kbe="_text_1cutb_23",M2={replies:vbe,link:wbe,text:kbe},xbe=({tweet:t})=>_.jsx("div",{className:M2.replies,children:_.jsx("a",{className:M2.link,href:t.url,target:"_blank",rel:"noopener noreferrer",children:_.jsx("span",{className:M2.text,children:t.conversation_count===0?"Read more on X":t.conversation_count===1?`Read ${kk(t.conversation_count)} reply`:`Read ${kk(t.conversation_count)} replies`})})}),Ebe="_root_q5799_1",Sbe="_article_q5799_16",n5={root:Ebe,article:Sbe},Cbe=({tweet:t,children:e})=>_.jsx("div",{className:n5.root,onClick:n=>{n.preventDefault(),window.open(t.url,"_blank")},children:_.jsx("article",{className:n5.article,children:e})}),_be="_header_r31i5_1",Abe="_avatar_r31i5_11",Tbe="_avatarSquare_r31i5_17",Mbe="_author_r31i5_21",Obe="_authorText_r31i5_26",Dbe="_username_r31i5_33",Ra={header:_be,avatar:Abe,avatarSquare:Tbe,author:Mbe,authorText:Obe,username:Dbe},Nbe=({tweet:t})=>{const{user:e}=t;return _.jsxs("div",{className:Ra.header,children:[_.jsx("a",{href:t.url,className:Ra.avatar,target:"_blank",rel:"noopener noreferrer",children:_.jsx("div",{className:ua(Ra.avatarOverflow,e.profile_image_shape==="Square"&&Ra.avatarSquare),children:_.jsx(jR,{src:e.profile_image_url_https,alt:e.name,width:20,height:20})})}),_.jsxs("div",{className:Ra.author,children:[_.jsx("div",{className:Ra.authorText,children:_.jsx("span",{title:e.name,children:e.name})}),_.jsx(qR,{user:e}),_.jsx("div",{className:Ra.username,children:_.jsxs("span",{title:`@${e.screen_name}`,children:["@",e.screen_name]})})]})]})},$be="_root_175ot_1",Ibe={root:$be},Rbe=({tweet:t})=>_.jsx("p",{className:Ibe.root,children:t.entities.map((e,n)=>_.jsx("span",{dangerouslySetInnerHTML:{__html:e.text}},n))}),Fbe=({tweet:t})=>{var e;return _.jsxs(Cbe,{tweet:t,children:[_.jsx(Nbe,{tweet:t}),_.jsx(Rbe,{tweet:t}),(e=t.mediaDetails)!=null&&e.length?_.jsx(HR,{quoted:!0,tweet:t}):null]})},Lbe=({tweet:t,components:e})=>{var n;const r=ee.useMemo(()=>Mye(t),[t]);return _.jsxs(KE,{children:[_.jsx(cye,{tweet:r,components:e}),r.in_reply_to_status_id_str&&_.jsx(hye,{tweet:r}),_.jsx(vye,{tweet:r}),(n=r.mediaDetails)!=null&&n.length?_.jsx(HR,{tweet:r,components:e}):null,r.quoted_tweet&&_.jsx(Fbe,{tweet:r.quoted_tweet}),_.jsx(rbe,{tweet:r}),_.jsx(bbe,{tweet:r}),_.jsx(xbe,{tweet:r})]})},Bbe="_root_16yxa_1",Pbe={root:Bbe},zbe=t=>_.jsx(KE,{children:_.jsxs("div",{className:Pbe.root,children:[_.jsx("h3",{children:"Tweet not found"}),_.jsx("p",{children:"The embedded tweet could not be found…"})]})}),jbe="_skeleton_oi7hr_1",qbe="_loading_oi7hr_1",Vbe={skeleton:jbe,loading:qbe},Vp=({style:t})=>_.jsx("span",{className:Vbe.skeleton,style:t}),Ube="_root_17qqv_1",Hbe={root:Ube},Wbe=()=>_.jsxs(KE,{className:Hbe.root,children:[_.jsx(Vp,{style:{height:"3rem",marginBottom:"0.75rem"}}),_.jsx(Vp,{style:{height:"6rem",margin:"0.5rem 0"}}),_.jsx("div",{style:{borderTop:"var(--tweet-border)",margin:"0.5rem 0"}}),_.jsx(Vp,{style:{height:"2rem"}}),_.jsx(Vp,{style:{height:"2rem",borderRadius:"9999px",marginTop:"0.5rem"}})]});var WR={exports:{}},JR={};/** + `,children:[i&&_.jsxs("a",{children:["@",i.display_name||i.name||""]}),!i&&_.jsx("span",{className:"text-gray-600",children:"loading"})]})}function Ime(t){return _.jsx(_.Fragment,{children:_.jsx(_a,{as:"span",children:_.jsx(B7,{...t.node.attrs})})})}function Rme(t){const{pubkey:e,identifier:n}=t,r=FE(e),i=LE(r);return _.jsxs("div",{className:"border rounded-md p-2 pt-4 my-2",children:[_.jsxs("div",{className:"flex flex-row",children:[_.jsx("img",{src:i==null?void 0:i.picture,className:"size-8 rounded-full"}),_.jsx("span",{className:"ml-4",children:(i==null?void 0:i.display_name)||(i==null?void 0:i.name)})]}),_.jsx("div",{className:"border rounded-md p-2 mt-2",children:_.jsx("h6",{children:n})})]})}function Fme(t){return _.jsx(_a,{"data-drag-handle":"",draggable:t.node.type.spec.draggable,children:_.jsx("div",{className:`select-none rounded-md ${t.selected?"bg-blue-100":""}`,children:_.jsx(Rme,{...t.node.attrs})})})}const Lme=bn.create({name:"doc",topNode:!0,content:"block+"}),Bme=bn.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",Ece(this.options.HTMLAttributes,t)]},renderText(){return` +`},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:i,storedMarks:o}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:a}=r.extensionManager,l=o||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:u,dispatch:c})=>{if(c&&l&&s){const f=l.filter(d=>a.includes(d.type.name));u.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Pme=bn.create({name:"text",group:"inline"});class zl extends Error{}class zme extends zl{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class jme extends zl{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class qme extends zl{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Ou extends zl{}class P7 extends zl{constructor(e){super(`Invalid unit ${e}`)}}class pr extends zl{}class Ss extends zl{constructor(){super("Zone is an abstract class")}}const le="numeric",Bi="short",jr="long",A1={year:le,month:le,day:le},z7={year:le,month:Bi,day:le},Ume={year:le,month:Bi,day:le,weekday:Bi},j7={year:le,month:jr,day:le},q7={year:le,month:jr,day:le,weekday:jr},U7={hour:le,minute:le},V7={hour:le,minute:le,second:le},H7={hour:le,minute:le,second:le,timeZoneName:Bi},W7={hour:le,minute:le,second:le,timeZoneName:jr},J7={hour:le,minute:le,hourCycle:"h23"},K7={hour:le,minute:le,second:le,hourCycle:"h23"},G7={hour:le,minute:le,second:le,hourCycle:"h23",timeZoneName:Bi},Z7={hour:le,minute:le,second:le,hourCycle:"h23",timeZoneName:jr},Y7={year:le,month:le,day:le,hour:le,minute:le},Q7={year:le,month:le,day:le,hour:le,minute:le,second:le},X7={year:le,month:Bi,day:le,hour:le,minute:le},eR={year:le,month:Bi,day:le,hour:le,minute:le,second:le},Vme={year:le,month:Bi,day:le,weekday:Bi,hour:le,minute:le},tR={year:le,month:jr,day:le,hour:le,minute:le,timeZoneName:Bi},nR={year:le,month:jr,day:le,hour:le,minute:le,second:le,timeZoneName:Bi},rR={year:le,month:jr,day:le,weekday:jr,hour:le,minute:le,timeZoneName:jr},iR={year:le,month:jr,day:le,weekday:jr,hour:le,minute:le,second:le,timeZoneName:jr};class Rh{get type(){throw new Ss}get name(){throw new Ss}get ianaName(){return this.name}get isUniversal(){throw new Ss}offsetName(e,n){throw new Ss}formatOffset(e,n){throw new Ss}offset(e){throw new Ss}equals(e){throw new Ss}get isValid(){throw new Ss}}let v2=null;class ny extends Rh{static get instance(){return v2===null&&(v2=new ny),v2}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:n,locale:r}){return hR(e,n,r)}formatOffset(e,n){return pd(this.offset(e),n)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let _0={};function Hme(t){return _0[t]||(_0[t]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),_0[t]}const Wme={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Jme(t,e){const n=t.format(e).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,i,o,s,a,l,u,c]=r;return[s,i,o,a,l,u,c]}function Kme(t,e){const n=t.formatToParts(e),r=[];for(let i=0;i=0?p:1e3+p,(d-h)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let kA={};function Gme(t,e={}){const n=JSON.stringify([t,e]);let r=kA[n];return r||(r=new Intl.ListFormat(t,e),kA[n]=r),r}let mk={};function gk(t,e={}){const n=JSON.stringify([t,e]);let r=mk[n];return r||(r=new Intl.DateTimeFormat(t,e),mk[n]=r),r}let yk={};function Zme(t,e={}){const n=JSON.stringify([t,e]);let r=yk[n];return r||(r=new Intl.NumberFormat(t,e),yk[n]=r),r}let bk={};function Yme(t,e={}){const{base:n,...r}=e,i=JSON.stringify([t,r]);let o=bk[i];return o||(o=new Intl.RelativeTimeFormat(t,e),bk[i]=o),o}let jf=null;function Qme(){return jf||(jf=new Intl.DateTimeFormat().resolvedOptions().locale,jf)}let xA={};function Xme(t){let e=xA[t];if(!e){const n=new Intl.Locale(t);e="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,xA[t]=e}return e}function e1e(t){const e=t.indexOf("-x-");e!==-1&&(t=t.substring(0,e));const n=t.indexOf("-u-");if(n===-1)return[t];{let r,i;try{r=gk(t).resolvedOptions(),i=t}catch{const l=t.substring(0,n);r=gk(l).resolvedOptions(),i=l}const{numberingSystem:o,calendar:s}=r;return[i,o,s]}}function t1e(t,e,n){return(n||e)&&(t.includes("-u-")||(t+="-u"),n&&(t+=`-ca-${n}`),e&&(t+=`-nu-${e}`)),t}function n1e(t){const e=[];for(let n=1;n<=12;n++){const r=Re.utc(2009,n,1);e.push(t(r))}return e}function r1e(t){const e=[];for(let n=1;n<=7;n++){const r=Re.utc(2016,11,13+n);e.push(t(r))}return e}function Bp(t,e,n,r){const i=t.listingMode();return i==="error"?null:i==="en"?n(e):r(e)}function i1e(t){return t.numberingSystem&&t.numberingSystem!=="latn"?!1:t.numberingSystem==="latn"||!t.locale||t.locale.startsWith("en")||new Intl.DateTimeFormat(t.intl).resolvedOptions().numberingSystem==="latn"}class o1e{constructor(e,n,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:i,floor:o,...s}=r;if(!n||Object.keys(s).length>0){const a={useGrouping:!1,...r};r.padTo>0&&(a.minimumIntegerDigits=r.padTo),this.inf=Zme(e,a)}}format(e){if(this.inf){const n=this.floor?Math.floor(e):e;return this.inf.format(n)}else{const n=this.floor?Math.floor(e):jE(e,3);return Jt(n,this.padTo)}}}class s1e{constructor(e,n,r){this.opts=r,this.originalZone=void 0;let i;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){const s=-1*(e.offset/60),a=s>=0?`Etc/GMT+${s}`:`Etc/GMT${s}`;e.offset!==0&&es.create(a).valid?(i=a,this.dt=e):(i="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,i=e.zone.name):(i="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const o={...this.opts};o.timeZone=o.timeZone||i,this.dtf=gk(n,o)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(n=>{if(n.type==="timeZoneName"){const r=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...n,value:r}}else return n}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class a1e{constructor(e,n,r){this.opts={style:"long",...r},!n&&fR()&&(this.rtf=Yme(e,r))}format(e,n){return this.rtf?this.rtf.format(e,n):A1e(n,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,n){return this.rtf?this.rtf.formatToParts(e,n):[]}}const l1e={firstDay:1,minimalDays:4,weekend:[6,7]};class ct{static fromOpts(e){return ct.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,n,r,i,o=!1){const s=e||zt.defaultLocale,a=s||(o?"en-US":Qme()),l=n||zt.defaultNumberingSystem,u=r||zt.defaultOutputCalendar,c=vk(i)||zt.defaultWeekSettings;return new ct(a,l,u,c,s)}static resetCache(){jf=null,mk={},yk={},bk={}}static fromObject({locale:e,numberingSystem:n,outputCalendar:r,weekSettings:i}={}){return ct.create(e,n,r,i)}constructor(e,n,r,i,o){const[s,a,l]=e1e(e);this.locale=s,this.numberingSystem=n||a||null,this.outputCalendar=r||l||null,this.weekSettings=i,this.intl=t1e(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=o,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=i1e(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&n?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:ct.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,vk(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,n=!1){return Bp(this,e,gR,()=>{const r=n?{month:e,day:"numeric"}:{month:e},i=n?"format":"standalone";return this.monthsCache[i][e]||(this.monthsCache[i][e]=n1e(o=>this.extract(o,r,"month"))),this.monthsCache[i][e]})}weekdays(e,n=!1){return Bp(this,e,vR,()=>{const r=n?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},i=n?"format":"standalone";return this.weekdaysCache[i][e]||(this.weekdaysCache[i][e]=r1e(o=>this.extract(o,r,"weekday"))),this.weekdaysCache[i][e]})}meridiems(){return Bp(this,void 0,()=>wR,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Re.utc(2016,11,13,9),Re.utc(2016,11,13,19)].map(n=>this.extract(n,e,"dayperiod"))}return this.meridiemCache})}eras(e){return Bp(this,e,kR,()=>{const n={era:e};return this.eraCache[e]||(this.eraCache[e]=[Re.utc(-40,1,1),Re.utc(2017,1,1)].map(r=>this.extract(r,n,"era"))),this.eraCache[e]})}extract(e,n,r){const i=this.dtFormatter(e,n),o=i.formatToParts(),s=o.find(a=>a.type.toLowerCase()===r);return s?s.value:null}numberFormatter(e={}){return new o1e(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,n={}){return new s1e(e,this.intl,n)}relFormatter(e={}){return new a1e(this.intl,this.isEnglish(),e)}listFormatter(e={}){return Gme(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:dR()?Xme(this.locale):l1e}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}}let w2=null;class ir extends Rh{static get utcInstance(){return w2===null&&(w2=new ir(0)),w2}static instance(e){return e===0?ir.utcInstance:new ir(e)}static parseSpecifier(e){if(e){const n=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new ir(oy(n[1],n[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${pd(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${pd(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,n){return pd(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class u1e extends Rh{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function js(t,e){if($e(t)||t===null)return e;if(t instanceof Rh)return t;if(d1e(t)){const n=t.toLowerCase();return n==="default"?e:n==="local"||n==="system"?ny.instance:n==="utc"||n==="gmt"?ir.utcInstance:ir.parseSpecifier(n)||es.create(t)}else return kl(t)?ir.instance(t):typeof t=="object"&&"offset"in t&&typeof t.offset=="function"?t:new u1e(t)}let EA=()=>Date.now(),SA="system",CA=null,_A=null,AA=null,TA=60,MA,OA=null;class zt{static get now(){return EA}static set now(e){EA=e}static set defaultZone(e){SA=e}static get defaultZone(){return js(SA,ny.instance)}static get defaultLocale(){return CA}static set defaultLocale(e){CA=e}static get defaultNumberingSystem(){return _A}static set defaultNumberingSystem(e){_A=e}static get defaultOutputCalendar(){return AA}static set defaultOutputCalendar(e){AA=e}static get defaultWeekSettings(){return OA}static set defaultWeekSettings(e){OA=vk(e)}static get twoDigitCutoffYear(){return TA}static set twoDigitCutoffYear(e){TA=e%100}static get throwOnInvalid(){return MA}static set throwOnInvalid(e){MA=e}static resetCaches(){ct.resetCache(),es.resetCache()}}class Ti{constructor(e,n){this.reason=e,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const oR=[0,31,59,90,120,151,181,212,243,273,304,334],sR=[0,31,60,91,121,152,182,213,244,274,305,335];function ai(t,e){return new Ti("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`)}function BE(t,e,n){const r=new Date(Date.UTC(t,e-1,n));t<100&&t>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const i=r.getUTCDay();return i===0?7:i}function aR(t,e,n){return n+(Fh(t)?sR:oR)[e-1]}function lR(t,e){const n=Fh(t)?sR:oR,r=n.findIndex(o=>olh(r,e,n)?(u=r+1,l=1):u=r,{weekYear:u,weekNumber:l,weekday:a,...sy(t)}}function DA(t,e=4,n=1){const{weekYear:r,weekNumber:i,weekday:o}=t,s=PE(BE(r,1,e),n),a=Wu(r);let l=i*7+o-s-7+e,u;l<1?(u=r-1,l+=Wu(u)):l>a?(u=r+1,l-=Wu(r)):u=r;const{month:c,day:f}=lR(u,l);return{year:u,month:c,day:f,...sy(t)}}function k2(t){const{year:e,month:n,day:r}=t,i=aR(e,n,r);return{year:e,ordinal:i,...sy(t)}}function NA(t){const{year:e,ordinal:n}=t,{month:r,day:i}=lR(e,n);return{year:e,month:r,day:i,...sy(t)}}function $A(t,e){if(!$e(t.localWeekday)||!$e(t.localWeekNumber)||!$e(t.localWeekYear)){if(!$e(t.weekday)||!$e(t.weekNumber)||!$e(t.weekYear))throw new Ou("Cannot mix locale-based week fields with ISO-based week fields");return $e(t.localWeekday)||(t.weekday=t.localWeekday),$e(t.localWeekNumber)||(t.weekNumber=t.localWeekNumber),$e(t.localWeekYear)||(t.weekYear=t.localWeekYear),delete t.localWeekday,delete t.localWeekNumber,delete t.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function c1e(t,e=4,n=1){const r=ry(t.weekYear),i=li(t.weekNumber,1,lh(t.weekYear,e,n)),o=li(t.weekday,1,7);return r?i?o?!1:ai("weekday",t.weekday):ai("week",t.weekNumber):ai("weekYear",t.weekYear)}function f1e(t){const e=ry(t.year),n=li(t.ordinal,1,Wu(t.year));return e?n?!1:ai("ordinal",t.ordinal):ai("year",t.year)}function uR(t){const e=ry(t.year),n=li(t.month,1,12),r=li(t.day,1,M1(t.year,t.month));return e?n?r?!1:ai("day",t.day):ai("month",t.month):ai("year",t.year)}function cR(t){const{hour:e,minute:n,second:r,millisecond:i}=t,o=li(e,0,23)||e===24&&n===0&&r===0&&i===0,s=li(n,0,59),a=li(r,0,59),l=li(i,0,999);return o?s?a?l?!1:ai("millisecond",i):ai("second",r):ai("minute",n):ai("hour",e)}function $e(t){return typeof t>"u"}function kl(t){return typeof t=="number"}function ry(t){return typeof t=="number"&&t%1===0}function d1e(t){return typeof t=="string"}function h1e(t){return Object.prototype.toString.call(t)==="[object Date]"}function fR(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function dR(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function p1e(t){return Array.isArray(t)?t:[t]}function IA(t,e,n){if(t.length!==0)return t.reduce((r,i)=>{const o=[e(i),i];return r&&n(r[0],o[0])===r[0]?r:o},null)[1]}function m1e(t,e){return e.reduce((n,r)=>(n[r]=t[r],n),{})}function Ac(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function vk(t){if(t==null)return null;if(typeof t!="object")throw new pr("Week settings must be an object");if(!li(t.firstDay,1,7)||!li(t.minimalDays,1,7)||!Array.isArray(t.weekend)||t.weekend.some(e=>!li(e,1,7)))throw new pr("Invalid week settings");return{firstDay:t.firstDay,minimalDays:t.minimalDays,weekend:Array.from(t.weekend)}}function li(t,e,n){return ry(t)&&t>=e&&t<=n}function g1e(t,e){return t-e*Math.floor(t/e)}function Jt(t,e=2){const n=t<0;let r;return n?r="-"+(""+-t).padStart(e,"0"):r=(""+t).padStart(e,"0"),r}function Is(t){if(!($e(t)||t===null||t===""))return parseInt(t,10)}function $a(t){if(!($e(t)||t===null||t===""))return parseFloat(t)}function zE(t){if(!($e(t)||t===null||t==="")){const e=parseFloat("0."+t)*1e3;return Math.floor(e)}}function jE(t,e,n=!1){const r=10**e;return(n?Math.trunc:Math.round)(t*r)/r}function Fh(t){return t%4===0&&(t%100!==0||t%400===0)}function Wu(t){return Fh(t)?366:365}function M1(t,e){const n=g1e(e-1,12)+1,r=t+(e-n)/12;return n===2?Fh(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function iy(t){let e=Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second,t.millisecond);return t.year<100&&t.year>=0&&(e=new Date(e),e.setUTCFullYear(t.year,t.month-1,t.day)),+e}function RA(t,e,n){return-PE(BE(t,1,e),n)+e-1}function lh(t,e=4,n=1){const r=RA(t,e,n),i=RA(t+1,e,n);return(Wu(t)-r+i)/7}function wk(t){return t>99?t:t>zt.twoDigitCutoffYear?1900+t:2e3+t}function hR(t,e,n,r=null){const i=new Date(t),o={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(o.timeZone=r);const s={timeZoneName:e,...o},a=new Intl.DateTimeFormat(n,s).formatToParts(i).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function oy(t,e){let n=parseInt(t,10);Number.isNaN(n)&&(n=0);const r=parseInt(e,10)||0,i=n<0||Object.is(n,-0)?-r:r;return n*60+i}function pR(t){const e=Number(t);if(typeof t=="boolean"||t===""||Number.isNaN(e))throw new pr(`Invalid unit value ${t}`);return e}function O1(t,e){const n={};for(const r in t)if(Ac(t,r)){const i=t[r];if(i==null)continue;n[e(r)]=pR(i)}return n}function pd(t,e){const n=Math.trunc(Math.abs(t/60)),r=Math.trunc(Math.abs(t%60)),i=t>=0?"+":"-";switch(e){case"short":return`${i}${Jt(n,2)}:${Jt(r,2)}`;case"narrow":return`${i}${n}${r>0?`:${r}`:""}`;case"techie":return`${i}${Jt(n,2)}${Jt(r,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function sy(t){return m1e(t,["hour","minute","second","millisecond"])}const y1e=["January","February","March","April","May","June","July","August","September","October","November","December"],mR=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],b1e=["J","F","M","A","M","J","J","A","S","O","N","D"];function gR(t){switch(t){case"narrow":return[...b1e];case"short":return[...mR];case"long":return[...y1e];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const yR=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],bR=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],v1e=["M","T","W","T","F","S","S"];function vR(t){switch(t){case"narrow":return[...v1e];case"short":return[...bR];case"long":return[...yR];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const wR=["AM","PM"],w1e=["Before Christ","Anno Domini"],k1e=["BC","AD"],x1e=["B","A"];function kR(t){switch(t){case"narrow":return[...x1e];case"short":return[...k1e];case"long":return[...w1e];default:return null}}function E1e(t){return wR[t.hour<12?0:1]}function S1e(t,e){return vR(e)[t.weekday-1]}function C1e(t,e){return gR(e)[t.month-1]}function _1e(t,e){return kR(e)[t.year<0?0:1]}function A1e(t,e,n="always",r=!1){const i={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},o=["hours","minutes","seconds"].indexOf(t)===-1;if(n==="auto"&&o){const f=t==="days";switch(e){case 1:return f?"tomorrow":`next ${i[t][0]}`;case-1:return f?"yesterday":`last ${i[t][0]}`;case 0:return f?"today":`this ${i[t][0]}`}}const s=Object.is(e,-0)||e<0,a=Math.abs(e),l=a===1,u=i[t],c=r?l?u[1]:u[2]||u[1]:l?i[t][0]:t;return s?`${a} ${c} ago`:`in ${a} ${c}`}function FA(t,e){let n="";for(const r of t)r.literal?n+=r.val:n+=e(r.val);return n}const T1e={D:A1,DD:z7,DDD:j7,DDDD:q7,t:U7,tt:V7,ttt:H7,tttt:W7,T:J7,TT:K7,TTT:G7,TTTT:Z7,f:Y7,ff:X7,fff:tR,ffff:rR,F:Q7,FF:eR,FFF:nR,FFFF:iR};class jn{static create(e,n={}){return new jn(e,n)}static parseFormat(e){let n=null,r="",i=!1;const o=[];for(let s=0;s0&&o.push({literal:i||/^\s+$/.test(r),val:r}),n=null,r="",i=!i):i||a===n?r+=a:(r.length>0&&o.push({literal:/^\s+$/.test(r),val:r}),r=a,n=a)}return r.length>0&&o.push({literal:i||/^\s+$/.test(r),val:r}),o}static macroTokenToFormatOpts(e){return T1e[e]}constructor(e,n){this.opts=n,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...n}).format()}dtFormatter(e,n={}){return this.loc.dtFormatter(e,{...this.opts,...n})}formatDateTime(e,n){return this.dtFormatter(e,n).format()}formatDateTimeParts(e,n){return this.dtFormatter(e,n).formatToParts()}formatInterval(e,n){return this.dtFormatter(e.start,n).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,n){return this.dtFormatter(e,n).resolvedOptions()}num(e,n=0){if(this.opts.forceSimple)return Jt(e,n);const r={...this.opts};return n>0&&(r.padTo=n),this.loc.numberFormatter(r).format(e)}formatDateTimeFromString(e,n){const r=this.loc.listingMode()==="en",i=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",o=(h,p)=>this.loc.extract(e,h,p),s=h=>e.isOffsetFixed&&e.offset===0&&h.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,h.format):"",a=()=>r?E1e(e):o({hour:"numeric",hourCycle:"h12"},"dayperiod"),l=(h,p)=>r?C1e(e,h):o(p?{month:h}:{month:h,day:"numeric"},"month"),u=(h,p)=>r?S1e(e,h):o(p?{weekday:h}:{weekday:h,month:"long",day:"numeric"},"weekday"),c=h=>{const p=jn.macroTokenToFormatOpts(h);return p?this.formatWithSystemDefault(e,p):h},f=h=>r?_1e(e,h):o({era:h},"era"),d=h=>{switch(h){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return s({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return s({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return s({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return a();case"d":return i?o({day:"numeric"},"day"):this.num(e.day);case"dd":return i?o({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return i?o({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return i?o({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return l("short",!0);case"LLLL":return l("long",!0);case"LLLLL":return l("narrow",!0);case"M":return i?o({month:"numeric"},"month"):this.num(e.month);case"MM":return i?o({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return l("short",!1);case"MMMM":return l("long",!1);case"MMMMM":return l("narrow",!1);case"y":return i?o({year:"numeric"},"year"):this.num(e.year);case"yy":return i?o({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return i?o({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return i?o({year:"numeric"},"year"):this.num(e.year,6);case"G":return f("short");case"GG":return f("long");case"GGGGG":return f("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return c(h)}};return FA(jn.parseFormat(n),d)}formatDurationFromString(e,n){const r=l=>{switch(l[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},i=l=>u=>{const c=r(u);return c?this.num(l.get(c),u.length):u},o=jn.parseFormat(n),s=o.reduce((l,{literal:u,val:c})=>u?l:l.concat(c),[]),a=e.shiftTo(...s.map(r).filter(l=>l));return FA(o,i(a))}}const xR=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Wc(...t){const e=t.reduce((n,r)=>n+r.source,"");return RegExp(`^${e}$`)}function Jc(...t){return e=>t.reduce(([n,r,i],o)=>{const[s,a,l]=o(e,i);return[{...n,...s},a||r,l]},[{},null,1]).slice(0,2)}function Kc(t,...e){if(t==null)return[null,null];for(const[n,r]of e){const i=n.exec(t);if(i)return r(i)}return[null,null]}function ER(...t){return(e,n)=>{const r={};let i;for(i=0;ih!==void 0&&(p||h&&c)?-h:h;return[{years:d($a(n)),months:d($a(r)),weeks:d($a(i)),days:d($a(o)),hours:d($a(s)),minutes:d($a(a)),seconds:d($a(l),l==="-0"),milliseconds:d(zE(u),f)}]}const j1e={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function VE(t,e,n,r,i,o,s){const a={year:e.length===2?wk(Is(e)):Is(e),month:mR.indexOf(n)+1,day:Is(r),hour:Is(i),minute:Is(o)};return s&&(a.second=Is(s)),t&&(a.weekday=t.length>3?yR.indexOf(t)+1:bR.indexOf(t)+1),a}const q1e=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function U1e(t){const[,e,n,r,i,o,s,a,l,u,c,f]=t,d=VE(e,i,r,n,o,s,a);let h;return l?h=j1e[l]:u?h=0:h=oy(c,f),[d,new ir(h)]}function V1e(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const H1e=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,W1e=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,J1e=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function LA(t){const[,e,n,r,i,o,s,a]=t;return[VE(e,i,r,n,o,s,a),ir.utcInstance]}function K1e(t){const[,e,n,r,i,o,s,a]=t;return[VE(e,a,n,r,i,o,s),ir.utcInstance]}const G1e=Wc(O1e,UE),Z1e=Wc(D1e,UE),Y1e=Wc(N1e,UE),Q1e=Wc(CR),AR=Jc(L1e,Gc,Lh,Bh),X1e=Jc($1e,Gc,Lh,Bh),ege=Jc(I1e,Gc,Lh,Bh),tge=Jc(Gc,Lh,Bh);function nge(t){return Kc(t,[G1e,AR],[Z1e,X1e],[Y1e,ege],[Q1e,tge])}function rge(t){return Kc(V1e(t),[q1e,U1e])}function ige(t){return Kc(t,[H1e,LA],[W1e,LA],[J1e,K1e])}function oge(t){return Kc(t,[P1e,z1e])}const sge=Jc(Gc);function age(t){return Kc(t,[B1e,sge])}const lge=Wc(R1e,F1e),uge=Wc(_R),cge=Jc(Gc,Lh,Bh);function fge(t){return Kc(t,[lge,AR],[uge,cge])}const BA="Invalid Duration",TR={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},dge={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...TR},ei=146097/400,tu=146097/4800,hge={years:{quarters:4,months:12,weeks:ei/7,days:ei,hours:ei*24,minutes:ei*24*60,seconds:ei*24*60*60,milliseconds:ei*24*60*60*1e3},quarters:{months:3,weeks:ei/28,days:ei/4,hours:ei*24/4,minutes:ei*24*60/4,seconds:ei*24*60*60/4,milliseconds:ei*24*60*60*1e3/4},months:{weeks:tu/7,days:tu,hours:tu*24,minutes:tu*24*60,seconds:tu*24*60*60,milliseconds:tu*24*60*60*1e3},...TR},sl=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],pge=sl.slice(0).reverse();function Cs(t,e,n=!1){const r={values:n?e.values:{...t.values,...e.values||{}},loc:t.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||t.conversionAccuracy,matrix:e.matrix||t.matrix};return new Je(r)}function MR(t,e){let n=e.milliseconds??0;for(const r of pge.slice(1))e[r]&&(n+=e[r]*t[r].milliseconds);return n}function PA(t,e){const n=MR(t,e)<0?-1:1;sl.reduceRight((r,i)=>{if($e(e[i]))return r;if(r){const o=e[r]*n,s=t[i][r],a=Math.floor(o/s);e[i]+=a*n,e[r]-=a*s*n}return i},null),sl.reduce((r,i)=>{if($e(e[i]))return r;if(r){const o=e[r]%1;e[r]-=o,e[i]+=o*t[r][i]}return i},null)}function mge(t){const e={};for(const[n,r]of Object.entries(t))r!==0&&(e[n]=r);return e}class Je{constructor(e){const n=e.conversionAccuracy==="longterm"||!1;let r=n?hge:dge;e.matrix&&(r=e.matrix),this.values=e.values,this.loc=e.loc||ct.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(e,n){return Je.fromObject({milliseconds:e},n)}static fromObject(e,n={}){if(e==null||typeof e!="object")throw new pr(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new Je({values:O1(e,Je.normalizeUnit),loc:ct.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(e){if(kl(e))return Je.fromMillis(e);if(Je.isDuration(e))return e;if(typeof e=="object")return Je.fromObject(e);throw new pr(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,n){const[r]=oge(e);return r?Je.fromObject(r,n):Je.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,n){const[r]=age(e);return r?Je.fromObject(r,n):Je.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,n=null){if(!e)throw new pr("need to specify a reason the Duration is invalid");const r=e instanceof Ti?e:new Ti(e,n);if(zt.throwOnInvalid)throw new qme(r);return new Je({invalid:r})}static normalizeUnit(e){const n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!n)throw new P7(e);return n}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,n={}){const r={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?jn.create(this.loc,r).formatDurationFromString(this,e):BA}toHuman(e={}){if(!this.isValid)return BA;const n=sl.map(r=>{const i=this.values[r];return $e(i)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:r.slice(0,-1)}).format(i)}).filter(r=>r);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=jE(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const n=this.toMillis();return n<0||n>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},Re.fromMillis(n,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?MR(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const n=Je.fromDurationLike(e),r={};for(const i of sl)(Ac(n.values,i)||Ac(this.values,i))&&(r[i]=n.get(i)+this.get(i));return Cs(this,{values:r},!0)}minus(e){if(!this.isValid)return this;const n=Je.fromDurationLike(e);return this.plus(n.negate())}mapUnits(e){if(!this.isValid)return this;const n={};for(const r of Object.keys(this.values))n[r]=pR(e(this.values[r],r));return Cs(this,{values:n},!0)}get(e){return this[Je.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const n={...this.values,...O1(e,Je.normalizeUnit)};return Cs(this,{values:n})}reconfigure({locale:e,numberingSystem:n,conversionAccuracy:r,matrix:i}={}){const s={loc:this.loc.clone({locale:e,numberingSystem:n}),matrix:i,conversionAccuracy:r};return Cs(this,s)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return PA(this.matrix,e),Cs(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=mge(this.normalize().shiftToAll().toObject());return Cs(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(s=>Je.normalizeUnit(s));const n={},r={},i=this.toObject();let o;for(const s of sl)if(e.indexOf(s)>=0){o=s;let a=0;for(const u in r)a+=this.matrix[u][s]*r[u],r[u]=0;kl(i[s])&&(a+=i[s]);const l=Math.trunc(a);n[s]=l,r[s]=(a*1e3-l*1e3)/1e3}else kl(i[s])&&(r[s]=i[s]);for(const s in r)r[s]!==0&&(n[o]+=s===o?r[s]:r[s]/this.matrix[o][s]);return PA(this.matrix,n),Cs(this,{values:n},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const n of Object.keys(this.values))e[n]=this.values[n]===0?0:-this.values[n];return Cs(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function n(r,i){return r===void 0||r===0?i===void 0||i===0:r===i}for(const r of sl)if(!n(this.values[r],e.values[r]))return!1;return!0}}const nu="Invalid Interval";function gge(t,e){return!t||!t.isValid?$t.invalid("missing or invalid start"):!e||!e.isValid?$t.invalid("missing or invalid end"):ee:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:n}={}){return this.isValid?$t.fromDateTimes(e||this.s,n||this.e):this}splitAt(...e){if(!this.isValid)return[];const n=e.map(pf).filter(s=>this.contains(s)).sort((s,a)=>s.toMillis()-a.toMillis()),r=[];let{s:i}=this,o=0;for(;i+this.e?this.e:s;r.push($t.fromDateTimes(i,a)),i=a,o+=1}return r}splitBy(e){const n=Je.fromDurationLike(e);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:r}=this,i=1,o;const s=[];for(;rl*i));o=+a>+this.e?this.e:a,s.push($t.fromDateTimes(r,o)),r=o,i+=1}return s}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const n=this.s>e.s?this.s:e.s,r=this.e=r?null:$t.fromDateTimes(n,r)}union(e){if(!this.isValid)return this;const n=this.se.e?this.e:e.e;return $t.fromDateTimes(n,r)}static merge(e){const[n,r]=e.sort((i,o)=>i.s-o.s).reduce(([i,o],s)=>o?o.overlaps(s)||o.abutsStart(s)?[i,o.union(s)]:[i.concat([o]),s]:[i,s],[[],null]);return r&&n.push(r),n}static xor(e){let n=null,r=0;const i=[],o=e.map(l=>[{time:l.s,type:"s"},{time:l.e,type:"e"}]),s=Array.prototype.concat(...o),a=s.sort((l,u)=>l.time-u.time);for(const l of a)r+=l.type==="s"?1:-1,r===1?n=l.time:(n&&+n!=+l.time&&i.push($t.fromDateTimes(n,l.time)),n=null);return $t.merge(i)}difference(...e){return $t.xor([this].concat(e)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:nu}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=A1,n={}){return this.isValid?jn.create(this.s.loc.clone(n),e).formatInterval(this):nu}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:nu}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:nu}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:nu}toFormat(e,{separator:n=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${n}${this.e.toFormat(e)}`:nu}toDuration(e,n){return this.isValid?this.e.diff(this.s,e,n):Je.invalid(this.invalidReason)}mapEndpoints(e){return $t.fromDateTimes(e(this.s),e(this.e))}}class Pp{static hasDST(e=zt.defaultZone){const n=Re.now().setZone(e).set({month:12});return!e.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(e){return es.isValidZone(e)}static normalizeZone(e){return js(e,zt.defaultZone)}static getStartOfWeek({locale:e=null,locObj:n=null}={}){return(n||ct.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:n=null}={}){return(n||ct.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:n=null}={}){return(n||ct.create(e)).getWeekendDays().slice()}static months(e="long",{locale:n=null,numberingSystem:r=null,locObj:i=null,outputCalendar:o="gregory"}={}){return(i||ct.create(n,r,o)).months(e)}static monthsFormat(e="long",{locale:n=null,numberingSystem:r=null,locObj:i=null,outputCalendar:o="gregory"}={}){return(i||ct.create(n,r,o)).months(e,!0)}static weekdays(e="long",{locale:n=null,numberingSystem:r=null,locObj:i=null}={}){return(i||ct.create(n,r,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:n=null,numberingSystem:r=null,locObj:i=null}={}){return(i||ct.create(n,r,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return ct.create(e).meridiems()}static eras(e="short",{locale:n=null}={}){return ct.create(n,null,"gregory").eras(e)}static features(){return{relative:fR(),localeWeek:dR()}}}function zA(t,e){const n=i=>i.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(e)-n(t);return Math.floor(Je.fromMillis(r).as("days"))}function yge(t,e,n){const r=[["years",(l,u)=>u.year-l.year],["quarters",(l,u)=>u.quarter-l.quarter+(u.year-l.year)*4],["months",(l,u)=>u.month-l.month+(u.year-l.year)*12],["weeks",(l,u)=>{const c=zA(l,u);return(c-c%7)/7}],["days",zA]],i={},o=t;let s,a;for(const[l,u]of r)n.indexOf(l)>=0&&(s=l,i[l]=u(t,e),a=o.plus(i),a>e?(i[l]--,t=o.plus(i),t>e&&(a=t,i[l]--,t=o.plus(i))):t=a);return[t,i,a,s]}function bge(t,e,n,r){let[i,o,s,a]=yge(t,e,n);const l=e-i,u=n.filter(f=>["hours","minutes","seconds","milliseconds"].indexOf(f)>=0);u.length===0&&(s0?Je.fromMillis(l,r).shiftTo(...u).plus(c):c}const HE={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},jA={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},vge=HE.hanidec.replace(/[\[|\]]/g,"").split("");function wge(t){let e=parseInt(t,10);if(isNaN(e)){e="";for(let n=0;n=o&&r<=s&&(e+=r-o)}}return parseInt(e,10)}else return e}function vi({numberingSystem:t},e=""){return new RegExp(`${HE[t||"latn"]}${e}`)}const kge="missing Intl.DateTimeFormat.formatToParts support";function et(t,e=n=>n){return{regex:t,deser:([n])=>e(wge(n))}}const xge=" ",OR=`[ ${xge}]`,DR=new RegExp(OR,"g");function Ege(t){return t.replace(/\./g,"\\.?").replace(DR,OR)}function qA(t){return t.replace(/\./g,"").replace(DR," ").toLowerCase()}function wi(t,e){return t===null?null:{regex:RegExp(t.map(Ege).join("|")),deser:([n])=>t.findIndex(r=>qA(n)===qA(r))+e}}function UA(t,e){return{regex:t,deser:([,n,r])=>oy(n,r),groups:e}}function zp(t){return{regex:t,deser:([e])=>e}}function Sge(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Cge(t,e){const n=vi(e),r=vi(e,"{2}"),i=vi(e,"{3}"),o=vi(e,"{4}"),s=vi(e,"{6}"),a=vi(e,"{1,2}"),l=vi(e,"{1,3}"),u=vi(e,"{1,6}"),c=vi(e,"{1,9}"),f=vi(e,"{2,4}"),d=vi(e,"{4,6}"),h=b=>({regex:RegExp(Sge(b.val)),deser:([y])=>y,literal:!0}),m=(b=>{if(t.literal)return h(b);switch(b.val){case"G":return wi(e.eras("short"),0);case"GG":return wi(e.eras("long"),0);case"y":return et(u);case"yy":return et(f,wk);case"yyyy":return et(o);case"yyyyy":return et(d);case"yyyyyy":return et(s);case"M":return et(a);case"MM":return et(r);case"MMM":return wi(e.months("short",!0),1);case"MMMM":return wi(e.months("long",!0),1);case"L":return et(a);case"LL":return et(r);case"LLL":return wi(e.months("short",!1),1);case"LLLL":return wi(e.months("long",!1),1);case"d":return et(a);case"dd":return et(r);case"o":return et(l);case"ooo":return et(i);case"HH":return et(r);case"H":return et(a);case"hh":return et(r);case"h":return et(a);case"mm":return et(r);case"m":return et(a);case"q":return et(a);case"qq":return et(r);case"s":return et(a);case"ss":return et(r);case"S":return et(l);case"SSS":return et(i);case"u":return zp(c);case"uu":return zp(a);case"uuu":return et(n);case"a":return wi(e.meridiems(),0);case"kkkk":return et(o);case"kk":return et(f,wk);case"W":return et(a);case"WW":return et(r);case"E":case"c":return et(n);case"EEE":return wi(e.weekdays("short",!1),1);case"EEEE":return wi(e.weekdays("long",!1),1);case"ccc":return wi(e.weekdays("short",!0),1);case"cccc":return wi(e.weekdays("long",!0),1);case"Z":case"ZZ":return UA(new RegExp(`([+-]${a.source})(?::(${r.source}))?`),2);case"ZZZ":return UA(new RegExp(`([+-]${a.source})(${r.source})?`),2);case"z":return zp(/[a-z_+-/]{1,256}?/i);case" ":return zp(/[^\S\n\r]/);default:return h(b)}})(t)||{invalidReason:kge};return m.token=t,m}const _ge={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function Age(t,e,n){const{type:r,value:i}=t;if(r==="literal"){const l=/^\s+$/.test(i);return{literal:!l,val:l?" ":i}}const o=e[r];let s=r;r==="hour"&&(e.hour12!=null?s=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?s="hour12":s="hour24":s=n.hour12?"hour12":"hour24");let a=_ge[s];if(typeof a=="object"&&(a=a[o]),a)return{literal:!1,val:a}}function Tge(t){return[`^${t.map(n=>n.regex).reduce((n,r)=>`${n}(${r.source})`,"")}$`,t]}function Mge(t,e,n){const r=t.match(e);if(r){const i={};let o=1;for(const s in n)if(Ac(n,s)){const a=n[s],l=a.groups?a.groups+1:1;!a.literal&&a.token&&(i[a.token.val[0]]=a.deser(r.slice(o,o+l))),o+=l}return[r,i]}else return[r,{}]}function Oge(t){const e=o=>{switch(o){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let n=null,r;return $e(t.z)||(n=es.create(t.z)),$e(t.Z)||(n||(n=new ir(t.Z)),r=t.Z),$e(t.q)||(t.M=(t.q-1)*3+1),$e(t.h)||(t.h<12&&t.a===1?t.h+=12:t.h===12&&t.a===0&&(t.h=0)),t.G===0&&t.y&&(t.y=-t.y),$e(t.u)||(t.S=zE(t.u)),[Object.keys(t).reduce((o,s)=>{const a=e(s);return a&&(o[a]=t[s]),o},{}),n,r]}let x2=null;function Dge(){return x2||(x2=Re.fromMillis(1555555555555)),x2}function Nge(t,e){if(t.literal)return t;const n=jn.macroTokenToFormatOpts(t.val),r=IR(n,e);return r==null||r.includes(void 0)?t:r}function NR(t,e){return Array.prototype.concat(...t.map(n=>Nge(n,e)))}function $R(t,e,n){const r=NR(jn.parseFormat(n),t),i=r.map(s=>Cge(s,t)),o=i.find(s=>s.invalidReason);if(o)return{input:e,tokens:r,invalidReason:o.invalidReason};{const[s,a]=Tge(i),l=RegExp(s,"i"),[u,c]=Mge(e,l,a),[f,d,h]=c?Oge(c):[null,null,void 0];if(Ac(c,"a")&&Ac(c,"H"))throw new Ou("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:r,regex:l,rawMatches:u,matches:c,result:f,zone:d,specificOffset:h}}}function $ge(t,e,n){const{result:r,zone:i,specificOffset:o,invalidReason:s}=$R(t,e,n);return[r,i,o,s]}function IR(t,e){if(!t)return null;const r=jn.create(e,t).dtFormatter(Dge()),i=r.formatToParts(),o=r.resolvedOptions();return i.map(s=>Age(s,t,o))}const E2="Invalid DateTime",VA=864e13;function jp(t){return new Ti("unsupported zone",`the zone "${t.name}" is not supported`)}function S2(t){return t.weekData===null&&(t.weekData=T1(t.c)),t.weekData}function C2(t){return t.localWeekData===null&&(t.localWeekData=T1(t.c,t.loc.getMinDaysInFirstWeek(),t.loc.getStartOfWeek())),t.localWeekData}function Ia(t,e){const n={ts:t.ts,zone:t.zone,c:t.c,o:t.o,loc:t.loc,invalid:t.invalid};return new Re({...n,...e,old:n})}function RR(t,e,n){let r=t-e*60*1e3;const i=n.offset(r);if(e===i)return[r,e];r-=(i-e)*60*1e3;const o=n.offset(r);return i===o?[r,i]:[t-Math.min(i,o)*60*1e3,Math.max(i,o)]}function qp(t,e){t+=e*60*1e3;const n=new Date(t);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function A0(t,e,n){return RR(iy(t),e,n)}function HA(t,e){const n=t.o,r=t.c.year+Math.trunc(e.years),i=t.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,o={...t.c,year:r,month:i,day:Math.min(t.c.day,M1(r,i))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},s=Je.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),a=iy(o);let[l,u]=RR(a,n,t.zone);return s!==0&&(l+=s,u=t.zone.offset(l)),{ts:l,o:u}}function hf(t,e,n,r,i,o){const{setZone:s,zone:a}=n;if(t&&Object.keys(t).length!==0||e){const l=e||a,u=Re.fromObject(t,{...n,zone:l,specificOffset:o});return s?u:u.setZone(a)}else return Re.invalid(new Ti("unparsable",`the input "${i}" can't be parsed as ${r}`))}function Up(t,e,n=!0){return t.isValid?jn.create(ct.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(t,e):null}function _2(t,e){const n=t.c.year>9999||t.c.year<0;let r="";return n&&t.c.year>=0&&(r+="+"),r+=Jt(t.c.year,n?6:4),e?(r+="-",r+=Jt(t.c.month),r+="-",r+=Jt(t.c.day)):(r+=Jt(t.c.month),r+=Jt(t.c.day)),r}function WA(t,e,n,r,i,o){let s=Jt(t.c.hour);return e?(s+=":",s+=Jt(t.c.minute),(t.c.millisecond!==0||t.c.second!==0||!n)&&(s+=":")):s+=Jt(t.c.minute),(t.c.millisecond!==0||t.c.second!==0||!n)&&(s+=Jt(t.c.second),(t.c.millisecond!==0||!r)&&(s+=".",s+=Jt(t.c.millisecond,3))),i&&(t.isOffsetFixed&&t.offset===0&&!o?s+="Z":t.o<0?(s+="-",s+=Jt(Math.trunc(-t.o/60)),s+=":",s+=Jt(Math.trunc(-t.o%60))):(s+="+",s+=Jt(Math.trunc(t.o/60)),s+=":",s+=Jt(Math.trunc(t.o%60)))),o&&(s+="["+t.zone.ianaName+"]"),s}const FR={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Ige={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Rge={ordinal:1,hour:0,minute:0,second:0,millisecond:0},LR=["year","month","day","hour","minute","second","millisecond"],Fge=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Lge=["year","ordinal","hour","minute","second","millisecond"];function Bge(t){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[t.toLowerCase()];if(!e)throw new P7(t);return e}function JA(t){switch(t.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return Bge(t)}}function KA(t,e){const n=js(e.zone,zt.defaultZone),r=ct.fromObject(e),i=zt.now();let o,s;if($e(t.year))o=i;else{for(const u of LR)$e(t[u])&&(t[u]=FR[u]);const a=uR(t)||cR(t);if(a)return Re.invalid(a);const l=n.offset(i);[o,s]=A0(t,l,n)}return new Re({ts:o,zone:n,loc:r,o:s})}function GA(t,e,n){const r=$e(n.round)?!0:n.round,i=(s,a)=>(s=jE(s,r||n.calendary?0:2,!0),e.loc.clone(n).relFormatter(n).format(s,a)),o=s=>n.calendary?e.hasSame(t,s)?0:e.startOf(s).diff(t.startOf(s),s).get(s):e.diff(t,s).get(s);if(n.unit)return i(o(n.unit),n.unit);for(const s of n.units){const a=o(s);if(Math.abs(a)>=1)return i(a,s)}return i(t>e?-0:0,n.units[n.units.length-1])}function ZA(t){let e={},n;return t.length>0&&typeof t[t.length-1]=="object"?(e=t[t.length-1],n=Array.from(t).slice(0,t.length-1)):n=Array.from(t),[e,n]}class Re{constructor(e){const n=e.zone||zt.defaultZone;let r=e.invalid||(Number.isNaN(e.ts)?new Ti("invalid input"):null)||(n.isValid?null:jp(n));this.ts=$e(e.ts)?zt.now():e.ts;let i=null,o=null;if(!r)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(n))[i,o]=[e.old.c,e.old.o];else{const a=n.offset(this.ts);i=qp(this.ts,a),r=Number.isNaN(i.year)?new Ti("invalid input"):null,i=r?null:i,o=r?null:a}this._zone=n,this.loc=e.loc||ct.create(),this.invalid=r,this.weekData=null,this.localWeekData=null,this.c=i,this.o=o,this.isLuxonDateTime=!0}static now(){return new Re({})}static local(){const[e,n]=ZA(arguments),[r,i,o,s,a,l,u]=n;return KA({year:r,month:i,day:o,hour:s,minute:a,second:l,millisecond:u},e)}static utc(){const[e,n]=ZA(arguments),[r,i,o,s,a,l,u]=n;return e.zone=ir.utcInstance,KA({year:r,month:i,day:o,hour:s,minute:a,second:l,millisecond:u},e)}static fromJSDate(e,n={}){const r=h1e(e)?e.valueOf():NaN;if(Number.isNaN(r))return Re.invalid("invalid input");const i=js(n.zone,zt.defaultZone);return i.isValid?new Re({ts:r,zone:i,loc:ct.fromObject(n)}):Re.invalid(jp(i))}static fromMillis(e,n={}){if(kl(e))return e<-VA||e>VA?Re.invalid("Timestamp out of range"):new Re({ts:e,zone:js(n.zone,zt.defaultZone),loc:ct.fromObject(n)});throw new pr(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,n={}){if(kl(e))return new Re({ts:e*1e3,zone:js(n.zone,zt.defaultZone),loc:ct.fromObject(n)});throw new pr("fromSeconds requires a numerical input")}static fromObject(e,n={}){e=e||{};const r=js(n.zone,zt.defaultZone);if(!r.isValid)return Re.invalid(jp(r));const i=ct.fromObject(n),o=O1(e,JA),{minDaysInFirstWeek:s,startOfWeek:a}=$A(o,i),l=zt.now(),u=$e(n.specificOffset)?r.offset(l):n.specificOffset,c=!$e(o.ordinal),f=!$e(o.year),d=!$e(o.month)||!$e(o.day),h=f||d,p=o.weekYear||o.weekNumber;if((h||c)&&p)throw new Ou("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(d&&c)throw new Ou("Can't mix ordinal dates with month/day");const m=p||o.weekday&&!h;let b,y,v=qp(l,u);m?(b=Fge,y=Ige,v=T1(v,s,a)):c?(b=Lge,y=Rge,v=k2(v)):(b=LR,y=FR);let w=!1;for(const N of b){const C=o[N];$e(C)?w?o[N]=y[N]:o[N]=v[N]:w=!0}const g=m?c1e(o,s,a):c?f1e(o):uR(o),x=g||cR(o);if(x)return Re.invalid(x);const k=m?DA(o,s,a):c?NA(o):o,[E,D]=A0(k,u,r),O=new Re({ts:E,zone:r,o:D,loc:i});return o.weekday&&h&&e.weekday!==O.weekday?Re.invalid("mismatched weekday",`you can't specify both a weekday of ${o.weekday} and a date of ${O.toISO()}`):O}static fromISO(e,n={}){const[r,i]=nge(e);return hf(r,i,n,"ISO 8601",e)}static fromRFC2822(e,n={}){const[r,i]=rge(e);return hf(r,i,n,"RFC 2822",e)}static fromHTTP(e,n={}){const[r,i]=ige(e);return hf(r,i,n,"HTTP",n)}static fromFormat(e,n,r={}){if($e(e)||$e(n))throw new pr("fromFormat requires an input string and a format");const{locale:i=null,numberingSystem:o=null}=r,s=ct.fromOpts({locale:i,numberingSystem:o,defaultToEN:!0}),[a,l,u,c]=$ge(s,e,n);return c?Re.invalid(c):hf(a,l,r,`format ${n}`,e,u)}static fromString(e,n,r={}){return Re.fromFormat(e,n,r)}static fromSQL(e,n={}){const[r,i]=fge(e);return hf(r,i,n,"SQL",e)}static invalid(e,n=null){if(!e)throw new pr("need to specify a reason the DateTime is invalid");const r=e instanceof Ti?e:new Ti(e,n);if(zt.throwOnInvalid)throw new zme(r);return new Re({invalid:r})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,n={}){const r=IR(e,ct.fromObject(n));return r?r.map(i=>i?i.val:null).join(""):null}static expandFormat(e,n={}){return NR(jn.parseFormat(e),ct.fromObject(n)).map(i=>i.val).join("")}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?S2(this).weekYear:NaN}get weekNumber(){return this.isValid?S2(this).weekNumber:NaN}get weekday(){return this.isValid?S2(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?C2(this).weekday:NaN}get localWeekNumber(){return this.isValid?C2(this).weekNumber:NaN}get localWeekYear(){return this.isValid?C2(this).weekYear:NaN}get ordinal(){return this.isValid?k2(this.c).ordinal:NaN}get monthShort(){return this.isValid?Pp.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Pp.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Pp.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Pp.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const e=864e5,n=6e4,r=iy(this.c),i=this.zone.offset(r-e),o=this.zone.offset(r+e),s=this.zone.offset(r-i*n),a=this.zone.offset(r-o*n);if(s===a)return[this];const l=r-s*n,u=r-a*n,c=qp(l,s),f=qp(u,a);return c.hour===f.hour&&c.minute===f.minute&&c.second===f.second&&c.millisecond===f.millisecond?[Ia(this,{ts:l}),Ia(this,{ts:u})]:[this]}get isInLeapYear(){return Fh(this.year)}get daysInMonth(){return M1(this.year,this.month)}get daysInYear(){return this.isValid?Wu(this.year):NaN}get weeksInWeekYear(){return this.isValid?lh(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?lh(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:n,numberingSystem:r,calendar:i}=jn.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:n,numberingSystem:r,outputCalendar:i}}toUTC(e=0,n={}){return this.setZone(ir.instance(e),n)}toLocal(){return this.setZone(zt.defaultZone)}setZone(e,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(e=js(e,zt.defaultZone),e.equals(this.zone))return this;if(e.isValid){let i=this.ts;if(n||r){const o=e.offset(this.ts),s=this.toObject();[i]=A0(s,o,e)}return Ia(this,{ts:i,zone:e})}else return Re.invalid(jp(e))}reconfigure({locale:e,numberingSystem:n,outputCalendar:r}={}){const i=this.loc.clone({locale:e,numberingSystem:n,outputCalendar:r});return Ia(this,{loc:i})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const n=O1(e,JA),{minDaysInFirstWeek:r,startOfWeek:i}=$A(n,this.loc),o=!$e(n.weekYear)||!$e(n.weekNumber)||!$e(n.weekday),s=!$e(n.ordinal),a=!$e(n.year),l=!$e(n.month)||!$e(n.day),u=a||l,c=n.weekYear||n.weekNumber;if((u||s)&&c)throw new Ou("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&s)throw new Ou("Can't mix ordinal dates with month/day");let f;o?f=DA({...T1(this.c,r,i),...n},r,i):$e(n.ordinal)?(f={...this.toObject(),...n},$e(n.day)&&(f.day=Math.min(M1(f.year,f.month),f.day))):f=NA({...k2(this.c),...n});const[d,h]=A0(f,this.o,this.zone);return Ia(this,{ts:d,o:h})}plus(e){if(!this.isValid)return this;const n=Je.fromDurationLike(e);return Ia(this,HA(this,n))}minus(e){if(!this.isValid)return this;const n=Je.fromDurationLike(e).negate();return Ia(this,HA(this,n))}startOf(e,{useLocaleWeeks:n=!1}={}){if(!this.isValid)return this;const r={},i=Je.normalizeUnit(e);switch(i){case"years":r.month=1;case"quarters":case"months":r.day=1;case"weeks":case"days":r.hour=0;case"hours":r.minute=0;case"minutes":r.second=0;case"seconds":r.millisecond=0;break}if(i==="weeks")if(n){const o=this.loc.getStartOfWeek(),{weekday:s}=this;sthis.valueOf(),a=s?this:e,l=s?e:this,u=bge(a,l,o,i);return s?u.negate():u}diffNow(e="milliseconds",n={}){return this.diff(Re.now(),e,n)}until(e){return this.isValid?$t.fromDateTimes(this,e):this}hasSame(e,n,r){if(!this.isValid)return!1;const i=e.valueOf(),o=this.setZone(e.zone,{keepLocalTime:!0});return o.startOf(n,r)<=i&&i<=o.endOf(n,r)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const n=e.base||Re.fromObject({},{zone:this.zone}),r=e.padding?thisn.valueOf(),Math.min)}static max(...e){if(!e.every(Re.isDateTime))throw new pr("max requires all arguments be DateTimes");return IA(e,n=>n.valueOf(),Math.max)}static fromFormatExplain(e,n,r={}){const{locale:i=null,numberingSystem:o=null}=r,s=ct.fromOpts({locale:i,numberingSystem:o,defaultToEN:!0});return $R(s,e,n)}static fromStringExplain(e,n,r={}){return Re.fromFormatExplain(e,n,r)}static get DATE_SHORT(){return A1}static get DATE_MED(){return z7}static get DATE_MED_WITH_WEEKDAY(){return Ume}static get DATE_FULL(){return j7}static get DATE_HUGE(){return q7}static get TIME_SIMPLE(){return U7}static get TIME_WITH_SECONDS(){return V7}static get TIME_WITH_SHORT_OFFSET(){return H7}static get TIME_WITH_LONG_OFFSET(){return W7}static get TIME_24_SIMPLE(){return J7}static get TIME_24_WITH_SECONDS(){return K7}static get TIME_24_WITH_SHORT_OFFSET(){return G7}static get TIME_24_WITH_LONG_OFFSET(){return Z7}static get DATETIME_SHORT(){return Y7}static get DATETIME_SHORT_WITH_SECONDS(){return Q7}static get DATETIME_MED(){return X7}static get DATETIME_MED_WITH_SECONDS(){return eR}static get DATETIME_MED_WITH_WEEKDAY(){return Vme}static get DATETIME_FULL(){return tR}static get DATETIME_FULL_WITH_SECONDS(){return nR}static get DATETIME_HUGE(){return rR}static get DATETIME_HUGE_WITH_SECONDS(){return iR}}function pf(t){if(Re.isDateTime(t))return t;if(t&&t.valueOf&&kl(t.valueOf()))return Re.fromJSDate(t);if(t&&typeof t=="object")return Re.fromObject(t);throw new pr(`Unknown datetime argument: ${t}, of type ${typeof t}`)}function Pge(t){const{text:e,marks:n=[]}=t.node;return _.jsx(_.Fragment,{children:n.reduce((r,i)=>{switch(i.type){case"bold":return _.jsx("b",{children:r});case"italic":return _.jsx("i",{children:r});case"strike":return _.jsx("s",{children:r});case"code":return _.jsx("span",{className:"px-2 rounded-lg text-nowrap bg-gray-200",children:r});case"tag":return _.jsx("a",{href:"#",children:r});case"link":return _.jsx("a",{href:i.attrs.href,children:r});default:return r}},_.jsx("span",{children:e}))})}function BR(t){var e;return _.jsx(_.Fragment,{children:(e=t.node.content)==null?void 0:e.map((n,r)=>_.jsxs(tt.Fragment,{children:[n.type==="nprofile"&&_.jsx(B7,{...n.attrs}),n.type==="text"&&_.jsx(Pge,{node:n}),n.type==="hardBreak"&&_.jsx("div",{className:"mt-4"})]},n.type+r))})}function WE(t){return _.jsx("div",{className:"mt-2 ml-2",children:_.jsx(BR,{node:t.node})})}function zge(t){var e;return _.jsx("div",{className:"ml-2 my-4 px-2 py-1 border-l-4 border-gray-200 italic text-gray-600",children:(e=t.node.content)==null?void 0:e.map((n,r)=>_.jsx(tt.Fragment,{children:n.type==="paragraph"&&_.jsx(WE,{node:n})},n.type+r))})}function PR(t){const e=ee.useRef(null),[n,r]=ee.useState(!1),i=ee.useCallback(()=>{var o;e.current&&navigator.clipboard.writeText((o=e.current)==null?void 0:o.innerText).then(()=>{r(!0),setTimeout(()=>{r(!1)},2e3)})},[]);return _.jsxs("div",{className:"mx-2 pr-6 rounded-lg bg-gray-200 relative",children:[_.jsx("pre",{className:"my-1 py-2 px-2 overflow-scroll",ref:e,children:t.node.content.map((o,s)=>_.jsx(tt.Fragment,{children:o.type==="text"&&o.text},o.type+s))}),_.jsx("div",{className:"absolute top-0 right-0",children:_.jsx("button",{className:"p-4",onClick:i,children:n?_.jsx(G1,{size:20,strokeWidth:"1.5"}):_.jsx(kT,{size:20,strokeWidth:"1.5"})})})]})}const jge={1:"text-3xl",2:"text-2xl",3:"text-xl",4:"text-lg",5:"text-lg",6:"text-lg"};function qge(t){return _.jsx("div",{className:`mt-8 ml-2 ${jge[t.node.attrs.level]||""}`,children:_.jsx(BR,{node:t.node})})}function YA(t){const{type:e,node:n}=t,r=e;return _.jsx(r,{className:"ml-10",children:n.content.map((i,o)=>_.jsx("li",{children:i.content.map((s,a)=>_.jsxs(tt.Fragment,{children:[s.type==="paragraph"&&_.jsx(WE,{node:s}),s.type==="codeBlock"&&_.jsx(PR,{node:s})]},s.type+a))},i.type+o))})}const Uge="_verified_lvyh0_1",JE={verified:Uge},Vge=()=>_.jsx("svg",{viewBox:"0 0 24 24","aria-label":"Verified account",role:"img",className:JE.verified,children:_.jsx("g",{children:_.jsx("path",{d:"M22.25 12c0-1.43-.88-2.67-2.19-3.34.46-1.39.2-2.9-.81-3.91s-2.52-1.27-3.91-.81c-.66-1.31-1.91-2.19-3.34-2.19s-2.67.88-3.33 2.19c-1.4-.46-2.91-.2-3.92.81s-1.26 2.52-.8 3.91c-1.31.67-2.2 1.91-2.2 3.34s.89 2.67 2.2 3.34c-.46 1.39-.21 2.9.8 3.91s2.52 1.26 3.91.81c.67 1.31 1.91 2.19 3.34 2.19s2.68-.88 3.34-2.19c1.39.45 2.9.2 3.91-.81s1.27-2.52.81-3.91c1.31-.67 2.19-1.91 2.19-3.34zm-11.71 4.2L6.8 12.46l1.41-1.42 2.26 2.26 4.8-5.23 1.47 1.36-6.2 6.77z"})})}),Hge=()=>_.jsx("svg",{viewBox:"0 0 22 22","aria-label":"Verified account",role:"img",className:JE.verified,children:_.jsxs("g",{children:[_.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"0-a",x1:"4.411",x2:"18.083",y1:"2.495",y2:"21.508",children:[_.jsx("stop",{offset:"0",stopColor:"#f4e72a"}),_.jsx("stop",{offset:".539",stopColor:"#cd8105"}),_.jsx("stop",{offset:".68",stopColor:"#cb7b00"}),_.jsx("stop",{offset:"1",stopColor:"#f4ec26"}),_.jsx("stop",{offset:"1",stopColor:"#f4e72a"})]}),_.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"0-b",x1:"5.355",x2:"16.361",y1:"3.395",y2:"19.133",children:[_.jsx("stop",{offset:"0",stopColor:"#f9e87f"}),_.jsx("stop",{offset:".406",stopColor:"#e2b719"}),_.jsx("stop",{offset:".989",stopColor:"#e2b719"})]}),_.jsxs("g",{clipRule:"evenodd",fillRule:"evenodd",children:[_.jsx("path",{d:"M13.324 3.848L11 1.6 8.676 3.848l-3.201-.453-.559 3.184L2.06 8.095 3.48 11l-1.42 2.904 2.856 1.516.559 3.184 3.201-.452L11 20.4l2.324-2.248 3.201.452.559-3.184 2.856-1.516L18.52 11l1.42-2.905-2.856-1.516-.559-3.184zm-7.09 7.575l3.428 3.428 5.683-6.206-1.347-1.247-4.4 4.795-2.072-2.072z",fill:"url(#0-a)"}),_.jsx("path",{d:"M13.101 4.533L11 2.5 8.899 4.533l-2.895-.41-.505 2.88-2.583 1.37L4.2 11l-1.284 2.627 2.583 1.37.505 2.88 2.895-.41L11 19.5l2.101-2.033 2.895.41.505-2.88 2.583-1.37L17.8 11l1.284-2.627-2.583-1.37-.505-2.88zm-6.868 6.89l3.429 3.428 5.683-6.206-1.347-1.247-4.4 4.795-2.072-2.072z",fill:"url(#0-b)"}),_.jsx("path",{d:"M6.233 11.423l3.429 3.428 5.65-6.17.038-.033-.005 1.398-5.683 6.206-3.429-3.429-.003-1.405.005.003z",fill:"#d18800"})]})]})}),Wge=()=>_.jsx("svg",{viewBox:"0 0 22 22","aria-label":"Verified account",role:"img",className:JE.verified,children:_.jsx("g",{children:_.jsx("path",{clipRule:"evenodd",d:"M12.05 2.056c-.568-.608-1.532-.608-2.1 0l-1.393 1.49c-.284.303-.685.47-1.1.455L5.42 3.932c-.832-.028-1.514.654-1.486 1.486l.069 2.039c.014.415-.152.816-.456 1.1l-1.49 1.392c-.608.568-.608 1.533 0 2.101l1.49 1.393c.304.284.47.684.456 1.1l-.07 2.038c-.027.832.655 1.514 1.487 1.486l2.038-.069c.415-.014.816.152 1.1.455l1.392 1.49c.569.609 1.533.609 2.102 0l1.393-1.49c.283-.303.684-.47 1.099-.455l2.038.069c.832.028 1.515-.654 1.486-1.486L18 14.542c-.015-.415.152-.815.455-1.099l1.49-1.393c.608-.568.608-1.533 0-2.101l-1.49-1.393c-.303-.283-.47-.684-.455-1.1l.068-2.038c.029-.832-.654-1.514-1.486-1.486l-2.038.07c-.415.013-.816-.153-1.1-.456zm-5.817 9.367l3.429 3.428 5.683-6.206-1.347-1.247-4.4 4.795-2.072-2.072z",fillRule:"evenodd"})})});function zR(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e_.jsx("div",{className:ua("react-tweet-theme",QA.root,t),children:_.jsx("article",{className:QA.article,children:e})}),jR=t=>_.jsx("img",{...t}),Gge="_header_nqq4j_1",Zge="_avatar_nqq4j_11",Yge="_avatarOverflow_nqq4j_16",Qge="_avatarSquare_nqq4j_23",Xge="_avatarShadow_nqq4j_26",eye="_author_nqq4j_37",tye="_authorLink_nqq4j_44",nye="_authorVerified_nqq4j_53",rye="_authorLinkText_nqq4j_56",iye="_authorMeta_nqq4j_63",oye="_authorFollow_nqq4j_66",sye="_username_nqq4j_69",aye="_follow_nqq4j_74",lye="_separator_nqq4j_82",uye="_brand_nqq4j_86",cye="_twitterIcon_nqq4j_90",kn={header:Gge,avatar:Zge,avatarOverflow:Yge,avatarSquare:Qge,avatarShadow:Xge,author:eye,authorLink:tye,authorVerified:nye,authorLinkText:rye,authorMeta:iye,authorFollow:oye,username:sye,follow:aye,separator:lye,brand:uye,twitterIcon:cye},fye="_verifiedOld_lcna5_1",dye="_verifiedBlue_lcna5_4",hye="_verifiedGovernment_lcna5_7",A2={verifiedOld:fye,verifiedBlue:dye,verifiedGovernment:hye},qR=({user:t,className:e})=>{const n=t.verified||t.is_blue_verified||t.verified_type;let r=_.jsx(Vge,{}),i=A2.verifiedBlue;if(n)switch(t.is_blue_verified||(i=A2.verifiedOld),t.verified_type){case"Government":r=_.jsx(Wge,{}),i=A2.verifiedGovernment;break;case"Business":r=_.jsx(Hge,{}),i=null;break}return n?_.jsx("div",{className:ua(e,i),children:r}):null},pye=({tweet:t,components:e})=>{var n;const r=(n=e==null?void 0:e.AvatarImg)!=null?n:jR,{user:i}=t;return _.jsxs("div",{className:kn.header,children:[_.jsxs("a",{href:t.url,className:kn.avatar,target:"_blank",rel:"noopener noreferrer",children:[_.jsx("div",{className:ua(kn.avatarOverflow,i.profile_image_shape==="Square"&&kn.avatarSquare),children:_.jsx(r,{src:i.profile_image_url_https,alt:i.name,width:48,height:48})}),_.jsx("div",{className:kn.avatarOverflow,children:_.jsx("div",{className:kn.avatarShadow})})]}),_.jsxs("div",{className:kn.author,children:[_.jsxs("a",{href:t.url,className:kn.authorLink,target:"_blank",rel:"noopener noreferrer",children:[_.jsx("div",{className:kn.authorLinkText,children:_.jsx("span",{title:i.name,children:i.name})}),_.jsx(qR,{user:i,className:kn.authorVerified})]}),_.jsxs("div",{className:kn.authorMeta,children:[_.jsx("a",{href:t.url,className:kn.username,target:"_blank",rel:"noopener noreferrer",children:_.jsxs("span",{title:`@${i.screen_name}`,children:["@",i.screen_name]})}),_.jsxs("div",{className:kn.authorFollow,children:[_.jsx("span",{className:kn.separator,children:"·"}),_.jsx("a",{href:i.follow_url,className:kn.follow,target:"_blank",rel:"noopener noreferrer",children:"Follow"})]})]})]}),_.jsx("a",{href:t.url,className:kn.brand,target:"_blank",rel:"noopener noreferrer","aria-label":"View on Twitter",children:_.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:kn.twitterIcon,children:_.jsx("g",{children:_.jsx("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})})})})]})},mye="_root_1ec15_1",gye={root:mye},yye=({tweet:t})=>_.jsxs("a",{href:t.in_reply_to_url,className:gye.root,target:"_blank",rel:"noopener noreferrer",children:["Replying to @",t.in_reply_to_screen_name]}),bye="_root_eihfa_1",vye={root:bye},wye=({href:t,children:e})=>_.jsx("a",{href:t,className:vye.root,target:"_blank",rel:"noopener noreferrer nofollow",children:e}),kye="_root_1xq52_1",xye={root:kye},Eye=({tweet:t})=>_.jsx("p",{className:xye.root,children:t.entities.map((e,n)=>{switch(e.type){case"hashtag":case"mention":case"url":case"symbol":return _.jsx(wye,{href:e.href,children:e.text},n);case"media":return;default:return _.jsx("span",{dangerouslySetInnerHTML:{__html:e.text}},n)}})}),XA=t=>`https://twitter.com/${t.user.screen_name}/status/${t.id_str}`,UR=t=>`https://twitter.com/${typeof t=="string"?t:t.user.screen_name}`,Sye=t=>`https://twitter.com/intent/like?tweet_id=${t.id_str}`,Cye=t=>`https://twitter.com/intent/tweet?in_reply_to=${t.id_str}`,_ye=t=>`https://twitter.com/intent/follow?screen_name=${t.user.screen_name}`,Aye=t=>`https://twitter.com/hashtag/${t.text}`,Tye=t=>`https://twitter.com/search?q=%24${t.text}`,Mye=t=>`https://twitter.com/${t.in_reply_to_screen_name}/status/${t.in_reply_to_status_id_str}`,VR=(t,e)=>{const n=new URL(t.media_url_https),r=n.pathname.split(".").pop();return r?(n.pathname=n.pathname.replace(`.${r}`,""),n.searchParams.set("format",r),n.searchParams.set("name",e),n.toString()):t.media_url_https},Oye=t=>{const{variants:e}=t.video_info;return e.filter(r=>r.content_type==="video/mp4").sort((r,i)=>{var o,s;return((o=i.bitrate)!=null?o:0)-((s=r.bitrate)!=null?s:0)})},Dye=t=>{const e=Oye(t);return e.length>1?e[1]:e[0]},kk=t=>t>999999?`${(t/1e6).toFixed(1)}M`:t>999?`${(t/1e3).toFixed(1)}K`:t.toString();function e5(t){const e=Array.from(t.text),n=[{indices:t.display_text_range,type:"text"}];return mf(n,"hashtag",t.entities.hashtags),mf(n,"mention",t.entities.user_mentions),mf(n,"url",t.entities.urls),mf(n,"symbol",t.entities.symbols),t.entities.media&&mf(n,"media",t.entities.media),Nye(t,n),n.map(r=>{const i=e.slice(r.indices[0],r.indices[1]).join("");switch(r.type){case"hashtag":return Object.assign(r,{href:Aye(r),text:i});case"mention":return Object.assign(r,{href:UR(r.screen_name),text:i});case"url":case"media":return Object.assign(r,{href:r.expanded_url,text:r.display_url});case"symbol":return Object.assign(r,{href:Tye(r),text:i});default:return Object.assign(r,{text:i})}})}function mf(t,e,n){for(const r of n)for(const[i,o]of t.entries()){if(o.indices[0]>r.indices[0]||o.indices[1]r.indices[1]&&s.push({indices:[r.indices[1],o.indices[1]],type:"text"}),t.splice(i,1,...s);break}}function Nye(t,e){t.entities.media&&t.entities.media[0].indices[0]t.display_text_range[1]&&(n.indices[1]=t.display_text_range[1])}const $ye=t=>({...t,url:XA(t),user:{...t.user,url:UR(t),follow_url:_ye(t)},like_url:Sye(t),reply_url:Cye(t),in_reply_to_url:t.in_reply_to_screen_name?Mye(t):void 0,entities:e5(t),quoted_tweet:t.quoted_tweet?{...t.quoted_tweet,url:XA(t.quoted_tweet),entities:e5(t.quoted_tweet)}:void 0}),Iye="_root_g9tkv_1",Rye="_rounded_g9tkv_6",Fye="_mediaWrapper_g9tkv_10",Lye="_grid2Columns_g9tkv_17",Bye="_grid3_g9tkv_20",Pye="_grid2x2_g9tkv_23",zye="_mediaContainer_g9tkv_26",jye="_mediaLink_g9tkv_34",qye="_skeleton_g9tkv_38",Uye="_image_g9tkv_43",$r={root:Iye,rounded:Rye,mediaWrapper:Fye,grid2Columns:Lye,grid3:Bye,grid2x2:Pye,mediaContainer:zye,mediaLink:jye,skeleton:qye,image:Uye},Vye="_anchor_fp31d_1",Hye="_videoButton_fp31d_17",Wye="_videoButtonIcon_fp31d_35",Jye="_watchOnTwitter_fp31d_44",Kye="_viewReplies_fp31d_60",ru={anchor:Vye,videoButton:Hye,videoButtonIcon:Wye,watchOnTwitter:Jye,viewReplies:Kye},Gye=({tweet:t,media:e})=>{const[n,r]=ee.useState(!0),[i,o]=ee.useState(!1),[s,a]=ee.useState(!1),l=Dye(e);let u=0;return _.jsxs(_.Fragment,{children:[_.jsx("video",{className:$r.image,poster:VR(e,"small"),controls:!n,muted:!0,preload:"none",tabIndex:n?-1:0,onPlay:()=>{u&&window.clearTimeout(u),i||o(!0),s&&a(!1)},onPause:()=>{u&&window.clearTimeout(u),u=window.setTimeout(()=>{i&&o(!1),u=0},100)},onEnded:()=>{a(!0)},children:_.jsx("source",{src:l.url,type:l.content_type})}),n&&_.jsx("button",{type:"button",className:ru.videoButton,"aria-label":"View video on X",onClick:c=>{const f=c.currentTarget.previousSibling;c.preventDefault(),r(!1),o(!0),f.play(),f.focus()},children:_.jsx("svg",{viewBox:"0 0 24 24",className:ru.videoButtonIcon,"aria-hidden":"true",children:_.jsx("g",{children:_.jsx("path",{d:"M21 12L4 2v20l17-10z"})})})}),!i&&!s&&_.jsx("div",{className:ru.watchOnTwitter,children:_.jsx("a",{href:t.url,className:ru.anchor,target:"_blank",rel:"noopener noreferrer",children:n?"Watch on X":"Continue watching on X"})}),s&&_.jsx("a",{href:t.url,className:ua(ru.anchor,ru.viewReplies),target:"_blank",rel:"noopener noreferrer",children:"View replies"})]})},Zye=t=>_.jsx("img",{...t}),t5=(t,e)=>{let n=56.25;return e===1&&(n=100/t.original_info.width*t.original_info.height),e===2&&(n=n*2),{width:t.type==="photo"?void 0:"unset",paddingBottom:`${n}%`}},HR=({tweet:t,components:e,quoted:n})=>{var r,i,o;const s=(o=(r=t.mediaDetails)==null?void 0:r.length)!=null?o:0;var a;const l=(a=e==null?void 0:e.MediaImg)!=null?a:Zye;return _.jsx("div",{className:ua($r.root,!n&&$r.rounded),children:_.jsx("div",{className:ua($r.mediaWrapper,s>1&&$r.grid2Columns,s===3&&$r.grid3,s>4&&$r.grid2x2),children:(i=t.mediaDetails)==null?void 0:i.map(u=>_.jsx(ee.Fragment,{children:u.type==="photo"?_.jsxs("a",{href:t.url,className:ua($r.mediaContainer,$r.mediaLink),target:"_blank",rel:"noopener noreferrer",children:[_.jsx("div",{className:$r.skeleton,style:t5(u,s)}),_.jsx(l,{src:VR(u,"small"),alt:u.ext_alt_text||"Image",className:$r.image,draggable:!0})]},u.media_url_https):_.jsxs("div",{className:$r.mediaContainer,children:[_.jsx("div",{className:$r.skeleton,style:t5(u,s)}),_.jsx(Gye,{tweet:t,media:u})]},u.media_url_https)},u.media_url_https))})})},Yye={hour:"numeric",minute:"2-digit",hour12:!0,weekday:"short",month:"short",day:"numeric",year:"numeric"},Qye=new Intl.DateTimeFormat("en-US",Yye),Xye=t=>{const e={};for(const n of t)e[n.type]=n.value;return e},ebe=t=>{const e=Xye(Qye.formatToParts(t)),n=`${e.hour}:${e.minute} ${e.dayPeriod}`,r=`${e.month} ${e.day}, ${e.year}`;return`${n} · ${r}`},tbe="_root_i24yn_1",nbe={root:tbe},rbe=({tweet:t})=>{const e=new Date(t.created_at),n=ebe(e);return _.jsx("a",{className:nbe.root,href:t.url,target:"_blank",rel:"noopener noreferrer","aria-label":n,children:_.jsx("time",{dateTime:e.toISOString(),children:n})})},ibe="_info_19qcj_1",obe="_infoLink_19qcj_10",sbe="_infoIcon_19qcj_30",T2={info:ibe,infoLink:obe,infoIcon:sbe},abe=({tweet:t})=>_.jsxs("div",{className:T2.info,children:[_.jsx(rbe,{tweet:t}),_.jsx("a",{className:T2.infoLink,href:"https://help.twitter.com/en/twitter-for-websites-ads-info-and-privacy",target:"_blank",rel:"noopener noreferrer","aria-label":"Twitter for Websites, Ads Information and Privacy",children:_.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:T2.infoIcon,children:_.jsx("g",{children:_.jsx("path",{d:"M13.5 8.5c0 .83-.67 1.5-1.5 1.5s-1.5-.67-1.5-1.5S11.17 7 12 7s1.5.67 1.5 1.5zM13 17v-5h-2v5h2zm-1 5.25c5.66 0 10.25-4.59 10.25-10.25S17.66 1.75 12 1.75 1.75 6.34 1.75 12 6.34 22.25 12 22.25zM20.25 12c0 4.56-3.69 8.25-8.25 8.25S3.75 16.56 3.75 12 7.44 3.75 12 3.75s8.25 3.69 8.25 8.25z"})})})})]}),lbe="_actions_n2anf_1",ube="_like_n2anf_13",cbe="_reply_n2anf_14",fbe="_copy_n2anf_15",dbe="_likeIconWrapper_n2anf_27",hbe="_likeCount_n2anf_30",pbe="_replyIconWrapper_n2anf_35",mbe="_copyIconWrapper_n2anf_36",gbe="_likeIcon_n2anf_27",ybe="_replyIcon_n2anf_35",bbe="_copyIcon_n2anf_36",vbe="_replyText_n2anf_56",wbe="_copyText_n2anf_57",fr={actions:lbe,like:ube,reply:cbe,copy:fbe,likeIconWrapper:dbe,likeCount:hbe,replyIconWrapper:pbe,copyIconWrapper:mbe,likeIcon:gbe,replyIcon:ybe,copyIcon:bbe,replyText:vbe,copyText:wbe},kbe=({tweet:t})=>{const[e,n]=ee.useState(!1),[r,i]=ee.useState(!1),o=()=>{navigator.clipboard.writeText(t.url),n(!0)};return ee.useEffect(()=>{if(e){const s=setTimeout(()=>{n(!1),i(!0)},6e3);return()=>clearTimeout(s)}},[e]),_.jsxs("button",{type:"button",className:fr.copy,"aria-label":"Copy link",onClick:o,children:[_.jsx("div",{className:fr.copyIconWrapper,children:e?_.jsx("svg",{viewBox:"0 0 24 24",className:fr.copyIcon,"aria-hidden":"true",children:_.jsx("g",{children:_.jsx("path",{d:"M9.64 18.952l-5.55-4.861 1.317-1.504 3.951 3.459 8.459-10.948L19.4 6.32 9.64 18.952z"})})}):_.jsx("svg",{viewBox:"0 0 24 24",className:fr.copyIcon,"aria-hidden":"true",children:_.jsx("g",{children:_.jsx("path",{d:"M18.36 5.64c-1.95-1.96-5.11-1.96-7.07 0L9.88 7.05 8.46 5.64l1.42-1.42c2.73-2.73 7.16-2.73 9.9 0 2.73 2.74 2.73 7.17 0 9.9l-1.42 1.42-1.41-1.42 1.41-1.41c1.96-1.96 1.96-5.12 0-7.07zm-2.12 3.53l-7.07 7.07-1.41-1.41 7.07-7.07 1.41 1.41zm-12.02.71l1.42-1.42 1.41 1.42-1.41 1.41c-1.96 1.96-1.96 5.12 0 7.07 1.95 1.96 5.11 1.96 7.07 0l1.41-1.41 1.42 1.41-1.42 1.42c-2.73 2.73-7.16 2.73-9.9 0-2.73-2.74-2.73-7.17 0-9.9z"})})})}),_.jsx("span",{className:fr.copyText,children:e?"Copied!":r?"Copy link to Tweet":"Copy link"})]})},xbe=({tweet:t})=>{const e=kk(t.favorite_count);return _.jsxs("div",{className:fr.actions,children:[_.jsxs("a",{className:fr.like,href:t.like_url,target:"_blank",rel:"noopener noreferrer","aria-label":`Like. This Tweet has ${e} likes`,children:[_.jsx("div",{className:fr.likeIconWrapper,children:_.jsx("svg",{viewBox:"0 0 24 24",className:fr.likeIcon,"aria-hidden":"true",children:_.jsx("g",{children:_.jsx("path",{d:"M20.884 13.19c-1.351 2.48-4.001 5.12-8.379 7.67l-.503.3-.504-.3c-4.379-2.55-7.029-5.19-8.382-7.67-1.36-2.5-1.41-4.86-.514-6.67.887-1.79 2.647-2.91 4.601-3.01 1.651-.09 3.368.56 4.798 2.01 1.429-1.45 3.146-2.1 4.796-2.01 1.954.1 3.714 1.22 4.601 3.01.896 1.81.846 4.17-.514 6.67z"})})})}),_.jsx("span",{className:fr.likeCount,children:e})]}),_.jsxs("a",{className:fr.reply,href:t.reply_url,target:"_blank",rel:"noopener noreferrer","aria-label":"Reply to this Tweet on Twitter",children:[_.jsx("div",{className:fr.replyIconWrapper,children:_.jsx("svg",{viewBox:"0 0 24 24",className:fr.replyIcon,"aria-hidden":"true",children:_.jsx("g",{children:_.jsx("path",{d:"M1.751 10c0-4.42 3.584-8 8.005-8h4.366c4.49 0 8.129 3.64 8.129 8.13 0 2.96-1.607 5.68-4.196 7.11l-8.054 4.46v-3.69h-.067c-4.49.1-8.183-3.51-8.183-8.01z"})})})}),_.jsx("span",{className:fr.replyText,children:"Reply"})]}),_.jsx(kbe,{tweet:t})]})},Ebe="_replies_1cutb_1",Sbe="_link_1cutb_4",Cbe="_text_1cutb_23",M2={replies:Ebe,link:Sbe,text:Cbe},_be=({tweet:t})=>_.jsx("div",{className:M2.replies,children:_.jsx("a",{className:M2.link,href:t.url,target:"_blank",rel:"noopener noreferrer",children:_.jsx("span",{className:M2.text,children:t.conversation_count===0?"Read more on X":t.conversation_count===1?`Read ${kk(t.conversation_count)} reply`:`Read ${kk(t.conversation_count)} replies`})})}),Abe="_root_q5799_1",Tbe="_article_q5799_16",n5={root:Abe,article:Tbe},Mbe=({tweet:t,children:e})=>_.jsx("div",{className:n5.root,onClick:n=>{n.preventDefault(),window.open(t.url,"_blank")},children:_.jsx("article",{className:n5.article,children:e})}),Obe="_header_r31i5_1",Dbe="_avatar_r31i5_11",Nbe="_avatarSquare_r31i5_17",$be="_author_r31i5_21",Ibe="_authorText_r31i5_26",Rbe="_username_r31i5_33",Ra={header:Obe,avatar:Dbe,avatarSquare:Nbe,author:$be,authorText:Ibe,username:Rbe},Fbe=({tweet:t})=>{const{user:e}=t;return _.jsxs("div",{className:Ra.header,children:[_.jsx("a",{href:t.url,className:Ra.avatar,target:"_blank",rel:"noopener noreferrer",children:_.jsx("div",{className:ua(Ra.avatarOverflow,e.profile_image_shape==="Square"&&Ra.avatarSquare),children:_.jsx(jR,{src:e.profile_image_url_https,alt:e.name,width:20,height:20})})}),_.jsxs("div",{className:Ra.author,children:[_.jsx("div",{className:Ra.authorText,children:_.jsx("span",{title:e.name,children:e.name})}),_.jsx(qR,{user:e}),_.jsx("div",{className:Ra.username,children:_.jsxs("span",{title:`@${e.screen_name}`,children:["@",e.screen_name]})})]})]})},Lbe="_root_175ot_1",Bbe={root:Lbe},Pbe=({tweet:t})=>_.jsx("p",{className:Bbe.root,children:t.entities.map((e,n)=>_.jsx("span",{dangerouslySetInnerHTML:{__html:e.text}},n))}),zbe=({tweet:t})=>{var e;return _.jsxs(Mbe,{tweet:t,children:[_.jsx(Fbe,{tweet:t}),_.jsx(Pbe,{tweet:t}),(e=t.mediaDetails)!=null&&e.length?_.jsx(HR,{quoted:!0,tweet:t}):null]})},jbe=({tweet:t,components:e})=>{var n;const r=ee.useMemo(()=>$ye(t),[t]);return _.jsxs(KE,{children:[_.jsx(pye,{tweet:r,components:e}),r.in_reply_to_status_id_str&&_.jsx(yye,{tweet:r}),_.jsx(Eye,{tweet:r}),(n=r.mediaDetails)!=null&&n.length?_.jsx(HR,{tweet:r,components:e}):null,r.quoted_tweet&&_.jsx(zbe,{tweet:r.quoted_tweet}),_.jsx(abe,{tweet:r}),_.jsx(xbe,{tweet:r}),_.jsx(_be,{tweet:r})]})},qbe="_root_16yxa_1",Ube={root:qbe},Vbe=t=>_.jsx(KE,{children:_.jsxs("div",{className:Ube.root,children:[_.jsx("h3",{children:"Tweet not found"}),_.jsx("p",{children:"The embedded tweet could not be found…"})]})}),Hbe="_skeleton_oi7hr_1",Wbe="_loading_oi7hr_1",Jbe={skeleton:Hbe,loading:Wbe},Vp=({style:t})=>_.jsx("span",{className:Jbe.skeleton,style:t}),Kbe="_root_17qqv_1",Gbe={root:Kbe},Zbe=()=>_.jsxs(KE,{className:Gbe.root,children:[_.jsx(Vp,{style:{height:"3rem",marginBottom:"0.75rem"}}),_.jsx(Vp,{style:{height:"6rem",margin:"0.5rem 0"}}),_.jsx("div",{style:{borderTop:"var(--tweet-border)",margin:"0.5rem 0"}}),_.jsx(Vp,{style:{height:"2rem"}}),_.jsx(Vp,{style:{height:"2rem",borderRadius:"9999px",marginTop:"0.5rem"}})]});var WR={exports:{}},JR={};/** * @license React * use-sync-external-store-shim.production.min.js * @@ -293,7 +293,7 @@ Relays: ${JSON.stringify(n)} * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Tc=ee;function Jbe(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Kbe=typeof Object.is=="function"?Object.is:Jbe,Gbe=Tc.useState,Zbe=Tc.useEffect,Ybe=Tc.useLayoutEffect,Qbe=Tc.useDebugValue;function Xbe(t,e){var n=e(),r=Gbe({inst:{value:n,getSnapshot:e}}),i=r[0].inst,o=r[1];return Ybe(function(){i.value=n,i.getSnapshot=e,O2(i)&&o({inst:i})},[t,n,e]),Zbe(function(){return O2(i)&&o({inst:i}),t(function(){O2(i)&&o({inst:i})})},[t]),Qbe(n),n}function O2(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!Kbe(t,n)}catch{return!0}}function e2e(t,e){return e()}var t2e=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?e2e:Xbe;JR.useSyncExternalStore=Tc.useSyncExternalStore!==void 0?Tc.useSyncExternalStore:t2e;WR.exports=JR;var n2e=WR.exports;const Gs=()=>{},mr=Gs(),D2=Object,Xe=t=>t===mr,io=t=>typeof t=="function",ya=(t,e)=>({...t,...e}),r2e=t=>io(t.then),Up=new WeakMap;let i2e=0;const lh=t=>{const e=typeof t,n=t&&t.constructor,r=n==Date;let i,o;if(D2(t)===t&&!r&&n!=RegExp){if(i=Up.get(t),i)return i;if(i=++i2e+"~",Up.set(t,i),n==Array){for(i="@",o=0;oay&&typeof window.requestAnimationFrame!=GE,KR=(t,e)=>{const n=Po.get(t);return[()=>!Xe(e)&&t.get(e)||N2,r=>{if(!Xe(e)){const i=t.get(e);e in Hp||(Hp[e]=i),n[5](e,ya(i,r),i||N2)}},n[6],()=>!Xe(e)&&e in Hp?Hp[e]:!Xe(e)&&t.get(e)||N2]};let Ek=!0;const s2e=()=>Ek,[Sk,Ck]=ay&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Gs,Gs],a2e=()=>{const t=xk&&document.visibilityState;return Xe(t)||t!=="hidden"},l2e=t=>(xk&&document.addEventListener("visibilitychange",t),Sk("focus",t),()=>{xk&&document.removeEventListener("visibilitychange",t),Ck("focus",t)}),u2e=t=>{const e=()=>{Ek=!0,t()},n=()=>{Ek=!1};return Sk("online",e),Sk("offline",n),()=>{Ck("online",e),Ck("offline",n)}},c2e={isOnline:s2e,isVisible:a2e},f2e={initFocus:l2e,initReconnect:u2e},r5=!tt.useId,uh=!ay||"Deno"in window,d2e=t=>o2e()?window.requestAnimationFrame(t):setTimeout(t,1),$2=uh?ee.useEffect:ee.useLayoutEffect,I2=typeof navigator<"u"&&navigator.connection,i5=!uh&&I2&&(["slow-2g","2g"].includes(I2.effectiveType)||I2.saveData),ZE=t=>{if(io(t))try{t=t()}catch{t=""}const e=t;return t=typeof t=="string"?t:(Array.isArray(t)?t.length:t)?lh(t):"",[t,e]};let h2e=0;const _k=()=>++h2e,GR=0,ZR=1,YR=2,p2e=3;var gf={__proto__:null,ERROR_REVALIDATE_EVENT:p2e,FOCUS_EVENT:GR,MUTATE_EVENT:YR,RECONNECT_EVENT:ZR};async function QR(...t){const[e,n,r,i]=t,o=ya({populateCache:!0,throwOnError:!0},typeof i=="boolean"?{revalidate:i}:i||{});let s=o.populateCache;const a=o.rollbackOnError;let l=o.optimisticData;const u=d=>typeof a=="function"?a(d):a!==!1,c=o.throwOnError;if(io(n)){const d=n,h=[],p=e.keys();for(const m of p)!/^\$(inf|sub)\$/.test(m)&&d(e.get(m)._k)&&h.push(m);return Promise.all(h.map(f))}return f(n);async function f(d){const[h]=ZE(d);if(!h)return;const[p,m]=KR(e,h),[b,y,v,w]=Po.get(e),g=()=>{const T=b[h];return(io(o.revalidate)?o.revalidate(p().data,d):o.revalidate!==!1)&&(delete v[h],delete w[h],T&&T[0])?T[0](YR).then(()=>p().data):p().data};if(t.length<3)return g();let x=r,k;const E=_k();y[h]=[E,0];const D=!Xe(l),O=p(),N=O.data,C=O._c,R=Xe(C)?N:C;if(D&&(l=io(l)?l(R,N):l,m({data:l,_c:R})),io(x))try{x=x(R)}catch(T){k=T}if(x&&r2e(x))if(x=await x.catch(T=>{k=T}),E!==y[h][0]){if(k)throw k;return x}else k&&D&&u(k)&&(s=!0,m({data:R,_c:mr}));if(s&&!k)if(io(s)){const T=s(x,R);m({data:T,error:mr,_c:mr})}else m({data:x,error:mr,_c:mr});if(y[h][1]=_k(),Promise.resolve(g()).then(()=>{m({_c:mr})}),k){if(c)throw k;return}return x}}const o5=(t,e)=>{for(const n in t)t[n][0]&&t[n][0](e)},m2e=(t,e)=>{if(!Po.has(t)){const n=ya(f2e,e),r={},i=QR.bind(mr,t);let o=Gs;const s={},a=(c,f)=>{const d=s[c]||[];return s[c]=d,d.push(f),()=>d.splice(d.indexOf(f),1)},l=(c,f,d)=>{t.set(c,f);const h=s[c];if(h)for(const p of h)p(f,d)},u=()=>{if(!Po.has(t)&&(Po.set(t,[r,{},{},{},i,l,a]),!uh)){const c=n.initFocus(setTimeout.bind(mr,o5.bind(mr,r,GR))),f=n.initReconnect(setTimeout.bind(mr,o5.bind(mr,r,ZR)));o=()=>{c&&c(),f&&f(),Po.delete(t)}}};return u(),[t,i,u,o]}return[t,Po.get(t)[4]]},g2e=(t,e,n,r,i)=>{const o=n.errorRetryCount,s=i.retryCount,a=~~((Math.random()+.5)*(1<<(s<8?s:8)))*n.errorRetryInterval;!Xe(o)&&s>o||setTimeout(r,a,i)},y2e=(t,e)=>lh(t)==lh(e),[XR,b2e]=m2e(new Map),v2e=ya({onLoadingSlow:Gs,onSuccess:Gs,onError:Gs,onErrorRetry:g2e,onDiscarded:Gs,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:i5?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:i5?5e3:3e3,compare:y2e,isPaused:()=>!1,cache:XR,mutate:b2e,fallback:{}},c2e),w2e=(t,e)=>{const n=ya(t,e);if(e){const{use:r,fallback:i}=t,{use:o,fallback:s}=e;r&&o&&(n.use=r.concat(o)),i&&s&&(n.fallback=ya(i,s))}return n},k2e=ee.createContext({}),x2e="$inf$",eF=ay&&window.__SWR_DEVTOOLS_USE__,E2e=eF?window.__SWR_DEVTOOLS_USE__:[],S2e=()=>{eF&&(window.__SWR_DEVTOOLS_REACT__=tt)},C2e=t=>io(t[1])?[t[0],t[1],t[2]||{}]:[t[0],null,(t[1]===null?t[2]:t[1])||{}],_2e=()=>ya(v2e,ee.useContext(k2e)),A2e=t=>(e,n,r)=>t(e,n&&((...o)=>{const[s]=ZE(e),[,,,a]=Po.get(XR);if(s.startsWith(x2e))return n(...o);const l=a[s];return Xe(l)?n(...o):(delete a[s],l)}),r),T2e=E2e.concat(A2e),M2e=t=>function(...n){const r=_2e(),[i,o,s]=C2e(n),a=w2e(r,s);let l=t;const{use:u}=a,c=(u||[]).concat(T2e);for(let f=c.length;f--;)l=c[f](l);return l(i,o||a.fetcher||null,a)},O2e=(t,e,n)=>{const r=e[t]||(e[t]=[]);return r.push(n),()=>{const i=r.indexOf(n);i>=0&&(r[i]=r[r.length-1],r.pop())}};S2e();const s5=tt.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}),t)}),R2={dedupe:!0},D2e=(t,e,n)=>{const{cache:r,compare:i,suspense:o,fallbackData:s,revalidateOnMount:a,revalidateIfStale:l,refreshInterval:u,refreshWhenHidden:c,refreshWhenOffline:f,keepPreviousData:d}=n,[h,p,m,b]=Po.get(r),[y,v]=ZE(t),w=ee.useRef(!1),g=ee.useRef(!1),x=ee.useRef(y),k=ee.useRef(e),E=ee.useRef(n),D=()=>E.current,O=()=>D().isVisible()&&D().isOnline(),[N,C,R,T]=KR(r,y),q=ee.useRef({}).current,A=Xe(s)?n.fallback[y]:s,S=(Ce,pe)=>{for(const De in q){const Le=De;if(Le==="data"){if(!i(Ce[Le],pe[Le])&&(!Xe(Ce[Le])||!i(ke,pe[Le])))return!1}else if(pe[Le]!==Ce[Le])return!1}return!0},P=ee.useMemo(()=>{const Ce=!y||!e?!1:Xe(a)?D().isPaused()||o?!1:Xe(l)?!0:l:a,pe=it=>{const bt=ya(it);return delete bt._k,Ce?{isValidating:!0,isLoading:!0,...bt}:bt},De=N(),Le=T(),Ge=pe(De),Qt=De===Le?Ge:pe(Le);let rt=Ge;return[()=>{const it=pe(N());return S(it,rt)?(rt.data=it.data,rt.isLoading=it.isLoading,rt.isValidating=it.isValidating,rt.error=it.error,rt):(rt=it,it)},()=>Qt]},[r,y]),B=n2e.useSyncExternalStore(ee.useCallback(Ce=>R(y,(pe,De)=>{S(De,pe)||Ce()}),[r,y]),P[0],P[1]),j=!w.current,z=h[y]&&h[y].length>0,J=B.data,K=Xe(J)?A:J,ae=B.error,fe=ee.useRef(K),ke=d?Xe(J)?fe.current:J:K,ve=z&&!Xe(ae)?!1:j&&!Xe(a)?a:D().isPaused()?!1:o?Xe(K)?!1:l:Xe(K)||l,xe=!!(y&&e&&j&&ve),Se=Xe(B.isValidating)?xe:B.isValidating,Oe=Xe(B.isLoading)?xe:B.isLoading,Fe=ee.useCallback(async Ce=>{const pe=k.current;if(!y||!pe||g.current||D().isPaused())return!1;let De,Le,Ge=!0;const Qt=Ce||{},rt=!m[y]||!Qt.dedupe,it=()=>r5?!g.current&&y===x.current&&w.current:y===x.current,bt={isValidating:!1,isLoading:!1},Ft=()=>{C(bt)},Lt=()=>{const gt=m[y];gt&>[1]===Le&&delete m[y]},at={isValidating:!0};Xe(N().data)&&(at.isLoading=!0);try{if(rt&&(C(at),n.loadingTimeout&&Xe(N().data)&&setTimeout(()=>{Ge&&it()&&D().onLoadingSlow(y,n)},n.loadingTimeout),m[y]=[pe(v),_k()]),[De,Le]=m[y],De=await De,rt&&setTimeout(Lt,n.dedupingInterval),!m[y]||m[y][1]!==Le)return rt&&it()&&D().onDiscarded(y),!1;bt.error=mr;const gt=p[y];if(!Xe(gt)&&(Le<=gt[0]||Le<=gt[1]||gt[1]===0))return Ft(),rt&&it()&&D().onDiscarded(y),!1;const Y=N().data;bt.data=i(Y,De)?Y:De,rt&&it()&&D().onSuccess(De,y,n)}catch(gt){Lt();const Y=D(),{shouldRetryOnError:U}=Y;Y.isPaused()||(bt.error=gt,rt&&it()&&(Y.onError(gt,y,Y),(U===!0||io(U)&&U(gt))&&(!D().revalidateOnFocus||!D().revalidateOnReconnect||O())&&Y.onErrorRetry(gt,y,Y,W=>{const X=h[y];X&&X[0]&&X[0](gf.ERROR_REVALIDATE_EVENT,W)},{retryCount:(Qt.retryCount||0)+1,dedupe:!0})))}return Ge=!1,Ft(),!0},[y,r]),mt=ee.useCallback((...Ce)=>QR(r,x.current,...Ce),[]);if($2(()=>{k.current=e,E.current=n,Xe(J)||(fe.current=J)}),$2(()=>{if(!y)return;const Ce=Fe.bind(mr,R2);let pe=0;const Le=O2e(y,h,(Ge,Qt={})=>{if(Ge==gf.FOCUS_EVENT){const rt=Date.now();D().revalidateOnFocus&&rt>pe&&O()&&(pe=rt+D().focusThrottleInterval,Ce())}else if(Ge==gf.RECONNECT_EVENT)D().revalidateOnReconnect&&O()&&Ce();else{if(Ge==gf.MUTATE_EVENT)return Fe();if(Ge==gf.ERROR_REVALIDATE_EVENT)return Fe(Qt)}});return g.current=!1,x.current=y,w.current=!0,C({_k:v}),ve&&(Xe(K)||uh?Ce():d2e(Ce)),()=>{g.current=!0,Le()}},[y]),$2(()=>{let Ce;function pe(){const Le=io(u)?u(N().data):u;Le&&Ce!==-1&&(Ce=setTimeout(De,Le))}function De(){!N().error&&(c||D().isVisible())&&(f||D().isOnline())?Fe(R2).then(pe):pe()}return pe(),()=>{Ce&&(clearTimeout(Ce),Ce=-1)}},[u,c,f,y]),ee.useDebugValue(ke),o&&Xe(K)&&y){if(!r5&&uh)throw new Error("Fallback data is required when using suspense in SSR.");k.current=e,E.current=n,g.current=!1;const Ce=b[y];if(!Xe(Ce)){const pe=mt(Ce);s5(pe)}if(Xe(ae)){const pe=Fe(R2);Xe(ke)||(pe.status="fulfilled",pe.value=!0),s5(pe)}else throw ae}return{mutate:mt,get data(){return q.data=!0,ke},get error(){return q.error=!0,ae},get isValidating(){return q.isValidating=!0,Se},get isLoading(){return q.isLoading=!0,Oe}}},a5=M2e(D2e);class N2e extends Error{constructor({message:e,status:n,data:r}){super(e),this.name="TwitterApiError",this.status=n,this.data=r}}const $2e=a5.default||a5,I2e="https://react-tweet.vercel.app";async function R2e([t,e]){const n=await fetch(t,e),r=await n.json();if(n.ok)return r.data||null;throw new N2e({message:`Failed to fetch tweet at "${t}" with "${n.status}".`,data:r,status:n.status})}const F2e=(t,e,n)=>{const{isLoading:r,data:i,error:o}=$2e(()=>e||t?[e||t&&`${I2e}/api/tweet/${t}`,n]:null,R2e,{revalidateIfStale:!1,revalidateOnFocus:!1,shouldRetryOnError:!1});return{isLoading:!!(r||i===void 0&&!o),data:i,error:o}},L2e=({id:t,apiUrl:e,fallback:n=_.jsx(Wbe,{}),components:r,fetchOptions:i,onError:o})=>{const{data:s,error:a,isLoading:l}=F2e(t,e,i);if(l)return n;if(a||!s){const u=(r==null?void 0:r.TweetNotFound)||zbe;return _.jsx(u,{error:o?o(a):a})}return _.jsx(Lbe,{tweet:s,components:r})};function tF(t){const{src:e}=t,n=e.slice(e.lastIndexOf("/")+1);return _.jsx(L2e,{id:n})}function nF(t){const{src:e,controls:n=!0}=t,r=ee.useMemo(()=>new URL(e).pathname.split(".").pop(),[e]);return _.jsx("video",{autoPlay:!0,loop:!0,muted:!0,controls:n,src:e,className:"my-2 rounded-lg z-auto",style:{maxHeight:400},children:_.jsx("source",{src:e,type:`video/${r==="mov"?"mp4":r}`})})}/*! ***************************************************************************** + */var Tc=ee;function Ybe(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Qbe=typeof Object.is=="function"?Object.is:Ybe,Xbe=Tc.useState,e2e=Tc.useEffect,t2e=Tc.useLayoutEffect,n2e=Tc.useDebugValue;function r2e(t,e){var n=e(),r=Xbe({inst:{value:n,getSnapshot:e}}),i=r[0].inst,o=r[1];return t2e(function(){i.value=n,i.getSnapshot=e,O2(i)&&o({inst:i})},[t,n,e]),e2e(function(){return O2(i)&&o({inst:i}),t(function(){O2(i)&&o({inst:i})})},[t]),n2e(n),n}function O2(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!Qbe(t,n)}catch{return!0}}function i2e(t,e){return e()}var o2e=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?i2e:r2e;JR.useSyncExternalStore=Tc.useSyncExternalStore!==void 0?Tc.useSyncExternalStore:o2e;WR.exports=JR;var s2e=WR.exports;const Gs=()=>{},mr=Gs(),D2=Object,Xe=t=>t===mr,io=t=>typeof t=="function",ya=(t,e)=>({...t,...e}),a2e=t=>io(t.then),Hp=new WeakMap;let l2e=0;const uh=t=>{const e=typeof t,n=t&&t.constructor,r=n==Date;let i,o;if(D2(t)===t&&!r&&n!=RegExp){if(i=Hp.get(t),i)return i;if(i=++l2e+"~",Hp.set(t,i),n==Array){for(i="@",o=0;oay&&typeof window.requestAnimationFrame!=GE,KR=(t,e)=>{const n=Po.get(t);return[()=>!Xe(e)&&t.get(e)||N2,r=>{if(!Xe(e)){const i=t.get(e);e in Wp||(Wp[e]=i),n[5](e,ya(i,r),i||N2)}},n[6],()=>!Xe(e)&&e in Wp?Wp[e]:!Xe(e)&&t.get(e)||N2]};let Ek=!0;const c2e=()=>Ek,[Sk,Ck]=ay&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Gs,Gs],f2e=()=>{const t=xk&&document.visibilityState;return Xe(t)||t!=="hidden"},d2e=t=>(xk&&document.addEventListener("visibilitychange",t),Sk("focus",t),()=>{xk&&document.removeEventListener("visibilitychange",t),Ck("focus",t)}),h2e=t=>{const e=()=>{Ek=!0,t()},n=()=>{Ek=!1};return Sk("online",e),Sk("offline",n),()=>{Ck("online",e),Ck("offline",n)}},p2e={isOnline:c2e,isVisible:f2e},m2e={initFocus:d2e,initReconnect:h2e},r5=!tt.useId,ch=!ay||"Deno"in window,g2e=t=>u2e()?window.requestAnimationFrame(t):setTimeout(t,1),$2=ch?ee.useEffect:ee.useLayoutEffect,I2=typeof navigator<"u"&&navigator.connection,i5=!ch&&I2&&(["slow-2g","2g"].includes(I2.effectiveType)||I2.saveData),ZE=t=>{if(io(t))try{t=t()}catch{t=""}const e=t;return t=typeof t=="string"?t:(Array.isArray(t)?t.length:t)?uh(t):"",[t,e]};let y2e=0;const _k=()=>++y2e,GR=0,ZR=1,YR=2,b2e=3;var gf={__proto__:null,ERROR_REVALIDATE_EVENT:b2e,FOCUS_EVENT:GR,MUTATE_EVENT:YR,RECONNECT_EVENT:ZR};async function QR(...t){const[e,n,r,i]=t,o=ya({populateCache:!0,throwOnError:!0},typeof i=="boolean"?{revalidate:i}:i||{});let s=o.populateCache;const a=o.rollbackOnError;let l=o.optimisticData;const u=d=>typeof a=="function"?a(d):a!==!1,c=o.throwOnError;if(io(n)){const d=n,h=[],p=e.keys();for(const m of p)!/^\$(inf|sub)\$/.test(m)&&d(e.get(m)._k)&&h.push(m);return Promise.all(h.map(f))}return f(n);async function f(d){const[h]=ZE(d);if(!h)return;const[p,m]=KR(e,h),[b,y,v,w]=Po.get(e),g=()=>{const T=b[h];return(io(o.revalidate)?o.revalidate(p().data,d):o.revalidate!==!1)&&(delete v[h],delete w[h],T&&T[0])?T[0](YR).then(()=>p().data):p().data};if(t.length<3)return g();let x=r,k;const E=_k();y[h]=[E,0];const D=!Xe(l),O=p(),N=O.data,C=O._c,R=Xe(C)?N:C;if(D&&(l=io(l)?l(R,N):l,m({data:l,_c:R})),io(x))try{x=x(R)}catch(T){k=T}if(x&&a2e(x))if(x=await x.catch(T=>{k=T}),E!==y[h][0]){if(k)throw k;return x}else k&&D&&u(k)&&(s=!0,m({data:R,_c:mr}));if(s&&!k)if(io(s)){const T=s(x,R);m({data:T,error:mr,_c:mr})}else m({data:x,error:mr,_c:mr});if(y[h][1]=_k(),Promise.resolve(g()).then(()=>{m({_c:mr})}),k){if(c)throw k;return}return x}}const o5=(t,e)=>{for(const n in t)t[n][0]&&t[n][0](e)},v2e=(t,e)=>{if(!Po.has(t)){const n=ya(m2e,e),r={},i=QR.bind(mr,t);let o=Gs;const s={},a=(c,f)=>{const d=s[c]||[];return s[c]=d,d.push(f),()=>d.splice(d.indexOf(f),1)},l=(c,f,d)=>{t.set(c,f);const h=s[c];if(h)for(const p of h)p(f,d)},u=()=>{if(!Po.has(t)&&(Po.set(t,[r,{},{},{},i,l,a]),!ch)){const c=n.initFocus(setTimeout.bind(mr,o5.bind(mr,r,GR))),f=n.initReconnect(setTimeout.bind(mr,o5.bind(mr,r,ZR)));o=()=>{c&&c(),f&&f(),Po.delete(t)}}};return u(),[t,i,u,o]}return[t,Po.get(t)[4]]},w2e=(t,e,n,r,i)=>{const o=n.errorRetryCount,s=i.retryCount,a=~~((Math.random()+.5)*(1<<(s<8?s:8)))*n.errorRetryInterval;!Xe(o)&&s>o||setTimeout(r,a,i)},k2e=(t,e)=>uh(t)==uh(e),[XR,x2e]=v2e(new Map),E2e=ya({onLoadingSlow:Gs,onSuccess:Gs,onError:Gs,onErrorRetry:w2e,onDiscarded:Gs,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:i5?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:i5?5e3:3e3,compare:k2e,isPaused:()=>!1,cache:XR,mutate:x2e,fallback:{}},p2e),S2e=(t,e)=>{const n=ya(t,e);if(e){const{use:r,fallback:i}=t,{use:o,fallback:s}=e;r&&o&&(n.use=r.concat(o)),i&&s&&(n.fallback=ya(i,s))}return n},C2e=ee.createContext({}),_2e="$inf$",eF=ay&&window.__SWR_DEVTOOLS_USE__,A2e=eF?window.__SWR_DEVTOOLS_USE__:[],T2e=()=>{eF&&(window.__SWR_DEVTOOLS_REACT__=tt)},M2e=t=>io(t[1])?[t[0],t[1],t[2]||{}]:[t[0],null,(t[1]===null?t[2]:t[1])||{}],O2e=()=>ya(E2e,ee.useContext(C2e)),D2e=t=>(e,n,r)=>t(e,n&&((...o)=>{const[s]=ZE(e),[,,,a]=Po.get(XR);if(s.startsWith(_2e))return n(...o);const l=a[s];return Xe(l)?n(...o):(delete a[s],l)}),r),N2e=A2e.concat(D2e),$2e=t=>function(...n){const r=O2e(),[i,o,s]=M2e(n),a=S2e(r,s);let l=t;const{use:u}=a,c=(u||[]).concat(N2e);for(let f=c.length;f--;)l=c[f](l);return l(i,o||a.fetcher||null,a)},I2e=(t,e,n)=>{const r=e[t]||(e[t]=[]);return r.push(n),()=>{const i=r.indexOf(n);i>=0&&(r[i]=r[r.length-1],r.pop())}};T2e();const s5=tt.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}),t)}),R2={dedupe:!0},R2e=(t,e,n)=>{const{cache:r,compare:i,suspense:o,fallbackData:s,revalidateOnMount:a,revalidateIfStale:l,refreshInterval:u,refreshWhenHidden:c,refreshWhenOffline:f,keepPreviousData:d}=n,[h,p,m,b]=Po.get(r),[y,v]=ZE(t),w=ee.useRef(!1),g=ee.useRef(!1),x=ee.useRef(y),k=ee.useRef(e),E=ee.useRef(n),D=()=>E.current,O=()=>D().isVisible()&&D().isOnline(),[N,C,R,T]=KR(r,y),q=ee.useRef({}).current,A=Xe(s)?n.fallback[y]:s,S=(Ce,pe)=>{for(const De in q){const Le=De;if(Le==="data"){if(!i(Ce[Le],pe[Le])&&(!Xe(Ce[Le])||!i(ke,pe[Le])))return!1}else if(pe[Le]!==Ce[Le])return!1}return!0},P=ee.useMemo(()=>{const Ce=!y||!e?!1:Xe(a)?D().isPaused()||o?!1:Xe(l)?!0:l:a,pe=it=>{const bt=ya(it);return delete bt._k,Ce?{isValidating:!0,isLoading:!0,...bt}:bt},De=N(),Le=T(),Ge=pe(De),Qt=De===Le?Ge:pe(Le);let rt=Ge;return[()=>{const it=pe(N());return S(it,rt)?(rt.data=it.data,rt.isLoading=it.isLoading,rt.isValidating=it.isValidating,rt.error=it.error,rt):(rt=it,it)},()=>Qt]},[r,y]),B=s2e.useSyncExternalStore(ee.useCallback(Ce=>R(y,(pe,De)=>{S(De,pe)||Ce()}),[r,y]),P[0],P[1]),j=!w.current,z=h[y]&&h[y].length>0,J=B.data,K=Xe(J)?A:J,ae=B.error,fe=ee.useRef(K),ke=d?Xe(J)?fe.current:J:K,ve=z&&!Xe(ae)?!1:j&&!Xe(a)?a:D().isPaused()?!1:o?Xe(K)?!1:l:Xe(K)||l,xe=!!(y&&e&&j&&ve),Se=Xe(B.isValidating)?xe:B.isValidating,Oe=Xe(B.isLoading)?xe:B.isLoading,Fe=ee.useCallback(async Ce=>{const pe=k.current;if(!y||!pe||g.current||D().isPaused())return!1;let De,Le,Ge=!0;const Qt=Ce||{},rt=!m[y]||!Qt.dedupe,it=()=>r5?!g.current&&y===x.current&&w.current:y===x.current,bt={isValidating:!1,isLoading:!1},Ft=()=>{C(bt)},Lt=()=>{const gt=m[y];gt&>[1]===Le&&delete m[y]},at={isValidating:!0};Xe(N().data)&&(at.isLoading=!0);try{if(rt&&(C(at),n.loadingTimeout&&Xe(N().data)&&setTimeout(()=>{Ge&&it()&&D().onLoadingSlow(y,n)},n.loadingTimeout),m[y]=[pe(v),_k()]),[De,Le]=m[y],De=await De,rt&&setTimeout(Lt,n.dedupingInterval),!m[y]||m[y][1]!==Le)return rt&&it()&&D().onDiscarded(y),!1;bt.error=mr;const gt=p[y];if(!Xe(gt)&&(Le<=gt[0]||Le<=gt[1]||gt[1]===0))return Ft(),rt&&it()&&D().onDiscarded(y),!1;const Y=N().data;bt.data=i(Y,De)?Y:De,rt&&it()&&D().onSuccess(De,y,n)}catch(gt){Lt();const Y=D(),{shouldRetryOnError:V}=Y;Y.isPaused()||(bt.error=gt,rt&&it()&&(Y.onError(gt,y,Y),(V===!0||io(V)&&V(gt))&&(!D().revalidateOnFocus||!D().revalidateOnReconnect||O())&&Y.onErrorRetry(gt,y,Y,W=>{const X=h[y];X&&X[0]&&X[0](gf.ERROR_REVALIDATE_EVENT,W)},{retryCount:(Qt.retryCount||0)+1,dedupe:!0})))}return Ge=!1,Ft(),!0},[y,r]),mt=ee.useCallback((...Ce)=>QR(r,x.current,...Ce),[]);if($2(()=>{k.current=e,E.current=n,Xe(J)||(fe.current=J)}),$2(()=>{if(!y)return;const Ce=Fe.bind(mr,R2);let pe=0;const Le=I2e(y,h,(Ge,Qt={})=>{if(Ge==gf.FOCUS_EVENT){const rt=Date.now();D().revalidateOnFocus&&rt>pe&&O()&&(pe=rt+D().focusThrottleInterval,Ce())}else if(Ge==gf.RECONNECT_EVENT)D().revalidateOnReconnect&&O()&&Ce();else{if(Ge==gf.MUTATE_EVENT)return Fe();if(Ge==gf.ERROR_REVALIDATE_EVENT)return Fe(Qt)}});return g.current=!1,x.current=y,w.current=!0,C({_k:v}),ve&&(Xe(K)||ch?Ce():g2e(Ce)),()=>{g.current=!0,Le()}},[y]),$2(()=>{let Ce;function pe(){const Le=io(u)?u(N().data):u;Le&&Ce!==-1&&(Ce=setTimeout(De,Le))}function De(){!N().error&&(c||D().isVisible())&&(f||D().isOnline())?Fe(R2).then(pe):pe()}return pe(),()=>{Ce&&(clearTimeout(Ce),Ce=-1)}},[u,c,f,y]),ee.useDebugValue(ke),o&&Xe(K)&&y){if(!r5&&ch)throw new Error("Fallback data is required when using suspense in SSR.");k.current=e,E.current=n,g.current=!1;const Ce=b[y];if(!Xe(Ce)){const pe=mt(Ce);s5(pe)}if(Xe(ae)){const pe=Fe(R2);Xe(ke)||(pe.status="fulfilled",pe.value=!0),s5(pe)}else throw ae}return{mutate:mt,get data(){return q.data=!0,ke},get error(){return q.error=!0,ae},get isValidating(){return q.isValidating=!0,Se},get isLoading(){return q.isLoading=!0,Oe}}},a5=$2e(R2e);class F2e extends Error{constructor({message:e,status:n,data:r}){super(e),this.name="TwitterApiError",this.status=n,this.data=r}}const L2e=a5.default||a5,B2e="https://react-tweet.vercel.app";async function P2e([t,e]){const n=await fetch(t,e),r=await n.json();if(n.ok)return r.data||null;throw new F2e({message:`Failed to fetch tweet at "${t}" with "${n.status}".`,data:r,status:n.status})}const z2e=(t,e,n)=>{const{isLoading:r,data:i,error:o}=L2e(()=>e||t?[e||t&&`${B2e}/api/tweet/${t}`,n]:null,P2e,{revalidateIfStale:!1,revalidateOnFocus:!1,shouldRetryOnError:!1});return{isLoading:!!(r||i===void 0&&!o),data:i,error:o}},j2e=({id:t,apiUrl:e,fallback:n=_.jsx(Zbe,{}),components:r,fetchOptions:i,onError:o})=>{const{data:s,error:a,isLoading:l}=z2e(t,e,i);if(l)return n;if(a||!s){const u=(r==null?void 0:r.TweetNotFound)||Vbe;return _.jsx(u,{error:o?o(a):a})}return _.jsx(jbe,{tweet:s,components:r})};function tF(t){const{src:e}=t,n=e.slice(e.lastIndexOf("/")+1);return _.jsx(j2e,{id:n})}function nF(t){const{src:e,controls:n=!0}=t,r=ee.useMemo(()=>new URL(e).pathname.split(".").pop(),[e]);return _.jsx("video",{autoPlay:!0,loop:!0,muted:!0,controls:n,src:e,className:"my-2 rounded-lg z-auto",style:{maxHeight:400},children:_.jsx("source",{src:e,type:`video/${r==="mov"?"mp4":r}`})})}/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any @@ -306,10 +306,10 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var Ak=function(){return Ak=Object.assign||function(e){for(var n,r=1,i=arguments.length;r{const r=new URL(e),i=r.host==="youtu.be"?r.pathname:new URLSearchParams(r.search).get("v");return i==null?void 0:i.replace(/^\//,"")},[e]);return _.jsxs("div",{children:[_.jsx("style",{children:` +***************************************************************************** */var Ak=function(){return Ak=Object.assign||function(e){for(var n,r=1,i=arguments.length;r{const r=new URL(e),i=r.host==="youtu.be"?r.pathname:new URLSearchParams(r.search).get("v");return i==null?void 0:i.replace(/^\//,"")},[e]);return _.jsxs("div",{children:[_.jsx("style",{children:` .lty-playbtn { border: none; border-radius: 16%; } - `}),n&&_.jsx("div",{className:"overflow-hidden rounded-lg",children:_.jsx(P2e,{id:n,title:""})})]})}const z2e=function(e){const{schema:n}=e;return _.jsx(_.Fragment,{children:n.content.map((r,i)=>_.jsxs(tt.Fragment,{children:[r.type==="heading"&&_.jsx(Bge,{node:r}),r.type==="paragraph"&&_.jsx(WE,{node:r}),r.type==="horizontalRule"&&_.jsx("hr",{className:"mt-6 mb-6"}),r.type==="image"&&_.jsx(R7,{src:r.attrs.src}),r.type==="video"&&_.jsx(nF,{src:r.attrs.src}),r.type==="nevent"&&_.jsx(iF,{...r.attrs}),r.type==="orderedList"&&_.jsx(YA,{type:"ol",node:r}),r.type==="bulletList"&&_.jsx(YA,{type:"ul",node:r}),r.type==="codeBlock"&&_.jsx(PR,{node:r}),r.type==="blockquote"&&_.jsx(Fge,{node:r}),r.type==="tweet"&&_.jsx(tF,{src:r.attrs.src}),r.type==="youtube"&&_.jsx(rF,{src:r.attrs.src})]},r.type+i))})};function iF(t){const{id:e,relays:n,author:r}=t,[i,o]=ee.useState(),s=FE(r,n),a=LE(s);ee.useEffect(()=>{const d=RE.subscribeMany([...n,"wss://relay.damus.io"],[{ids:[e]}],{onevent(h){o(h)}});return()=>d.close()},[e,r,n]);const l=ee.useMemo(()=>{if(i!=null&&i.content){const d=i.kind===30023?[uw,A7,Hw]:[$me,IO,Rme,Ime,Hw],h=new aO({extensions:d});return h.commands.parseNote(i),h.getJSON()}},[i==null?void 0:i.content]),u=(a==null?void 0:a.display_name)||(a==null?void 0:a.name)||"",c=a==null?void 0:a.picture,f=ee.useMemo(()=>{var d;return s?(d=Re.fromSeconds(s.created_at).toRelative({style:"narrow"}))==null?void 0:d.replace("ago",""):null},[s]);return _.jsxs("div",{className:"relative px-4 py-4 my-2 border rounded-xl w-full l",children:[!i&&"Loading",i&&_.jsxs(_.Fragment,{children:[_.jsxs("div",{className:"flex flex-row items-center py-2",children:[_.jsx("img",{className:"w-8 rounded-full mr-4",src:c}),_.jsx("div",{children:u}),_.jsx("div",{className:"text-xs text-gray-500 ml-2",children:f})]}),l&&_.jsx(z2e,{schema:l})]})]})}function j2e(t){const e=t.node.attrs;return _.jsx(_a,{as:"div","data-nevent":e.nevent,"data-drag-handle":"",draggable:t.node.type.spec.draggable,children:_.jsxs("div",{className:`relative select-none w-10/12 rounded-xl ${t.selected?"bg-blue-100":""}`,children:[_.jsx(iF,{...e}),_.jsx(ey,{onClick:()=>t.deleteNode()})]})})}function q2e(t,e=500){const[n,r]=ee.useState(t),i=ee.useRef(null);return ee.useEffect(()=>{const o=Date.now();if(i.current&&o>=i.current+e)i.current=o,r(t);else{const s=window.setTimeout(()=>{i.current=o,r(t)},e);return()=>window.clearTimeout(s)}},[t,e]),n}function V2e(t){const[e,n]=ee.useState([]),r=q2e(t,500);return ee.useEffect(()=>{if(r){n([]);const i=RE.subscribeMany(["wss://relay.nostr.band"],[{kinds:[0],search:r}],{onevent:o=>{n(s=>[...s,o])}});return()=>i.close()}},[r]),e}const U2e=ee.forwardRef(function(e,n){const[r,i]=ee.useState(0),o=V2e(e.query),s=c=>{const f=o[c];f&&e.command(f)},a=()=>{i((r+o.length-1)%o.length)},l=()=>{i((r+1)%o.length)},u=()=>{s(r)};return ee.useEffect(()=>i(0),[o]),ee.useImperativeHandle(n,()=>({onKeyDown:({event:c})=>c.key==="ArrowUp"?(a(),!0):c.key==="ArrowDown"?(l(),!0):c.key==="Enter"?(u(),!0):!1})),_.jsx("div",{className:"flex flex-col items-start bg-white py-1 rounded-lg border border-solid border-gray-300",children:o.map((c,f)=>{const{name:d,display_name:h}=JSON.parse(c.content);return _.jsx("div",{className:`px-3 py-2 w-full text-left justify-start items-start hover:bg-gray-100 cursor-pointer ${f===r?"bg-gray-100":""}`,onClick:()=>s(f),children:h||d},f)})})});function H2e(t){const{src:e}=t.node.attrs;return _.jsx(_a,{"data-drag-handle":"",draggable:t.node.type.spec.draggable,children:_.jsx(tF,{src:e})})}function W2e(t){const{src:e,alt:n,sha256:r,uploadError:i,uploadUrl:o,uploading:s}=t.node.attrs;return _.jsxs(_a,{"data-drag-handle":"",draggable:t.node.type.spec.draggable,className:`relative w-fit h-fit ${t.selected?"opacity-90":""}`,children:[_.jsx(ey,{onClick:()=>t.deleteNode()}),_.jsx(I7,{uploading:s}),_.jsx(nF,{controls:!1,src:e}),_.jsxs(M7,{children:[r?_.jsx("div",{}):_.jsx(T7,{value:n,onChange:a=>t.updateAttributes({alt:a})}),!r&&_.jsx($7,{uploadUrl:o,onChange:(a,l)=>t.updateAttributes({uploadType:a,uploadUrl:l})}),r&&_.jsx("span",{"data-tooltip":e,children:_.jsx(G1,{size:26,strokeWidth:"2.5",className:"p-1 flex flex-row justify-between rounded-full border border-white/20 bg-black text-green-300 text-xs right-2 bottom-2 z-50"})}),i&&_.jsx("span",{"data-tooltip":i,className:"",children:_.jsx(xT,{size:28,strokeWidth:"1.5",className:"border border-white/20 bg-black rounded-full py-1 ml-1 text-red-500 relative top-0"})})]})]})}function J2e(t){const e=t.node.attrs;return _.jsx(_a,{as:"div","data-drag-handle":"",draggable:t.node.type.spec.draggable,children:_.jsxs("div",{className:`relative select-none w-10/12 rounded-xl ${t.selected?"bg-blue-100":""}`,children:[_.jsx(ey,{onClick:()=>t.deleteNode()}),_.jsx(rF,{...e})]})})}function No(t){return _.jsx("button",{disabled:t.disabled,className:`rounded-lg p-1 mb-1 mr-1 text-sm bg-gray-100 ${t.isActive?"bg-indigo-600 text-white":"bg-gray-200"} disabled:line-through disabled:bg-gray-50`,onClick:t.onClick,children:t.children})}function K2e(t){return _.jsx("nav",{className:"fixed overflow-y-auto h-full right-0 w-1/2 bg-gray-100 p-4",children:t.children})}const oF="nostr:nprofile1qy88wumn8ghj7mn0wvhxcmmv9uq32amnwvaz7tmjv4kxz7fwv3sk6atn9e5k7tcprfmhxue69uhhyetvv9ujuem9w3skccne9e3k7mf0wccsqgxxvqas78x0a339m8qgkaf7fam5atmarne8dy3rzfd4l4x6w2qpncmfs8zh",G2e="nostr:nprofile1qyd8wumn8ghj7urewfsk66ty9enxjct5dfskvtnrdakj7qgmwaehxw309aex2mrp0yh8wetnw3jhymnzw33jucm0d5hsz9thwden5te0wfjkccte9ejxzmt4wvhxjme0qqsrhuxx8l9ex335q7he0f09aej04zpazpl0ne2cgukyawd24mayt8gfnma0u",Z2e="nostr:nprofile1qyfhwumn8ghj7ur4wfcxcetsv9njuetn9uqsuamnwvaz7tmwdaejumr0dshsz9mhwden5te0wfjkccte9ec8y6tdv9kzumn9wshsqgyzxs0cs2mw40xjhfl3a7g24ktpeur54u2mnm6y5z0e6250h7lx5gflu83m",sF="nostr:nevent1qvzqqqqqqypzplnld0r0wvutw6alsrd5q2k7vk2nug9j7glxd6ycyp9k8nzz2wdrqyg8wumn8ghj7mn0wd68ytnhd9hx2qg5waehxw309aex2mrp0yhxgctdw4eju6t0qyxhwumn8ghj7mn0wvhxcmmvqqs9gg4thq8ng87z8377jxksjwhk9dl0f8su9c4kq335ydzp0ykmv5gqt3csa",Y2e="nostr:note1dezy67z2sl5yxm6scwmy6w4k0zjleyw3tnttxyduygz96cl79fnsgcsf6g",aF="nostr:naddr1qqwysetjv5syxmmdv4ejqsnfw33k76twyp38jgznwp5hyctvqgsph3c2q9yt8uckmgelu0yf7glruudvfluesqn7cuftjpwdynm2gygrqsqqqa2w4ua43m",lF="lnbc15u1p3xnhl2pp5jptserfk3zk4qy42tlucycrfwxhydvlemu9pqr93tuzlv9cc7g3sdqsvfhkcap3xyhx7un8cqzpgxqzjcsp5f8c52y2stc300gl6s4xswtjpc37hrnnr3c9wvtgjfuvqmpm35evq9qyyssqy4lgd8tj637qcjp05rdpxxykjenthxftej7a2zzmwrmrl70fyj9hvj0rewhzj7jfyuwkwcg9g2jpwtk3wkjtwnkdks84hsnu8xps5vsq4gj5hs",Q2e="https://image.nostr.build/87dbc55a6391d15bddda206561d53867a5679dd95e84fe8ed62bfe2e3adcadf3.jpg",X2e=()=>{const[t,e]=ee.useState(!1);return _.jsxs(_.Fragment,{children:[_.jsxs("div",{className:"flex flex-row items-center justify-start mt-4",children:[_.jsx("button",{className:"hover:bg-gray-200 rounded-full w-6 h-6 mr-2",onClick:()=>e(n=>!n),children:t?_.jsx(wT,{}):_.jsx(HB,{})}),_.jsx("h6",{className:"text-gray-800",children:"Testing text"})]}),t&&_.jsxs("span",{id:"raw",className:"text-xs break-words text-wrap relative",children:["Try copy & paste some of text below into the editor. ",_.jsx("br",{}),"Hello ",oF,_.jsx("br",{}),G2e,_.jsx("br",{}),Z2e,_.jsx("br",{}),sF,_.jsx("br",{}),Y2e,_.jsx("br",{}),aF,_.jsx("br",{}),Q2e,_.jsx("br",{}),lF]})]})};function eve(){const[t,e]=ee.useState(""),[n,r]=ee.useState("text"),[i,o]=ee.useState({}),[s]=ee.useState({nevent1:!0,nprofile1:!0,naddr1:!0,links:!0,images:!0,tags:!0,videos:!0,youtube:!0,tweet:!0,bolt11:!0,nsecReject:!0,fileUpload:!0}),[a,l]=ee.useState(!1),u=ee.useRef(""),c=ee.useMemo(()=>n==="text"?[uw.configure({heading:!1,bold:!1,italic:!1,strike:!1,listItem:!1,bulletList:!1,orderedList:!1,code:!1,codeBlock:!1,blockquote:!1})]:[A7.configure({linkify:!0,transformCopiedText:!0,transformPastedText:!0}),uw],[n]),f=qH({autofocus:!0,extensions:[...c,Hw.configure({extend:{bolt11:{addNodeView:()=>hs(cme)},naddr:{addNodeView:()=>hs(Nme)},nevent:{addNodeView:()=>hs(j2e)},image:{addNodeView:()=>hs(ume)},video:{addNodeView:()=>hs(W2e)},tweet:{addNodeView:()=>hs(H2e)},youtube:{addNodeView:()=>hs(J2e)},nprofile:{addNodeView:()=>hs(Ome),addProseMirrorPlugins(){return[KW({char:"@",editor:this.editor,pluginKey:new xo("@"),command:({editor:p,range:m,props:b})=>{var g,x;const y=p.view.state.selection.$to.nodeAfter;((g=y==null?void 0:y.text)==null?void 0:g.startsWith(" "))&&(m.to+=1);const w={pubkey:b.pubkey,relays:["wss://purplepag.es","wss://relay.nostr.band"]};w.nprofile="nostr:"+F9.nprofileEncode(w),p.chain().focus().insertContentAt(m,[{type:"nprofile",attrs:w},{type:"text",text:" "}]).run(),(x=window.getSelection())==null||x.collapseToEnd()},render:()=>{let p,m;return{onStart:b=>{p=new TO(U2e,{props:b,editor:b.editor}),m=$c("body",{getReferenceClientRect:b.clientRect,appendTo:()=>document.body,content:p.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"})},onUpdate:b=>{p.updateProps(b),b.clientRect&&m[0].setProps({getReferenceClientRect:b.clientRect})},onKeyDown:b=>{var y,v;return b.event.key==="Escape"?(m[0].hide(),!0):(v=(y=p.ref)==null?void 0:y.onKeyDown)==null?void 0:v.call(y,b)},onExit(){m[0].destroy(),p.destroy()}}}})]}}},link:{autolink:n==="markdown"},fileUpload:s.fileUpload!==!1&&{immediateUpload:!1,sign:async p=>"nostr"in window?await window.nostr.signEvent(p):(console.error("No nostr extension found"),Promise.reject("No signer found, install a nostr browser extension")),onDrop(){l(!0)},onComplete(p){console.log("Upload Completed",p.getText()),l(!1)}}})],onUpdate:()=>{d()}},[c]),d=ee.useCallback(()=>{f&&(u.current=f.getText(),e(n==="text"?f.getText({blockSeparator:` -`}):f.storage.markdown.getMarkdown()),o(JSON.parse(JSON.stringify((f==null?void 0:f.getJSON().content)||{}))))},[n,f]),h=ee.useCallback(p=>{r(p),e("")},[n]);return _.jsxs("div",{className:"flex flex-row",children:[_.jsxs("main",{className:"fixed overflow-y-auto h-full w-1/2 p-4",children:[_.jsxs("div",{className:"flex flex-row items-center justify-between bg-black text-white py-1 px-4 rounded-tl-lg rounded-tr-lg",children:[_.jsx("h4",{className:"bg-white/20 inline px-2 rounded-full pb-0.5",children:"nostr-editor"}),_.jsxs("a",{href:"https://github.com/cesardeazevedo/nostr-editor",target:"_blank",rel:"noopener noreferrer",className:"flex flex-row items-center no-underline px-2 bg-white/20 rounded-full p-0.5 text-inherit",children:[_.jsx(JB,{className:"mr-1",size:20,strokeWidth:"1.5"}),"Github"]})]}),_.jsxs("div",{className:"mb-2 z-20 relative border border-gray-100 border-solid rounded-bl-2xl rounded-br-2xl p-8",children:[_.jsxs("div",{className:"",children:[_.jsxs("div",{children:[_.jsx(No,{isActive:n==="text",onClick:()=>h("text"),children:"Text"}),_.jsx(No,{isActive:n==="markdown",onClick:()=>h("markdown"),children:"Markdown"})]}),_.jsx(No,{onClick:()=>{f.chain().insertContent({type:"text",text:" "}).insertNEvent({nevent:sF}).run()},children:"Add NEvent"}),_.jsx(No,{onClick:()=>{f.chain().insertNProfile({nprofile:oF}).focus().run()},children:"Add NProfile"}),_.jsx(No,{onClick:()=>{f.chain().insertContent({type:"text",text:" "}).insertNAddr({naddr:aF}).focus().run()},children:"Add NAddr"}),_.jsx(No,{onClick:()=>f.chain().insertContent({type:"text",text:" "}).insertBolt11({lnbc:lF}).focus().run(),children:"Add Bolt11"}),_.jsx(No,{onClick:()=>f.chain().selectFile().run(),children:"Add Media"}),_.jsx(No,{onClick:()=>f.chain().uploadFiles().run(),children:"Upload"}),_.jsx(No,{disabled:a,onClick:()=>{},children:"Sign"})]}),_.jsx($H,{editor:f,id:"editor",className:"text-lg font-normal"})]}),_.jsx(X2e,{})]}),_.jsxs(K2e,{children:[t&&_.jsxs(_.Fragment,{children:[_.jsx("h3",{children:n==="text"?"editor.getText()":"editor.storage.markdown.getMarkdown()"}),_.jsx("pre",{className:"break-all mt-2 text-wrap",children:t})]}),i&&_.jsxs("div",{className:"text-left pl-0 mt-5",children:[_.jsx("h3",{className:"mb-2",children:"editor.getJSON()"}),_.jsx(cue,{src:i})]})]})]})}F2.createRoot(document.getElementById("root")).render(_.jsx(eve,{})); + `}),n&&_.jsx("div",{className:"overflow-hidden rounded-lg",children:_.jsx(U2e,{id:n,title:""})})]})}const V2e=function(e){const{schema:n}=e;return _.jsx(_.Fragment,{children:n.content.map((r,i)=>_.jsxs(tt.Fragment,{children:[r.type==="heading"&&_.jsx(qge,{node:r}),r.type==="paragraph"&&_.jsx(WE,{node:r}),r.type==="horizontalRule"&&_.jsx("hr",{className:"mt-6 mb-6"}),r.type==="image"&&_.jsx(R7,{src:r.attrs.src}),r.type==="video"&&_.jsx(nF,{src:r.attrs.src}),r.type==="nevent"&&_.jsx(iF,{...r.attrs}),r.type==="orderedList"&&_.jsx(YA,{type:"ol",node:r}),r.type==="bulletList"&&_.jsx(YA,{type:"ul",node:r}),r.type==="codeBlock"&&_.jsx(PR,{node:r}),r.type==="blockquote"&&_.jsx(zge,{node:r}),r.type==="tweet"&&_.jsx(tF,{src:r.attrs.src}),r.type==="youtube"&&_.jsx(rF,{src:r.attrs.src})]},r.type+i))})};function iF(t){const{id:e,relays:n,author:r}=t,[i,o]=ee.useState(),s=FE(r,n),a=LE(s);ee.useEffect(()=>{const d=RE.subscribeMany([...n,"wss://relay.damus.io"],[{ids:[e]}],{onevent(h){o(h)}});return()=>d.close()},[e,r,n]);const l=ee.useMemo(()=>{if(i!=null&&i.content){const d=i.kind===30023?[uw,A7,Hw]:[Lme,IO,Pme,Bme,Hw],h=new aO({extensions:d});return h.commands.setEventContent(i),h.getJSON()}},[i==null?void 0:i.content]),u=(a==null?void 0:a.display_name)||(a==null?void 0:a.name)||"",c=a==null?void 0:a.picture,f=ee.useMemo(()=>{var d;return s?(d=Re.fromSeconds(s.created_at).toRelative({style:"narrow"}))==null?void 0:d.replace("ago",""):null},[s]);return _.jsxs("div",{className:"relative px-4 py-4 my-2 border rounded-xl w-full l",children:[!i&&"Loading",i&&_.jsxs(_.Fragment,{children:[_.jsxs("div",{className:"flex flex-row items-center py-2",children:[_.jsx("img",{className:"w-8 rounded-full mr-4",src:c}),_.jsx("div",{children:u}),_.jsx("div",{className:"text-xs text-gray-500 ml-2",children:f})]}),l&&_.jsx(V2e,{schema:l})]})]})}function H2e(t){const e=t.node.attrs;return _.jsx(_a,{as:"div","data-nevent":e.nevent,"data-drag-handle":"",draggable:t.node.type.spec.draggable,children:_.jsxs("div",{className:`relative select-none w-10/12 rounded-xl ${t.selected?"bg-blue-100":""}`,children:[_.jsx(iF,{...e}),_.jsx(ey,{onClick:()=>t.deleteNode()})]})})}function W2e(t,e=500){const[n,r]=ee.useState(t),i=ee.useRef(null);return ee.useEffect(()=>{const o=Date.now();if(i.current&&o>=i.current+e)i.current=o,r(t);else{const s=window.setTimeout(()=>{i.current=o,r(t)},e);return()=>window.clearTimeout(s)}},[t,e]),n}function J2e(t){const[e,n]=ee.useState([]),r=W2e(t,500);return ee.useEffect(()=>{if(r){n([]);const i=RE.subscribeMany(["wss://relay.nostr.band"],[{kinds:[0],search:r}],{onevent:o=>{n(s=>[...s,o])}});return()=>i.close()}},[r]),e}const K2e=ee.forwardRef(function(e,n){const[r,i]=ee.useState(0),o=J2e(e.query),s=c=>{const f=o[c];f&&e.command(f)},a=()=>{i((r+o.length-1)%o.length)},l=()=>{i((r+1)%o.length)},u=()=>{s(r)};return ee.useEffect(()=>i(0),[o]),ee.useImperativeHandle(n,()=>({onKeyDown:({event:c})=>c.key==="ArrowUp"?(a(),!0):c.key==="ArrowDown"?(l(),!0):c.key==="Enter"?(u(),!0):!1})),_.jsx("div",{className:"flex flex-col items-start bg-white py-1 rounded-lg border border-solid border-gray-300",children:o.map((c,f)=>{const{name:d,display_name:h}=JSON.parse(c.content);return _.jsx("div",{className:`px-3 py-2 w-full text-left justify-start items-start hover:bg-gray-100 cursor-pointer ${f===r?"bg-gray-100":""}`,onClick:()=>s(f),children:h||d},f)})})});function G2e(t){const{src:e}=t.node.attrs;return _.jsx(_a,{"data-drag-handle":"",draggable:t.node.type.spec.draggable,children:_.jsx(tF,{src:e})})}function Z2e(t){const{src:e,alt:n,sha256:r,uploadError:i,uploadUrl:o,uploading:s}=t.node.attrs;return _.jsxs(_a,{"data-drag-handle":"",draggable:t.node.type.spec.draggable,className:`relative w-fit h-fit ${t.selected?"opacity-90":""}`,children:[_.jsx(ey,{onClick:()=>t.deleteNode()}),_.jsx(I7,{uploading:s}),_.jsx(nF,{controls:!1,src:e}),_.jsxs(M7,{children:[r?_.jsx("div",{}):_.jsx(T7,{value:n,onChange:a=>t.updateAttributes({alt:a})}),!r&&_.jsx($7,{uploadUrl:o,onChange:(a,l)=>t.updateAttributes({uploadType:a,uploadUrl:l})}),r&&_.jsx("span",{"data-tooltip":e,children:_.jsx(G1,{size:26,strokeWidth:"2.5",className:"p-1 flex flex-row justify-between rounded-full border border-white/20 bg-black text-green-300 text-xs right-2 bottom-2 z-50"})}),i&&_.jsx("span",{"data-tooltip":i,className:"",children:_.jsx(xT,{size:28,strokeWidth:"1.5",className:"border border-white/20 bg-black rounded-full py-1 ml-1 text-red-500 relative top-0"})})]})]})}function Y2e(t){const e=t.node.attrs;return _.jsx(_a,{as:"div","data-drag-handle":"",draggable:t.node.type.spec.draggable,children:_.jsxs("div",{className:`relative select-none w-10/12 rounded-xl ${t.selected?"bg-blue-100":""}`,children:[_.jsx(ey,{onClick:()=>t.deleteNode()}),_.jsx(rF,{...e})]})})}function No(t){return _.jsx("button",{disabled:t.disabled,className:`rounded-lg p-1 mb-1 mr-1 text-sm bg-gray-100 ${t.isActive?"bg-indigo-600 text-white":"bg-gray-200"} disabled:line-through disabled:bg-gray-50`,onClick:t.onClick,children:t.children})}function Q2e(t){return _.jsx("nav",{className:"fixed overflow-y-auto h-full right-0 w-1/2 bg-gray-100 p-4",children:t.children})}const oF="nostr:nprofile1qy88wumn8ghj7mn0wvhxcmmv9uq32amnwvaz7tmjv4kxz7fwv3sk6atn9e5k7tcprfmhxue69uhhyetvv9ujuem9w3skccne9e3k7mf0wccsqgxxvqas78x0a339m8qgkaf7fam5atmarne8dy3rzfd4l4x6w2qpncmfs8zh",X2e="nostr:nprofile1qyd8wumn8ghj7urewfsk66ty9enxjct5dfskvtnrdakj7qgmwaehxw309aex2mrp0yh8wetnw3jhymnzw33jucm0d5hsz9thwden5te0wfjkccte9ejxzmt4wvhxjme0qqsrhuxx8l9ex335q7he0f09aej04zpazpl0ne2cgukyawd24mayt8gfnma0u",eve="nostr:nprofile1qyfhwumn8ghj7ur4wfcxcetsv9njuetn9uqsuamnwvaz7tmwdaejumr0dshsz9mhwden5te0wfjkccte9ec8y6tdv9kzumn9wshsqgyzxs0cs2mw40xjhfl3a7g24ktpeur54u2mnm6y5z0e6250h7lx5gflu83m",sF="nostr:nevent1qvzqqqqqqypzplnld0r0wvutw6alsrd5q2k7vk2nug9j7glxd6ycyp9k8nzz2wdrqyg8wumn8ghj7mn0wd68ytnhd9hx2qg5waehxw309aex2mrp0yhxgctdw4eju6t0qyxhwumn8ghj7mn0wvhxcmmvqqs9gg4thq8ng87z8377jxksjwhk9dl0f8su9c4kq335ydzp0ykmv5gqt3csa",tve="nostr:note1dezy67z2sl5yxm6scwmy6w4k0zjleyw3tnttxyduygz96cl79fnsgcsf6g",aF="nostr:naddr1qqwysetjv5syxmmdv4ejqsnfw33k76twyp38jgznwp5hyctvqgsph3c2q9yt8uckmgelu0yf7glruudvfluesqn7cuftjpwdynm2gygrqsqqqa2w4ua43m",lF="lnbc15u1p3xnhl2pp5jptserfk3zk4qy42tlucycrfwxhydvlemu9pqr93tuzlv9cc7g3sdqsvfhkcap3xyhx7un8cqzpgxqzjcsp5f8c52y2stc300gl6s4xswtjpc37hrnnr3c9wvtgjfuvqmpm35evq9qyyssqy4lgd8tj637qcjp05rdpxxykjenthxftej7a2zzmwrmrl70fyj9hvj0rewhzj7jfyuwkwcg9g2jpwtk3wkjtwnkdks84hsnu8xps5vsq4gj5hs",nve="https://image.nostr.build/87dbc55a6391d15bddda206561d53867a5679dd95e84fe8ed62bfe2e3adcadf3.jpg",rve=()=>{const[t,e]=ee.useState(!1);return _.jsxs(_.Fragment,{children:[_.jsxs("div",{className:"flex flex-row items-center justify-start mt-4",children:[_.jsx("button",{className:"hover:bg-gray-200 rounded-full w-6 h-6 mr-2",onClick:()=>e(n=>!n),children:t?_.jsx(wT,{}):_.jsx(HB,{})}),_.jsx("h6",{className:"text-gray-800",children:"Testing text"})]}),t&&_.jsxs("span",{id:"raw",className:"text-xs break-words text-wrap relative",children:["Try copy & paste some of text below into the editor. ",_.jsx("br",{}),"Hello ",oF," ",X2e," ",eve," ",sF," ",tve," ",_.jsx("br",{}),aF,_.jsx("br",{}),nve,_.jsx("br",{}),lF]})]})};function ive(){const[t,e]=ee.useState(""),[n,r]=ee.useState("text"),[i,o]=ee.useState({}),[s]=ee.useState({nevent1:!0,nprofile1:!0,naddr1:!0,links:!0,images:!0,tags:!0,videos:!0,youtube:!0,tweet:!0,bolt11:!0,nsecReject:!0,fileUpload:!0}),[a,l]=ee.useState(!1),u=ee.useRef(""),c=ee.useMemo(()=>n==="text"?[uw.configure({heading:!1,bold:!1,italic:!1,strike:!1,listItem:!1,bulletList:!1,orderedList:!1,code:!1,codeBlock:!1,blockquote:!1})]:[uw,A7.configure({transformCopiedText:!0,transformPastedText:!0})],[n]),f=qH({autofocus:!0,extensions:[...c,Hw.configure({extend:{bolt11:{addNodeView:()=>hs(pme)},naddr:{addNodeView:()=>hs(Fme)},nevent:{addNodeView:()=>hs(H2e)},image:{addNodeView:()=>hs(hme)},video:{addNodeView:()=>hs(Z2e)},tweet:{addNodeView:()=>hs(G2e)},youtube:{addNodeView:()=>hs(Y2e)},nprofile:{addNodeView:()=>hs(Ime),addProseMirrorPlugins(){return[KW({char:"@",editor:this.editor,pluginKey:new xo("@"),command:({editor:p,range:m,props:b})=>{var g,x;const y=p.view.state.selection.$to.nodeAfter;((g=y==null?void 0:y.text)==null?void 0:g.startsWith(" "))&&(m.to+=1);const w={pubkey:b.pubkey,relays:["wss://purplepag.es","wss://relay.nostr.band"]};w.nprofile="nostr:"+F9.nprofileEncode(w),p.chain().focus().insertContentAt(m,[{type:"nprofile",attrs:w},{type:"text",text:" "}]).run(),(x=window.getSelection())==null||x.collapseToEnd()},render:()=>{let p,m;return{onStart:b=>{p=new TO(K2e,{props:b,editor:b.editor}),m=$c("body",{getReferenceClientRect:b.clientRect,appendTo:()=>document.body,content:p.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"})},onUpdate:b=>{p.updateProps(b),b.clientRect&&m[0].setProps({getReferenceClientRect:b.clientRect})},onKeyDown:b=>{var y,v;return b.event.key==="Escape"?(m[0].hide(),!0):(v=(y=p.ref)==null?void 0:y.onKeyDown)==null?void 0:v.call(y,b)},onExit(){m[0].destroy(),p.destroy()}}}})]}}},link:{autolink:n==="markdown"},video:{defaultUploadUrl:"https://nostr.build",defaultUploadType:"nip96"},image:{defaultUploadUrl:"https://nostr.build",defaultUploadType:"nip96"},fileUpload:s.fileUpload!==!1&&{immediateUpload:!1,sign:async p=>"nostr"in window?await window.nostr.signEvent(p):(console.error("No nostr extension found"),Promise.reject("No signer found, install a nostr browser extension")),onDrop(){l(!0)},onComplete(p){console.log("Upload Completed",p.getText()),l(!1)}}})],onUpdate:()=>{d()}},[c]),d=ee.useCallback(()=>{f&&(u.current=f.getText(),e(n==="text"?f.getText({blockSeparator:` +`}):f.storage.markdown.getMarkdown()),o(JSON.parse(JSON.stringify((f==null?void 0:f.getJSON().content)||{}))))},[n,f]),h=ee.useCallback(p=>{r(p),e("")},[n]);return _.jsxs("div",{className:"flex flex-row",children:[_.jsxs("main",{className:"fixed overflow-y-auto h-full w-1/2 p-4",children:[_.jsxs("div",{className:"flex flex-row items-center justify-between bg-black text-white py-1 px-4 rounded-tl-lg rounded-tr-lg",children:[_.jsx("h4",{className:"bg-white/20 inline px-2 rounded-full pb-0.5",children:"nostr-editor"}),_.jsxs("a",{href:"https://github.com/cesardeazevedo/nostr-editor",target:"_blank",rel:"noopener noreferrer",className:"flex flex-row items-center no-underline px-2 bg-white/20 rounded-full p-0.5 text-inherit",children:[_.jsx(JB,{className:"mr-1",size:20,strokeWidth:"1.5"}),"Github"]})]}),_.jsxs("div",{className:"mb-2 z-20 relative border border-gray-100 border-solid rounded-bl-2xl rounded-br-2xl p-8",children:[_.jsxs("div",{className:"",children:[_.jsxs("div",{children:[_.jsx(No,{isActive:n==="text",onClick:()=>h("text"),children:"Text"}),_.jsx(No,{isActive:n==="markdown",onClick:()=>h("markdown"),children:"Markdown"})]}),_.jsx(No,{onClick:()=>{f.chain().insertContent({type:"text",text:" "}).insertNEvent({nevent:sF}).run()},children:"Add NEvent"}),_.jsx(No,{onClick:()=>{f.chain().insertNProfile({nprofile:oF}).focus().run()},children:"Add NProfile"}),_.jsx(No,{onClick:()=>{f.chain().insertContent({type:"text",text:" "}).insertNAddr({naddr:aF}).focus().run()},children:"Add NAddr"}),_.jsx(No,{onClick:()=>f.chain().insertContent({type:"text",text:" "}).insertBolt11({lnbc:lF}).focus().run(),children:"Add Bolt11"}),_.jsx(No,{onClick:()=>f.chain().selectFiles().run(),children:"Add Media"}),_.jsx(No,{onClick:()=>f.chain().uploadFiles().run(),children:"Upload"}),_.jsx(No,{disabled:a,onClick:()=>{},children:"Sign"})]}),_.jsx($H,{editor:f,id:"editor",className:"text-lg font-normal"})]}),_.jsx(rve,{})]}),_.jsxs(Q2e,{children:[t&&_.jsxs(_.Fragment,{children:[_.jsx("h3",{children:n==="text"?"editor.getText()":"editor.storage.markdown.getMarkdown()"}),_.jsx("pre",{className:"break-all mt-2 text-wrap",children:t})]}),i&&_.jsxs("div",{className:"text-left pl-0 mt-5",children:[_.jsx("h3",{className:"mb-2",children:"editor.getJSON()"}),_.jsx(pue,{src:i})]})]})]})}F2.createRoot(document.getElementById("root")).render(_.jsx(ive,{})); diff --git a/index.html b/index.html index 05cb9d4..79b2caa 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,7 @@ nostr-editor - +