@aprovan/patchwork-chat 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1434 @@
1
+ var wN=Object.defineProperty;var CN=(e,t,n)=>t in e?wN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var So=(e,t,n)=>CN(e,typeof t!="symbol"?t+"":t,n);function SN(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(e,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();function Ra(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var E0={exports:{}},Ou={},_0={exports:{}},Dt={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var yk;function EN(){if(yk)return Dt;yk=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),s=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),h=Symbol.iterator;function m(W){return W===null||typeof W!="object"?null:(W=h&&W[h]||W["@@iterator"],typeof W=="function"?W:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,b={};function v(W,ie,P){this.props=W,this.context=ie,this.refs=b,this.updater=P||g}v.prototype.isReactComponent={},v.prototype.setState=function(W,ie){if(typeof W!="object"&&typeof W!="function"&&W!=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,W,ie,"setState")},v.prototype.forceUpdate=function(W){this.updater.enqueueForceUpdate(this,W,"forceUpdate")};function C(){}C.prototype=v.prototype;function _(W,ie,P){this.props=W,this.context=ie,this.refs=b,this.updater=P||g}var E=_.prototype=new C;E.constructor=_,x(E,v.prototype),E.isPureReactComponent=!0;var I=Array.isArray,N=Object.prototype.hasOwnProperty,M={current:null},F={key:!0,ref:!0,__self:!0,__source:!0};function R(W,ie,P){var Ze,V={},Re=null,pe=null;if(ie!=null)for(Ze in ie.ref!==void 0&&(pe=ie.ref),ie.key!==void 0&&(Re=""+ie.key),ie)N.call(ie,Ze)&&!F.hasOwnProperty(Ze)&&(V[Ze]=ie[Ze]);var Pe=arguments.length-2;if(Pe===1)V.children=P;else if(1<Pe){for(var je=Array(Pe),$e=0;$e<Pe;$e++)je[$e]=arguments[$e+2];V.children=je}if(W&&W.defaultProps)for(Ze in Pe=W.defaultProps,Pe)V[Ze]===void 0&&(V[Ze]=Pe[Ze]);return{$$typeof:e,type:W,key:Re,ref:pe,props:V,_owner:M.current}}function D(W,ie){return{$$typeof:e,type:W.type,key:ie,ref:W.ref,props:W.props,_owner:W._owner}}function L(W){return typeof W=="object"&&W!==null&&W.$$typeof===e}function X(W){var ie={"=":"=0",":":"=2"};return"$"+W.replace(/[=:]/g,function(P){return ie[P]})}var ee=/\/+/g;function Ie(W,ie){return typeof W=="object"&&W!==null&&W.key!=null?X(""+W.key):ie.toString(36)}function he(W,ie,P,Ze,V){var Re=typeof W;(Re==="undefined"||Re==="boolean")&&(W=null);var pe=!1;if(W===null)pe=!0;else switch(Re){case"string":case"number":pe=!0;break;case"object":switch(W.$$typeof){case e:case t:pe=!0}}if(pe)return pe=W,V=V(pe),W=Ze===""?"."+Ie(pe,0):Ze,I(V)?(P="",W!=null&&(P=W.replace(ee,"$&/")+"/"),he(V,ie,P,"",function($e){return $e})):V!=null&&(L(V)&&(V=D(V,P+(!V.key||pe&&pe.key===V.key?"":(""+V.key).replace(ee,"$&/")+"/")+W)),ie.push(V)),1;if(pe=0,Ze=Ze===""?".":Ze+":",I(W))for(var Pe=0;Pe<W.length;Pe++){Re=W[Pe];var je=Ze+Ie(Re,Pe);pe+=he(Re,ie,P,je,V)}else if(je=m(W),typeof je=="function")for(W=je.call(W),Pe=0;!(Re=W.next()).done;)Re=Re.value,je=Ze+Ie(Re,Pe++),pe+=he(Re,ie,P,je,V);else if(Re==="object")throw ie=String(W),Error("Objects are not valid as a React child (found: "+(ie==="[object Object]"?"object with keys {"+Object.keys(W).join(", ")+"}":ie)+"). If you meant to render a collection of children, use an array instead.");return pe}function Z(W,ie,P){if(W==null)return W;var Ze=[],V=0;return he(W,Ze,"","",function(Re){return ie.call(P,Re,V++)}),Ze}function ge(W){if(W._status===-1){var ie=W._result;ie=ie(),ie.then(function(P){(W._status===0||W._status===-1)&&(W._status=1,W._result=P)},function(P){(W._status===0||W._status===-1)&&(W._status=2,W._result=P)}),W._status===-1&&(W._status=0,W._result=ie)}if(W._status===1)return W._result.default;throw W._result}var Oe={current:null},Y={transition:null},qe={ReactCurrentDispatcher:Oe,ReactCurrentBatchConfig:Y,ReactCurrentOwner:M};function O(){throw Error("act(...) is not supported in production builds of React.")}return Dt.Children={map:Z,forEach:function(W,ie,P){Z(W,function(){ie.apply(this,arguments)},P)},count:function(W){var ie=0;return Z(W,function(){ie++}),ie},toArray:function(W){return Z(W,function(ie){return ie})||[]},only:function(W){if(!L(W))throw Error("React.Children.only expected to receive a single React element child.");return W}},Dt.Component=v,Dt.Fragment=n,Dt.Profiler=i,Dt.PureComponent=_,Dt.StrictMode=r,Dt.Suspense=u,Dt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=qe,Dt.act=O,Dt.cloneElement=function(W,ie,P){if(W==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+W+".");var Ze=x({},W.props),V=W.key,Re=W.ref,pe=W._owner;if(ie!=null){if(ie.ref!==void 0&&(Re=ie.ref,pe=M.current),ie.key!==void 0&&(V=""+ie.key),W.type&&W.type.defaultProps)var Pe=W.type.defaultProps;for(je in ie)N.call(ie,je)&&!F.hasOwnProperty(je)&&(Ze[je]=ie[je]===void 0&&Pe!==void 0?Pe[je]:ie[je])}var je=arguments.length-2;if(je===1)Ze.children=P;else if(1<je){Pe=Array(je);for(var $e=0;$e<je;$e++)Pe[$e]=arguments[$e+2];Ze.children=Pe}return{$$typeof:e,type:W.type,key:V,ref:Re,props:Ze,_owner:pe}},Dt.createContext=function(W){return W={$$typeof:s,_currentValue:W,_currentValue2:W,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},W.Provider={$$typeof:o,_context:W},W.Consumer=W},Dt.createElement=R,Dt.createFactory=function(W){var ie=R.bind(null,W);return ie.type=W,ie},Dt.createRef=function(){return{current:null}},Dt.forwardRef=function(W){return{$$typeof:a,render:W}},Dt.isValidElement=L,Dt.lazy=function(W){return{$$typeof:f,_payload:{_status:-1,_result:W},_init:ge}},Dt.memo=function(W,ie){return{$$typeof:d,type:W,compare:ie===void 0?null:ie}},Dt.startTransition=function(W){var ie=Y.transition;Y.transition={};try{W()}finally{Y.transition=ie}},Dt.unstable_act=O,Dt.useCallback=function(W,ie){return Oe.current.useCallback(W,ie)},Dt.useContext=function(W){return Oe.current.useContext(W)},Dt.useDebugValue=function(){},Dt.useDeferredValue=function(W){return Oe.current.useDeferredValue(W)},Dt.useEffect=function(W,ie){return Oe.current.useEffect(W,ie)},Dt.useId=function(){return Oe.current.useId()},Dt.useImperativeHandle=function(W,ie,P){return Oe.current.useImperativeHandle(W,ie,P)},Dt.useInsertionEffect=function(W,ie){return Oe.current.useInsertionEffect(W,ie)},Dt.useLayoutEffect=function(W,ie){return Oe.current.useLayoutEffect(W,ie)},Dt.useMemo=function(W,ie){return Oe.current.useMemo(W,ie)},Dt.useReducer=function(W,ie,P){return Oe.current.useReducer(W,ie,P)},Dt.useRef=function(W){return Oe.current.useRef(W)},Dt.useState=function(W){return Oe.current.useState(W)},Dt.useSyncExternalStore=function(W,ie,P){return Oe.current.useSyncExternalStore(W,ie,P)},Dt.useTransition=function(){return Oe.current.useTransition()},Dt.version="18.3.1",Dt}var xk;function Kc(){return xk||(xk=1,_0.exports=EN()),_0.exports}/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var bk;function _N(){if(bk)return Ou;bk=1;var e=Kc(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(a,u,d){var f,h={},m=null,g=null;d!==void 0&&(m=""+d),u.key!==void 0&&(m=""+u.key),u.ref!==void 0&&(g=u.ref);for(f in u)r.call(u,f)&&!o.hasOwnProperty(f)&&(h[f]=u[f]);if(a&&a.defaultProps)for(f in u=a.defaultProps,u)h[f]===void 0&&(h[f]=u[f]);return{$$typeof:t,type:a,key:m,ref:g,props:h,_owner:i.current}}return Ou.Fragment=n,Ou.jsx=s,Ou.jsxs=s,Ou}var vk;function TN(){return vk||(vk=1,E0.exports=_N()),E0.exports}var w=TN(),A=Kc();const jo=Ra(A),cy=SN({__proto__:null,default:jo},[A]);var xf={},T0={exports:{}},Pr={},A0={exports:{}},M0={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var kk;function AN(){return kk||(kk=1,(function(e){function t(Y,qe){var O=Y.length;Y.push(qe);e:for(;0<O;){var W=O-1>>>1,ie=Y[W];if(0<i(ie,qe))Y[W]=qe,Y[O]=ie,O=W;else break e}}function n(Y){return Y.length===0?null:Y[0]}function r(Y){if(Y.length===0)return null;var qe=Y[0],O=Y.pop();if(O!==qe){Y[0]=O;e:for(var W=0,ie=Y.length,P=ie>>>1;W<P;){var Ze=2*(W+1)-1,V=Y[Ze],Re=Ze+1,pe=Y[Re];if(0>i(V,O))Re<ie&&0>i(pe,V)?(Y[W]=pe,Y[Re]=O,W=Re):(Y[W]=V,Y[Ze]=O,W=Ze);else if(Re<ie&&0>i(pe,O))Y[W]=pe,Y[Re]=O,W=Re;else break e}}return qe}function i(Y,qe){var O=Y.sortIndex-qe.sortIndex;return O!==0?O:Y.id-qe.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var u=[],d=[],f=1,h=null,m=3,g=!1,x=!1,b=!1,v=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function E(Y){for(var qe=n(d);qe!==null;){if(qe.callback===null)r(d);else if(qe.startTime<=Y)r(d),qe.sortIndex=qe.expirationTime,t(u,qe);else break;qe=n(d)}}function I(Y){if(b=!1,E(Y),!x)if(n(u)!==null)x=!0,ge(N);else{var qe=n(d);qe!==null&&Oe(I,qe.startTime-Y)}}function N(Y,qe){x=!1,b&&(b=!1,C(R),R=-1),g=!0;var O=m;try{for(E(qe),h=n(u);h!==null&&(!(h.expirationTime>qe)||Y&&!X());){var W=h.callback;if(typeof W=="function"){h.callback=null,m=h.priorityLevel;var ie=W(h.expirationTime<=qe);qe=e.unstable_now(),typeof ie=="function"?h.callback=ie:h===n(u)&&r(u),E(qe)}else r(u);h=n(u)}if(h!==null)var P=!0;else{var Ze=n(d);Ze!==null&&Oe(I,Ze.startTime-qe),P=!1}return P}finally{h=null,m=O,g=!1}}var M=!1,F=null,R=-1,D=5,L=-1;function X(){return!(e.unstable_now()-L<D)}function ee(){if(F!==null){var Y=e.unstable_now();L=Y;var qe=!0;try{qe=F(!0,Y)}finally{qe?Ie():(M=!1,F=null)}}else M=!1}var Ie;if(typeof _=="function")Ie=function(){_(ee)};else if(typeof MessageChannel<"u"){var he=new MessageChannel,Z=he.port2;he.port1.onmessage=ee,Ie=function(){Z.postMessage(null)}}else Ie=function(){v(ee,0)};function ge(Y){F=Y,M||(M=!0,Ie())}function Oe(Y,qe){R=v(function(){Y(e.unstable_now())},qe)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(Y){Y.callback=null},e.unstable_continueExecution=function(){x||g||(x=!0,ge(N))},e.unstable_forceFrameRate=function(Y){0>Y||125<Y?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<Y?Math.floor(1e3/Y):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(Y){switch(m){case 1:case 2:case 3:var qe=3;break;default:qe=m}var O=m;m=qe;try{return Y()}finally{m=O}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(Y,qe){switch(Y){case 1:case 2:case 3:case 4:case 5:break;default:Y=3}var O=m;m=Y;try{return qe()}finally{m=O}},e.unstable_scheduleCallback=function(Y,qe,O){var W=e.unstable_now();switch(typeof O=="object"&&O!==null?(O=O.delay,O=typeof O=="number"&&0<O?W+O:W):O=W,Y){case 1:var ie=-1;break;case 2:ie=250;break;case 5:ie=1073741823;break;case 4:ie=1e4;break;default:ie=5e3}return ie=O+ie,Y={id:f++,callback:qe,priorityLevel:Y,startTime:O,expirationTime:ie,sortIndex:-1},O>W?(Y.sortIndex=O,t(d,Y),n(u)===null&&Y===n(d)&&(b?(C(R),R=-1):b=!0,Oe(I,O-W))):(Y.sortIndex=ie,t(u,Y),x||g||(x=!0,ge(N))),Y},e.unstable_shouldYield=X,e.unstable_wrapCallback=function(Y){var qe=m;return function(){var O=m;m=qe;try{return Y.apply(this,arguments)}finally{m=O}}}})(M0)),M0}var wk;function MN(){return wk||(wk=1,A0.exports=AN()),A0.exports}/**
26
+ * @license React
27
+ * react-dom.production.min.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var Ck;function NN(){if(Ck)return Pr;Ck=1;var e=Kc(),t=MN();function n(l){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+l,p=1;p<arguments.length;p++)c+="&args[]="+encodeURIComponent(arguments[p]);return"Minified React error #"+l+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,i={};function o(l,c){s(l,c),s(l+"Capture",c)}function s(l,c){for(i[l]=c,l=0;l<c.length;l++)r.add(c[l])}var a=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u=Object.prototype.hasOwnProperty,d=/^[: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]*$/,f={},h={};function m(l){return u.call(h,l)?!0:u.call(f,l)?!1:d.test(l)?h[l]=!0:(f[l]=!0,!1)}function g(l,c,p,y){if(p!==null&&p.type===0)return!1;switch(typeof c){case"function":case"symbol":return!0;case"boolean":return y?!1:p!==null?!p.acceptsBooleans:(l=l.toLowerCase().slice(0,5),l!=="data-"&&l!=="aria-");default:return!1}}function x(l,c,p,y){if(c===null||typeof c>"u"||g(l,c,p,y))return!0;if(y)return!1;if(p!==null)switch(p.type){case 3:return!c;case 4:return c===!1;case 5:return isNaN(c);case 6:return isNaN(c)||1>c}return!1}function b(l,c,p,y,k,S,T){this.acceptsBooleans=c===2||c===3||c===4,this.attributeName=y,this.attributeNamespace=k,this.mustUseProperty=p,this.propertyName=l,this.type=c,this.sanitizeURL=S,this.removeEmptyString=T}var v={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(l){v[l]=new b(l,0,!1,l,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(l){var c=l[0];v[c]=new b(c,1,!1,l[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(l){v[l]=new b(l,2,!1,l.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(l){v[l]=new b(l,2,!1,l,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(l){v[l]=new b(l,3,!1,l.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(l){v[l]=new b(l,3,!0,l,null,!1,!1)}),["capture","download"].forEach(function(l){v[l]=new b(l,4,!1,l,null,!1,!1)}),["cols","rows","size","span"].forEach(function(l){v[l]=new b(l,6,!1,l,null,!1,!1)}),["rowSpan","start"].forEach(function(l){v[l]=new b(l,5,!1,l.toLowerCase(),null,!1,!1)});var C=/[\-:]([a-z])/g;function _(l){return l[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(l){var c=l.replace(C,_);v[c]=new b(c,1,!1,l,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(l){var c=l.replace(C,_);v[c]=new b(c,1,!1,l,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(l){var c=l.replace(C,_);v[c]=new b(c,1,!1,l,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(l){v[l]=new b(l,1,!1,l.toLowerCase(),null,!1,!1)}),v.xlinkHref=new b("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(l){v[l]=new b(l,1,!1,l.toLowerCase(),null,!0,!0)});function E(l,c,p,y){var k=v.hasOwnProperty(c)?v[c]:null;(k!==null?k.type!==0:y||!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(x(c,p,k,y)&&(p=null),y||k===null?m(c)&&(p===null?l.removeAttribute(c):l.setAttribute(c,""+p)):k.mustUseProperty?l[k.propertyName]=p===null?k.type===3?!1:"":p:(c=k.attributeName,y=k.attributeNamespace,p===null?l.removeAttribute(c):(k=k.type,p=k===3||k===4&&p===!0?"":""+p,y?l.setAttributeNS(y,c,p):l.setAttribute(c,p))))}var I=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,N=Symbol.for("react.element"),M=Symbol.for("react.portal"),F=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),L=Symbol.for("react.provider"),X=Symbol.for("react.context"),ee=Symbol.for("react.forward_ref"),Ie=Symbol.for("react.suspense"),he=Symbol.for("react.suspense_list"),Z=Symbol.for("react.memo"),ge=Symbol.for("react.lazy"),Oe=Symbol.for("react.offscreen"),Y=Symbol.iterator;function qe(l){return l===null||typeof l!="object"?null:(l=Y&&l[Y]||l["@@iterator"],typeof l=="function"?l:null)}var O=Object.assign,W;function ie(l){if(W===void 0)try{throw Error()}catch(p){var c=p.stack.trim().match(/\n( *(at )?)/);W=c&&c[1]||""}return`
34
+ `+W+l}var P=!1;function Ze(l,c){if(!l||P)return"";P=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(c)if(c=function(){throw Error()},Object.defineProperty(c.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(c,[])}catch(Q){var y=Q}Reflect.construct(l,[],c)}else{try{c.call()}catch(Q){y=Q}l.call(c.prototype)}else{try{throw Error()}catch(Q){y=Q}l()}}catch(Q){if(Q&&y&&typeof Q.stack=="string"){for(var k=Q.stack.split(`
35
+ `),S=y.stack.split(`
36
+ `),T=k.length-1,j=S.length-1;1<=T&&0<=j&&k[T]!==S[j];)j--;for(;1<=T&&0<=j;T--,j--)if(k[T]!==S[j]){if(T!==1||j!==1)do if(T--,j--,0>j||k[T]!==S[j]){var B=`
37
+ `+k[T].replace(" at new "," at ");return l.displayName&&B.includes("<anonymous>")&&(B=B.replace("<anonymous>",l.displayName)),B}while(1<=T&&0<=j);break}}}finally{P=!1,Error.prepareStackTrace=p}return(l=l?l.displayName||l.name:"")?ie(l):""}function V(l){switch(l.tag){case 5:return ie(l.type);case 16:return ie("Lazy");case 13:return ie("Suspense");case 19:return ie("SuspenseList");case 0:case 2:case 15:return l=Ze(l.type,!1),l;case 11:return l=Ze(l.type.render,!1),l;case 1:return l=Ze(l.type,!0),l;default:return""}}function Re(l){if(l==null)return null;if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case F:return"Fragment";case M:return"Portal";case D:return"Profiler";case R:return"StrictMode";case Ie:return"Suspense";case he:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case X:return(l.displayName||"Context")+".Consumer";case L:return(l._context.displayName||"Context")+".Provider";case ee:var c=l.render;return l=l.displayName,l||(l=c.displayName||c.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case Z:return c=l.displayName||null,c!==null?c:Re(l.type)||"Memo";case ge:c=l._payload,l=l._init;try{return Re(l(c))}catch{}}return null}function pe(l){var c=l.type;switch(l.tag){case 24:return"Cache";case 9:return(c.displayName||"Context")+".Consumer";case 10:return(c._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return l=c.render,l=l.displayName||l.name||"",c.displayName||(l!==""?"ForwardRef("+l+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Re(c);case 8:return c===R?"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 c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c}return null}function Pe(l){switch(typeof l){case"boolean":case"number":case"string":case"undefined":return l;case"object":return l;default:return""}}function je(l){var c=l.type;return(l=l.nodeName)&&l.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function $e(l){var c=je(l)?"checked":"value",p=Object.getOwnPropertyDescriptor(l.constructor.prototype,c),y=""+l[c];if(!l.hasOwnProperty(c)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var k=p.get,S=p.set;return Object.defineProperty(l,c,{configurable:!0,get:function(){return k.call(this)},set:function(T){y=""+T,S.call(this,T)}}),Object.defineProperty(l,c,{enumerable:p.enumerable}),{getValue:function(){return y},setValue:function(T){y=""+T},stopTracking:function(){l._valueTracker=null,delete l[c]}}}}function qt(l){l._valueTracker||(l._valueTracker=$e(l))}function Pn(l){if(!l)return!1;var c=l._valueTracker;if(!c)return!0;var p=c.getValue(),y="";return l&&(y=je(l)?l.checked?"true":"false":l.value),l=y,l!==p?(c.setValue(l),!0):!1}function ni(l){if(l=l||(typeof document<"u"?document:void 0),typeof l>"u")return null;try{return l.activeElement||l.body}catch{return l.body}}function uo(l,c){var p=c.checked;return O({},c,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:p??l._wrapperState.initialChecked})}function Zs(l,c){var p=c.defaultValue==null?"":c.defaultValue,y=c.checked!=null?c.checked:c.defaultChecked;p=Pe(c.value!=null?c.value:p),l._wrapperState={initialChecked:y,initialValue:p,controlled:c.type==="checkbox"||c.type==="radio"?c.checked!=null:c.value!=null}}function Js(l,c){c=c.checked,c!=null&&E(l,"checked",c,!1)}function co(l,c){Js(l,c);var p=Pe(c.value),y=c.type;if(p!=null)y==="number"?(p===0&&l.value===""||l.value!=p)&&(l.value=""+p):l.value!==""+p&&(l.value=""+p);else if(y==="submit"||y==="reset"){l.removeAttribute("value");return}c.hasOwnProperty("value")?Sr(l,c.type,p):c.hasOwnProperty("defaultValue")&&Sr(l,c.type,Pe(c.defaultValue)),c.checked==null&&c.defaultChecked!=null&&(l.defaultChecked=!!c.defaultChecked)}function fo(l,c,p){if(c.hasOwnProperty("value")||c.hasOwnProperty("defaultValue")){var y=c.type;if(!(y!=="submit"&&y!=="reset"||c.value!==void 0&&c.value!==null))return;c=""+l._wrapperState.initialValue,p||c===l.value||(l.value=c),l.defaultValue=c}p=l.name,p!==""&&(l.name=""),l.defaultChecked=!!l._wrapperState.initialChecked,p!==""&&(l.name=p)}function Sr(l,c,p){(c!=="number"||ni(l.ownerDocument)!==l)&&(p==null?l.defaultValue=""+l._wrapperState.initialValue:l.defaultValue!==""+p&&(l.defaultValue=""+p))}var wi=Array.isArray;function Er(l,c,p,y){if(l=l.options,c){c={};for(var k=0;k<p.length;k++)c["$"+p[k]]=!0;for(p=0;p<l.length;p++)k=c.hasOwnProperty("$"+l[p].value),l[p].selected!==k&&(l[p].selected=k),k&&y&&(l[p].defaultSelected=!0)}else{for(p=""+Pe(p),c=null,k=0;k<l.length;k++){if(l[k].value===p){l[k].selected=!0,y&&(l[k].defaultSelected=!0);return}c!==null||l[k].disabled||(c=l[k])}c!==null&&(c.selected=!0)}}function ri(l,c){if(c.dangerouslySetInnerHTML!=null)throw Error(n(91));return O({},c,{value:void 0,defaultValue:void 0,children:""+l._wrapperState.initialValue})}function Ks(l,c){var p=c.value;if(p==null){if(p=c.children,c=c.defaultValue,p!=null){if(c!=null)throw Error(n(92));if(wi(p)){if(1<p.length)throw Error(n(93));p=p[0]}c=p}c==null&&(c=""),p=c}l._wrapperState={initialValue:Pe(p)}}function _r(l,c){var p=Pe(c.value),y=Pe(c.defaultValue);p!=null&&(p=""+p,p!==l.value&&(l.value=p),c.defaultValue==null&&l.defaultValue!==p&&(l.defaultValue=p)),y!=null&&(l.defaultValue=""+y)}function ho(l){var c=l.textContent;c===l._wrapperState.initialValue&&c!==""&&c!==null&&(l.value=c)}function ne(l){switch(l){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function _e(l,c){return l==null||l==="http://www.w3.org/1999/xhtml"?ne(c):l==="http://www.w3.org/2000/svg"&&c==="foreignObject"?"http://www.w3.org/1999/xhtml":l}var dt,_t=(function(l){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(c,p,y,k){MSApp.execUnsafeLocalFunction(function(){return l(c,p,y,k)})}:l})(function(l,c){if(l.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in l)l.innerHTML=c;else{for(dt=dt||document.createElement("div"),dt.innerHTML="<svg>"+c.valueOf().toString()+"</svg>",c=dt.firstChild;l.firstChild;)l.removeChild(l.firstChild);for(;c.firstChild;)l.appendChild(c.firstChild)}});function jt(l,c){if(c){var p=l.firstChild;if(p&&p===l.lastChild&&p.nodeType===3){p.nodeValue=c;return}}l.textContent=c}var jn={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},Ci=["Webkit","ms","Moz","O"];Object.keys(jn).forEach(function(l){Ci.forEach(function(c){c=c+l.charAt(0).toUpperCase()+l.substring(1),jn[c]=jn[l]})});function Tr(l,c,p){return c==null||typeof c=="boolean"||c===""?"":p||typeof c!="number"||c===0||jn.hasOwnProperty(l)&&jn[l]?(""+c).trim():c+"px"}function $i(l,c){l=l.style;for(var p in c)if(c.hasOwnProperty(p)){var y=p.indexOf("--")===0,k=Tr(p,c[p],y);p==="float"&&(p="cssFloat"),y?l.setProperty(p,k):l[p]=k}}var po=O({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 zn(l,c){if(c){if(po[l]&&(c.children!=null||c.dangerouslySetInnerHTML!=null))throw Error(n(137,l));if(c.dangerouslySetInnerHTML!=null){if(c.children!=null)throw Error(n(60));if(typeof c.dangerouslySetInnerHTML!="object"||!("__html"in c.dangerouslySetInnerHTML))throw Error(n(61))}if(c.style!=null&&typeof c.style!="object")throw Error(n(62))}}function ii(l,c){if(l.indexOf("-")===-1)return typeof c.is=="string";switch(l){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 dr=null;function tu(l){return l=l.target||l.srcElement||window,l.correspondingUseElement&&(l=l.correspondingUseElement),l.nodeType===3?l.parentNode:l}var Si=null,Ei=null,_i=null;function Bo(l){if(l=xu(l)){if(typeof Si!="function")throw Error(n(280));var c=l.stateNode;c&&(c=Dd(c),Si(l.stateNode,l.type,c))}}function fd(l){Ei?_i?_i.push(l):_i=[l]:Ei=l}function hd(){if(Ei){var l=Ei,c=_i;if(_i=Ei=null,Bo(l),c)for(l=0;l<c.length;l++)Bo(c[l])}}function pd(l,c){return l(c)}function z(){}var $=!1;function q(l,c,p){if($)return l(c,p);$=!0;try{return pd(l,c,p)}finally{$=!1,(Ei!==null||_i!==null)&&(z(),hd())}}function oe(l,c){var p=l.stateNode;if(p===null)return null;var y=Dd(p);if(y===null)return null;p=y[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(y=!y.disabled)||(l=l.type,y=!(l==="button"||l==="input"||l==="select"||l==="textarea")),l=!y;break e;default:l=!1}if(l)return null;if(p&&typeof p!="function")throw Error(n(231,c,typeof p));return p}var ke=!1;if(a)try{var Te={};Object.defineProperty(Te,"passive",{get:function(){ke=!0}}),window.addEventListener("test",Te,Te),window.removeEventListener("test",Te,Te)}catch{ke=!1}function be(l,c,p,y,k,S,T,j,B){var Q=Array.prototype.slice.call(arguments,3);try{c.apply(p,Q)}catch(me){this.onError(me)}}var Be=!1,ue=null,bt=!1,wt=null,ct={onError:function(l){Be=!0,ue=l}};function zt(l,c,p,y,k,S,T,j,B){Be=!1,ue=null,be.apply(ct,arguments)}function vt(l,c,p,y,k,S,T,j,B){if(zt.apply(this,arguments),Be){if(Be){var Q=ue;Be=!1,ue=null}else throw Error(n(198));bt||(bt=!0,wt=Q)}}function kt(l){var c=l,p=l;if(l.alternate)for(;c.return;)c=c.return;else{l=c;do c=l,(c.flags&4098)!==0&&(p=c.return),l=c.return;while(l)}return c.tag===3?p:null}function It(l){if(l.tag===13){var c=l.memoizedState;if(c===null&&(l=l.alternate,l!==null&&(c=l.memoizedState)),c!==null)return c.dehydrated}return null}function Ye(l){if(kt(l)!==l)throw Error(n(188))}function on(l){var c=l.alternate;if(!c){if(c=kt(l),c===null)throw Error(n(188));return c!==l?null:l}for(var p=l,y=c;;){var k=p.return;if(k===null)break;var S=k.alternate;if(S===null){if(y=k.return,y!==null){p=y;continue}break}if(k.child===S.child){for(S=k.child;S;){if(S===p)return Ye(k),l;if(S===y)return Ye(k),c;S=S.sibling}throw Error(n(188))}if(p.return!==y.return)p=k,y=S;else{for(var T=!1,j=k.child;j;){if(j===p){T=!0,p=k,y=S;break}if(j===y){T=!0,y=k,p=S;break}j=j.sibling}if(!T){for(j=S.child;j;){if(j===p){T=!0,p=S,y=k;break}if(j===y){T=!0,y=S,p=k;break}j=j.sibling}if(!T)throw Error(n(189))}}if(p.alternate!==y)throw Error(n(190))}if(p.tag!==3)throw Error(n(188));return p.stateNode.current===p?l:c}function Ke(l){return l=on(l),l!==null?Je(l):null}function Je(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){var c=Je(l);if(c!==null)return c;l=l.sibling}return null}var Ae=t.unstable_scheduleCallback,ce=t.unstable_cancelCallback,G=t.unstable_shouldYield,ae=t.unstable_requestPaint,se=t.unstable_now,ze=t.unstable_getCurrentPriorityLevel,Fe=t.unstable_ImmediatePriority,le=t.unstable_UserBlockingPriority,ye=t.unstable_NormalPriority,Le=t.unstable_LowPriority,U=t.unstable_IdlePriority,te=null,Me=null;function De(l){if(Me&&typeof Me.onCommitFiberRoot=="function")try{Me.onCommitFiberRoot(te,l,void 0,(l.current.flags&128)===128)}catch{}}var Qe=Math.clz32?Math.clz32:Ot,Gt=Math.log,Ve=Math.LN2;function Ot(l){return l>>>=0,l===0?32:31-(Gt(l)/Ve|0)|0}var St=64,Ct=4194304;function _n(l){switch(l&-l){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 l&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return l&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return l}}function Xt(l,c){var p=l.pendingLanes;if(p===0)return 0;var y=0,k=l.suspendedLanes,S=l.pingedLanes,T=p&268435455;if(T!==0){var j=T&~k;j!==0?y=_n(j):(S&=T,S!==0&&(y=_n(S)))}else T=p&~k,T!==0?y=_n(T):S!==0&&(y=_n(S));if(y===0)return 0;if(c!==0&&c!==y&&(c&k)===0&&(k=y&-y,S=c&-c,k>=S||k===16&&(S&4194240)!==0))return c;if((y&4)!==0&&(y|=p&16),c=l.entangledLanes,c!==0)for(l=l.entanglements,c&=y;0<c;)p=31-Qe(c),k=1<<p,y|=l[p],c&=~k;return y}function Ti(l,c){switch(l){case 1:case 2:case 4:return c+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function at(l,c){for(var p=l.suspendedLanes,y=l.pingedLanes,k=l.expirationTimes,S=l.pendingLanes;0<S;){var T=31-Qe(S),j=1<<T,B=k[T];B===-1?((j&p)===0||(j&y)!==0)&&(k[T]=Ti(j,c)):B<=c&&(l.expiredLanes|=j),S&=~j}}function Vr(l){return l=l.pendingLanes&-1073741825,l!==0?l:l&1073741824?1073741824:0}function fr(){var l=St;return St<<=1,(St&4194240)===0&&(St=64),l}function Ar(l){for(var c=[],p=0;31>p;p++)c.push(l);return c}function hr(l,c,p){l.pendingLanes|=c,c!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),l=l.eventTimes,c=31-Qe(c),l[c]=p}function Mr(l,c){var p=l.pendingLanes&~c;l.pendingLanes=c,l.suspendedLanes=0,l.pingedLanes=0,l.expiredLanes&=c,l.mutableReadLanes&=c,l.entangledLanes&=c,c=l.entanglements;var y=l.eventTimes;for(l=l.expirationTimes;0<p;){var k=31-Qe(p),S=1<<k;c[k]=0,y[k]=-1,l[k]=-1,p&=~S}}function mo(l,c){var p=l.entangledLanes|=c;for(l=l.entanglements;p;){var y=31-Qe(p),k=1<<y;k&c|l[y]&c&&(l[y]|=c),p&=~k}}var Pt=0;function md(l){return l&=-l,1<l?4<l?(l&268435455)!==0?16:536870912:4:1}var gd,Kp,Yx,Qx,Xx,Gp=!1,yd=[],Uo=null,Vo=null,Ho=null,nu=new Map,ru=new Map,Wo=[],HA="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function eb(l,c){switch(l){case"focusin":case"focusout":Uo=null;break;case"dragenter":case"dragleave":Vo=null;break;case"mouseover":case"mouseout":Ho=null;break;case"pointerover":case"pointerout":nu.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":ru.delete(c.pointerId)}}function iu(l,c,p,y,k,S){return l===null||l.nativeEvent!==S?(l={blockedOn:c,domEventName:p,eventSystemFlags:y,nativeEvent:S,targetContainers:[k]},c!==null&&(c=xu(c),c!==null&&Kp(c)),l):(l.eventSystemFlags|=y,c=l.targetContainers,k!==null&&c.indexOf(k)===-1&&c.push(k),l)}function WA(l,c,p,y,k){switch(c){case"focusin":return Uo=iu(Uo,l,c,p,y,k),!0;case"dragenter":return Vo=iu(Vo,l,c,p,y,k),!0;case"mouseover":return Ho=iu(Ho,l,c,p,y,k),!0;case"pointerover":var S=k.pointerId;return nu.set(S,iu(nu.get(S)||null,l,c,p,y,k)),!0;case"gotpointercapture":return S=k.pointerId,ru.set(S,iu(ru.get(S)||null,l,c,p,y,k)),!0}return!1}function tb(l){var c=Gs(l.target);if(c!==null){var p=kt(c);if(p!==null){if(c=p.tag,c===13){if(c=It(p),c!==null){l.blockedOn=c,Xx(l.priority,function(){Yx(p)});return}}else if(c===3&&p.stateNode.current.memoizedState.isDehydrated){l.blockedOn=p.tag===3?p.stateNode.containerInfo:null;return}}}l.blockedOn=null}function xd(l){if(l.blockedOn!==null)return!1;for(var c=l.targetContainers;0<c.length;){var p=Qp(l.domEventName,l.eventSystemFlags,c[0],l.nativeEvent);if(p===null){p=l.nativeEvent;var y=new p.constructor(p.type,p);dr=y,p.target.dispatchEvent(y),dr=null}else return c=xu(p),c!==null&&Kp(c),l.blockedOn=p,!1;c.shift()}return!0}function nb(l,c,p){xd(l)&&p.delete(c)}function qA(){Gp=!1,Uo!==null&&xd(Uo)&&(Uo=null),Vo!==null&&xd(Vo)&&(Vo=null),Ho!==null&&xd(Ho)&&(Ho=null),nu.forEach(nb),ru.forEach(nb)}function ou(l,c){l.blockedOn===c&&(l.blockedOn=null,Gp||(Gp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,qA)))}function su(l){function c(k){return ou(k,l)}if(0<yd.length){ou(yd[0],l);for(var p=1;p<yd.length;p++){var y=yd[p];y.blockedOn===l&&(y.blockedOn=null)}}for(Uo!==null&&ou(Uo,l),Vo!==null&&ou(Vo,l),Ho!==null&&ou(Ho,l),nu.forEach(c),ru.forEach(c),p=0;p<Wo.length;p++)y=Wo[p],y.blockedOn===l&&(y.blockedOn=null);for(;0<Wo.length&&(p=Wo[0],p.blockedOn===null);)tb(p),p.blockedOn===null&&Wo.shift()}var Ua=I.ReactCurrentBatchConfig,bd=!0;function ZA(l,c,p,y){var k=Pt,S=Ua.transition;Ua.transition=null;try{Pt=1,Yp(l,c,p,y)}finally{Pt=k,Ua.transition=S}}function JA(l,c,p,y){var k=Pt,S=Ua.transition;Ua.transition=null;try{Pt=4,Yp(l,c,p,y)}finally{Pt=k,Ua.transition=S}}function Yp(l,c,p,y){if(bd){var k=Qp(l,c,p,y);if(k===null)mm(l,c,y,vd,p),eb(l,y);else if(WA(k,l,c,p,y))y.stopPropagation();else if(eb(l,y),c&4&&-1<HA.indexOf(l)){for(;k!==null;){var S=xu(k);if(S!==null&&gd(S),S=Qp(l,c,p,y),S===null&&mm(l,c,y,vd,p),S===k)break;k=S}k!==null&&y.stopPropagation()}else mm(l,c,y,null,p)}}var vd=null;function Qp(l,c,p,y){if(vd=null,l=tu(y),l=Gs(l),l!==null)if(c=kt(l),c===null)l=null;else if(p=c.tag,p===13){if(l=It(c),l!==null)return l;l=null}else if(p===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;l=null}else c!==l&&(l=null);return vd=l,null}function rb(l){switch(l){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(ze()){case Fe:return 1;case le:return 4;case ye:case Le:return 16;case U:return 536870912;default:return 16}default:return 16}}var qo=null,Xp=null,kd=null;function ib(){if(kd)return kd;var l,c=Xp,p=c.length,y,k="value"in qo?qo.value:qo.textContent,S=k.length;for(l=0;l<p&&c[l]===k[l];l++);var T=p-l;for(y=1;y<=T&&c[p-y]===k[S-y];y++);return kd=k.slice(l,1<y?1-y:void 0)}function wd(l){var c=l.keyCode;return"charCode"in l?(l=l.charCode,l===0&&c===13&&(l=13)):l=c,l===10&&(l=13),32<=l||l===13?l:0}function Cd(){return!0}function ob(){return!1}function Hr(l){function c(p,y,k,S,T){this._reactName=p,this._targetInst=k,this.type=y,this.nativeEvent=S,this.target=T,this.currentTarget=null;for(var j in l)l.hasOwnProperty(j)&&(p=l[j],this[j]=p?p(S):S[j]);return this.isDefaultPrevented=(S.defaultPrevented!=null?S.defaultPrevented:S.returnValue===!1)?Cd:ob,this.isPropagationStopped=ob,this}return O(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var p=this.nativeEvent;p&&(p.preventDefault?p.preventDefault():typeof p.returnValue!="unknown"&&(p.returnValue=!1),this.isDefaultPrevented=Cd)},stopPropagation:function(){var p=this.nativeEvent;p&&(p.stopPropagation?p.stopPropagation():typeof p.cancelBubble!="unknown"&&(p.cancelBubble=!0),this.isPropagationStopped=Cd)},persist:function(){},isPersistent:Cd}),c}var Va={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(l){return l.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},em=Hr(Va),au=O({},Va,{view:0,detail:0}),KA=Hr(au),tm,nm,lu,Sd=O({},au,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:im,button:0,buttons:0,relatedTarget:function(l){return l.relatedTarget===void 0?l.fromElement===l.srcElement?l.toElement:l.fromElement:l.relatedTarget},movementX:function(l){return"movementX"in l?l.movementX:(l!==lu&&(lu&&l.type==="mousemove"?(tm=l.screenX-lu.screenX,nm=l.screenY-lu.screenY):nm=tm=0,lu=l),tm)},movementY:function(l){return"movementY"in l?l.movementY:nm}}),sb=Hr(Sd),GA=O({},Sd,{dataTransfer:0}),YA=Hr(GA),QA=O({},au,{relatedTarget:0}),rm=Hr(QA),XA=O({},Va,{animationName:0,elapsedTime:0,pseudoElement:0}),eM=Hr(XA),tM=O({},Va,{clipboardData:function(l){return"clipboardData"in l?l.clipboardData:window.clipboardData}}),nM=Hr(tM),rM=O({},Va,{data:0}),ab=Hr(rM),iM={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},oM={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},sM={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function aM(l){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(l):(l=sM[l])?!!c[l]:!1}function im(){return aM}var lM=O({},au,{key:function(l){if(l.key){var c=iM[l.key]||l.key;if(c!=="Unidentified")return c}return l.type==="keypress"?(l=wd(l),l===13?"Enter":String.fromCharCode(l)):l.type==="keydown"||l.type==="keyup"?oM[l.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:im,charCode:function(l){return l.type==="keypress"?wd(l):0},keyCode:function(l){return l.type==="keydown"||l.type==="keyup"?l.keyCode:0},which:function(l){return l.type==="keypress"?wd(l):l.type==="keydown"||l.type==="keyup"?l.keyCode:0}}),uM=Hr(lM),cM=O({},Sd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),lb=Hr(cM),dM=O({},au,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:im}),fM=Hr(dM),hM=O({},Va,{propertyName:0,elapsedTime:0,pseudoElement:0}),pM=Hr(hM),mM=O({},Sd,{deltaX:function(l){return"deltaX"in l?l.deltaX:"wheelDeltaX"in l?-l.wheelDeltaX:0},deltaY:function(l){return"deltaY"in l?l.deltaY:"wheelDeltaY"in l?-l.wheelDeltaY:"wheelDelta"in l?-l.wheelDelta:0},deltaZ:0,deltaMode:0}),gM=Hr(mM),yM=[9,13,27,32],om=a&&"CompositionEvent"in window,uu=null;a&&"documentMode"in document&&(uu=document.documentMode);var xM=a&&"TextEvent"in window&&!uu,ub=a&&(!om||uu&&8<uu&&11>=uu),cb=" ",db=!1;function fb(l,c){switch(l){case"keyup":return yM.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hb(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var Ha=!1;function bM(l,c){switch(l){case"compositionend":return hb(c);case"keypress":return c.which!==32?null:(db=!0,cb);case"textInput":return l=c.data,l===cb&&db?null:l;default:return null}}function vM(l,c){if(Ha)return l==="compositionend"||!om&&fb(l,c)?(l=ib(),kd=Xp=qo=null,Ha=!1,l):null;switch(l){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return ub&&c.locale!=="ko"?null:c.data;default:return null}}var kM={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function pb(l){var c=l&&l.nodeName&&l.nodeName.toLowerCase();return c==="input"?!!kM[l.type]:c==="textarea"}function mb(l,c,p,y){fd(y),c=Md(c,"onChange"),0<c.length&&(p=new em("onChange","change",null,p,y),l.push({event:p,listeners:c}))}var cu=null,du=null;function wM(l){Ob(l,0)}function Ed(l){var c=Ka(l);if(Pn(c))return l}function CM(l,c){if(l==="change")return c}var gb=!1;if(a){var sm;if(a){var am="oninput"in document;if(!am){var yb=document.createElement("div");yb.setAttribute("oninput","return;"),am=typeof yb.oninput=="function"}sm=am}else sm=!1;gb=sm&&(!document.documentMode||9<document.documentMode)}function xb(){cu&&(cu.detachEvent("onpropertychange",bb),du=cu=null)}function bb(l){if(l.propertyName==="value"&&Ed(du)){var c=[];mb(c,du,l,tu(l)),q(wM,c)}}function SM(l,c,p){l==="focusin"?(xb(),cu=c,du=p,cu.attachEvent("onpropertychange",bb)):l==="focusout"&&xb()}function EM(l){if(l==="selectionchange"||l==="keyup"||l==="keydown")return Ed(du)}function _M(l,c){if(l==="click")return Ed(c)}function TM(l,c){if(l==="input"||l==="change")return Ed(c)}function AM(l,c){return l===c&&(l!==0||1/l===1/c)||l!==l&&c!==c}var Ai=typeof Object.is=="function"?Object.is:AM;function fu(l,c){if(Ai(l,c))return!0;if(typeof l!="object"||l===null||typeof c!="object"||c===null)return!1;var p=Object.keys(l),y=Object.keys(c);if(p.length!==y.length)return!1;for(y=0;y<p.length;y++){var k=p[y];if(!u.call(c,k)||!Ai(l[k],c[k]))return!1}return!0}function vb(l){for(;l&&l.firstChild;)l=l.firstChild;return l}function kb(l,c){var p=vb(l);l=0;for(var y;p;){if(p.nodeType===3){if(y=l+p.textContent.length,l<=c&&y>=c)return{node:p,offset:c-l};l=y}e:{for(;p;){if(p.nextSibling){p=p.nextSibling;break e}p=p.parentNode}p=void 0}p=vb(p)}}function wb(l,c){return l&&c?l===c?!0:l&&l.nodeType===3?!1:c&&c.nodeType===3?wb(l,c.parentNode):"contains"in l?l.contains(c):l.compareDocumentPosition?!!(l.compareDocumentPosition(c)&16):!1:!1}function Cb(){for(var l=window,c=ni();c instanceof l.HTMLIFrameElement;){try{var p=typeof c.contentWindow.location.href=="string"}catch{p=!1}if(p)l=c.contentWindow;else break;c=ni(l.document)}return c}function lm(l){var c=l&&l.nodeName&&l.nodeName.toLowerCase();return c&&(c==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||c==="textarea"||l.contentEditable==="true")}function MM(l){var c=Cb(),p=l.focusedElem,y=l.selectionRange;if(c!==p&&p&&p.ownerDocument&&wb(p.ownerDocument.documentElement,p)){if(y!==null&&lm(p)){if(c=y.start,l=y.end,l===void 0&&(l=c),"selectionStart"in p)p.selectionStart=c,p.selectionEnd=Math.min(l,p.value.length);else if(l=(c=p.ownerDocument||document)&&c.defaultView||window,l.getSelection){l=l.getSelection();var k=p.textContent.length,S=Math.min(y.start,k);y=y.end===void 0?S:Math.min(y.end,k),!l.extend&&S>y&&(k=y,y=S,S=k),k=kb(p,S);var T=kb(p,y);k&&T&&(l.rangeCount!==1||l.anchorNode!==k.node||l.anchorOffset!==k.offset||l.focusNode!==T.node||l.focusOffset!==T.offset)&&(c=c.createRange(),c.setStart(k.node,k.offset),l.removeAllRanges(),S>y?(l.addRange(c),l.extend(T.node,T.offset)):(c.setEnd(T.node,T.offset),l.addRange(c)))}}for(c=[],l=p;l=l.parentNode;)l.nodeType===1&&c.push({element:l,left:l.scrollLeft,top:l.scrollTop});for(typeof p.focus=="function"&&p.focus(),p=0;p<c.length;p++)l=c[p],l.element.scrollLeft=l.left,l.element.scrollTop=l.top}}var NM=a&&"documentMode"in document&&11>=document.documentMode,Wa=null,um=null,hu=null,cm=!1;function Sb(l,c,p){var y=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;cm||Wa==null||Wa!==ni(y)||(y=Wa,"selectionStart"in y&&lm(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anchorNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),hu&&fu(hu,y)||(hu=y,y=Md(um,"onSelect"),0<y.length&&(c=new em("onSelect","select",null,c,p),l.push({event:c,listeners:y}),c.target=Wa)))}function _d(l,c){var p={};return p[l.toLowerCase()]=c.toLowerCase(),p["Webkit"+l]="webkit"+c,p["Moz"+l]="moz"+c,p}var qa={animationend:_d("Animation","AnimationEnd"),animationiteration:_d("Animation","AnimationIteration"),animationstart:_d("Animation","AnimationStart"),transitionend:_d("Transition","TransitionEnd")},dm={},Eb={};a&&(Eb=document.createElement("div").style,"AnimationEvent"in window||(delete qa.animationend.animation,delete qa.animationiteration.animation,delete qa.animationstart.animation),"TransitionEvent"in window||delete qa.transitionend.transition);function Td(l){if(dm[l])return dm[l];if(!qa[l])return l;var c=qa[l],p;for(p in c)if(c.hasOwnProperty(p)&&p in Eb)return dm[l]=c[p];return l}var _b=Td("animationend"),Tb=Td("animationiteration"),Ab=Td("animationstart"),Mb=Td("transitionend"),Nb=new Map,Ib="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Zo(l,c){Nb.set(l,c),o(c,[l])}for(var fm=0;fm<Ib.length;fm++){var hm=Ib[fm],IM=hm.toLowerCase(),DM=hm[0].toUpperCase()+hm.slice(1);Zo(IM,"on"+DM)}Zo(_b,"onAnimationEnd"),Zo(Tb,"onAnimationIteration"),Zo(Ab,"onAnimationStart"),Zo("dblclick","onDoubleClick"),Zo("focusin","onFocus"),Zo("focusout","onBlur"),Zo(Mb,"onTransitionEnd"),s("onMouseEnter",["mouseout","mouseover"]),s("onMouseLeave",["mouseout","mouseover"]),s("onPointerEnter",["pointerout","pointerover"]),s("onPointerLeave",["pointerout","pointerover"]),o("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),o("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),o("onBeforeInput",["compositionend","keypress","textInput","paste"]),o("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var pu="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),OM=new Set("cancel close invalid load scroll toggle".split(" ").concat(pu));function Db(l,c,p){var y=l.type||"unknown-event";l.currentTarget=p,vt(y,c,void 0,l),l.currentTarget=null}function Ob(l,c){c=(c&4)!==0;for(var p=0;p<l.length;p++){var y=l[p],k=y.event;y=y.listeners;e:{var S=void 0;if(c)for(var T=y.length-1;0<=T;T--){var j=y[T],B=j.instance,Q=j.currentTarget;if(j=j.listener,B!==S&&k.isPropagationStopped())break e;Db(k,j,Q),S=B}else for(T=0;T<y.length;T++){if(j=y[T],B=j.instance,Q=j.currentTarget,j=j.listener,B!==S&&k.isPropagationStopped())break e;Db(k,j,Q),S=B}}}if(bt)throw l=wt,bt=!1,wt=null,l}function sn(l,c){var p=c[km];p===void 0&&(p=c[km]=new Set);var y=l+"__bubble";p.has(y)||(Rb(c,l,2,!1),p.add(y))}function pm(l,c,p){var y=0;c&&(y|=4),Rb(p,l,y,c)}var Ad="_reactListening"+Math.random().toString(36).slice(2);function mu(l){if(!l[Ad]){l[Ad]=!0,r.forEach(function(p){p!=="selectionchange"&&(OM.has(p)||pm(p,!1,l),pm(p,!0,l))});var c=l.nodeType===9?l:l.ownerDocument;c===null||c[Ad]||(c[Ad]=!0,pm("selectionchange",!1,c))}}function Rb(l,c,p,y){switch(rb(c)){case 1:var k=ZA;break;case 4:k=JA;break;default:k=Yp}p=k.bind(null,c,p,l),k=void 0,!ke||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(k=!0),y?k!==void 0?l.addEventListener(c,p,{capture:!0,passive:k}):l.addEventListener(c,p,!0):k!==void 0?l.addEventListener(c,p,{passive:k}):l.addEventListener(c,p,!1)}function mm(l,c,p,y,k){var S=y;if((c&1)===0&&(c&2)===0&&y!==null)e:for(;;){if(y===null)return;var T=y.tag;if(T===3||T===4){var j=y.stateNode.containerInfo;if(j===k||j.nodeType===8&&j.parentNode===k)break;if(T===4)for(T=y.return;T!==null;){var B=T.tag;if((B===3||B===4)&&(B=T.stateNode.containerInfo,B===k||B.nodeType===8&&B.parentNode===k))return;T=T.return}for(;j!==null;){if(T=Gs(j),T===null)return;if(B=T.tag,B===5||B===6){y=S=T;continue e}j=j.parentNode}}y=y.return}q(function(){var Q=S,me=tu(p),xe=[];e:{var de=Nb.get(l);if(de!==void 0){var He=em,Xe=l;switch(l){case"keypress":if(wd(p)===0)break e;case"keydown":case"keyup":He=uM;break;case"focusin":Xe="focus",He=rm;break;case"focusout":Xe="blur",He=rm;break;case"beforeblur":case"afterblur":He=rm;break;case"click":if(p.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":He=sb;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":He=YA;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":He=fM;break;case _b:case Tb:case Ab:He=eM;break;case Mb:He=pM;break;case"scroll":He=KA;break;case"wheel":He=gM;break;case"copy":case"cut":case"paste":He=nM;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":He=lb}var rt=(c&4)!==0,En=!rt&&l==="scroll",J=rt?de!==null?de+"Capture":null:de;rt=[];for(var H=Q,K;H!==null;){K=H;var Ce=K.stateNode;if(K.tag===5&&Ce!==null&&(K=Ce,J!==null&&(Ce=oe(H,J),Ce!=null&&rt.push(gu(H,Ce,K)))),En)break;H=H.return}0<rt.length&&(de=new He(de,Xe,null,p,me),xe.push({event:de,listeners:rt}))}}if((c&7)===0){e:{if(de=l==="mouseover"||l==="pointerover",He=l==="mouseout"||l==="pointerout",de&&p!==dr&&(Xe=p.relatedTarget||p.fromElement)&&(Gs(Xe)||Xe[go]))break e;if((He||de)&&(de=me.window===me?me:(de=me.ownerDocument)?de.defaultView||de.parentWindow:window,He?(Xe=p.relatedTarget||p.toElement,He=Q,Xe=Xe?Gs(Xe):null,Xe!==null&&(En=kt(Xe),Xe!==En||Xe.tag!==5&&Xe.tag!==6)&&(Xe=null)):(He=null,Xe=Q),He!==Xe)){if(rt=sb,Ce="onMouseLeave",J="onMouseEnter",H="mouse",(l==="pointerout"||l==="pointerover")&&(rt=lb,Ce="onPointerLeave",J="onPointerEnter",H="pointer"),En=He==null?de:Ka(He),K=Xe==null?de:Ka(Xe),de=new rt(Ce,H+"leave",He,p,me),de.target=En,de.relatedTarget=K,Ce=null,Gs(me)===Q&&(rt=new rt(J,H+"enter",Xe,p,me),rt.target=K,rt.relatedTarget=En,Ce=rt),En=Ce,He&&Xe)t:{for(rt=He,J=Xe,H=0,K=rt;K;K=Za(K))H++;for(K=0,Ce=J;Ce;Ce=Za(Ce))K++;for(;0<H-K;)rt=Za(rt),H--;for(;0<K-H;)J=Za(J),K--;for(;H--;){if(rt===J||J!==null&&rt===J.alternate)break t;rt=Za(rt),J=Za(J)}rt=null}else rt=null;He!==null&&Pb(xe,de,He,rt,!1),Xe!==null&&En!==null&&Pb(xe,En,Xe,rt,!0)}}e:{if(de=Q?Ka(Q):window,He=de.nodeName&&de.nodeName.toLowerCase(),He==="select"||He==="input"&&de.type==="file")var it=CM;else if(pb(de))if(gb)it=TM;else{it=EM;var ft=SM}else(He=de.nodeName)&&He.toLowerCase()==="input"&&(de.type==="checkbox"||de.type==="radio")&&(it=_M);if(it&&(it=it(l,Q))){mb(xe,it,p,me);break e}ft&&ft(l,de,Q),l==="focusout"&&(ft=de._wrapperState)&&ft.controlled&&de.type==="number"&&Sr(de,"number",de.value)}switch(ft=Q?Ka(Q):window,l){case"focusin":(pb(ft)||ft.contentEditable==="true")&&(Wa=ft,um=Q,hu=null);break;case"focusout":hu=um=Wa=null;break;case"mousedown":cm=!0;break;case"contextmenu":case"mouseup":case"dragend":cm=!1,Sb(xe,p,me);break;case"selectionchange":if(NM)break;case"keydown":case"keyup":Sb(xe,p,me)}var ht;if(om)e:{switch(l){case"compositionstart":var gt="onCompositionStart";break e;case"compositionend":gt="onCompositionEnd";break e;case"compositionupdate":gt="onCompositionUpdate";break e}gt=void 0}else Ha?fb(l,p)&&(gt="onCompositionEnd"):l==="keydown"&&p.keyCode===229&&(gt="onCompositionStart");gt&&(ub&&p.locale!=="ko"&&(Ha||gt!=="onCompositionStart"?gt==="onCompositionEnd"&&Ha&&(ht=ib()):(qo=me,Xp="value"in qo?qo.value:qo.textContent,Ha=!0)),ft=Md(Q,gt),0<ft.length&&(gt=new ab(gt,l,null,p,me),xe.push({event:gt,listeners:ft}),ht?gt.data=ht:(ht=hb(p),ht!==null&&(gt.data=ht)))),(ht=xM?bM(l,p):vM(l,p))&&(Q=Md(Q,"onBeforeInput"),0<Q.length&&(me=new ab("onBeforeInput","beforeinput",null,p,me),xe.push({event:me,listeners:Q}),me.data=ht))}Ob(xe,c)})}function gu(l,c,p){return{instance:l,listener:c,currentTarget:p}}function Md(l,c){for(var p=c+"Capture",y=[];l!==null;){var k=l,S=k.stateNode;k.tag===5&&S!==null&&(k=S,S=oe(l,p),S!=null&&y.unshift(gu(l,S,k)),S=oe(l,c),S!=null&&y.push(gu(l,S,k))),l=l.return}return y}function Za(l){if(l===null)return null;do l=l.return;while(l&&l.tag!==5);return l||null}function Pb(l,c,p,y,k){for(var S=c._reactName,T=[];p!==null&&p!==y;){var j=p,B=j.alternate,Q=j.stateNode;if(B!==null&&B===y)break;j.tag===5&&Q!==null&&(j=Q,k?(B=oe(p,S),B!=null&&T.unshift(gu(p,B,j))):k||(B=oe(p,S),B!=null&&T.push(gu(p,B,j)))),p=p.return}T.length!==0&&l.push({event:c,listeners:T})}var RM=/\r\n?/g,PM=/\u0000|\uFFFD/g;function jb(l){return(typeof l=="string"?l:""+l).replace(RM,`
38
+ `).replace(PM,"")}function Nd(l,c,p){if(c=jb(c),jb(l)!==c&&p)throw Error(n(425))}function Id(){}var gm=null,ym=null;function xm(l,c){return l==="textarea"||l==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var bm=typeof setTimeout=="function"?setTimeout:void 0,jM=typeof clearTimeout=="function"?clearTimeout:void 0,zb=typeof Promise=="function"?Promise:void 0,zM=typeof queueMicrotask=="function"?queueMicrotask:typeof zb<"u"?function(l){return zb.resolve(null).then(l).catch(LM)}:bm;function LM(l){setTimeout(function(){throw l})}function vm(l,c){var p=c,y=0;do{var k=p.nextSibling;if(l.removeChild(p),k&&k.nodeType===8)if(p=k.data,p==="/$"){if(y===0){l.removeChild(k),su(c);return}y--}else p!=="$"&&p!=="$?"&&p!=="$!"||y++;p=k}while(p);su(c)}function Jo(l){for(;l!=null;l=l.nextSibling){var c=l.nodeType;if(c===1||c===3)break;if(c===8){if(c=l.data,c==="$"||c==="$!"||c==="$?")break;if(c==="/$")return null}}return l}function Lb(l){l=l.previousSibling;for(var c=0;l;){if(l.nodeType===8){var p=l.data;if(p==="$"||p==="$!"||p==="$?"){if(c===0)return l;c--}else p==="/$"&&c++}l=l.previousSibling}return null}var Ja=Math.random().toString(36).slice(2),Bi="__reactFiber$"+Ja,yu="__reactProps$"+Ja,go="__reactContainer$"+Ja,km="__reactEvents$"+Ja,FM="__reactListeners$"+Ja,$M="__reactHandles$"+Ja;function Gs(l){var c=l[Bi];if(c)return c;for(var p=l.parentNode;p;){if(c=p[go]||p[Bi]){if(p=c.alternate,c.child!==null||p!==null&&p.child!==null)for(l=Lb(l);l!==null;){if(p=l[Bi])return p;l=Lb(l)}return c}l=p,p=l.parentNode}return null}function xu(l){return l=l[Bi]||l[go],!l||l.tag!==5&&l.tag!==6&&l.tag!==13&&l.tag!==3?null:l}function Ka(l){if(l.tag===5||l.tag===6)return l.stateNode;throw Error(n(33))}function Dd(l){return l[yu]||null}var wm=[],Ga=-1;function Ko(l){return{current:l}}function an(l){0>Ga||(l.current=wm[Ga],wm[Ga]=null,Ga--)}function en(l,c){Ga++,wm[Ga]=l.current,l.current=c}var Go={},nr=Ko(Go),Nr=Ko(!1),Ys=Go;function Ya(l,c){var p=l.type.contextTypes;if(!p)return Go;var y=l.stateNode;if(y&&y.__reactInternalMemoizedUnmaskedChildContext===c)return y.__reactInternalMemoizedMaskedChildContext;var k={},S;for(S in p)k[S]=c[S];return y&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=c,l.__reactInternalMemoizedMaskedChildContext=k),k}function Ir(l){return l=l.childContextTypes,l!=null}function Od(){an(Nr),an(nr)}function Fb(l,c,p){if(nr.current!==Go)throw Error(n(168));en(nr,c),en(Nr,p)}function $b(l,c,p){var y=l.stateNode;if(c=c.childContextTypes,typeof y.getChildContext!="function")return p;y=y.getChildContext();for(var k in y)if(!(k in c))throw Error(n(108,pe(l)||"Unknown",k));return O({},p,y)}function Rd(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||Go,Ys=nr.current,en(nr,l),en(Nr,Nr.current),!0}function Bb(l,c,p){var y=l.stateNode;if(!y)throw Error(n(169));p?(l=$b(l,c,Ys),y.__reactInternalMemoizedMergedChildContext=l,an(Nr),an(nr),en(nr,l)):an(Nr),en(Nr,p)}var yo=null,Pd=!1,Cm=!1;function Ub(l){yo===null?yo=[l]:yo.push(l)}function BM(l){Pd=!0,Ub(l)}function Yo(){if(!Cm&&yo!==null){Cm=!0;var l=0,c=Pt;try{var p=yo;for(Pt=1;l<p.length;l++){var y=p[l];do y=y(!0);while(y!==null)}yo=null,Pd=!1}catch(k){throw yo!==null&&(yo=yo.slice(l+1)),Ae(Fe,Yo),k}finally{Pt=c,Cm=!1}}return null}var Qa=[],Xa=0,jd=null,zd=0,oi=[],si=0,Qs=null,xo=1,bo="";function Xs(l,c){Qa[Xa++]=zd,Qa[Xa++]=jd,jd=l,zd=c}function Vb(l,c,p){oi[si++]=xo,oi[si++]=bo,oi[si++]=Qs,Qs=l;var y=xo;l=bo;var k=32-Qe(y)-1;y&=~(1<<k),p+=1;var S=32-Qe(c)+k;if(30<S){var T=k-k%5;S=(y&(1<<T)-1).toString(32),y>>=T,k-=T,xo=1<<32-Qe(c)+k|p<<k|y,bo=S+l}else xo=1<<S|p<<k|y,bo=l}function Sm(l){l.return!==null&&(Xs(l,1),Vb(l,1,0))}function Em(l){for(;l===jd;)jd=Qa[--Xa],Qa[Xa]=null,zd=Qa[--Xa],Qa[Xa]=null;for(;l===Qs;)Qs=oi[--si],oi[si]=null,bo=oi[--si],oi[si]=null,xo=oi[--si],oi[si]=null}var Wr=null,qr=null,fn=!1,Mi=null;function Hb(l,c){var p=ci(5,null,null,0);p.elementType="DELETED",p.stateNode=c,p.return=l,c=l.deletions,c===null?(l.deletions=[p],l.flags|=16):c.push(p)}function Wb(l,c){switch(l.tag){case 5:var p=l.type;return c=c.nodeType!==1||p.toLowerCase()!==c.nodeName.toLowerCase()?null:c,c!==null?(l.stateNode=c,Wr=l,qr=Jo(c.firstChild),!0):!1;case 6:return c=l.pendingProps===""||c.nodeType!==3?null:c,c!==null?(l.stateNode=c,Wr=l,qr=null,!0):!1;case 13:return c=c.nodeType!==8?null:c,c!==null?(p=Qs!==null?{id:xo,overflow:bo}:null,l.memoizedState={dehydrated:c,treeContext:p,retryLane:1073741824},p=ci(18,null,null,0),p.stateNode=c,p.return=l,l.child=p,Wr=l,qr=null,!0):!1;default:return!1}}function _m(l){return(l.mode&1)!==0&&(l.flags&128)===0}function Tm(l){if(fn){var c=qr;if(c){var p=c;if(!Wb(l,c)){if(_m(l))throw Error(n(418));c=Jo(p.nextSibling);var y=Wr;c&&Wb(l,c)?Hb(y,p):(l.flags=l.flags&-4097|2,fn=!1,Wr=l)}}else{if(_m(l))throw Error(n(418));l.flags=l.flags&-4097|2,fn=!1,Wr=l}}}function qb(l){for(l=l.return;l!==null&&l.tag!==5&&l.tag!==3&&l.tag!==13;)l=l.return;Wr=l}function Ld(l){if(l!==Wr)return!1;if(!fn)return qb(l),fn=!0,!1;var c;if((c=l.tag!==3)&&!(c=l.tag!==5)&&(c=l.type,c=c!=="head"&&c!=="body"&&!xm(l.type,l.memoizedProps)),c&&(c=qr)){if(_m(l))throw Zb(),Error(n(418));for(;c;)Hb(l,c),c=Jo(c.nextSibling)}if(qb(l),l.tag===13){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(n(317));e:{for(l=l.nextSibling,c=0;l;){if(l.nodeType===8){var p=l.data;if(p==="/$"){if(c===0){qr=Jo(l.nextSibling);break e}c--}else p!=="$"&&p!=="$!"&&p!=="$?"||c++}l=l.nextSibling}qr=null}}else qr=Wr?Jo(l.stateNode.nextSibling):null;return!0}function Zb(){for(var l=qr;l;)l=Jo(l.nextSibling)}function el(){qr=Wr=null,fn=!1}function Am(l){Mi===null?Mi=[l]:Mi.push(l)}var UM=I.ReactCurrentBatchConfig;function bu(l,c,p){if(l=p.ref,l!==null&&typeof l!="function"&&typeof l!="object"){if(p._owner){if(p=p._owner,p){if(p.tag!==1)throw Error(n(309));var y=p.stateNode}if(!y)throw Error(n(147,l));var k=y,S=""+l;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===S?c.ref:(c=function(T){var j=k.refs;T===null?delete j[S]:j[S]=T},c._stringRef=S,c)}if(typeof l!="string")throw Error(n(284));if(!p._owner)throw Error(n(290,l))}return l}function Fd(l,c){throw l=Object.prototype.toString.call(c),Error(n(31,l==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":l))}function Jb(l){var c=l._init;return c(l._payload)}function Kb(l){function c(J,H){if(l){var K=J.deletions;K===null?(J.deletions=[H],J.flags|=16):K.push(H)}}function p(J,H){if(!l)return null;for(;H!==null;)c(J,H),H=H.sibling;return null}function y(J,H){for(J=new Map;H!==null;)H.key!==null?J.set(H.key,H):J.set(H.index,H),H=H.sibling;return J}function k(J,H){return J=ss(J,H),J.index=0,J.sibling=null,J}function S(J,H,K){return J.index=K,l?(K=J.alternate,K!==null?(K=K.index,K<H?(J.flags|=2,H):K):(J.flags|=2,H)):(J.flags|=1048576,H)}function T(J){return l&&J.alternate===null&&(J.flags|=2),J}function j(J,H,K,Ce){return H===null||H.tag!==6?(H=b0(K,J.mode,Ce),H.return=J,H):(H=k(H,K),H.return=J,H)}function B(J,H,K,Ce){var it=K.type;return it===F?me(J,H,K.props.children,Ce,K.key):H!==null&&(H.elementType===it||typeof it=="object"&&it!==null&&it.$$typeof===ge&&Jb(it)===H.type)?(Ce=k(H,K.props),Ce.ref=bu(J,H,K),Ce.return=J,Ce):(Ce=cf(K.type,K.key,K.props,null,J.mode,Ce),Ce.ref=bu(J,H,K),Ce.return=J,Ce)}function Q(J,H,K,Ce){return H===null||H.tag!==4||H.stateNode.containerInfo!==K.containerInfo||H.stateNode.implementation!==K.implementation?(H=v0(K,J.mode,Ce),H.return=J,H):(H=k(H,K.children||[]),H.return=J,H)}function me(J,H,K,Ce,it){return H===null||H.tag!==7?(H=aa(K,J.mode,Ce,it),H.return=J,H):(H=k(H,K),H.return=J,H)}function xe(J,H,K){if(typeof H=="string"&&H!==""||typeof H=="number")return H=b0(""+H,J.mode,K),H.return=J,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case N:return K=cf(H.type,H.key,H.props,null,J.mode,K),K.ref=bu(J,null,H),K.return=J,K;case M:return H=v0(H,J.mode,K),H.return=J,H;case ge:var Ce=H._init;return xe(J,Ce(H._payload),K)}if(wi(H)||qe(H))return H=aa(H,J.mode,K,null),H.return=J,H;Fd(J,H)}return null}function de(J,H,K,Ce){var it=H!==null?H.key:null;if(typeof K=="string"&&K!==""||typeof K=="number")return it!==null?null:j(J,H,""+K,Ce);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case N:return K.key===it?B(J,H,K,Ce):null;case M:return K.key===it?Q(J,H,K,Ce):null;case ge:return it=K._init,de(J,H,it(K._payload),Ce)}if(wi(K)||qe(K))return it!==null?null:me(J,H,K,Ce,null);Fd(J,K)}return null}function He(J,H,K,Ce,it){if(typeof Ce=="string"&&Ce!==""||typeof Ce=="number")return J=J.get(K)||null,j(H,J,""+Ce,it);if(typeof Ce=="object"&&Ce!==null){switch(Ce.$$typeof){case N:return J=J.get(Ce.key===null?K:Ce.key)||null,B(H,J,Ce,it);case M:return J=J.get(Ce.key===null?K:Ce.key)||null,Q(H,J,Ce,it);case ge:var ft=Ce._init;return He(J,H,K,ft(Ce._payload),it)}if(wi(Ce)||qe(Ce))return J=J.get(K)||null,me(H,J,Ce,it,null);Fd(H,Ce)}return null}function Xe(J,H,K,Ce){for(var it=null,ft=null,ht=H,gt=H=0,Hn=null;ht!==null&&gt<K.length;gt++){ht.index>gt?(Hn=ht,ht=null):Hn=ht.sibling;var Ut=de(J,ht,K[gt],Ce);if(Ut===null){ht===null&&(ht=Hn);break}l&&ht&&Ut.alternate===null&&c(J,ht),H=S(Ut,H,gt),ft===null?it=Ut:ft.sibling=Ut,ft=Ut,ht=Hn}if(gt===K.length)return p(J,ht),fn&&Xs(J,gt),it;if(ht===null){for(;gt<K.length;gt++)ht=xe(J,K[gt],Ce),ht!==null&&(H=S(ht,H,gt),ft===null?it=ht:ft.sibling=ht,ft=ht);return fn&&Xs(J,gt),it}for(ht=y(J,ht);gt<K.length;gt++)Hn=He(ht,J,gt,K[gt],Ce),Hn!==null&&(l&&Hn.alternate!==null&&ht.delete(Hn.key===null?gt:Hn.key),H=S(Hn,H,gt),ft===null?it=Hn:ft.sibling=Hn,ft=Hn);return l&&ht.forEach(function(as){return c(J,as)}),fn&&Xs(J,gt),it}function rt(J,H,K,Ce){var it=qe(K);if(typeof it!="function")throw Error(n(150));if(K=it.call(K),K==null)throw Error(n(151));for(var ft=it=null,ht=H,gt=H=0,Hn=null,Ut=K.next();ht!==null&&!Ut.done;gt++,Ut=K.next()){ht.index>gt?(Hn=ht,ht=null):Hn=ht.sibling;var as=de(J,ht,Ut.value,Ce);if(as===null){ht===null&&(ht=Hn);break}l&&ht&&as.alternate===null&&c(J,ht),H=S(as,H,gt),ft===null?it=as:ft.sibling=as,ft=as,ht=Hn}if(Ut.done)return p(J,ht),fn&&Xs(J,gt),it;if(ht===null){for(;!Ut.done;gt++,Ut=K.next())Ut=xe(J,Ut.value,Ce),Ut!==null&&(H=S(Ut,H,gt),ft===null?it=Ut:ft.sibling=Ut,ft=Ut);return fn&&Xs(J,gt),it}for(ht=y(J,ht);!Ut.done;gt++,Ut=K.next())Ut=He(ht,J,gt,Ut.value,Ce),Ut!==null&&(l&&Ut.alternate!==null&&ht.delete(Ut.key===null?gt:Ut.key),H=S(Ut,H,gt),ft===null?it=Ut:ft.sibling=Ut,ft=Ut);return l&&ht.forEach(function(kN){return c(J,kN)}),fn&&Xs(J,gt),it}function En(J,H,K,Ce){if(typeof K=="object"&&K!==null&&K.type===F&&K.key===null&&(K=K.props.children),typeof K=="object"&&K!==null){switch(K.$$typeof){case N:e:{for(var it=K.key,ft=H;ft!==null;){if(ft.key===it){if(it=K.type,it===F){if(ft.tag===7){p(J,ft.sibling),H=k(ft,K.props.children),H.return=J,J=H;break e}}else if(ft.elementType===it||typeof it=="object"&&it!==null&&it.$$typeof===ge&&Jb(it)===ft.type){p(J,ft.sibling),H=k(ft,K.props),H.ref=bu(J,ft,K),H.return=J,J=H;break e}p(J,ft);break}else c(J,ft);ft=ft.sibling}K.type===F?(H=aa(K.props.children,J.mode,Ce,K.key),H.return=J,J=H):(Ce=cf(K.type,K.key,K.props,null,J.mode,Ce),Ce.ref=bu(J,H,K),Ce.return=J,J=Ce)}return T(J);case M:e:{for(ft=K.key;H!==null;){if(H.key===ft)if(H.tag===4&&H.stateNode.containerInfo===K.containerInfo&&H.stateNode.implementation===K.implementation){p(J,H.sibling),H=k(H,K.children||[]),H.return=J,J=H;break e}else{p(J,H);break}else c(J,H);H=H.sibling}H=v0(K,J.mode,Ce),H.return=J,J=H}return T(J);case ge:return ft=K._init,En(J,H,ft(K._payload),Ce)}if(wi(K))return Xe(J,H,K,Ce);if(qe(K))return rt(J,H,K,Ce);Fd(J,K)}return typeof K=="string"&&K!==""||typeof K=="number"?(K=""+K,H!==null&&H.tag===6?(p(J,H.sibling),H=k(H,K),H.return=J,J=H):(p(J,H),H=b0(K,J.mode,Ce),H.return=J,J=H),T(J)):p(J,H)}return En}var tl=Kb(!0),Gb=Kb(!1),$d=Ko(null),Bd=null,nl=null,Mm=null;function Nm(){Mm=nl=Bd=null}function Im(l){var c=$d.current;an($d),l._currentValue=c}function Dm(l,c,p){for(;l!==null;){var y=l.alternate;if((l.childLanes&c)!==c?(l.childLanes|=c,y!==null&&(y.childLanes|=c)):y!==null&&(y.childLanes&c)!==c&&(y.childLanes|=c),l===p)break;l=l.return}}function rl(l,c){Bd=l,Mm=nl=null,l=l.dependencies,l!==null&&l.firstContext!==null&&((l.lanes&c)!==0&&(Dr=!0),l.firstContext=null)}function ai(l){var c=l._currentValue;if(Mm!==l)if(l={context:l,memoizedValue:c,next:null},nl===null){if(Bd===null)throw Error(n(308));nl=l,Bd.dependencies={lanes:0,firstContext:l}}else nl=nl.next=l;return c}var ea=null;function Om(l){ea===null?ea=[l]:ea.push(l)}function Yb(l,c,p,y){var k=c.interleaved;return k===null?(p.next=p,Om(c)):(p.next=k.next,k.next=p),c.interleaved=p,vo(l,y)}function vo(l,c){l.lanes|=c;var p=l.alternate;for(p!==null&&(p.lanes|=c),p=l,l=l.return;l!==null;)l.childLanes|=c,p=l.alternate,p!==null&&(p.childLanes|=c),p=l,l=l.return;return p.tag===3?p.stateNode:null}var Qo=!1;function Rm(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Qb(l,c){l=l.updateQueue,c.updateQueue===l&&(c.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,effects:l.effects})}function ko(l,c){return{eventTime:l,lane:c,tag:0,payload:null,callback:null,next:null}}function Xo(l,c,p){var y=l.updateQueue;if(y===null)return null;if(y=y.shared,(Bt&2)!==0){var k=y.pending;return k===null?c.next=c:(c.next=k.next,k.next=c),y.pending=c,vo(l,p)}return k=y.interleaved,k===null?(c.next=c,Om(y)):(c.next=k.next,k.next=c),y.interleaved=c,vo(l,p)}function Ud(l,c,p){if(c=c.updateQueue,c!==null&&(c=c.shared,(p&4194240)!==0)){var y=c.lanes;y&=l.pendingLanes,p|=y,c.lanes=p,mo(l,p)}}function Xb(l,c){var p=l.updateQueue,y=l.alternate;if(y!==null&&(y=y.updateQueue,p===y)){var k=null,S=null;if(p=p.firstBaseUpdate,p!==null){do{var T={eventTime:p.eventTime,lane:p.lane,tag:p.tag,payload:p.payload,callback:p.callback,next:null};S===null?k=S=T:S=S.next=T,p=p.next}while(p!==null);S===null?k=S=c:S=S.next=c}else k=S=c;p={baseState:y.baseState,firstBaseUpdate:k,lastBaseUpdate:S,shared:y.shared,effects:y.effects},l.updateQueue=p;return}l=p.lastBaseUpdate,l===null?p.firstBaseUpdate=c:l.next=c,p.lastBaseUpdate=c}function Vd(l,c,p,y){var k=l.updateQueue;Qo=!1;var S=k.firstBaseUpdate,T=k.lastBaseUpdate,j=k.shared.pending;if(j!==null){k.shared.pending=null;var B=j,Q=B.next;B.next=null,T===null?S=Q:T.next=Q,T=B;var me=l.alternate;me!==null&&(me=me.updateQueue,j=me.lastBaseUpdate,j!==T&&(j===null?me.firstBaseUpdate=Q:j.next=Q,me.lastBaseUpdate=B))}if(S!==null){var xe=k.baseState;T=0,me=Q=B=null,j=S;do{var de=j.lane,He=j.eventTime;if((y&de)===de){me!==null&&(me=me.next={eventTime:He,lane:0,tag:j.tag,payload:j.payload,callback:j.callback,next:null});e:{var Xe=l,rt=j;switch(de=c,He=p,rt.tag){case 1:if(Xe=rt.payload,typeof Xe=="function"){xe=Xe.call(He,xe,de);break e}xe=Xe;break e;case 3:Xe.flags=Xe.flags&-65537|128;case 0:if(Xe=rt.payload,de=typeof Xe=="function"?Xe.call(He,xe,de):Xe,de==null)break e;xe=O({},xe,de);break e;case 2:Qo=!0}}j.callback!==null&&j.lane!==0&&(l.flags|=64,de=k.effects,de===null?k.effects=[j]:de.push(j))}else He={eventTime:He,lane:de,tag:j.tag,payload:j.payload,callback:j.callback,next:null},me===null?(Q=me=He,B=xe):me=me.next=He,T|=de;if(j=j.next,j===null){if(j=k.shared.pending,j===null)break;de=j,j=de.next,de.next=null,k.lastBaseUpdate=de,k.shared.pending=null}}while(!0);if(me===null&&(B=xe),k.baseState=B,k.firstBaseUpdate=Q,k.lastBaseUpdate=me,c=k.shared.interleaved,c!==null){k=c;do T|=k.lane,k=k.next;while(k!==c)}else S===null&&(k.shared.lanes=0);ra|=T,l.lanes=T,l.memoizedState=xe}}function ev(l,c,p){if(l=c.effects,c.effects=null,l!==null)for(c=0;c<l.length;c++){var y=l[c],k=y.callback;if(k!==null){if(y.callback=null,y=p,typeof k!="function")throw Error(n(191,k));k.call(y)}}}var vu={},Ui=Ko(vu),ku=Ko(vu),wu=Ko(vu);function ta(l){if(l===vu)throw Error(n(174));return l}function Pm(l,c){switch(en(wu,c),en(ku,l),en(Ui,vu),l=c.nodeType,l){case 9:case 11:c=(c=c.documentElement)?c.namespaceURI:_e(null,"");break;default:l=l===8?c.parentNode:c,c=l.namespaceURI||null,l=l.tagName,c=_e(c,l)}an(Ui),en(Ui,c)}function il(){an(Ui),an(ku),an(wu)}function tv(l){ta(wu.current);var c=ta(Ui.current),p=_e(c,l.type);c!==p&&(en(ku,l),en(Ui,p))}function jm(l){ku.current===l&&(an(Ui),an(ku))}var gn=Ko(0);function Hd(l){for(var c=l;c!==null;){if(c.tag===13){var p=c.memoizedState;if(p!==null&&(p=p.dehydrated,p===null||p.data==="$?"||p.data==="$!"))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===l)break;for(;c.sibling===null;){if(c.return===null||c.return===l)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var zm=[];function Lm(){for(var l=0;l<zm.length;l++)zm[l]._workInProgressVersionPrimary=null;zm.length=0}var Wd=I.ReactCurrentDispatcher,Fm=I.ReactCurrentBatchConfig,na=0,yn=null,Ln=null,Un=null,qd=!1,Cu=!1,Su=0,VM=0;function rr(){throw Error(n(321))}function $m(l,c){if(c===null)return!1;for(var p=0;p<c.length&&p<l.length;p++)if(!Ai(l[p],c[p]))return!1;return!0}function Bm(l,c,p,y,k,S){if(na=S,yn=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,Wd.current=l===null||l.memoizedState===null?ZM:JM,l=p(y,k),Cu){S=0;do{if(Cu=!1,Su=0,25<=S)throw Error(n(301));S+=1,Un=Ln=null,c.updateQueue=null,Wd.current=KM,l=p(y,k)}while(Cu)}if(Wd.current=Kd,c=Ln!==null&&Ln.next!==null,na=0,Un=Ln=yn=null,qd=!1,c)throw Error(n(300));return l}function Um(){var l=Su!==0;return Su=0,l}function Vi(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Un===null?yn.memoizedState=Un=l:Un=Un.next=l,Un}function li(){if(Ln===null){var l=yn.alternate;l=l!==null?l.memoizedState:null}else l=Ln.next;var c=Un===null?yn.memoizedState:Un.next;if(c!==null)Un=c,Ln=l;else{if(l===null)throw Error(n(310));Ln=l,l={memoizedState:Ln.memoizedState,baseState:Ln.baseState,baseQueue:Ln.baseQueue,queue:Ln.queue,next:null},Un===null?yn.memoizedState=Un=l:Un=Un.next=l}return Un}function Eu(l,c){return typeof c=="function"?c(l):c}function Vm(l){var c=li(),p=c.queue;if(p===null)throw Error(n(311));p.lastRenderedReducer=l;var y=Ln,k=y.baseQueue,S=p.pending;if(S!==null){if(k!==null){var T=k.next;k.next=S.next,S.next=T}y.baseQueue=k=S,p.pending=null}if(k!==null){S=k.next,y=y.baseState;var j=T=null,B=null,Q=S;do{var me=Q.lane;if((na&me)===me)B!==null&&(B=B.next={lane:0,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null}),y=Q.hasEagerState?Q.eagerState:l(y,Q.action);else{var xe={lane:me,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null};B===null?(j=B=xe,T=y):B=B.next=xe,yn.lanes|=me,ra|=me}Q=Q.next}while(Q!==null&&Q!==S);B===null?T=y:B.next=j,Ai(y,c.memoizedState)||(Dr=!0),c.memoizedState=y,c.baseState=T,c.baseQueue=B,p.lastRenderedState=y}if(l=p.interleaved,l!==null){k=l;do S=k.lane,yn.lanes|=S,ra|=S,k=k.next;while(k!==l)}else k===null&&(p.lanes=0);return[c.memoizedState,p.dispatch]}function Hm(l){var c=li(),p=c.queue;if(p===null)throw Error(n(311));p.lastRenderedReducer=l;var y=p.dispatch,k=p.pending,S=c.memoizedState;if(k!==null){p.pending=null;var T=k=k.next;do S=l(S,T.action),T=T.next;while(T!==k);Ai(S,c.memoizedState)||(Dr=!0),c.memoizedState=S,c.baseQueue===null&&(c.baseState=S),p.lastRenderedState=S}return[S,y]}function nv(){}function rv(l,c){var p=yn,y=li(),k=c(),S=!Ai(y.memoizedState,k);if(S&&(y.memoizedState=k,Dr=!0),y=y.queue,Wm(sv.bind(null,p,y,l),[l]),y.getSnapshot!==c||S||Un!==null&&Un.memoizedState.tag&1){if(p.flags|=2048,_u(9,ov.bind(null,p,y,k,c),void 0,null),Vn===null)throw Error(n(349));(na&30)!==0||iv(p,c,k)}return k}function iv(l,c,p){l.flags|=16384,l={getSnapshot:c,value:p},c=yn.updateQueue,c===null?(c={lastEffect:null,stores:null},yn.updateQueue=c,c.stores=[l]):(p=c.stores,p===null?c.stores=[l]:p.push(l))}function ov(l,c,p,y){c.value=p,c.getSnapshot=y,av(c)&&lv(l)}function sv(l,c,p){return p(function(){av(c)&&lv(l)})}function av(l){var c=l.getSnapshot;l=l.value;try{var p=c();return!Ai(l,p)}catch{return!0}}function lv(l){var c=vo(l,1);c!==null&&Oi(c,l,1,-1)}function uv(l){var c=Vi();return typeof l=="function"&&(l=l()),c.memoizedState=c.baseState=l,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Eu,lastRenderedState:l},c.queue=l,l=l.dispatch=qM.bind(null,yn,l),[c.memoizedState,l]}function _u(l,c,p,y){return l={tag:l,create:c,destroy:p,deps:y,next:null},c=yn.updateQueue,c===null?(c={lastEffect:null,stores:null},yn.updateQueue=c,c.lastEffect=l.next=l):(p=c.lastEffect,p===null?c.lastEffect=l.next=l:(y=p.next,p.next=l,l.next=y,c.lastEffect=l)),l}function cv(){return li().memoizedState}function Zd(l,c,p,y){var k=Vi();yn.flags|=l,k.memoizedState=_u(1|c,p,void 0,y===void 0?null:y)}function Jd(l,c,p,y){var k=li();y=y===void 0?null:y;var S=void 0;if(Ln!==null){var T=Ln.memoizedState;if(S=T.destroy,y!==null&&$m(y,T.deps)){k.memoizedState=_u(c,p,S,y);return}}yn.flags|=l,k.memoizedState=_u(1|c,p,S,y)}function dv(l,c){return Zd(8390656,8,l,c)}function Wm(l,c){return Jd(2048,8,l,c)}function fv(l,c){return Jd(4,2,l,c)}function hv(l,c){return Jd(4,4,l,c)}function pv(l,c){if(typeof c=="function")return l=l(),c(l),function(){c(null)};if(c!=null)return l=l(),c.current=l,function(){c.current=null}}function mv(l,c,p){return p=p!=null?p.concat([l]):null,Jd(4,4,pv.bind(null,c,l),p)}function qm(){}function gv(l,c){var p=li();c=c===void 0?null:c;var y=p.memoizedState;return y!==null&&c!==null&&$m(c,y[1])?y[0]:(p.memoizedState=[l,c],l)}function yv(l,c){var p=li();c=c===void 0?null:c;var y=p.memoizedState;return y!==null&&c!==null&&$m(c,y[1])?y[0]:(l=l(),p.memoizedState=[l,c],l)}function xv(l,c,p){return(na&21)===0?(l.baseState&&(l.baseState=!1,Dr=!0),l.memoizedState=p):(Ai(p,c)||(p=fr(),yn.lanes|=p,ra|=p,l.baseState=!0),c)}function HM(l,c){var p=Pt;Pt=p!==0&&4>p?p:4,l(!0);var y=Fm.transition;Fm.transition={};try{l(!1),c()}finally{Pt=p,Fm.transition=y}}function bv(){return li().memoizedState}function WM(l,c,p){var y=rs(l);if(p={lane:y,action:p,hasEagerState:!1,eagerState:null,next:null},vv(l))kv(c,p);else if(p=Yb(l,c,p,y),p!==null){var k=mr();Oi(p,l,y,k),wv(p,c,y)}}function qM(l,c,p){var y=rs(l),k={lane:y,action:p,hasEagerState:!1,eagerState:null,next:null};if(vv(l))kv(c,k);else{var S=l.alternate;if(l.lanes===0&&(S===null||S.lanes===0)&&(S=c.lastRenderedReducer,S!==null))try{var T=c.lastRenderedState,j=S(T,p);if(k.hasEagerState=!0,k.eagerState=j,Ai(j,T)){var B=c.interleaved;B===null?(k.next=k,Om(c)):(k.next=B.next,B.next=k),c.interleaved=k;return}}catch{}finally{}p=Yb(l,c,k,y),p!==null&&(k=mr(),Oi(p,l,y,k),wv(p,c,y))}}function vv(l){var c=l.alternate;return l===yn||c!==null&&c===yn}function kv(l,c){Cu=qd=!0;var p=l.pending;p===null?c.next=c:(c.next=p.next,p.next=c),l.pending=c}function wv(l,c,p){if((p&4194240)!==0){var y=c.lanes;y&=l.pendingLanes,p|=y,c.lanes=p,mo(l,p)}}var Kd={readContext:ai,useCallback:rr,useContext:rr,useEffect:rr,useImperativeHandle:rr,useInsertionEffect:rr,useLayoutEffect:rr,useMemo:rr,useReducer:rr,useRef:rr,useState:rr,useDebugValue:rr,useDeferredValue:rr,useTransition:rr,useMutableSource:rr,useSyncExternalStore:rr,useId:rr,unstable_isNewReconciler:!1},ZM={readContext:ai,useCallback:function(l,c){return Vi().memoizedState=[l,c===void 0?null:c],l},useContext:ai,useEffect:dv,useImperativeHandle:function(l,c,p){return p=p!=null?p.concat([l]):null,Zd(4194308,4,pv.bind(null,c,l),p)},useLayoutEffect:function(l,c){return Zd(4194308,4,l,c)},useInsertionEffect:function(l,c){return Zd(4,2,l,c)},useMemo:function(l,c){var p=Vi();return c=c===void 0?null:c,l=l(),p.memoizedState=[l,c],l},useReducer:function(l,c,p){var y=Vi();return c=p!==void 0?p(c):c,y.memoizedState=y.baseState=c,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:c},y.queue=l,l=l.dispatch=WM.bind(null,yn,l),[y.memoizedState,l]},useRef:function(l){var c=Vi();return l={current:l},c.memoizedState=l},useState:uv,useDebugValue:qm,useDeferredValue:function(l){return Vi().memoizedState=l},useTransition:function(){var l=uv(!1),c=l[0];return l=HM.bind(null,l[1]),Vi().memoizedState=l,[c,l]},useMutableSource:function(){},useSyncExternalStore:function(l,c,p){var y=yn,k=Vi();if(fn){if(p===void 0)throw Error(n(407));p=p()}else{if(p=c(),Vn===null)throw Error(n(349));(na&30)!==0||iv(y,c,p)}k.memoizedState=p;var S={value:p,getSnapshot:c};return k.queue=S,dv(sv.bind(null,y,S,l),[l]),y.flags|=2048,_u(9,ov.bind(null,y,S,p,c),void 0,null),p},useId:function(){var l=Vi(),c=Vn.identifierPrefix;if(fn){var p=bo,y=xo;p=(y&~(1<<32-Qe(y)-1)).toString(32)+p,c=":"+c+"R"+p,p=Su++,0<p&&(c+="H"+p.toString(32)),c+=":"}else p=VM++,c=":"+c+"r"+p.toString(32)+":";return l.memoizedState=c},unstable_isNewReconciler:!1},JM={readContext:ai,useCallback:gv,useContext:ai,useEffect:Wm,useImperativeHandle:mv,useInsertionEffect:fv,useLayoutEffect:hv,useMemo:yv,useReducer:Vm,useRef:cv,useState:function(){return Vm(Eu)},useDebugValue:qm,useDeferredValue:function(l){var c=li();return xv(c,Ln.memoizedState,l)},useTransition:function(){var l=Vm(Eu)[0],c=li().memoizedState;return[l,c]},useMutableSource:nv,useSyncExternalStore:rv,useId:bv,unstable_isNewReconciler:!1},KM={readContext:ai,useCallback:gv,useContext:ai,useEffect:Wm,useImperativeHandle:mv,useInsertionEffect:fv,useLayoutEffect:hv,useMemo:yv,useReducer:Hm,useRef:cv,useState:function(){return Hm(Eu)},useDebugValue:qm,useDeferredValue:function(l){var c=li();return Ln===null?c.memoizedState=l:xv(c,Ln.memoizedState,l)},useTransition:function(){var l=Hm(Eu)[0],c=li().memoizedState;return[l,c]},useMutableSource:nv,useSyncExternalStore:rv,useId:bv,unstable_isNewReconciler:!1};function Ni(l,c){if(l&&l.defaultProps){c=O({},c),l=l.defaultProps;for(var p in l)c[p]===void 0&&(c[p]=l[p]);return c}return c}function Zm(l,c,p,y){c=l.memoizedState,p=p(y,c),p=p==null?c:O({},c,p),l.memoizedState=p,l.lanes===0&&(l.updateQueue.baseState=p)}var Gd={isMounted:function(l){return(l=l._reactInternals)?kt(l)===l:!1},enqueueSetState:function(l,c,p){l=l._reactInternals;var y=mr(),k=rs(l),S=ko(y,k);S.payload=c,p!=null&&(S.callback=p),c=Xo(l,S,k),c!==null&&(Oi(c,l,k,y),Ud(c,l,k))},enqueueReplaceState:function(l,c,p){l=l._reactInternals;var y=mr(),k=rs(l),S=ko(y,k);S.tag=1,S.payload=c,p!=null&&(S.callback=p),c=Xo(l,S,k),c!==null&&(Oi(c,l,k,y),Ud(c,l,k))},enqueueForceUpdate:function(l,c){l=l._reactInternals;var p=mr(),y=rs(l),k=ko(p,y);k.tag=2,c!=null&&(k.callback=c),c=Xo(l,k,y),c!==null&&(Oi(c,l,y,p),Ud(c,l,y))}};function Cv(l,c,p,y,k,S,T){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(y,S,T):c.prototype&&c.prototype.isPureReactComponent?!fu(p,y)||!fu(k,S):!0}function Sv(l,c,p){var y=!1,k=Go,S=c.contextType;return typeof S=="object"&&S!==null?S=ai(S):(k=Ir(c)?Ys:nr.current,y=c.contextTypes,S=(y=y!=null)?Ya(l,k):Go),c=new c(p,S),l.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Gd,l.stateNode=c,c._reactInternals=l,y&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=k,l.__reactInternalMemoizedMaskedChildContext=S),c}function Ev(l,c,p,y){l=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(p,y),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(p,y),c.state!==l&&Gd.enqueueReplaceState(c,c.state,null)}function Jm(l,c,p,y){var k=l.stateNode;k.props=p,k.state=l.memoizedState,k.refs={},Rm(l);var S=c.contextType;typeof S=="object"&&S!==null?k.context=ai(S):(S=Ir(c)?Ys:nr.current,k.context=Ya(l,S)),k.state=l.memoizedState,S=c.getDerivedStateFromProps,typeof S=="function"&&(Zm(l,c,S,p),k.state=l.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof k.getSnapshotBeforeUpdate=="function"||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(c=k.state,typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount(),c!==k.state&&Gd.enqueueReplaceState(k,k.state,null),Vd(l,p,k,y),k.state=l.memoizedState),typeof k.componentDidMount=="function"&&(l.flags|=4194308)}function ol(l,c){try{var p="",y=c;do p+=V(y),y=y.return;while(y);var k=p}catch(S){k=`
39
+ Error generating stack: `+S.message+`
40
+ `+S.stack}return{value:l,source:c,stack:k,digest:null}}function Km(l,c,p){return{value:l,source:null,stack:p??null,digest:c??null}}function Gm(l,c){try{console.error(c.value)}catch(p){setTimeout(function(){throw p})}}var GM=typeof WeakMap=="function"?WeakMap:Map;function _v(l,c,p){p=ko(-1,p),p.tag=3,p.payload={element:null};var y=c.value;return p.callback=function(){rf||(rf=!0,d0=y),Gm(l,c)},p}function Tv(l,c,p){p=ko(-1,p),p.tag=3;var y=l.type.getDerivedStateFromError;if(typeof y=="function"){var k=c.value;p.payload=function(){return y(k)},p.callback=function(){Gm(l,c)}}var S=l.stateNode;return S!==null&&typeof S.componentDidCatch=="function"&&(p.callback=function(){Gm(l,c),typeof y!="function"&&(ts===null?ts=new Set([this]):ts.add(this));var T=c.stack;this.componentDidCatch(c.value,{componentStack:T!==null?T:""})}),p}function Av(l,c,p){var y=l.pingCache;if(y===null){y=l.pingCache=new GM;var k=new Set;y.set(c,k)}else k=y.get(c),k===void 0&&(k=new Set,y.set(c,k));k.has(p)||(k.add(p),l=cN.bind(null,l,c,p),c.then(l,l))}function Mv(l){do{var c;if((c=l.tag===13)&&(c=l.memoizedState,c=c!==null?c.dehydrated!==null:!0),c)return l;l=l.return}while(l!==null);return null}function Nv(l,c,p,y,k){return(l.mode&1)===0?(l===c?l.flags|=65536:(l.flags|=128,p.flags|=131072,p.flags&=-52805,p.tag===1&&(p.alternate===null?p.tag=17:(c=ko(-1,1),c.tag=2,Xo(p,c,1))),p.lanes|=1),l):(l.flags|=65536,l.lanes=k,l)}var YM=I.ReactCurrentOwner,Dr=!1;function pr(l,c,p,y){c.child=l===null?Gb(c,null,p,y):tl(c,l.child,p,y)}function Iv(l,c,p,y,k){p=p.render;var S=c.ref;return rl(c,k),y=Bm(l,c,p,y,S,k),p=Um(),l!==null&&!Dr?(c.updateQueue=l.updateQueue,c.flags&=-2053,l.lanes&=~k,wo(l,c,k)):(fn&&p&&Sm(c),c.flags|=1,pr(l,c,y,k),c.child)}function Dv(l,c,p,y,k){if(l===null){var S=p.type;return typeof S=="function"&&!x0(S)&&S.defaultProps===void 0&&p.compare===null&&p.defaultProps===void 0?(c.tag=15,c.type=S,Ov(l,c,S,y,k)):(l=cf(p.type,null,y,c,c.mode,k),l.ref=c.ref,l.return=c,c.child=l)}if(S=l.child,(l.lanes&k)===0){var T=S.memoizedProps;if(p=p.compare,p=p!==null?p:fu,p(T,y)&&l.ref===c.ref)return wo(l,c,k)}return c.flags|=1,l=ss(S,y),l.ref=c.ref,l.return=c,c.child=l}function Ov(l,c,p,y,k){if(l!==null){var S=l.memoizedProps;if(fu(S,y)&&l.ref===c.ref)if(Dr=!1,c.pendingProps=y=S,(l.lanes&k)!==0)(l.flags&131072)!==0&&(Dr=!0);else return c.lanes=l.lanes,wo(l,c,k)}return Ym(l,c,p,y,k)}function Rv(l,c,p){var y=c.pendingProps,k=y.children,S=l!==null?l.memoizedState:null;if(y.mode==="hidden")if((c.mode&1)===0)c.memoizedState={baseLanes:0,cachePool:null,transitions:null},en(al,Zr),Zr|=p;else{if((p&1073741824)===0)return l=S!==null?S.baseLanes|p:p,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:l,cachePool:null,transitions:null},c.updateQueue=null,en(al,Zr),Zr|=l,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},y=S!==null?S.baseLanes:p,en(al,Zr),Zr|=y}else S!==null?(y=S.baseLanes|p,c.memoizedState=null):y=p,en(al,Zr),Zr|=y;return pr(l,c,k,p),c.child}function Pv(l,c){var p=c.ref;(l===null&&p!==null||l!==null&&l.ref!==p)&&(c.flags|=512,c.flags|=2097152)}function Ym(l,c,p,y,k){var S=Ir(p)?Ys:nr.current;return S=Ya(c,S),rl(c,k),p=Bm(l,c,p,y,S,k),y=Um(),l!==null&&!Dr?(c.updateQueue=l.updateQueue,c.flags&=-2053,l.lanes&=~k,wo(l,c,k)):(fn&&y&&Sm(c),c.flags|=1,pr(l,c,p,k),c.child)}function jv(l,c,p,y,k){if(Ir(p)){var S=!0;Rd(c)}else S=!1;if(rl(c,k),c.stateNode===null)Qd(l,c),Sv(c,p,y),Jm(c,p,y,k),y=!0;else if(l===null){var T=c.stateNode,j=c.memoizedProps;T.props=j;var B=T.context,Q=p.contextType;typeof Q=="object"&&Q!==null?Q=ai(Q):(Q=Ir(p)?Ys:nr.current,Q=Ya(c,Q));var me=p.getDerivedStateFromProps,xe=typeof me=="function"||typeof T.getSnapshotBeforeUpdate=="function";xe||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(j!==y||B!==Q)&&Ev(c,T,y,Q),Qo=!1;var de=c.memoizedState;T.state=de,Vd(c,y,T,k),B=c.memoizedState,j!==y||de!==B||Nr.current||Qo?(typeof me=="function"&&(Zm(c,p,me,y),B=c.memoizedState),(j=Qo||Cv(c,p,j,y,de,B,Q))?(xe||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount()),typeof T.componentDidMount=="function"&&(c.flags|=4194308)):(typeof T.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=y,c.memoizedState=B),T.props=y,T.state=B,T.context=Q,y=j):(typeof T.componentDidMount=="function"&&(c.flags|=4194308),y=!1)}else{T=c.stateNode,Qb(l,c),j=c.memoizedProps,Q=c.type===c.elementType?j:Ni(c.type,j),T.props=Q,xe=c.pendingProps,de=T.context,B=p.contextType,typeof B=="object"&&B!==null?B=ai(B):(B=Ir(p)?Ys:nr.current,B=Ya(c,B));var He=p.getDerivedStateFromProps;(me=typeof He=="function"||typeof T.getSnapshotBeforeUpdate=="function")||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(j!==xe||de!==B)&&Ev(c,T,y,B),Qo=!1,de=c.memoizedState,T.state=de,Vd(c,y,T,k);var Xe=c.memoizedState;j!==xe||de!==Xe||Nr.current||Qo?(typeof He=="function"&&(Zm(c,p,He,y),Xe=c.memoizedState),(Q=Qo||Cv(c,p,Q,y,de,Xe,B)||!1)?(me||typeof T.UNSAFE_componentWillUpdate!="function"&&typeof T.componentWillUpdate!="function"||(typeof T.componentWillUpdate=="function"&&T.componentWillUpdate(y,Xe,B),typeof T.UNSAFE_componentWillUpdate=="function"&&T.UNSAFE_componentWillUpdate(y,Xe,B)),typeof T.componentDidUpdate=="function"&&(c.flags|=4),typeof T.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof T.componentDidUpdate!="function"||j===l.memoizedProps&&de===l.memoizedState||(c.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||j===l.memoizedProps&&de===l.memoizedState||(c.flags|=1024),c.memoizedProps=y,c.memoizedState=Xe),T.props=y,T.state=Xe,T.context=B,y=Q):(typeof T.componentDidUpdate!="function"||j===l.memoizedProps&&de===l.memoizedState||(c.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||j===l.memoizedProps&&de===l.memoizedState||(c.flags|=1024),y=!1)}return Qm(l,c,p,y,S,k)}function Qm(l,c,p,y,k,S){Pv(l,c);var T=(c.flags&128)!==0;if(!y&&!T)return k&&Bb(c,p,!1),wo(l,c,S);y=c.stateNode,YM.current=c;var j=T&&typeof p.getDerivedStateFromError!="function"?null:y.render();return c.flags|=1,l!==null&&T?(c.child=tl(c,l.child,null,S),c.child=tl(c,null,j,S)):pr(l,c,j,S),c.memoizedState=y.state,k&&Bb(c,p,!0),c.child}function zv(l){var c=l.stateNode;c.pendingContext?Fb(l,c.pendingContext,c.pendingContext!==c.context):c.context&&Fb(l,c.context,!1),Pm(l,c.containerInfo)}function Lv(l,c,p,y,k){return el(),Am(k),c.flags|=256,pr(l,c,p,y),c.child}var Xm={dehydrated:null,treeContext:null,retryLane:0};function e0(l){return{baseLanes:l,cachePool:null,transitions:null}}function Fv(l,c,p){var y=c.pendingProps,k=gn.current,S=!1,T=(c.flags&128)!==0,j;if((j=T)||(j=l!==null&&l.memoizedState===null?!1:(k&2)!==0),j?(S=!0,c.flags&=-129):(l===null||l.memoizedState!==null)&&(k|=1),en(gn,k&1),l===null)return Tm(c),l=c.memoizedState,l!==null&&(l=l.dehydrated,l!==null)?((c.mode&1)===0?c.lanes=1:l.data==="$!"?c.lanes=8:c.lanes=1073741824,null):(T=y.children,l=y.fallback,S?(y=c.mode,S=c.child,T={mode:"hidden",children:T},(y&1)===0&&S!==null?(S.childLanes=0,S.pendingProps=T):S=df(T,y,0,null),l=aa(l,y,p,null),S.return=c,l.return=c,S.sibling=l,c.child=S,c.child.memoizedState=e0(p),c.memoizedState=Xm,l):t0(c,T));if(k=l.memoizedState,k!==null&&(j=k.dehydrated,j!==null))return QM(l,c,T,y,j,k,p);if(S){S=y.fallback,T=c.mode,k=l.child,j=k.sibling;var B={mode:"hidden",children:y.children};return(T&1)===0&&c.child!==k?(y=c.child,y.childLanes=0,y.pendingProps=B,c.deletions=null):(y=ss(k,B),y.subtreeFlags=k.subtreeFlags&14680064),j!==null?S=ss(j,S):(S=aa(S,T,p,null),S.flags|=2),S.return=c,y.return=c,y.sibling=S,c.child=y,y=S,S=c.child,T=l.child.memoizedState,T=T===null?e0(p):{baseLanes:T.baseLanes|p,cachePool:null,transitions:T.transitions},S.memoizedState=T,S.childLanes=l.childLanes&~p,c.memoizedState=Xm,y}return S=l.child,l=S.sibling,y=ss(S,{mode:"visible",children:y.children}),(c.mode&1)===0&&(y.lanes=p),y.return=c,y.sibling=null,l!==null&&(p=c.deletions,p===null?(c.deletions=[l],c.flags|=16):p.push(l)),c.child=y,c.memoizedState=null,y}function t0(l,c){return c=df({mode:"visible",children:c},l.mode,0,null),c.return=l,l.child=c}function Yd(l,c,p,y){return y!==null&&Am(y),tl(c,l.child,null,p),l=t0(c,c.pendingProps.children),l.flags|=2,c.memoizedState=null,l}function QM(l,c,p,y,k,S,T){if(p)return c.flags&256?(c.flags&=-257,y=Km(Error(n(422))),Yd(l,c,T,y)):c.memoizedState!==null?(c.child=l.child,c.flags|=128,null):(S=y.fallback,k=c.mode,y=df({mode:"visible",children:y.children},k,0,null),S=aa(S,k,T,null),S.flags|=2,y.return=c,S.return=c,y.sibling=S,c.child=y,(c.mode&1)!==0&&tl(c,l.child,null,T),c.child.memoizedState=e0(T),c.memoizedState=Xm,S);if((c.mode&1)===0)return Yd(l,c,T,null);if(k.data==="$!"){if(y=k.nextSibling&&k.nextSibling.dataset,y)var j=y.dgst;return y=j,S=Error(n(419)),y=Km(S,y,void 0),Yd(l,c,T,y)}if(j=(T&l.childLanes)!==0,Dr||j){if(y=Vn,y!==null){switch(T&-T){case 4:k=2;break;case 16:k=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:k=32;break;case 536870912:k=268435456;break;default:k=0}k=(k&(y.suspendedLanes|T))!==0?0:k,k!==0&&k!==S.retryLane&&(S.retryLane=k,vo(l,k),Oi(y,l,k,-1))}return y0(),y=Km(Error(n(421))),Yd(l,c,T,y)}return k.data==="$?"?(c.flags|=128,c.child=l.child,c=dN.bind(null,l),k._reactRetry=c,null):(l=S.treeContext,qr=Jo(k.nextSibling),Wr=c,fn=!0,Mi=null,l!==null&&(oi[si++]=xo,oi[si++]=bo,oi[si++]=Qs,xo=l.id,bo=l.overflow,Qs=c),c=t0(c,y.children),c.flags|=4096,c)}function $v(l,c,p){l.lanes|=c;var y=l.alternate;y!==null&&(y.lanes|=c),Dm(l.return,c,p)}function n0(l,c,p,y,k){var S=l.memoizedState;S===null?l.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:y,tail:p,tailMode:k}:(S.isBackwards=c,S.rendering=null,S.renderingStartTime=0,S.last=y,S.tail=p,S.tailMode=k)}function Bv(l,c,p){var y=c.pendingProps,k=y.revealOrder,S=y.tail;if(pr(l,c,y.children,p),y=gn.current,(y&2)!==0)y=y&1|2,c.flags|=128;else{if(l!==null&&(l.flags&128)!==0)e:for(l=c.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&$v(l,p,c);else if(l.tag===19)$v(l,p,c);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===c)break e;for(;l.sibling===null;){if(l.return===null||l.return===c)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}y&=1}if(en(gn,y),(c.mode&1)===0)c.memoizedState=null;else switch(k){case"forwards":for(p=c.child,k=null;p!==null;)l=p.alternate,l!==null&&Hd(l)===null&&(k=p),p=p.sibling;p=k,p===null?(k=c.child,c.child=null):(k=p.sibling,p.sibling=null),n0(c,!1,k,p,S);break;case"backwards":for(p=null,k=c.child,c.child=null;k!==null;){if(l=k.alternate,l!==null&&Hd(l)===null){c.child=k;break}l=k.sibling,k.sibling=p,p=k,k=l}n0(c,!0,p,null,S);break;case"together":n0(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function Qd(l,c){(c.mode&1)===0&&l!==null&&(l.alternate=null,c.alternate=null,c.flags|=2)}function wo(l,c,p){if(l!==null&&(c.dependencies=l.dependencies),ra|=c.lanes,(p&c.childLanes)===0)return null;if(l!==null&&c.child!==l.child)throw Error(n(153));if(c.child!==null){for(l=c.child,p=ss(l,l.pendingProps),c.child=p,p.return=c;l.sibling!==null;)l=l.sibling,p=p.sibling=ss(l,l.pendingProps),p.return=c;p.sibling=null}return c.child}function XM(l,c,p){switch(c.tag){case 3:zv(c),el();break;case 5:tv(c);break;case 1:Ir(c.type)&&Rd(c);break;case 4:Pm(c,c.stateNode.containerInfo);break;case 10:var y=c.type._context,k=c.memoizedProps.value;en($d,y._currentValue),y._currentValue=k;break;case 13:if(y=c.memoizedState,y!==null)return y.dehydrated!==null?(en(gn,gn.current&1),c.flags|=128,null):(p&c.child.childLanes)!==0?Fv(l,c,p):(en(gn,gn.current&1),l=wo(l,c,p),l!==null?l.sibling:null);en(gn,gn.current&1);break;case 19:if(y=(p&c.childLanes)!==0,(l.flags&128)!==0){if(y)return Bv(l,c,p);c.flags|=128}if(k=c.memoizedState,k!==null&&(k.rendering=null,k.tail=null,k.lastEffect=null),en(gn,gn.current),y)break;return null;case 22:case 23:return c.lanes=0,Rv(l,c,p)}return wo(l,c,p)}var Uv,r0,Vv,Hv;Uv=function(l,c){for(var p=c.child;p!==null;){if(p.tag===5||p.tag===6)l.appendChild(p.stateNode);else if(p.tag!==4&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===c)break;for(;p.sibling===null;){if(p.return===null||p.return===c)return;p=p.return}p.sibling.return=p.return,p=p.sibling}},r0=function(){},Vv=function(l,c,p,y){var k=l.memoizedProps;if(k!==y){l=c.stateNode,ta(Ui.current);var S=null;switch(p){case"input":k=uo(l,k),y=uo(l,y),S=[];break;case"select":k=O({},k,{value:void 0}),y=O({},y,{value:void 0}),S=[];break;case"textarea":k=ri(l,k),y=ri(l,y),S=[];break;default:typeof k.onClick!="function"&&typeof y.onClick=="function"&&(l.onclick=Id)}zn(p,y);var T;p=null;for(Q in k)if(!y.hasOwnProperty(Q)&&k.hasOwnProperty(Q)&&k[Q]!=null)if(Q==="style"){var j=k[Q];for(T in j)j.hasOwnProperty(T)&&(p||(p={}),p[T]="")}else Q!=="dangerouslySetInnerHTML"&&Q!=="children"&&Q!=="suppressContentEditableWarning"&&Q!=="suppressHydrationWarning"&&Q!=="autoFocus"&&(i.hasOwnProperty(Q)?S||(S=[]):(S=S||[]).push(Q,null));for(Q in y){var B=y[Q];if(j=k!=null?k[Q]:void 0,y.hasOwnProperty(Q)&&B!==j&&(B!=null||j!=null))if(Q==="style")if(j){for(T in j)!j.hasOwnProperty(T)||B&&B.hasOwnProperty(T)||(p||(p={}),p[T]="");for(T in B)B.hasOwnProperty(T)&&j[T]!==B[T]&&(p||(p={}),p[T]=B[T])}else p||(S||(S=[]),S.push(Q,p)),p=B;else Q==="dangerouslySetInnerHTML"?(B=B?B.__html:void 0,j=j?j.__html:void 0,B!=null&&j!==B&&(S=S||[]).push(Q,B)):Q==="children"?typeof B!="string"&&typeof B!="number"||(S=S||[]).push(Q,""+B):Q!=="suppressContentEditableWarning"&&Q!=="suppressHydrationWarning"&&(i.hasOwnProperty(Q)?(B!=null&&Q==="onScroll"&&sn("scroll",l),S||j===B||(S=[])):(S=S||[]).push(Q,B))}p&&(S=S||[]).push("style",p);var Q=S;(c.updateQueue=Q)&&(c.flags|=4)}},Hv=function(l,c,p,y){p!==y&&(c.flags|=4)};function Tu(l,c){if(!fn)switch(l.tailMode){case"hidden":c=l.tail;for(var p=null;c!==null;)c.alternate!==null&&(p=c),c=c.sibling;p===null?l.tail=null:p.sibling=null;break;case"collapsed":p=l.tail;for(var y=null;p!==null;)p.alternate!==null&&(y=p),p=p.sibling;y===null?c||l.tail===null?l.tail=null:l.tail.sibling=null:y.sibling=null}}function ir(l){var c=l.alternate!==null&&l.alternate.child===l.child,p=0,y=0;if(c)for(var k=l.child;k!==null;)p|=k.lanes|k.childLanes,y|=k.subtreeFlags&14680064,y|=k.flags&14680064,k.return=l,k=k.sibling;else for(k=l.child;k!==null;)p|=k.lanes|k.childLanes,y|=k.subtreeFlags,y|=k.flags,k.return=l,k=k.sibling;return l.subtreeFlags|=y,l.childLanes=p,c}function eN(l,c,p){var y=c.pendingProps;switch(Em(c),c.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ir(c),null;case 1:return Ir(c.type)&&Od(),ir(c),null;case 3:return y=c.stateNode,il(),an(Nr),an(nr),Lm(),y.pendingContext&&(y.context=y.pendingContext,y.pendingContext=null),(l===null||l.child===null)&&(Ld(c)?c.flags|=4:l===null||l.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,Mi!==null&&(p0(Mi),Mi=null))),r0(l,c),ir(c),null;case 5:jm(c);var k=ta(wu.current);if(p=c.type,l!==null&&c.stateNode!=null)Vv(l,c,p,y,k),l.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!y){if(c.stateNode===null)throw Error(n(166));return ir(c),null}if(l=ta(Ui.current),Ld(c)){y=c.stateNode,p=c.type;var S=c.memoizedProps;switch(y[Bi]=c,y[yu]=S,l=(c.mode&1)!==0,p){case"dialog":sn("cancel",y),sn("close",y);break;case"iframe":case"object":case"embed":sn("load",y);break;case"video":case"audio":for(k=0;k<pu.length;k++)sn(pu[k],y);break;case"source":sn("error",y);break;case"img":case"image":case"link":sn("error",y),sn("load",y);break;case"details":sn("toggle",y);break;case"input":Zs(y,S),sn("invalid",y);break;case"select":y._wrapperState={wasMultiple:!!S.multiple},sn("invalid",y);break;case"textarea":Ks(y,S),sn("invalid",y)}zn(p,S),k=null;for(var T in S)if(S.hasOwnProperty(T)){var j=S[T];T==="children"?typeof j=="string"?y.textContent!==j&&(S.suppressHydrationWarning!==!0&&Nd(y.textContent,j,l),k=["children",j]):typeof j=="number"&&y.textContent!==""+j&&(S.suppressHydrationWarning!==!0&&Nd(y.textContent,j,l),k=["children",""+j]):i.hasOwnProperty(T)&&j!=null&&T==="onScroll"&&sn("scroll",y)}switch(p){case"input":qt(y),fo(y,S,!0);break;case"textarea":qt(y),ho(y);break;case"select":case"option":break;default:typeof S.onClick=="function"&&(y.onclick=Id)}y=k,c.updateQueue=y,y!==null&&(c.flags|=4)}else{T=k.nodeType===9?k:k.ownerDocument,l==="http://www.w3.org/1999/xhtml"&&(l=ne(p)),l==="http://www.w3.org/1999/xhtml"?p==="script"?(l=T.createElement("div"),l.innerHTML="<script><\/script>",l=l.removeChild(l.firstChild)):typeof y.is=="string"?l=T.createElement(p,{is:y.is}):(l=T.createElement(p),p==="select"&&(T=l,y.multiple?T.multiple=!0:y.size&&(T.size=y.size))):l=T.createElementNS(l,p),l[Bi]=c,l[yu]=y,Uv(l,c,!1,!1),c.stateNode=l;e:{switch(T=ii(p,y),p){case"dialog":sn("cancel",l),sn("close",l),k=y;break;case"iframe":case"object":case"embed":sn("load",l),k=y;break;case"video":case"audio":for(k=0;k<pu.length;k++)sn(pu[k],l);k=y;break;case"source":sn("error",l),k=y;break;case"img":case"image":case"link":sn("error",l),sn("load",l),k=y;break;case"details":sn("toggle",l),k=y;break;case"input":Zs(l,y),k=uo(l,y),sn("invalid",l);break;case"option":k=y;break;case"select":l._wrapperState={wasMultiple:!!y.multiple},k=O({},y,{value:void 0}),sn("invalid",l);break;case"textarea":Ks(l,y),k=ri(l,y),sn("invalid",l);break;default:k=y}zn(p,k),j=k;for(S in j)if(j.hasOwnProperty(S)){var B=j[S];S==="style"?$i(l,B):S==="dangerouslySetInnerHTML"?(B=B?B.__html:void 0,B!=null&&_t(l,B)):S==="children"?typeof B=="string"?(p!=="textarea"||B!=="")&&jt(l,B):typeof B=="number"&&jt(l,""+B):S!=="suppressContentEditableWarning"&&S!=="suppressHydrationWarning"&&S!=="autoFocus"&&(i.hasOwnProperty(S)?B!=null&&S==="onScroll"&&sn("scroll",l):B!=null&&E(l,S,B,T))}switch(p){case"input":qt(l),fo(l,y,!1);break;case"textarea":qt(l),ho(l);break;case"option":y.value!=null&&l.setAttribute("value",""+Pe(y.value));break;case"select":l.multiple=!!y.multiple,S=y.value,S!=null?Er(l,!!y.multiple,S,!1):y.defaultValue!=null&&Er(l,!!y.multiple,y.defaultValue,!0);break;default:typeof k.onClick=="function"&&(l.onclick=Id)}switch(p){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}}y&&(c.flags|=4)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return ir(c),null;case 6:if(l&&c.stateNode!=null)Hv(l,c,l.memoizedProps,y);else{if(typeof y!="string"&&c.stateNode===null)throw Error(n(166));if(p=ta(wu.current),ta(Ui.current),Ld(c)){if(y=c.stateNode,p=c.memoizedProps,y[Bi]=c,(S=y.nodeValue!==p)&&(l=Wr,l!==null))switch(l.tag){case 3:Nd(y.nodeValue,p,(l.mode&1)!==0);break;case 5:l.memoizedProps.suppressHydrationWarning!==!0&&Nd(y.nodeValue,p,(l.mode&1)!==0)}S&&(c.flags|=4)}else y=(p.nodeType===9?p:p.ownerDocument).createTextNode(y),y[Bi]=c,c.stateNode=y}return ir(c),null;case 13:if(an(gn),y=c.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(fn&&qr!==null&&(c.mode&1)!==0&&(c.flags&128)===0)Zb(),el(),c.flags|=98560,S=!1;else if(S=Ld(c),y!==null&&y.dehydrated!==null){if(l===null){if(!S)throw Error(n(318));if(S=c.memoizedState,S=S!==null?S.dehydrated:null,!S)throw Error(n(317));S[Bi]=c}else el(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;ir(c),S=!1}else Mi!==null&&(p0(Mi),Mi=null),S=!0;if(!S)return c.flags&65536?c:null}return(c.flags&128)!==0?(c.lanes=p,c):(y=y!==null,y!==(l!==null&&l.memoizedState!==null)&&y&&(c.child.flags|=8192,(c.mode&1)!==0&&(l===null||(gn.current&1)!==0?Fn===0&&(Fn=3):y0())),c.updateQueue!==null&&(c.flags|=4),ir(c),null);case 4:return il(),r0(l,c),l===null&&mu(c.stateNode.containerInfo),ir(c),null;case 10:return Im(c.type._context),ir(c),null;case 17:return Ir(c.type)&&Od(),ir(c),null;case 19:if(an(gn),S=c.memoizedState,S===null)return ir(c),null;if(y=(c.flags&128)!==0,T=S.rendering,T===null)if(y)Tu(S,!1);else{if(Fn!==0||l!==null&&(l.flags&128)!==0)for(l=c.child;l!==null;){if(T=Hd(l),T!==null){for(c.flags|=128,Tu(S,!1),y=T.updateQueue,y!==null&&(c.updateQueue=y,c.flags|=4),c.subtreeFlags=0,y=p,p=c.child;p!==null;)S=p,l=y,S.flags&=14680066,T=S.alternate,T===null?(S.childLanes=0,S.lanes=l,S.child=null,S.subtreeFlags=0,S.memoizedProps=null,S.memoizedState=null,S.updateQueue=null,S.dependencies=null,S.stateNode=null):(S.childLanes=T.childLanes,S.lanes=T.lanes,S.child=T.child,S.subtreeFlags=0,S.deletions=null,S.memoizedProps=T.memoizedProps,S.memoizedState=T.memoizedState,S.updateQueue=T.updateQueue,S.type=T.type,l=T.dependencies,S.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),p=p.sibling;return en(gn,gn.current&1|2),c.child}l=l.sibling}S.tail!==null&&se()>ll&&(c.flags|=128,y=!0,Tu(S,!1),c.lanes=4194304)}else{if(!y)if(l=Hd(T),l!==null){if(c.flags|=128,y=!0,p=l.updateQueue,p!==null&&(c.updateQueue=p,c.flags|=4),Tu(S,!0),S.tail===null&&S.tailMode==="hidden"&&!T.alternate&&!fn)return ir(c),null}else 2*se()-S.renderingStartTime>ll&&p!==1073741824&&(c.flags|=128,y=!0,Tu(S,!1),c.lanes=4194304);S.isBackwards?(T.sibling=c.child,c.child=T):(p=S.last,p!==null?p.sibling=T:c.child=T,S.last=T)}return S.tail!==null?(c=S.tail,S.rendering=c,S.tail=c.sibling,S.renderingStartTime=se(),c.sibling=null,p=gn.current,en(gn,y?p&1|2:p&1),c):(ir(c),null);case 22:case 23:return g0(),y=c.memoizedState!==null,l!==null&&l.memoizedState!==null!==y&&(c.flags|=8192),y&&(c.mode&1)!==0?(Zr&1073741824)!==0&&(ir(c),c.subtreeFlags&6&&(c.flags|=8192)):ir(c),null;case 24:return null;case 25:return null}throw Error(n(156,c.tag))}function tN(l,c){switch(Em(c),c.tag){case 1:return Ir(c.type)&&Od(),l=c.flags,l&65536?(c.flags=l&-65537|128,c):null;case 3:return il(),an(Nr),an(nr),Lm(),l=c.flags,(l&65536)!==0&&(l&128)===0?(c.flags=l&-65537|128,c):null;case 5:return jm(c),null;case 13:if(an(gn),l=c.memoizedState,l!==null&&l.dehydrated!==null){if(c.alternate===null)throw Error(n(340));el()}return l=c.flags,l&65536?(c.flags=l&-65537|128,c):null;case 19:return an(gn),null;case 4:return il(),null;case 10:return Im(c.type._context),null;case 22:case 23:return g0(),null;case 24:return null;default:return null}}var Xd=!1,or=!1,nN=typeof WeakSet=="function"?WeakSet:Set,Ge=null;function sl(l,c){var p=l.ref;if(p!==null)if(typeof p=="function")try{p(null)}catch(y){kn(l,c,y)}else p.current=null}function i0(l,c,p){try{p()}catch(y){kn(l,c,y)}}var Wv=!1;function rN(l,c){if(gm=bd,l=Cb(),lm(l)){if("selectionStart"in l)var p={start:l.selectionStart,end:l.selectionEnd};else e:{p=(p=l.ownerDocument)&&p.defaultView||window;var y=p.getSelection&&p.getSelection();if(y&&y.rangeCount!==0){p=y.anchorNode;var k=y.anchorOffset,S=y.focusNode;y=y.focusOffset;try{p.nodeType,S.nodeType}catch{p=null;break e}var T=0,j=-1,B=-1,Q=0,me=0,xe=l,de=null;t:for(;;){for(var He;xe!==p||k!==0&&xe.nodeType!==3||(j=T+k),xe!==S||y!==0&&xe.nodeType!==3||(B=T+y),xe.nodeType===3&&(T+=xe.nodeValue.length),(He=xe.firstChild)!==null;)de=xe,xe=He;for(;;){if(xe===l)break t;if(de===p&&++Q===k&&(j=T),de===S&&++me===y&&(B=T),(He=xe.nextSibling)!==null)break;xe=de,de=xe.parentNode}xe=He}p=j===-1||B===-1?null:{start:j,end:B}}else p=null}p=p||{start:0,end:0}}else p=null;for(ym={focusedElem:l,selectionRange:p},bd=!1,Ge=c;Ge!==null;)if(c=Ge,l=c.child,(c.subtreeFlags&1028)!==0&&l!==null)l.return=c,Ge=l;else for(;Ge!==null;){c=Ge;try{var Xe=c.alternate;if((c.flags&1024)!==0)switch(c.tag){case 0:case 11:case 15:break;case 1:if(Xe!==null){var rt=Xe.memoizedProps,En=Xe.memoizedState,J=c.stateNode,H=J.getSnapshotBeforeUpdate(c.elementType===c.type?rt:Ni(c.type,rt),En);J.__reactInternalSnapshotBeforeUpdate=H}break;case 3:var K=c.stateNode.containerInfo;K.nodeType===1?K.textContent="":K.nodeType===9&&K.documentElement&&K.removeChild(K.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Ce){kn(c,c.return,Ce)}if(l=c.sibling,l!==null){l.return=c.return,Ge=l;break}Ge=c.return}return Xe=Wv,Wv=!1,Xe}function Au(l,c,p){var y=c.updateQueue;if(y=y!==null?y.lastEffect:null,y!==null){var k=y=y.next;do{if((k.tag&l)===l){var S=k.destroy;k.destroy=void 0,S!==void 0&&i0(c,p,S)}k=k.next}while(k!==y)}}function ef(l,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var p=c=c.next;do{if((p.tag&l)===l){var y=p.create;p.destroy=y()}p=p.next}while(p!==c)}}function o0(l){var c=l.ref;if(c!==null){var p=l.stateNode;switch(l.tag){case 5:l=p;break;default:l=p}typeof c=="function"?c(l):c.current=l}}function qv(l){var c=l.alternate;c!==null&&(l.alternate=null,qv(c)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(c=l.stateNode,c!==null&&(delete c[Bi],delete c[yu],delete c[km],delete c[FM],delete c[$M])),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}function Zv(l){return l.tag===5||l.tag===3||l.tag===4}function Jv(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||Zv(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function s0(l,c,p){var y=l.tag;if(y===5||y===6)l=l.stateNode,c?p.nodeType===8?p.parentNode.insertBefore(l,c):p.insertBefore(l,c):(p.nodeType===8?(c=p.parentNode,c.insertBefore(l,p)):(c=p,c.appendChild(l)),p=p._reactRootContainer,p!=null||c.onclick!==null||(c.onclick=Id));else if(y!==4&&(l=l.child,l!==null))for(s0(l,c,p),l=l.sibling;l!==null;)s0(l,c,p),l=l.sibling}function a0(l,c,p){var y=l.tag;if(y===5||y===6)l=l.stateNode,c?p.insertBefore(l,c):p.appendChild(l);else if(y!==4&&(l=l.child,l!==null))for(a0(l,c,p),l=l.sibling;l!==null;)a0(l,c,p),l=l.sibling}var Gn=null,Ii=!1;function es(l,c,p){for(p=p.child;p!==null;)Kv(l,c,p),p=p.sibling}function Kv(l,c,p){if(Me&&typeof Me.onCommitFiberUnmount=="function")try{Me.onCommitFiberUnmount(te,p)}catch{}switch(p.tag){case 5:or||sl(p,c);case 6:var y=Gn,k=Ii;Gn=null,es(l,c,p),Gn=y,Ii=k,Gn!==null&&(Ii?(l=Gn,p=p.stateNode,l.nodeType===8?l.parentNode.removeChild(p):l.removeChild(p)):Gn.removeChild(p.stateNode));break;case 18:Gn!==null&&(Ii?(l=Gn,p=p.stateNode,l.nodeType===8?vm(l.parentNode,p):l.nodeType===1&&vm(l,p),su(l)):vm(Gn,p.stateNode));break;case 4:y=Gn,k=Ii,Gn=p.stateNode.containerInfo,Ii=!0,es(l,c,p),Gn=y,Ii=k;break;case 0:case 11:case 14:case 15:if(!or&&(y=p.updateQueue,y!==null&&(y=y.lastEffect,y!==null))){k=y=y.next;do{var S=k,T=S.destroy;S=S.tag,T!==void 0&&((S&2)!==0||(S&4)!==0)&&i0(p,c,T),k=k.next}while(k!==y)}es(l,c,p);break;case 1:if(!or&&(sl(p,c),y=p.stateNode,typeof y.componentWillUnmount=="function"))try{y.props=p.memoizedProps,y.state=p.memoizedState,y.componentWillUnmount()}catch(j){kn(p,c,j)}es(l,c,p);break;case 21:es(l,c,p);break;case 22:p.mode&1?(or=(y=or)||p.memoizedState!==null,es(l,c,p),or=y):es(l,c,p);break;default:es(l,c,p)}}function Gv(l){var c=l.updateQueue;if(c!==null){l.updateQueue=null;var p=l.stateNode;p===null&&(p=l.stateNode=new nN),c.forEach(function(y){var k=fN.bind(null,l,y);p.has(y)||(p.add(y),y.then(k,k))})}}function Di(l,c){var p=c.deletions;if(p!==null)for(var y=0;y<p.length;y++){var k=p[y];try{var S=l,T=c,j=T;e:for(;j!==null;){switch(j.tag){case 5:Gn=j.stateNode,Ii=!1;break e;case 3:Gn=j.stateNode.containerInfo,Ii=!0;break e;case 4:Gn=j.stateNode.containerInfo,Ii=!0;break e}j=j.return}if(Gn===null)throw Error(n(160));Kv(S,T,k),Gn=null,Ii=!1;var B=k.alternate;B!==null&&(B.return=null),k.return=null}catch(Q){kn(k,c,Q)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)Yv(c,l),c=c.sibling}function Yv(l,c){var p=l.alternate,y=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:if(Di(c,l),Hi(l),y&4){try{Au(3,l,l.return),ef(3,l)}catch(rt){kn(l,l.return,rt)}try{Au(5,l,l.return)}catch(rt){kn(l,l.return,rt)}}break;case 1:Di(c,l),Hi(l),y&512&&p!==null&&sl(p,p.return);break;case 5:if(Di(c,l),Hi(l),y&512&&p!==null&&sl(p,p.return),l.flags&32){var k=l.stateNode;try{jt(k,"")}catch(rt){kn(l,l.return,rt)}}if(y&4&&(k=l.stateNode,k!=null)){var S=l.memoizedProps,T=p!==null?p.memoizedProps:S,j=l.type,B=l.updateQueue;if(l.updateQueue=null,B!==null)try{j==="input"&&S.type==="radio"&&S.name!=null&&Js(k,S),ii(j,T);var Q=ii(j,S);for(T=0;T<B.length;T+=2){var me=B[T],xe=B[T+1];me==="style"?$i(k,xe):me==="dangerouslySetInnerHTML"?_t(k,xe):me==="children"?jt(k,xe):E(k,me,xe,Q)}switch(j){case"input":co(k,S);break;case"textarea":_r(k,S);break;case"select":var de=k._wrapperState.wasMultiple;k._wrapperState.wasMultiple=!!S.multiple;var He=S.value;He!=null?Er(k,!!S.multiple,He,!1):de!==!!S.multiple&&(S.defaultValue!=null?Er(k,!!S.multiple,S.defaultValue,!0):Er(k,!!S.multiple,S.multiple?[]:"",!1))}k[yu]=S}catch(rt){kn(l,l.return,rt)}}break;case 6:if(Di(c,l),Hi(l),y&4){if(l.stateNode===null)throw Error(n(162));k=l.stateNode,S=l.memoizedProps;try{k.nodeValue=S}catch(rt){kn(l,l.return,rt)}}break;case 3:if(Di(c,l),Hi(l),y&4&&p!==null&&p.memoizedState.isDehydrated)try{su(c.containerInfo)}catch(rt){kn(l,l.return,rt)}break;case 4:Di(c,l),Hi(l);break;case 13:Di(c,l),Hi(l),k=l.child,k.flags&8192&&(S=k.memoizedState!==null,k.stateNode.isHidden=S,!S||k.alternate!==null&&k.alternate.memoizedState!==null||(c0=se())),y&4&&Gv(l);break;case 22:if(me=p!==null&&p.memoizedState!==null,l.mode&1?(or=(Q=or)||me,Di(c,l),or=Q):Di(c,l),Hi(l),y&8192){if(Q=l.memoizedState!==null,(l.stateNode.isHidden=Q)&&!me&&(l.mode&1)!==0)for(Ge=l,me=l.child;me!==null;){for(xe=Ge=me;Ge!==null;){switch(de=Ge,He=de.child,de.tag){case 0:case 11:case 14:case 15:Au(4,de,de.return);break;case 1:sl(de,de.return);var Xe=de.stateNode;if(typeof Xe.componentWillUnmount=="function"){y=de,p=de.return;try{c=y,Xe.props=c.memoizedProps,Xe.state=c.memoizedState,Xe.componentWillUnmount()}catch(rt){kn(y,p,rt)}}break;case 5:sl(de,de.return);break;case 22:if(de.memoizedState!==null){ek(xe);continue}}He!==null?(He.return=de,Ge=He):ek(xe)}me=me.sibling}e:for(me=null,xe=l;;){if(xe.tag===5){if(me===null){me=xe;try{k=xe.stateNode,Q?(S=k.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none"):(j=xe.stateNode,B=xe.memoizedProps.style,T=B!=null&&B.hasOwnProperty("display")?B.display:null,j.style.display=Tr("display",T))}catch(rt){kn(l,l.return,rt)}}}else if(xe.tag===6){if(me===null)try{xe.stateNode.nodeValue=Q?"":xe.memoizedProps}catch(rt){kn(l,l.return,rt)}}else if((xe.tag!==22&&xe.tag!==23||xe.memoizedState===null||xe===l)&&xe.child!==null){xe.child.return=xe,xe=xe.child;continue}if(xe===l)break e;for(;xe.sibling===null;){if(xe.return===null||xe.return===l)break e;me===xe&&(me=null),xe=xe.return}me===xe&&(me=null),xe.sibling.return=xe.return,xe=xe.sibling}}break;case 19:Di(c,l),Hi(l),y&4&&Gv(l);break;case 21:break;default:Di(c,l),Hi(l)}}function Hi(l){var c=l.flags;if(c&2){try{e:{for(var p=l.return;p!==null;){if(Zv(p)){var y=p;break e}p=p.return}throw Error(n(160))}switch(y.tag){case 5:var k=y.stateNode;y.flags&32&&(jt(k,""),y.flags&=-33);var S=Jv(l);a0(l,S,k);break;case 3:case 4:var T=y.stateNode.containerInfo,j=Jv(l);s0(l,j,T);break;default:throw Error(n(161))}}catch(B){kn(l,l.return,B)}l.flags&=-3}c&4096&&(l.flags&=-4097)}function iN(l,c,p){Ge=l,Qv(l)}function Qv(l,c,p){for(var y=(l.mode&1)!==0;Ge!==null;){var k=Ge,S=k.child;if(k.tag===22&&y){var T=k.memoizedState!==null||Xd;if(!T){var j=k.alternate,B=j!==null&&j.memoizedState!==null||or;j=Xd;var Q=or;if(Xd=T,(or=B)&&!Q)for(Ge=k;Ge!==null;)T=Ge,B=T.child,T.tag===22&&T.memoizedState!==null?tk(k):B!==null?(B.return=T,Ge=B):tk(k);for(;S!==null;)Ge=S,Qv(S),S=S.sibling;Ge=k,Xd=j,or=Q}Xv(l)}else(k.subtreeFlags&8772)!==0&&S!==null?(S.return=k,Ge=S):Xv(l)}}function Xv(l){for(;Ge!==null;){var c=Ge;if((c.flags&8772)!==0){var p=c.alternate;try{if((c.flags&8772)!==0)switch(c.tag){case 0:case 11:case 15:or||ef(5,c);break;case 1:var y=c.stateNode;if(c.flags&4&&!or)if(p===null)y.componentDidMount();else{var k=c.elementType===c.type?p.memoizedProps:Ni(c.type,p.memoizedProps);y.componentDidUpdate(k,p.memoizedState,y.__reactInternalSnapshotBeforeUpdate)}var S=c.updateQueue;S!==null&&ev(c,S,y);break;case 3:var T=c.updateQueue;if(T!==null){if(p=null,c.child!==null)switch(c.child.tag){case 5:p=c.child.stateNode;break;case 1:p=c.child.stateNode}ev(c,T,p)}break;case 5:var j=c.stateNode;if(p===null&&c.flags&4){p=j;var B=c.memoizedProps;switch(c.type){case"button":case"input":case"select":case"textarea":B.autoFocus&&p.focus();break;case"img":B.src&&(p.src=B.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(c.memoizedState===null){var Q=c.alternate;if(Q!==null){var me=Q.memoizedState;if(me!==null){var xe=me.dehydrated;xe!==null&&su(xe)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}or||c.flags&512&&o0(c)}catch(de){kn(c,c.return,de)}}if(c===l){Ge=null;break}if(p=c.sibling,p!==null){p.return=c.return,Ge=p;break}Ge=c.return}}function ek(l){for(;Ge!==null;){var c=Ge;if(c===l){Ge=null;break}var p=c.sibling;if(p!==null){p.return=c.return,Ge=p;break}Ge=c.return}}function tk(l){for(;Ge!==null;){var c=Ge;try{switch(c.tag){case 0:case 11:case 15:var p=c.return;try{ef(4,c)}catch(B){kn(c,p,B)}break;case 1:var y=c.stateNode;if(typeof y.componentDidMount=="function"){var k=c.return;try{y.componentDidMount()}catch(B){kn(c,k,B)}}var S=c.return;try{o0(c)}catch(B){kn(c,S,B)}break;case 5:var T=c.return;try{o0(c)}catch(B){kn(c,T,B)}}}catch(B){kn(c,c.return,B)}if(c===l){Ge=null;break}var j=c.sibling;if(j!==null){j.return=c.return,Ge=j;break}Ge=c.return}}var oN=Math.ceil,tf=I.ReactCurrentDispatcher,l0=I.ReactCurrentOwner,ui=I.ReactCurrentBatchConfig,Bt=0,Vn=null,Tn=null,Yn=0,Zr=0,al=Ko(0),Fn=0,Mu=null,ra=0,nf=0,u0=0,Nu=null,Or=null,c0=0,ll=1/0,Co=null,rf=!1,d0=null,ts=null,of=!1,ns=null,sf=0,Iu=0,f0=null,af=-1,lf=0;function mr(){return(Bt&6)!==0?se():af!==-1?af:af=se()}function rs(l){return(l.mode&1)===0?1:(Bt&2)!==0&&Yn!==0?Yn&-Yn:UM.transition!==null?(lf===0&&(lf=fr()),lf):(l=Pt,l!==0||(l=window.event,l=l===void 0?16:rb(l.type)),l)}function Oi(l,c,p,y){if(50<Iu)throw Iu=0,f0=null,Error(n(185));hr(l,p,y),((Bt&2)===0||l!==Vn)&&(l===Vn&&((Bt&2)===0&&(nf|=p),Fn===4&&is(l,Yn)),Rr(l,y),p===1&&Bt===0&&(c.mode&1)===0&&(ll=se()+500,Pd&&Yo()))}function Rr(l,c){var p=l.callbackNode;at(l,c);var y=Xt(l,l===Vn?Yn:0);if(y===0)p!==null&&ce(p),l.callbackNode=null,l.callbackPriority=0;else if(c=y&-y,l.callbackPriority!==c){if(p!=null&&ce(p),c===1)l.tag===0?BM(rk.bind(null,l)):Ub(rk.bind(null,l)),zM(function(){(Bt&6)===0&&Yo()}),p=null;else{switch(md(y)){case 1:p=Fe;break;case 4:p=le;break;case 16:p=ye;break;case 536870912:p=U;break;default:p=ye}p=dk(p,nk.bind(null,l))}l.callbackPriority=c,l.callbackNode=p}}function nk(l,c){if(af=-1,lf=0,(Bt&6)!==0)throw Error(n(327));var p=l.callbackNode;if(ul()&&l.callbackNode!==p)return null;var y=Xt(l,l===Vn?Yn:0);if(y===0)return null;if((y&30)!==0||(y&l.expiredLanes)!==0||c)c=uf(l,y);else{c=y;var k=Bt;Bt|=2;var S=ok();(Vn!==l||Yn!==c)&&(Co=null,ll=se()+500,oa(l,c));do try{lN();break}catch(j){ik(l,j)}while(!0);Nm(),tf.current=S,Bt=k,Tn!==null?c=0:(Vn=null,Yn=0,c=Fn)}if(c!==0){if(c===2&&(k=Vr(l),k!==0&&(y=k,c=h0(l,k))),c===1)throw p=Mu,oa(l,0),is(l,y),Rr(l,se()),p;if(c===6)is(l,y);else{if(k=l.current.alternate,(y&30)===0&&!sN(k)&&(c=uf(l,y),c===2&&(S=Vr(l),S!==0&&(y=S,c=h0(l,S))),c===1))throw p=Mu,oa(l,0),is(l,y),Rr(l,se()),p;switch(l.finishedWork=k,l.finishedLanes=y,c){case 0:case 1:throw Error(n(345));case 2:sa(l,Or,Co);break;case 3:if(is(l,y),(y&130023424)===y&&(c=c0+500-se(),10<c)){if(Xt(l,0)!==0)break;if(k=l.suspendedLanes,(k&y)!==y){mr(),l.pingedLanes|=l.suspendedLanes&k;break}l.timeoutHandle=bm(sa.bind(null,l,Or,Co),c);break}sa(l,Or,Co);break;case 4:if(is(l,y),(y&4194240)===y)break;for(c=l.eventTimes,k=-1;0<y;){var T=31-Qe(y);S=1<<T,T=c[T],T>k&&(k=T),y&=~S}if(y=k,y=se()-y,y=(120>y?120:480>y?480:1080>y?1080:1920>y?1920:3e3>y?3e3:4320>y?4320:1960*oN(y/1960))-y,10<y){l.timeoutHandle=bm(sa.bind(null,l,Or,Co),y);break}sa(l,Or,Co);break;case 5:sa(l,Or,Co);break;default:throw Error(n(329))}}}return Rr(l,se()),l.callbackNode===p?nk.bind(null,l):null}function h0(l,c){var p=Nu;return l.current.memoizedState.isDehydrated&&(oa(l,c).flags|=256),l=uf(l,c),l!==2&&(c=Or,Or=p,c!==null&&p0(c)),l}function p0(l){Or===null?Or=l:Or.push.apply(Or,l)}function sN(l){for(var c=l;;){if(c.flags&16384){var p=c.updateQueue;if(p!==null&&(p=p.stores,p!==null))for(var y=0;y<p.length;y++){var k=p[y],S=k.getSnapshot;k=k.value;try{if(!Ai(S(),k))return!1}catch{return!1}}}if(p=c.child,c.subtreeFlags&16384&&p!==null)p.return=c,c=p;else{if(c===l)break;for(;c.sibling===null;){if(c.return===null||c.return===l)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function is(l,c){for(c&=~u0,c&=~nf,l.suspendedLanes|=c,l.pingedLanes&=~c,l=l.expirationTimes;0<c;){var p=31-Qe(c),y=1<<p;l[p]=-1,c&=~y}}function rk(l){if((Bt&6)!==0)throw Error(n(327));ul();var c=Xt(l,0);if((c&1)===0)return Rr(l,se()),null;var p=uf(l,c);if(l.tag!==0&&p===2){var y=Vr(l);y!==0&&(c=y,p=h0(l,y))}if(p===1)throw p=Mu,oa(l,0),is(l,c),Rr(l,se()),p;if(p===6)throw Error(n(345));return l.finishedWork=l.current.alternate,l.finishedLanes=c,sa(l,Or,Co),Rr(l,se()),null}function m0(l,c){var p=Bt;Bt|=1;try{return l(c)}finally{Bt=p,Bt===0&&(ll=se()+500,Pd&&Yo())}}function ia(l){ns!==null&&ns.tag===0&&(Bt&6)===0&&ul();var c=Bt;Bt|=1;var p=ui.transition,y=Pt;try{if(ui.transition=null,Pt=1,l)return l()}finally{Pt=y,ui.transition=p,Bt=c,(Bt&6)===0&&Yo()}}function g0(){Zr=al.current,an(al)}function oa(l,c){l.finishedWork=null,l.finishedLanes=0;var p=l.timeoutHandle;if(p!==-1&&(l.timeoutHandle=-1,jM(p)),Tn!==null)for(p=Tn.return;p!==null;){var y=p;switch(Em(y),y.tag){case 1:y=y.type.childContextTypes,y!=null&&Od();break;case 3:il(),an(Nr),an(nr),Lm();break;case 5:jm(y);break;case 4:il();break;case 13:an(gn);break;case 19:an(gn);break;case 10:Im(y.type._context);break;case 22:case 23:g0()}p=p.return}if(Vn=l,Tn=l=ss(l.current,null),Yn=Zr=c,Fn=0,Mu=null,u0=nf=ra=0,Or=Nu=null,ea!==null){for(c=0;c<ea.length;c++)if(p=ea[c],y=p.interleaved,y!==null){p.interleaved=null;var k=y.next,S=p.pending;if(S!==null){var T=S.next;S.next=k,y.next=T}p.pending=y}ea=null}return l}function ik(l,c){do{var p=Tn;try{if(Nm(),Wd.current=Kd,qd){for(var y=yn.memoizedState;y!==null;){var k=y.queue;k!==null&&(k.pending=null),y=y.next}qd=!1}if(na=0,Un=Ln=yn=null,Cu=!1,Su=0,l0.current=null,p===null||p.return===null){Fn=1,Mu=c,Tn=null;break}e:{var S=l,T=p.return,j=p,B=c;if(c=Yn,j.flags|=32768,B!==null&&typeof B=="object"&&typeof B.then=="function"){var Q=B,me=j,xe=me.tag;if((me.mode&1)===0&&(xe===0||xe===11||xe===15)){var de=me.alternate;de?(me.updateQueue=de.updateQueue,me.memoizedState=de.memoizedState,me.lanes=de.lanes):(me.updateQueue=null,me.memoizedState=null)}var He=Mv(T);if(He!==null){He.flags&=-257,Nv(He,T,j,S,c),He.mode&1&&Av(S,Q,c),c=He,B=Q;var Xe=c.updateQueue;if(Xe===null){var rt=new Set;rt.add(B),c.updateQueue=rt}else Xe.add(B);break e}else{if((c&1)===0){Av(S,Q,c),y0();break e}B=Error(n(426))}}else if(fn&&j.mode&1){var En=Mv(T);if(En!==null){(En.flags&65536)===0&&(En.flags|=256),Nv(En,T,j,S,c),Am(ol(B,j));break e}}S=B=ol(B,j),Fn!==4&&(Fn=2),Nu===null?Nu=[S]:Nu.push(S),S=T;do{switch(S.tag){case 3:S.flags|=65536,c&=-c,S.lanes|=c;var J=_v(S,B,c);Xb(S,J);break e;case 1:j=B;var H=S.type,K=S.stateNode;if((S.flags&128)===0&&(typeof H.getDerivedStateFromError=="function"||K!==null&&typeof K.componentDidCatch=="function"&&(ts===null||!ts.has(K)))){S.flags|=65536,c&=-c,S.lanes|=c;var Ce=Tv(S,j,c);Xb(S,Ce);break e}}S=S.return}while(S!==null)}ak(p)}catch(it){c=it,Tn===p&&p!==null&&(Tn=p=p.return);continue}break}while(!0)}function ok(){var l=tf.current;return tf.current=Kd,l===null?Kd:l}function y0(){(Fn===0||Fn===3||Fn===2)&&(Fn=4),Vn===null||(ra&268435455)===0&&(nf&268435455)===0||is(Vn,Yn)}function uf(l,c){var p=Bt;Bt|=2;var y=ok();(Vn!==l||Yn!==c)&&(Co=null,oa(l,c));do try{aN();break}catch(k){ik(l,k)}while(!0);if(Nm(),Bt=p,tf.current=y,Tn!==null)throw Error(n(261));return Vn=null,Yn=0,Fn}function aN(){for(;Tn!==null;)sk(Tn)}function lN(){for(;Tn!==null&&!G();)sk(Tn)}function sk(l){var c=ck(l.alternate,l,Zr);l.memoizedProps=l.pendingProps,c===null?ak(l):Tn=c,l0.current=null}function ak(l){var c=l;do{var p=c.alternate;if(l=c.return,(c.flags&32768)===0){if(p=eN(p,c,Zr),p!==null){Tn=p;return}}else{if(p=tN(p,c),p!==null){p.flags&=32767,Tn=p;return}if(l!==null)l.flags|=32768,l.subtreeFlags=0,l.deletions=null;else{Fn=6,Tn=null;return}}if(c=c.sibling,c!==null){Tn=c;return}Tn=c=l}while(c!==null);Fn===0&&(Fn=5)}function sa(l,c,p){var y=Pt,k=ui.transition;try{ui.transition=null,Pt=1,uN(l,c,p,y)}finally{ui.transition=k,Pt=y}return null}function uN(l,c,p,y){do ul();while(ns!==null);if((Bt&6)!==0)throw Error(n(327));p=l.finishedWork;var k=l.finishedLanes;if(p===null)return null;if(l.finishedWork=null,l.finishedLanes=0,p===l.current)throw Error(n(177));l.callbackNode=null,l.callbackPriority=0;var S=p.lanes|p.childLanes;if(Mr(l,S),l===Vn&&(Tn=Vn=null,Yn=0),(p.subtreeFlags&2064)===0&&(p.flags&2064)===0||of||(of=!0,dk(ye,function(){return ul(),null})),S=(p.flags&15990)!==0,(p.subtreeFlags&15990)!==0||S){S=ui.transition,ui.transition=null;var T=Pt;Pt=1;var j=Bt;Bt|=4,l0.current=null,rN(l,p),Yv(p,l),MM(ym),bd=!!gm,ym=gm=null,l.current=p,iN(p),ae(),Bt=j,Pt=T,ui.transition=S}else l.current=p;if(of&&(of=!1,ns=l,sf=k),S=l.pendingLanes,S===0&&(ts=null),De(p.stateNode),Rr(l,se()),c!==null)for(y=l.onRecoverableError,p=0;p<c.length;p++)k=c[p],y(k.value,{componentStack:k.stack,digest:k.digest});if(rf)throw rf=!1,l=d0,d0=null,l;return(sf&1)!==0&&l.tag!==0&&ul(),S=l.pendingLanes,(S&1)!==0?l===f0?Iu++:(Iu=0,f0=l):Iu=0,Yo(),null}function ul(){if(ns!==null){var l=md(sf),c=ui.transition,p=Pt;try{if(ui.transition=null,Pt=16>l?16:l,ns===null)var y=!1;else{if(l=ns,ns=null,sf=0,(Bt&6)!==0)throw Error(n(331));var k=Bt;for(Bt|=4,Ge=l.current;Ge!==null;){var S=Ge,T=S.child;if((Ge.flags&16)!==0){var j=S.deletions;if(j!==null){for(var B=0;B<j.length;B++){var Q=j[B];for(Ge=Q;Ge!==null;){var me=Ge;switch(me.tag){case 0:case 11:case 15:Au(8,me,S)}var xe=me.child;if(xe!==null)xe.return=me,Ge=xe;else for(;Ge!==null;){me=Ge;var de=me.sibling,He=me.return;if(qv(me),me===Q){Ge=null;break}if(de!==null){de.return=He,Ge=de;break}Ge=He}}}var Xe=S.alternate;if(Xe!==null){var rt=Xe.child;if(rt!==null){Xe.child=null;do{var En=rt.sibling;rt.sibling=null,rt=En}while(rt!==null)}}Ge=S}}if((S.subtreeFlags&2064)!==0&&T!==null)T.return=S,Ge=T;else e:for(;Ge!==null;){if(S=Ge,(S.flags&2048)!==0)switch(S.tag){case 0:case 11:case 15:Au(9,S,S.return)}var J=S.sibling;if(J!==null){J.return=S.return,Ge=J;break e}Ge=S.return}}var H=l.current;for(Ge=H;Ge!==null;){T=Ge;var K=T.child;if((T.subtreeFlags&2064)!==0&&K!==null)K.return=T,Ge=K;else e:for(T=H;Ge!==null;){if(j=Ge,(j.flags&2048)!==0)try{switch(j.tag){case 0:case 11:case 15:ef(9,j)}}catch(it){kn(j,j.return,it)}if(j===T){Ge=null;break e}var Ce=j.sibling;if(Ce!==null){Ce.return=j.return,Ge=Ce;break e}Ge=j.return}}if(Bt=k,Yo(),Me&&typeof Me.onPostCommitFiberRoot=="function")try{Me.onPostCommitFiberRoot(te,l)}catch{}y=!0}return y}finally{Pt=p,ui.transition=c}}return!1}function lk(l,c,p){c=ol(p,c),c=_v(l,c,1),l=Xo(l,c,1),c=mr(),l!==null&&(hr(l,1,c),Rr(l,c))}function kn(l,c,p){if(l.tag===3)lk(l,l,p);else for(;c!==null;){if(c.tag===3){lk(c,l,p);break}else if(c.tag===1){var y=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(ts===null||!ts.has(y))){l=ol(p,l),l=Tv(c,l,1),c=Xo(c,l,1),l=mr(),c!==null&&(hr(c,1,l),Rr(c,l));break}}c=c.return}}function cN(l,c,p){var y=l.pingCache;y!==null&&y.delete(c),c=mr(),l.pingedLanes|=l.suspendedLanes&p,Vn===l&&(Yn&p)===p&&(Fn===4||Fn===3&&(Yn&130023424)===Yn&&500>se()-c0?oa(l,0):u0|=p),Rr(l,c)}function uk(l,c){c===0&&((l.mode&1)===0?c=1:(c=Ct,Ct<<=1,(Ct&130023424)===0&&(Ct=4194304)));var p=mr();l=vo(l,c),l!==null&&(hr(l,c,p),Rr(l,p))}function dN(l){var c=l.memoizedState,p=0;c!==null&&(p=c.retryLane),uk(l,p)}function fN(l,c){var p=0;switch(l.tag){case 13:var y=l.stateNode,k=l.memoizedState;k!==null&&(p=k.retryLane);break;case 19:y=l.stateNode;break;default:throw Error(n(314))}y!==null&&y.delete(c),uk(l,p)}var ck;ck=function(l,c,p){if(l!==null)if(l.memoizedProps!==c.pendingProps||Nr.current)Dr=!0;else{if((l.lanes&p)===0&&(c.flags&128)===0)return Dr=!1,XM(l,c,p);Dr=(l.flags&131072)!==0}else Dr=!1,fn&&(c.flags&1048576)!==0&&Vb(c,zd,c.index);switch(c.lanes=0,c.tag){case 2:var y=c.type;Qd(l,c),l=c.pendingProps;var k=Ya(c,nr.current);rl(c,p),k=Bm(null,c,y,l,k,p);var S=Um();return c.flags|=1,typeof k=="object"&&k!==null&&typeof k.render=="function"&&k.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,Ir(y)?(S=!0,Rd(c)):S=!1,c.memoizedState=k.state!==null&&k.state!==void 0?k.state:null,Rm(c),k.updater=Gd,c.stateNode=k,k._reactInternals=c,Jm(c,y,l,p),c=Qm(null,c,y,!0,S,p)):(c.tag=0,fn&&S&&Sm(c),pr(null,c,k,p),c=c.child),c;case 16:y=c.elementType;e:{switch(Qd(l,c),l=c.pendingProps,k=y._init,y=k(y._payload),c.type=y,k=c.tag=pN(y),l=Ni(y,l),k){case 0:c=Ym(null,c,y,l,p);break e;case 1:c=jv(null,c,y,l,p);break e;case 11:c=Iv(null,c,y,l,p);break e;case 14:c=Dv(null,c,y,Ni(y.type,l),p);break e}throw Error(n(306,y,""))}return c;case 0:return y=c.type,k=c.pendingProps,k=c.elementType===y?k:Ni(y,k),Ym(l,c,y,k,p);case 1:return y=c.type,k=c.pendingProps,k=c.elementType===y?k:Ni(y,k),jv(l,c,y,k,p);case 3:e:{if(zv(c),l===null)throw Error(n(387));y=c.pendingProps,S=c.memoizedState,k=S.element,Qb(l,c),Vd(c,y,null,p);var T=c.memoizedState;if(y=T.element,S.isDehydrated)if(S={element:y,isDehydrated:!1,cache:T.cache,pendingSuspenseBoundaries:T.pendingSuspenseBoundaries,transitions:T.transitions},c.updateQueue.baseState=S,c.memoizedState=S,c.flags&256){k=ol(Error(n(423)),c),c=Lv(l,c,y,p,k);break e}else if(y!==k){k=ol(Error(n(424)),c),c=Lv(l,c,y,p,k);break e}else for(qr=Jo(c.stateNode.containerInfo.firstChild),Wr=c,fn=!0,Mi=null,p=Gb(c,null,y,p),c.child=p;p;)p.flags=p.flags&-3|4096,p=p.sibling;else{if(el(),y===k){c=wo(l,c,p);break e}pr(l,c,y,p)}c=c.child}return c;case 5:return tv(c),l===null&&Tm(c),y=c.type,k=c.pendingProps,S=l!==null?l.memoizedProps:null,T=k.children,xm(y,k)?T=null:S!==null&&xm(y,S)&&(c.flags|=32),Pv(l,c),pr(l,c,T,p),c.child;case 6:return l===null&&Tm(c),null;case 13:return Fv(l,c,p);case 4:return Pm(c,c.stateNode.containerInfo),y=c.pendingProps,l===null?c.child=tl(c,null,y,p):pr(l,c,y,p),c.child;case 11:return y=c.type,k=c.pendingProps,k=c.elementType===y?k:Ni(y,k),Iv(l,c,y,k,p);case 7:return pr(l,c,c.pendingProps,p),c.child;case 8:return pr(l,c,c.pendingProps.children,p),c.child;case 12:return pr(l,c,c.pendingProps.children,p),c.child;case 10:e:{if(y=c.type._context,k=c.pendingProps,S=c.memoizedProps,T=k.value,en($d,y._currentValue),y._currentValue=T,S!==null)if(Ai(S.value,T)){if(S.children===k.children&&!Nr.current){c=wo(l,c,p);break e}}else for(S=c.child,S!==null&&(S.return=c);S!==null;){var j=S.dependencies;if(j!==null){T=S.child;for(var B=j.firstContext;B!==null;){if(B.context===y){if(S.tag===1){B=ko(-1,p&-p),B.tag=2;var Q=S.updateQueue;if(Q!==null){Q=Q.shared;var me=Q.pending;me===null?B.next=B:(B.next=me.next,me.next=B),Q.pending=B}}S.lanes|=p,B=S.alternate,B!==null&&(B.lanes|=p),Dm(S.return,p,c),j.lanes|=p;break}B=B.next}}else if(S.tag===10)T=S.type===c.type?null:S.child;else if(S.tag===18){if(T=S.return,T===null)throw Error(n(341));T.lanes|=p,j=T.alternate,j!==null&&(j.lanes|=p),Dm(T,p,c),T=S.sibling}else T=S.child;if(T!==null)T.return=S;else for(T=S;T!==null;){if(T===c){T=null;break}if(S=T.sibling,S!==null){S.return=T.return,T=S;break}T=T.return}S=T}pr(l,c,k.children,p),c=c.child}return c;case 9:return k=c.type,y=c.pendingProps.children,rl(c,p),k=ai(k),y=y(k),c.flags|=1,pr(l,c,y,p),c.child;case 14:return y=c.type,k=Ni(y,c.pendingProps),k=Ni(y.type,k),Dv(l,c,y,k,p);case 15:return Ov(l,c,c.type,c.pendingProps,p);case 17:return y=c.type,k=c.pendingProps,k=c.elementType===y?k:Ni(y,k),Qd(l,c),c.tag=1,Ir(y)?(l=!0,Rd(c)):l=!1,rl(c,p),Sv(c,y,k),Jm(c,y,k,p),Qm(null,c,y,!0,l,p);case 19:return Bv(l,c,p);case 22:return Rv(l,c,p)}throw Error(n(156,c.tag))};function dk(l,c){return Ae(l,c)}function hN(l,c,p,y){this.tag=l,this.key=p,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ci(l,c,p,y){return new hN(l,c,p,y)}function x0(l){return l=l.prototype,!(!l||!l.isReactComponent)}function pN(l){if(typeof l=="function")return x0(l)?1:0;if(l!=null){if(l=l.$$typeof,l===ee)return 11;if(l===Z)return 14}return 2}function ss(l,c){var p=l.alternate;return p===null?(p=ci(l.tag,c,l.key,l.mode),p.elementType=l.elementType,p.type=l.type,p.stateNode=l.stateNode,p.alternate=l,l.alternate=p):(p.pendingProps=c,p.type=l.type,p.flags=0,p.subtreeFlags=0,p.deletions=null),p.flags=l.flags&14680064,p.childLanes=l.childLanes,p.lanes=l.lanes,p.child=l.child,p.memoizedProps=l.memoizedProps,p.memoizedState=l.memoizedState,p.updateQueue=l.updateQueue,c=l.dependencies,p.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},p.sibling=l.sibling,p.index=l.index,p.ref=l.ref,p}function cf(l,c,p,y,k,S){var T=2;if(y=l,typeof l=="function")x0(l)&&(T=1);else if(typeof l=="string")T=5;else e:switch(l){case F:return aa(p.children,k,S,c);case R:T=8,k|=8;break;case D:return l=ci(12,p,c,k|2),l.elementType=D,l.lanes=S,l;case Ie:return l=ci(13,p,c,k),l.elementType=Ie,l.lanes=S,l;case he:return l=ci(19,p,c,k),l.elementType=he,l.lanes=S,l;case Oe:return df(p,k,S,c);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case L:T=10;break e;case X:T=9;break e;case ee:T=11;break e;case Z:T=14;break e;case ge:T=16,y=null;break e}throw Error(n(130,l==null?l:typeof l,""))}return c=ci(T,p,c,k),c.elementType=l,c.type=y,c.lanes=S,c}function aa(l,c,p,y){return l=ci(7,l,y,c),l.lanes=p,l}function df(l,c,p,y){return l=ci(22,l,y,c),l.elementType=Oe,l.lanes=p,l.stateNode={isHidden:!1},l}function b0(l,c,p){return l=ci(6,l,null,c),l.lanes=p,l}function v0(l,c,p){return c=ci(4,l.children!==null?l.children:[],l.key,c),c.lanes=p,c.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},c}function mN(l,c,p,y,k){this.tag=c,this.containerInfo=l,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ar(0),this.expirationTimes=Ar(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ar(0),this.identifierPrefix=y,this.onRecoverableError=k,this.mutableSourceEagerHydrationData=null}function k0(l,c,p,y,k,S,T,j,B){return l=new mN(l,c,p,j,B),c===1?(c=1,S===!0&&(c|=8)):c=0,S=ci(3,null,null,c),l.current=S,S.stateNode=l,S.memoizedState={element:y,isDehydrated:p,cache:null,transitions:null,pendingSuspenseBoundaries:null},Rm(S),l}function gN(l,c,p){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:M,key:y==null?null:""+y,children:l,containerInfo:c,implementation:p}}function fk(l){if(!l)return Go;l=l._reactInternals;e:{if(kt(l)!==l||l.tag!==1)throw Error(n(170));var c=l;do{switch(c.tag){case 3:c=c.stateNode.context;break e;case 1:if(Ir(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(n(171))}if(l.tag===1){var p=l.type;if(Ir(p))return $b(l,p,c)}return c}function hk(l,c,p,y,k,S,T,j,B){return l=k0(p,y,!0,l,k,S,T,j,B),l.context=fk(null),p=l.current,y=mr(),k=rs(p),S=ko(y,k),S.callback=c??null,Xo(p,S,k),l.current.lanes=k,hr(l,k,y),Rr(l,y),l}function ff(l,c,p,y){var k=c.current,S=mr(),T=rs(k);return p=fk(p),c.context===null?c.context=p:c.pendingContext=p,c=ko(S,T),c.payload={element:l},y=y===void 0?null:y,y!==null&&(c.callback=y),l=Xo(k,c,T),l!==null&&(Oi(l,k,T,S),Ud(l,k,T)),T}function hf(l){if(l=l.current,!l.child)return null;switch(l.child.tag){case 5:return l.child.stateNode;default:return l.child.stateNode}}function pk(l,c){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var p=l.retryLane;l.retryLane=p!==0&&p<c?p:c}}function w0(l,c){pk(l,c),(l=l.alternate)&&pk(l,c)}function yN(){return null}var mk=typeof reportError=="function"?reportError:function(l){console.error(l)};function C0(l){this._internalRoot=l}pf.prototype.render=C0.prototype.render=function(l){var c=this._internalRoot;if(c===null)throw Error(n(409));ff(l,c,null,null)},pf.prototype.unmount=C0.prototype.unmount=function(){var l=this._internalRoot;if(l!==null){this._internalRoot=null;var c=l.containerInfo;ia(function(){ff(null,l,null,null)}),c[go]=null}};function pf(l){this._internalRoot=l}pf.prototype.unstable_scheduleHydration=function(l){if(l){var c=Qx();l={blockedOn:null,target:l,priority:c};for(var p=0;p<Wo.length&&c!==0&&c<Wo[p].priority;p++);Wo.splice(p,0,l),p===0&&tb(l)}};function S0(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}function mf(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11&&(l.nodeType!==8||l.nodeValue!==" react-mount-point-unstable "))}function gk(){}function xN(l,c,p,y,k){if(k){if(typeof y=="function"){var S=y;y=function(){var Q=hf(T);S.call(Q)}}var T=hk(c,y,l,0,null,!1,!1,"",gk);return l._reactRootContainer=T,l[go]=T.current,mu(l.nodeType===8?l.parentNode:l),ia(),T}for(;k=l.lastChild;)l.removeChild(k);if(typeof y=="function"){var j=y;y=function(){var Q=hf(B);j.call(Q)}}var B=k0(l,0,!1,null,null,!1,!1,"",gk);return l._reactRootContainer=B,l[go]=B.current,mu(l.nodeType===8?l.parentNode:l),ia(function(){ff(c,B,p,y)}),B}function gf(l,c,p,y,k){var S=p._reactRootContainer;if(S){var T=S;if(typeof k=="function"){var j=k;k=function(){var B=hf(T);j.call(B)}}ff(c,T,l,k)}else T=xN(p,c,l,k,y);return hf(T)}gd=function(l){switch(l.tag){case 3:var c=l.stateNode;if(c.current.memoizedState.isDehydrated){var p=_n(c.pendingLanes);p!==0&&(mo(c,p|1),Rr(c,se()),(Bt&6)===0&&(ll=se()+500,Yo()))}break;case 13:ia(function(){var y=vo(l,1);if(y!==null){var k=mr();Oi(y,l,1,k)}}),w0(l,1)}},Kp=function(l){if(l.tag===13){var c=vo(l,134217728);if(c!==null){var p=mr();Oi(c,l,134217728,p)}w0(l,134217728)}},Yx=function(l){if(l.tag===13){var c=rs(l),p=vo(l,c);if(p!==null){var y=mr();Oi(p,l,c,y)}w0(l,c)}},Qx=function(){return Pt},Xx=function(l,c){var p=Pt;try{return Pt=l,c()}finally{Pt=p}},Si=function(l,c,p){switch(c){case"input":if(co(l,p),c=p.name,p.type==="radio"&&c!=null){for(p=l;p.parentNode;)p=p.parentNode;for(p=p.querySelectorAll("input[name="+JSON.stringify(""+c)+'][type="radio"]'),c=0;c<p.length;c++){var y=p[c];if(y!==l&&y.form===l.form){var k=Dd(y);if(!k)throw Error(n(90));Pn(y),co(y,k)}}}break;case"textarea":_r(l,p);break;case"select":c=p.value,c!=null&&Er(l,!!p.multiple,c,!1)}},pd=m0,z=ia;var bN={usingClientEntryPoint:!1,Events:[xu,Ka,Dd,fd,hd,m0]},Du={findFiberByHostInstance:Gs,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},vN={bundleType:Du.bundleType,version:Du.version,rendererPackageName:Du.rendererPackageName,rendererConfig:Du.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:I.ReactCurrentDispatcher,findHostInstanceByFiber:function(l){return l=Ke(l),l===null?null:l.stateNode},findFiberByHostInstance:Du.findFiberByHostInstance||yN,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var yf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!yf.isDisabled&&yf.supportsFiber)try{te=yf.inject(vN),Me=yf}catch{}}return Pr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=bN,Pr.createPortal=function(l,c){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!S0(c))throw Error(n(200));return gN(l,c,null,p)},Pr.createRoot=function(l,c){if(!S0(l))throw Error(n(299));var p=!1,y="",k=mk;return c!=null&&(c.unstable_strictMode===!0&&(p=!0),c.identifierPrefix!==void 0&&(y=c.identifierPrefix),c.onRecoverableError!==void 0&&(k=c.onRecoverableError)),c=k0(l,1,!1,null,null,p,!1,y,k),l[go]=c.current,mu(l.nodeType===8?l.parentNode:l),new C0(c)},Pr.findDOMNode=function(l){if(l==null)return null;if(l.nodeType===1)return l;var c=l._reactInternals;if(c===void 0)throw typeof l.render=="function"?Error(n(188)):(l=Object.keys(l).join(","),Error(n(268,l)));return l=Ke(c),l=l===null?null:l.stateNode,l},Pr.flushSync=function(l){return ia(l)},Pr.hydrate=function(l,c,p){if(!mf(c))throw Error(n(200));return gf(null,l,c,!0,p)},Pr.hydrateRoot=function(l,c,p){if(!S0(l))throw Error(n(405));var y=p!=null&&p.hydratedSources||null,k=!1,S="",T=mk;if(p!=null&&(p.unstable_strictMode===!0&&(k=!0),p.identifierPrefix!==void 0&&(S=p.identifierPrefix),p.onRecoverableError!==void 0&&(T=p.onRecoverableError)),c=hk(c,null,l,1,p??null,k,!1,S,T),l[go]=c.current,mu(l),y)for(l=0;l<y.length;l++)p=y[l],k=p._getVersion,k=k(p._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[p,k]:c.mutableSourceEagerHydrationData.push(p,k);return new pf(c)},Pr.render=function(l,c,p){if(!mf(c))throw Error(n(200));return gf(null,l,c,!1,p)},Pr.unmountComponentAtNode=function(l){if(!mf(l))throw Error(n(40));return l._reactRootContainer?(ia(function(){gf(null,null,l,!1,function(){l._reactRootContainer=null,l[go]=null})}),!0):!1},Pr.unstable_batchedUpdates=m0,Pr.unstable_renderSubtreeIntoContainer=function(l,c,p,y){if(!mf(p))throw Error(n(200));if(l==null||l._reactInternals===void 0)throw Error(n(38));return gf(l,c,p,!1,y)},Pr.version="18.3.1-next-f1338f8080-20240426",Pr}var Sk;function ZS(){if(Sk)return T0.exports;Sk=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),T0.exports=NN(),T0.exports}var Ek;function IN(){if(Ek)return xf;Ek=1;var e=ZS();return xf.createRoot=e.createRoot,xf.hydrateRoot=e.hydrateRoot,xf}var DN=IN();const ON=Ra(DN);var JS="vercel.ai.error",RN=Symbol.for(JS),_k,Tk,eo=class KS extends(Tk=Error,_k=RN,Tk){constructor({name:t,message:n,cause:r}){super(n),this[_k]=!0,this.name=t,this.cause=r}static isInstance(t){return KS.hasMarker(t,JS)}static hasMarker(t,n){const r=Symbol.for(n);return t!=null&&typeof t=="object"&&r in t&&typeof t[r]=="boolean"&&t[r]===!0}};function GS(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.message:JSON.stringify(e)}var YS="AI_InvalidArgumentError",QS=`vercel.ai.error.${YS}`,PN=Symbol.for(QS),Ak,Mk,jN=class extends(Mk=eo,Ak=PN,Mk){constructor({message:e,cause:t,argument:n}){super({name:YS,message:e,cause:t}),this[Ak]=!0,this.argument=n}static isInstance(e){return eo.hasMarker(e,QS)}},XS="AI_JSONParseError",eE=`vercel.ai.error.${XS}`,zN=Symbol.for(eE),Nk,Ik,Dk=class extends(Ik=eo,Nk=zN,Ik){constructor({text:e,cause:t}){super({name:XS,message:`JSON parsing failed: Text: ${e}.
41
+ Error message: ${GS(t)}`,cause:t}),this[Nk]=!0,this.text=e}static isInstance(e){return eo.hasMarker(e,eE)}},tE="AI_TypeValidationError",nE=`vercel.ai.error.${tE}`,LN=Symbol.for(nE),Ok,Rk,Dl=class Gg extends(Rk=eo,Ok=LN,Rk){constructor({value:t,cause:n,context:r}){let i="Type validation failed";if(r!=null&&r.field&&(i+=` for ${r.field}`),r!=null&&r.entityName||r!=null&&r.entityId){i+=" (";const o=[];r.entityName&&o.push(r.entityName),r.entityId&&o.push(`id: "${r.entityId}"`),i+=o.join(", "),i+=")"}super({name:tE,message:`${i}: Value: ${JSON.stringify(t)}.
42
+ Error message: ${GS(n)}`,cause:n}),this[Ok]=!0,this.value=t,this.context=r}static isInstance(t){return eo.hasMarker(t,nE)}static wrap({value:t,cause:n,context:r}){var i,o,s;return Gg.isInstance(n)&&n.value===t&&((i=n.context)==null?void 0:i.field)===(r==null?void 0:r.field)&&((o=n.context)==null?void 0:o.entityName)===(r==null?void 0:r.entityName)&&((s=n.context)==null?void 0:s.entityId)===(r==null?void 0:r.entityId)?n:new Gg({value:t,cause:n,context:r})}};function re(e,t,n){function r(a,u){var d;Object.defineProperty(a,"_zod",{value:a._zod??{},enumerable:!1}),(d=a._zod).traits??(d.traits=new Set),a._zod.traits.add(e),t(a,u);for(const f in s.prototype)f in a||Object.defineProperty(a,f,{value:s.prototype[f].bind(a)});a._zod.constr=s,a._zod.def=u}const i=(n==null?void 0:n.Parent)??Object;class o extends i{}Object.defineProperty(o,"name",{value:e});function s(a){var u;const d=n!=null&&n.Parent?new o:this;r(d,a),(u=d._zod).deferred??(u.deferred=[]);for(const f of d._zod.deferred)f();return d}return Object.defineProperty(s,"init",{value:r}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>{var u,d;return n!=null&&n.Parent&&a instanceof n.Parent?!0:(d=(u=a==null?void 0:a._zod)==null?void 0:u.traits)==null?void 0:d.has(e)}}),Object.defineProperty(s,"name",{value:e}),s}class kc extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const rE={};function Rs(e){return rE}function iE(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,i])=>t.indexOf(+r)===-1).map(([r,i])=>i)}function FN(e,t){return typeof t=="bigint"?t.toString():t}function dy(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function fy(e){return e==null}function hy(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function $N(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,o=Number.parseInt(e.toFixed(i).replace(".","")),s=Number.parseInt(t.toFixed(i).replace(".",""));return o%s/10**i}function Ht(e,t,n){Object.defineProperty(e,t,{get(){{const r=n();return e[t]=r,r}},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function xp(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ru(e){return JSON.stringify(e)}const oE=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function nh(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const BN=dy(()=>{var e;if(typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function rh(e){if(nh(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(nh(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}const UN=new Set(["string","number","symbol"]);function Gc(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Pa(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n!=null&&n.parent)&&(r._zod.parent=e),r}function st(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function VN(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const HN={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function WN(e,t){const n={},r=e._zod.def;for(const i in t){if(!(i in r.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&(n[i]=r.shape[i])}return Pa(e,{...e._zod.def,shape:n,checks:[]})}function qN(e,t){const n={...e._zod.def.shape},r=e._zod.def;for(const i in t){if(!(i in r.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&delete n[i]}return Pa(e,{...e._zod.def,shape:n,checks:[]})}function ZN(e,t){if(!rh(t))throw new Error("Invalid input to extend: expected a plain object");const n={...e._zod.def,get shape(){const r={...e._zod.def.shape,...t};return xp(this,"shape",r),r},checks:[]};return Pa(e,n)}function JN(e,t){return Pa(e,{...e._zod.def,get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return xp(this,"shape",n),n},catchall:t._zod.def.catchall,checks:[]})}function KN(e,t,n){const r=t._zod.def.shape,i={...r};if(n)for(const o in n){if(!(o in r))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(i[o]=e?new e({type:"optional",innerType:r[o]}):r[o])}else for(const o in r)i[o]=e?new e({type:"optional",innerType:r[o]}):r[o];return Pa(t,{...t._zod.def,shape:i,checks:[]})}function GN(e,t,n){const r=t._zod.def.shape,i={...r};if(n)for(const o in n){if(!(o in i))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(i[o]=new e({type:"nonoptional",innerType:r[o]}))}else for(const o in r)i[o]=new e({type:"nonoptional",innerType:r[o]});return Pa(t,{...t._zod.def,shape:i,checks:[]})}function ic(e,t=0){var n;for(let r=t;r<e.issues.length;r++)if(((n=e.issues[r])==null?void 0:n.continue)!==!0)return!0;return!1}function pa(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function bf(e){return typeof e=="string"?e:e==null?void 0:e.message}function Ps(e,t,n){var i,o,s,a,u,d;const r={...e,path:e.path??[]};if(!e.message){const f=bf((s=(o=(i=e.inst)==null?void 0:i._zod.def)==null?void 0:o.error)==null?void 0:s.call(o,e))??bf((a=t==null?void 0:t.error)==null?void 0:a.call(t,e))??bf((u=n.customError)==null?void 0:u.call(n,e))??bf((d=n.localeError)==null?void 0:d.call(n,e))??"Invalid input";r.message=f}return delete r.inst,delete r.continue,t!=null&&t.reportInput||delete r.input,r}function py(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function wc(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const sE=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,FN,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},aE=re("$ZodError",sE),lE=re("$ZodError",sE,{Parent:Error});function YN(e,t=n=>n.message){const n={},r=[];for(const i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function QN(e,t){const n=t||function(o){return o.message},r={_errors:[]},i=o=>{for(const s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>i({issues:a}));else if(s.code==="invalid_key")i({issues:s.issues});else if(s.code==="invalid_element")i({issues:s.issues});else if(s.path.length===0)r._errors.push(n(s));else{let a=r,u=0;for(;u<s.path.length;){const d=s.path[u];u===s.path.length-1?(a[d]=a[d]||{_errors:[]},a[d]._errors.push(n(s))):a[d]=a[d]||{_errors:[]},a=a[d],u++}}};return i(e),r}const XN=e=>(t,n,r,i)=>{const o=r?Object.assign(r,{async:!1}):{async:!1},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new kc;if(s.issues.length){const a=new((i==null?void 0:i.Err)??e)(s.issues.map(u=>Ps(u,o,Rs())));throw oE(a,i==null?void 0:i.callee),a}return s.value},eI=e=>async(t,n,r,i)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){const a=new((i==null?void 0:i.Err)??e)(s.issues.map(u=>Ps(u,o,Rs())));throw oE(a,i==null?void 0:i.callee),a}return s.value},uE=e=>(t,n,r)=>{const i=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise)throw new kc;return o.issues.length?{success:!1,error:new(e??aE)(o.issues.map(s=>Ps(s,i,Rs())))}:{success:!0,data:o.value}},tI=uE(lE),cE=e=>async(t,n,r)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(s=>Ps(s,i,Rs())))}:{success:!0,data:o.value}},nI=cE(lE),rI=/^[cC][^\s-]{8,}$/,iI=/^[0-9a-z]+$/,oI=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,sI=/^[0-9a-vA-V]{20}$/,aI=/^[A-Za-z0-9]{27}$/,lI=/^[a-zA-Z0-9_-]{21}$/,uI=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,cI=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Pk=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,dI=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,fI="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function hI(){return new RegExp(fI,"u")}const pI=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,mI=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,gI=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,yI=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,xI=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,dE=/^[A-Za-z0-9_-]*$/,bI=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,vI=/^\+(?:[0-9]){6,14}[0-9]$/,fE="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",kI=new RegExp(`^${fE}$`);function hE(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function wI(e){return new RegExp(`^${hE(e)}$`)}function CI(e){const t=hE({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-]\\d{2}:\\d{2})");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${fE}T(?:${r})$`)}const SI=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},EI=/^\d+$/,_I=/^-?\d+(?:\.\d+)?/i,TI=/true|false/i,AI=/null/i,MI=/^[^A-Z]*$/,NI=/^[^a-z]*$/,Br=re("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),pE={number:"number",bigint:"bigint",object:"date"},mE=re("$ZodCheckLessThan",(e,t)=>{Br.init(e,t);const n=pE[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,o=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<o&&(t.inclusive?i.maximum=t.value:i.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),gE=re("$ZodCheckGreaterThan",(e,t)=>{Br.init(e,t);const n=pE[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,o=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),II=re("$ZodCheckMultipleOf",(e,t)=>{Br.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):$N(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),DI=re("$ZodCheckNumberFormat",(e,t)=>{var s;Br.init(e,t),t.format=t.format||"float64";const n=(s=t.format)==null?void 0:s.includes("int"),r=n?"int":"number",[i,o]=HN[t.format];e._zod.onattach.push(a=>{const u=a._zod.bag;u.format=t.format,u.minimum=i,u.maximum=o,n&&(u.pattern=EI)}),e._zod.check=a=>{const u=a.value;if(n){if(!Number.isInteger(u)){a.issues.push({expected:r,format:t.format,code:"invalid_type",input:u,inst:e});return}if(!Number.isSafeInteger(u)){u>0?a.issues.push({input:u,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!t.abort}):a.issues.push({input:u,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!t.abort});return}}u<i&&a.issues.push({origin:"number",input:u,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),u>o&&a.issues.push({origin:"number",input:u,code:"too_big",maximum:o,inst:e})}}),OI=re("$ZodCheckMaxLength",(e,t)=>{var n;Br.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!fy(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const i=r.value;if(i.length<=t.maximum)return;const s=py(i);r.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),RI=re("$ZodCheckMinLength",(e,t)=>{var n;Br.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!fy(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const i=r.value;if(i.length>=t.minimum)return;const s=py(i);r.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),PI=re("$ZodCheckLengthEquals",(e,t)=>{var n;Br.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!fy(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=r=>{const i=r.value,o=i.length;if(o===t.length)return;const s=py(i),a=o>t.length;r.issues.push({origin:s,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),bp=re("$ZodCheckStringFormat",(e,t)=>{var n,r;Br.init(e,t),e._zod.onattach.push(i=>{const o=i._zod.bag;o.format=t.format,t.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),jI=re("$ZodCheckRegex",(e,t)=>{bp.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),zI=re("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=MI),bp.init(e,t)}),LI=re("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=NI),bp.init(e,t)}),FI=re("$ZodCheckIncludes",(e,t)=>{Br.init(e,t);const n=Gc(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(i=>{const o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),$I=re("$ZodCheckStartsWith",(e,t)=>{Br.init(e,t);const n=new RegExp(`^${Gc(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),BI=re("$ZodCheckEndsWith",(e,t)=>{Br.init(e,t);const n=new RegExp(`.*${Gc(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),UI=re("$ZodCheckOverwrite",(e,t)=>{Br.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class VI{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
43
+ `).filter(s=>s),i=Math.min(...r.map(s=>s.length-s.trimStart().length)),o=r.map(s=>s.slice(i)).map(s=>" ".repeat(this.indent*2)+s);for(const s of o)this.content.push(s)}compile(){const t=Function,n=this==null?void 0:this.args,i=[...((this==null?void 0:this.content)??[""]).map(o=>` ${o}`)];return new t(...n,i.join(`
44
+ `))}}const HI={major:4,minor:0,patch:0},rn=re("$ZodType",(e,t)=>{var i;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=HI;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const o of r)for(const s of o._zod.onattach)s(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),(i=e._zod.deferred)==null||i.push(()=>{e._zod.run=e._zod.parse});else{const o=(s,a,u)=>{let d=ic(s),f;for(const h of a){if(h._zod.def.when){if(!h._zod.def.when(s))continue}else if(d)continue;const m=s.issues.length,g=h._zod.check(s);if(g instanceof Promise&&(u==null?void 0:u.async)===!1)throw new kc;if(f||g instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await g,s.issues.length!==m&&(d||(d=ic(s,m)))});else{if(s.issues.length===m)continue;d||(d=ic(s,m))}}return f?f.then(()=>s):s};e._zod.run=(s,a)=>{const u=e._zod.parse(s,a);if(u instanceof Promise){if(a.async===!1)throw new kc;return u.then(d=>o(d,r,a))}return o(u,r,a)}}e["~standard"]={validate:o=>{var s;try{const a=tI(e,o);return a.success?{value:a.data}:{issues:(s=a.error)==null?void 0:s.issues}}catch{return nI(e,o).then(u=>{var d;return u.success?{value:u.data}:{issues:(d=u.error)==null?void 0:d.issues}})}},vendor:"zod",version:1}}),my=re("$ZodString",(e,t)=>{var n;rn.init(e,t),e._zod.pattern=[...((n=e==null?void 0:e._zod.bag)==null?void 0:n.patterns)??[]].pop()??SI(e._zod.bag),e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),hn=re("$ZodStringFormat",(e,t)=>{bp.init(e,t),my.init(e,t)}),WI=re("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=cI),hn.init(e,t)}),qI=re("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Pk(r))}else t.pattern??(t.pattern=Pk());hn.init(e,t)}),ZI=re("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=dI),hn.init(e,t)}),JI=re("$ZodURL",(e,t)=>{hn.init(e,t),e._zod.check=n=>{try{const r=n.value,i=new URL(r),o=i.href;t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:bI.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),!r.endsWith("/")&&o.endsWith("/")?n.value=o.slice(0,-1):n.value=o;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),KI=re("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=hI()),hn.init(e,t)}),GI=re("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=lI),hn.init(e,t)}),YI=re("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=rI),hn.init(e,t)}),QI=re("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=iI),hn.init(e,t)}),XI=re("$ZodULID",(e,t)=>{t.pattern??(t.pattern=oI),hn.init(e,t)}),eD=re("$ZodXID",(e,t)=>{t.pattern??(t.pattern=sI),hn.init(e,t)}),tD=re("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=aI),hn.init(e,t)}),nD=re("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=CI(t)),hn.init(e,t)}),rD=re("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=kI),hn.init(e,t)}),iD=re("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=wI(t)),hn.init(e,t)}),oD=re("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=uI),hn.init(e,t)}),sD=re("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=pI),hn.init(e,t),e._zod.onattach.push(n=>{const r=n._zod.bag;r.format="ipv4"})}),aD=re("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=mI),hn.init(e,t),e._zod.onattach.push(n=>{const r=n._zod.bag;r.format="ipv6"}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),lD=re("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=gI),hn.init(e,t)}),uD=re("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=yI),hn.init(e,t),e._zod.check=n=>{const[r,i]=n.value.split("/");try{if(!i)throw new Error;const o=Number(i);if(`${o}`!==i)throw new Error;if(o<0||o>128)throw new Error;new URL(`http://[${r}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function yE(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const cD=re("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=xI),hn.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64"}),e._zod.check=n=>{yE(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function dD(e){if(!dE.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return yE(n)}const fD=re("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=dE),hn.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64url"}),e._zod.check=n=>{dD(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),hD=re("$ZodE164",(e,t)=>{t.pattern??(t.pattern=vI),hn.init(e,t)});function pD(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const i=JSON.parse(atob(r));return!("typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}}const mD=re("$ZodJWT",(e,t)=>{hn.init(e,t),e._zod.check=n=>{pD(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),xE=re("$ZodNumber",(e,t)=>{rn.init(e,t),e._zod.pattern=e._zod.bag.pattern??_I,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const i=n.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return n;const o=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...o?{received:o}:{}}),n}}),gD=re("$ZodNumber",(e,t)=>{DI.init(e,t),xE.init(e,t)}),yD=re("$ZodBoolean",(e,t)=>{rn.init(e,t),e._zod.pattern=TI,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const i=n.value;return typeof i=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),n}}),xD=re("$ZodNull",(e,t)=>{rn.init(e,t),e._zod.pattern=AI,e._zod.values=new Set([null]),e._zod.parse=(n,r)=>{const i=n.value;return i===null||n.issues.push({expected:"null",code:"invalid_type",input:i,inst:e}),n}}),bD=re("$ZodUnknown",(e,t)=>{rn.init(e,t),e._zod.parse=n=>n}),vD=re("$ZodNever",(e,t)=>{rn.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function jk(e,t,n){e.issues.length&&t.issues.push(...pa(n,e.issues)),t.value[n]=e.value}const kD=re("$ZodArray",(e,t)=>{rn.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=Array(i.length);const o=[];for(let s=0;s<i.length;s++){const a=i[s],u=t.element._zod.run({value:a,issues:[]},r);u instanceof Promise?o.push(u.then(d=>jk(d,n,s))):jk(u,n,s)}return o.length?Promise.all(o).then(()=>n):n}});function vf(e,t,n){e.issues.length&&t.issues.push(...pa(n,e.issues)),t.value[n]=e.value}function zk(e,t,n,r){e.issues.length?r[n]===void 0?n in r?t.value[n]=void 0:t.value[n]=e.value:t.issues.push(...pa(n,e.issues)):e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}const wD=re("$ZodObject",(e,t)=>{rn.init(e,t);const n=dy(()=>{const h=Object.keys(t.shape);for(const g of h)if(!(t.shape[g]instanceof rn))throw new Error(`Invalid element at key "${g}": expected a Zod schema`);const m=VN(t.shape);return{shape:t.shape,keys:h,keySet:new Set(h),numKeys:h.length,optionalKeys:new Set(m)}});Ht(e._zod,"propValues",()=>{const h=t.shape,m={};for(const g in h){const x=h[g]._zod;if(x.values){m[g]??(m[g]=new Set);for(const b of x.values)m[g].add(b)}}return m});const r=h=>{const m=new VI(["shape","payload","ctx"]),g=n.value,x=_=>{const E=Ru(_);return`shape[${E}]._zod.run({ value: input[${E}], issues: [] }, ctx)`};m.write("const input = payload.value;");const b=Object.create(null);let v=0;for(const _ of g.keys)b[_]=`key_${v++}`;m.write("const newResult = {}");for(const _ of g.keys)if(g.optionalKeys.has(_)){const E=b[_];m.write(`const ${E} = ${x(_)};`);const I=Ru(_);m.write(`
45
+ if (${E}.issues.length) {
46
+ if (input[${I}] === undefined) {
47
+ if (${I} in input) {
48
+ newResult[${I}] = undefined;
49
+ }
50
+ } else {
51
+ payload.issues = payload.issues.concat(
52
+ ${E}.issues.map((iss) => ({
53
+ ...iss,
54
+ path: iss.path ? [${I}, ...iss.path] : [${I}],
55
+ }))
56
+ );
57
+ }
58
+ } else if (${E}.value === undefined) {
59
+ if (${I} in input) newResult[${I}] = undefined;
60
+ } else {
61
+ newResult[${I}] = ${E}.value;
62
+ }
63
+ `)}else{const E=b[_];m.write(`const ${E} = ${x(_)};`),m.write(`
64
+ if (${E}.issues.length) payload.issues = payload.issues.concat(${E}.issues.map(iss => ({
65
+ ...iss,
66
+ path: iss.path ? [${Ru(_)}, ...iss.path] : [${Ru(_)}]
67
+ })));`),m.write(`newResult[${Ru(_)}] = ${E}.value`)}m.write("payload.value = newResult;"),m.write("return payload;");const C=m.compile();return(_,E)=>C(h,_,E)};let i;const o=nh,s=!rE.jitless,u=s&&BN.value,d=t.catchall;let f;e._zod.parse=(h,m)=>{f??(f=n.value);const g=h.value;if(!o(g))return h.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),h;const x=[];if(s&&u&&(m==null?void 0:m.async)===!1&&m.jitless!==!0)i||(i=r(t.shape)),h=i(h,m);else{h.value={};const E=f.shape;for(const I of f.keys){const N=E[I],M=N._zod.run({value:g[I],issues:[]},m),F=N._zod.optin==="optional"&&N._zod.optout==="optional";M instanceof Promise?x.push(M.then(R=>F?zk(R,h,I,g):vf(R,h,I))):F?zk(M,h,I,g):vf(M,h,I)}}if(!d)return x.length?Promise.all(x).then(()=>h):h;const b=[],v=f.keySet,C=d._zod,_=C.def.type;for(const E of Object.keys(g)){if(v.has(E))continue;if(_==="never"){b.push(E);continue}const I=C.run({value:g[E],issues:[]},m);I instanceof Promise?x.push(I.then(N=>vf(N,h,E))):vf(I,h,E)}return b.length&&h.issues.push({code:"unrecognized_keys",keys:b,input:g,inst:e}),x.length?Promise.all(x).then(()=>h):h}});function Lk(e,t,n,r){for(const i of e)if(i.issues.length===0)return t.value=i.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(i=>i.issues.map(o=>Ps(o,r,Rs())))}),t}const bE=re("$ZodUnion",(e,t)=>{rn.init(e,t),Ht(e._zod,"optin",()=>t.options.some(n=>n._zod.optin==="optional")?"optional":void 0),Ht(e._zod,"optout",()=>t.options.some(n=>n._zod.optout==="optional")?"optional":void 0),Ht(e._zod,"values",()=>{if(t.options.every(n=>n._zod.values))return new Set(t.options.flatMap(n=>Array.from(n._zod.values)))}),Ht(e._zod,"pattern",()=>{if(t.options.every(n=>n._zod.pattern)){const n=t.options.map(r=>r._zod.pattern);return new RegExp(`^(${n.map(r=>hy(r.source)).join("|")})$`)}}),e._zod.parse=(n,r)=>{let i=!1;const o=[];for(const s of t.options){const a=s._zod.run({value:n.value,issues:[]},r);if(a instanceof Promise)o.push(a),i=!0;else{if(a.issues.length===0)return a;o.push(a)}}return i?Promise.all(o).then(s=>Lk(s,n,e,r)):Lk(o,n,e,r)}}),CD=re("$ZodDiscriminatedUnion",(e,t)=>{bE.init(e,t);const n=e._zod.parse;Ht(e._zod,"propValues",()=>{const i={};for(const o of t.options){const s=o._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(const[a,u]of Object.entries(s)){i[a]||(i[a]=new Set);for(const d of u)i[a].add(d)}}return i});const r=dy(()=>{const i=t.options,o=new Map;for(const s of i){const a=s._zod.propValues[t.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(const u of a){if(o.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);o.set(u,s)}}return o});e._zod.parse=(i,o)=>{const s=i.value;if(!nh(s))return i.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),i;const a=r.value.get(s==null?void 0:s[t.discriminator]);return a?a._zod.run(i,o):t.unionFallback?n(i,o):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:s,path:[t.discriminator],inst:e}),i)}}),SD=re("$ZodIntersection",(e,t)=>{rn.init(e,t),e._zod.parse=(n,r)=>{const i=n.value,o=t.left._zod.run({value:i,issues:[]},r),s=t.right._zod.run({value:i,issues:[]},r);return o instanceof Promise||s instanceof Promise?Promise.all([o,s]).then(([u,d])=>Fk(n,u,d)):Fk(n,o,s)}});function Yg(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(rh(e)&&rh(t)){const n=Object.keys(t),r=Object.keys(e).filter(o=>n.indexOf(o)!==-1),i={...e,...t};for(const o of r){const s=Yg(e[o],t[o]);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};i[o]=s.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const i=e[r],o=t[r],s=Yg(i,o);if(!s.valid)return{valid:!1,mergeErrorPath:[r,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Fk(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),ic(e))return e;const r=Yg(t.value,n.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const ED=re("$ZodRecord",(e,t)=>{rn.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!rh(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;const o=[];if(t.keyType._zod.values){const s=t.keyType._zod.values;n.value={};for(const u of s)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){const d=t.valueType._zod.run({value:i[u],issues:[]},r);d instanceof Promise?o.push(d.then(f=>{f.issues.length&&n.issues.push(...pa(u,f.issues)),n.value[u]=f.value})):(d.issues.length&&n.issues.push(...pa(u,d.issues)),n.value[u]=d.value)}let a;for(const u in i)s.has(u)||(a=a??[],a.push(u));a&&a.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:a})}else{n.value={};for(const s of Reflect.ownKeys(i)){if(s==="__proto__")continue;const a=t.keyType._zod.run({value:s,issues:[]},r);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(a.issues.length){n.issues.push({origin:"record",code:"invalid_key",issues:a.issues.map(d=>Ps(d,r,Rs())),input:s,path:[s],inst:e}),n.value[a.value]=a.value;continue}const u=t.valueType._zod.run({value:i[s],issues:[]},r);u instanceof Promise?o.push(u.then(d=>{d.issues.length&&n.issues.push(...pa(s,d.issues)),n.value[a.value]=d.value})):(u.issues.length&&n.issues.push(...pa(s,u.issues)),n.value[a.value]=u.value)}}return o.length?Promise.all(o).then(()=>n):n}}),_D=re("$ZodEnum",(e,t)=>{rn.init(e,t);const n=iE(t.entries);e._zod.values=new Set(n),e._zod.pattern=new RegExp(`^(${n.filter(r=>UN.has(typeof r)).map(r=>typeof r=="string"?Gc(r):r.toString()).join("|")})$`),e._zod.parse=(r,i)=>{const o=r.value;return e._zod.values.has(o)||r.issues.push({code:"invalid_value",values:n,input:o,inst:e}),r}}),TD=re("$ZodLiteral",(e,t)=>{rn.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?Gc(n):n?n.toString():String(n)).join("|")})$`),e._zod.parse=(n,r)=>{const i=n.value;return e._zod.values.has(i)||n.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),n}}),AD=re("$ZodTransform",(e,t)=>{rn.init(e,t),e._zod.parse=(n,r)=>{const i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(s=>(n.value=s,n));if(i instanceof Promise)throw new kc;return n.value=i,n}}),MD=re("$ZodOptional",(e,t)=>{rn.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Ht(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Ht(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${hy(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>t.innerType._zod.optin==="optional"?t.innerType._zod.run(n,r):n.value===void 0?n:t.innerType._zod.run(n,r)}),ND=re("$ZodNullable",(e,t)=>{rn.init(e,t),Ht(e._zod,"optin",()=>t.innerType._zod.optin),Ht(e._zod,"optout",()=>t.innerType._zod.optout),Ht(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${hy(n.source)}|null)$`):void 0}),Ht(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),ID=re("$ZodDefault",(e,t)=>{rn.init(e,t),e._zod.optin="optional",Ht(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(n.value===void 0)return n.value=t.defaultValue,n;const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(o=>$k(o,t)):$k(i,t)}});function $k(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const DD=re("$ZodPrefault",(e,t)=>{rn.init(e,t),e._zod.optin="optional",Ht(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),OD=re("$ZodNonOptional",(e,t)=>{rn.init(e,t),Ht(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(o=>Bk(o,e)):Bk(i,e)}});function Bk(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const RD=re("$ZodCatch",(e,t)=>{rn.init(e,t),e._zod.optin="optional",Ht(e._zod,"optout",()=>t.innerType._zod.optout),Ht(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(o=>(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(s=>Ps(s,r,Rs()))},input:n.value}),n.issues=[]),n)):(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(o=>Ps(o,r,Rs()))},input:n.value}),n.issues=[]),n)}}),PD=re("$ZodPipe",(e,t)=>{rn.init(e,t),Ht(e._zod,"values",()=>t.in._zod.values),Ht(e._zod,"optin",()=>t.in._zod.optin),Ht(e._zod,"optout",()=>t.out._zod.optout),e._zod.parse=(n,r)=>{const i=t.in._zod.run(n,r);return i instanceof Promise?i.then(o=>Uk(o,t,r)):Uk(i,t,r)}});function Uk(e,t,n){return ic(e)?e:t.out._zod.run({value:e.value,issues:e.issues},n)}const jD=re("$ZodReadonly",(e,t)=>{rn.init(e,t),Ht(e._zod,"propValues",()=>t.innerType._zod.propValues),Ht(e._zod,"values",()=>t.innerType._zod.values),Ht(e._zod,"optin",()=>t.innerType._zod.optin),Ht(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(n,r)=>{const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(Vk):Vk(i)}});function Vk(e){return e.value=Object.freeze(e.value),e}const zD=re("$ZodLazy",(e,t)=>{rn.init(e,t),Ht(e._zod,"innerType",()=>t.getter()),Ht(e._zod,"pattern",()=>e._zod.innerType._zod.pattern),Ht(e._zod,"propValues",()=>e._zod.innerType._zod.propValues),Ht(e._zod,"optin",()=>e._zod.innerType._zod.optin),Ht(e._zod,"optout",()=>e._zod.innerType._zod.optout),e._zod.parse=(n,r)=>e._zod.innerType._zod.run(n,r)}),LD=re("$ZodCustom",(e,t)=>{Br.init(e,t),rn.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(o=>Hk(o,n,r,e));Hk(i,n,r,e)}});function Hk(e,t,n,r){if(!e){const i={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(i.params=r._zod.def.params),t.issues.push(wc(i))}}class vE{constructor(){this._map=new Map,this._idmap=new Map}add(t,...n){const r=n[0];if(this._map.set(t,r),r&&typeof r=="object"&&"id"in r){if(this._idmap.has(r.id))throw new Error(`ID ${r.id} already exists in the registry`);this._idmap.set(r.id,t)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};return delete r.id,{...r,...this._map.get(t)}}return this._map.get(t)}has(t){return this._map.has(t)}}function FD(){return new vE}const Wu=FD();function $D(e,t){return new e({type:"string",...st(t)})}function BD(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...st(t)})}function Wk(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...st(t)})}function UD(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...st(t)})}function VD(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...st(t)})}function HD(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...st(t)})}function WD(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...st(t)})}function qD(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...st(t)})}function ZD(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...st(t)})}function JD(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...st(t)})}function KD(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...st(t)})}function GD(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...st(t)})}function YD(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...st(t)})}function QD(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...st(t)})}function XD(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...st(t)})}function e8(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...st(t)})}function t8(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...st(t)})}function n8(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...st(t)})}function r8(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...st(t)})}function i8(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...st(t)})}function o8(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...st(t)})}function s8(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...st(t)})}function a8(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...st(t)})}function l8(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...st(t)})}function u8(e,t){return new e({type:"string",format:"date",check:"string_format",...st(t)})}function c8(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...st(t)})}function d8(e,t){return new e({type:"string",format:"duration",check:"string_format",...st(t)})}function f8(e,t){return new e({type:"number",checks:[],...st(t)})}function h8(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...st(t)})}function p8(e,t){return new e({type:"boolean",...st(t)})}function m8(e,t){return new e({type:"null",...st(t)})}function g8(e){return new e({type:"unknown"})}function y8(e,t){return new e({type:"never",...st(t)})}function qk(e,t){return new mE({check:"less_than",...st(t),value:e,inclusive:!1})}function N0(e,t){return new mE({check:"less_than",...st(t),value:e,inclusive:!0})}function Zk(e,t){return new gE({check:"greater_than",...st(t),value:e,inclusive:!1})}function I0(e,t){return new gE({check:"greater_than",...st(t),value:e,inclusive:!0})}function Jk(e,t){return new II({check:"multiple_of",...st(t),value:e})}function kE(e,t){return new OI({check:"max_length",...st(t),maximum:e})}function ih(e,t){return new RI({check:"min_length",...st(t),minimum:e})}function wE(e,t){return new PI({check:"length_equals",...st(t),length:e})}function x8(e,t){return new jI({check:"string_format",format:"regex",...st(t),pattern:e})}function b8(e){return new zI({check:"string_format",format:"lowercase",...st(e)})}function v8(e){return new LI({check:"string_format",format:"uppercase",...st(e)})}function k8(e,t){return new FI({check:"string_format",format:"includes",...st(t),includes:e})}function w8(e,t){return new $I({check:"string_format",format:"starts_with",...st(t),prefix:e})}function C8(e,t){return new BI({check:"string_format",format:"ends_with",...st(t),suffix:e})}function Yc(e){return new UI({check:"overwrite",tx:e})}function S8(e){return Yc(t=>t.normalize(e))}function E8(){return Yc(e=>e.trim())}function _8(){return Yc(e=>e.toLowerCase())}function T8(){return Yc(e=>e.toUpperCase())}function A8(e,t,n){return new e({type:"array",element:t,...st(n)})}function M8(e,t,n){const r=st(n);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}function N8(e,t,n){return new e({type:"custom",check:"custom",fn:t,...st(n)})}class Kk{constructor(t){this.counter=0,this.metadataRegistry=(t==null?void 0:t.metadata)??Wu,this.target=(t==null?void 0:t.target)??"draft-2020-12",this.unrepresentable=(t==null?void 0:t.unrepresentable)??"throw",this.override=(t==null?void 0:t.override)??(()=>{}),this.io=(t==null?void 0:t.io)??"output",this.seen=new Map}process(t,n={path:[],schemaPath:[]}){var h,m,g;var r;const i=t._zod.def,o={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},s=this.seen.get(t);if(s)return s.count++,n.schemaPath.includes(t)&&(s.cycle=n.path),s.schema;const a={schema:{},count:1,cycle:void 0,path:n.path};this.seen.set(t,a);const u=(m=(h=t._zod).toJSONSchema)==null?void 0:m.call(h);if(u)a.schema=u;else{const x={...n,schemaPath:[...n.schemaPath,t],path:n.path},b=t._zod.parent;if(b)a.ref=b,this.process(b,x),this.seen.get(b).isParent=!0;else{const v=a.schema;switch(i.type){case"string":{const C=v;C.type="string";const{minimum:_,maximum:E,format:I,patterns:N,contentEncoding:M}=t._zod.bag;if(typeof _=="number"&&(C.minLength=_),typeof E=="number"&&(C.maxLength=E),I&&(C.format=o[I]??I,C.format===""&&delete C.format),M&&(C.contentEncoding=M),N&&N.size>0){const F=[...N];F.length===1?C.pattern=F[0].source:F.length>1&&(a.schema.allOf=[...F.map(R=>({...this.target==="draft-7"?{type:"string"}:{},pattern:R.source}))])}break}case"number":{const C=v,{minimum:_,maximum:E,format:I,multipleOf:N,exclusiveMaximum:M,exclusiveMinimum:F}=t._zod.bag;typeof I=="string"&&I.includes("int")?C.type="integer":C.type="number",typeof F=="number"&&(C.exclusiveMinimum=F),typeof _=="number"&&(C.minimum=_,typeof F=="number"&&(F>=_?delete C.minimum:delete C.exclusiveMinimum)),typeof M=="number"&&(C.exclusiveMaximum=M),typeof E=="number"&&(C.maximum=E,typeof M=="number"&&(M<=E?delete C.maximum:delete C.exclusiveMaximum)),typeof N=="number"&&(C.multipleOf=N);break}case"boolean":{const C=v;C.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"null":{v.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"never":{v.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{const C=v,{minimum:_,maximum:E}=t._zod.bag;typeof _=="number"&&(C.minItems=_),typeof E=="number"&&(C.maxItems=E),C.type="array",C.items=this.process(i.element,{...x,path:[...x.path,"items"]});break}case"object":{const C=v;C.type="object",C.properties={};const _=i.shape;for(const N in _)C.properties[N]=this.process(_[N],{...x,path:[...x.path,"properties",N]});const E=new Set(Object.keys(_)),I=new Set([...E].filter(N=>{const M=i.shape[N]._zod;return this.io==="input"?M.optin===void 0:M.optout===void 0}));I.size>0&&(C.required=Array.from(I)),((g=i.catchall)==null?void 0:g._zod.def.type)==="never"?C.additionalProperties=!1:i.catchall?i.catchall&&(C.additionalProperties=this.process(i.catchall,{...x,path:[...x.path,"additionalProperties"]})):this.io==="output"&&(C.additionalProperties=!1);break}case"union":{const C=v;C.anyOf=i.options.map((_,E)=>this.process(_,{...x,path:[...x.path,"anyOf",E]}));break}case"intersection":{const C=v,_=this.process(i.left,{...x,path:[...x.path,"allOf",0]}),E=this.process(i.right,{...x,path:[...x.path,"allOf",1]}),I=M=>"allOf"in M&&Object.keys(M).length===1,N=[...I(_)?_.allOf:[_],...I(E)?E.allOf:[E]];C.allOf=N;break}case"tuple":{const C=v;C.type="array";const _=i.items.map((N,M)=>this.process(N,{...x,path:[...x.path,"prefixItems",M]}));if(this.target==="draft-2020-12"?C.prefixItems=_:C.items=_,i.rest){const N=this.process(i.rest,{...x,path:[...x.path,"items"]});this.target==="draft-2020-12"?C.items=N:C.additionalItems=N}i.rest&&(C.items=this.process(i.rest,{...x,path:[...x.path,"items"]}));const{minimum:E,maximum:I}=t._zod.bag;typeof E=="number"&&(C.minItems=E),typeof I=="number"&&(C.maxItems=I);break}case"record":{const C=v;C.type="object",C.propertyNames=this.process(i.keyType,{...x,path:[...x.path,"propertyNames"]}),C.additionalProperties=this.process(i.valueType,{...x,path:[...x.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{const C=v,_=iE(i.entries);_.every(E=>typeof E=="number")&&(C.type="number"),_.every(E=>typeof E=="string")&&(C.type="string"),C.enum=_;break}case"literal":{const C=v,_=[];for(const E of i.values)if(E===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof E=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");_.push(Number(E))}else _.push(E);if(_.length!==0)if(_.length===1){const E=_[0];C.type=E===null?"null":typeof E,C.const=E}else _.every(E=>typeof E=="number")&&(C.type="number"),_.every(E=>typeof E=="string")&&(C.type="string"),_.every(E=>typeof E=="boolean")&&(C.type="string"),_.every(E=>E===null)&&(C.type="null"),C.enum=_;break}case"file":{const C=v,_={type:"string",format:"binary",contentEncoding:"binary"},{minimum:E,maximum:I,mime:N}=t._zod.bag;E!==void 0&&(_.minLength=E),I!==void 0&&(_.maxLength=I),N?N.length===1?(_.contentMediaType=N[0],Object.assign(C,_)):C.anyOf=N.map(M=>({..._,contentMediaType:M})):Object.assign(C,_);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{const C=this.process(i.innerType,x);v.anyOf=[C,{type:"null"}];break}case"nonoptional":{this.process(i.innerType,x),a.ref=i.innerType;break}case"success":{const C=v;C.type="boolean";break}case"default":{this.process(i.innerType,x),a.ref=i.innerType,v.default=JSON.parse(JSON.stringify(i.defaultValue));break}case"prefault":{this.process(i.innerType,x),a.ref=i.innerType,this.io==="input"&&(v._prefault=JSON.parse(JSON.stringify(i.defaultValue)));break}case"catch":{this.process(i.innerType,x),a.ref=i.innerType;let C;try{C=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}v.default=C;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{const C=v,_=t._zod.pattern;if(!_)throw new Error("Pattern not found in template literal");C.type="string",C.pattern=_.source;break}case"pipe":{const C=this.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;this.process(C,x),a.ref=C;break}case"readonly":{this.process(i.innerType,x),a.ref=i.innerType,v.readOnly=!0;break}case"promise":{this.process(i.innerType,x),a.ref=i.innerType;break}case"optional":{this.process(i.innerType,x),a.ref=i.innerType;break}case"lazy":{const C=t._zod.innerType;this.process(C,x),a.ref=C;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}}}}const d=this.metadataRegistry.get(t);return d&&Object.assign(a.schema,d),this.io==="input"&&Bn(t)&&(delete a.schema.examples,delete a.schema.default),this.io==="input"&&a.schema._prefault&&((r=a.schema).default??(r.default=a.schema._prefault)),delete a.schema._prefault,this.seen.get(t).schema}emit(t,n){var f,h,m,g,x,b;const r={cycles:(n==null?void 0:n.cycles)??"ref",reused:(n==null?void 0:n.reused)??"inline",external:(n==null?void 0:n.external)??void 0},i=this.seen.get(t);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=v=>{var N;const C=this.target==="draft-2020-12"?"$defs":"definitions";if(r.external){const M=(N=r.external.registry.get(v[0]))==null?void 0:N.id,F=r.external.uri??(D=>D);if(M)return{ref:F(M)};const R=v[1].defId??v[1].schema.id??`schema${this.counter++}`;return v[1].defId=R,{defId:R,ref:`${F("__shared")}#/${C}/${R}`}}if(v[1]===i)return{ref:"#"};const E=`#/${C}/`,I=v[1].schema.id??`__schema${this.counter++}`;return{defId:I,ref:E+I}},s=v=>{if(v[1].schema.$ref)return;const C=v[1],{ref:_,defId:E}=o(v);C.def={...C.schema},E&&(C.defId=E);const I=C.schema;for(const N in I)delete I[N];I.$ref=_};if(r.cycles==="throw")for(const v of this.seen.entries()){const C=v[1];if(C.cycle)throw new Error(`Cycle detected: #/${(f=C.cycle)==null?void 0:f.join("/")}/<root>
68
+
69
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const v of this.seen.entries()){const C=v[1];if(t===v[0]){s(v);continue}if(r.external){const E=(h=r.external.registry.get(v[0]))==null?void 0:h.id;if(t!==v[0]&&E){s(v);continue}}if((m=this.metadataRegistry.get(v[0]))==null?void 0:m.id){s(v);continue}if(C.cycle){s(v);continue}if(C.count>1&&r.reused==="ref"){s(v);continue}}const a=(v,C)=>{const _=this.seen.get(v),E=_.def??_.schema,I={...E};if(_.ref===null)return;const N=_.ref;if(_.ref=null,N){a(N,C);const M=this.seen.get(N).schema;M.$ref&&C.target==="draft-7"?(E.allOf=E.allOf??[],E.allOf.push(M)):(Object.assign(E,M),Object.assign(E,I))}_.isParent||this.override({zodSchema:v,jsonSchema:E,path:_.path??[]})};for(const v of[...this.seen.entries()].reverse())a(v[0],{target:this.target});const u={};if(this.target==="draft-2020-12"?u.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?u.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),(g=r.external)!=null&&g.uri){const v=(x=r.external.registry.get(t))==null?void 0:x.id;if(!v)throw new Error("Schema is missing an `id` property");u.$id=r.external.uri(v)}Object.assign(u,i.def);const d=((b=r.external)==null?void 0:b.defs)??{};for(const v of this.seen.entries()){const C=v[1];C.def&&C.defId&&(d[C.defId]=C.def)}r.external||Object.keys(d).length>0&&(this.target==="draft-2020-12"?u.$defs=d:u.definitions=d);try{return JSON.parse(JSON.stringify(u))}catch{throw new Error("Error converting schema to JSON.")}}}function I8(e,t){if(e instanceof vE){const r=new Kk(t),i={};for(const a of e._idmap.entries()){const[u,d]=a;r.process(d)}const o={},s={registry:e,uri:t==null?void 0:t.uri,defs:i};for(const a of e._idmap.entries()){const[u,d]=a;o[u]=r.emit(d,{...t,external:s})}if(Object.keys(i).length>0){const a=r.target==="draft-2020-12"?"$defs":"definitions";o.__shared={[a]:i}}return{schemas:o}}const n=new Kk(t);return n.process(e),n.emit(e,t)}function Bn(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const i=e._zod.def;switch(i.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return Bn(i.element,n);case"object":{for(const o in i.shape)if(Bn(i.shape[o],n))return!0;return!1}case"union":{for(const o of i.options)if(Bn(o,n))return!0;return!1}case"intersection":return Bn(i.left,n)||Bn(i.right,n);case"tuple":{for(const o of i.items)if(Bn(o,n))return!0;return!!(i.rest&&Bn(i.rest,n))}case"record":return Bn(i.keyType,n)||Bn(i.valueType,n);case"map":return Bn(i.keyType,n)||Bn(i.valueType,n);case"set":return Bn(i.valueType,n);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return Bn(i.innerType,n);case"lazy":return Bn(i.getter(),n);case"default":return Bn(i.innerType,n);case"prefault":return Bn(i.innerType,n);case"custom":return!1;case"transform":return!0;case"pipe":return Bn(i.in,n)||Bn(i.out,n);case"success":return!1;case"catch":return!1}throw new Error(`Unknown schema type: ${i.type}`)}const D8=re("ZodISODateTime",(e,t)=>{nD.init(e,t),vn.init(e,t)});function O8(e){return l8(D8,e)}const R8=re("ZodISODate",(e,t)=>{rD.init(e,t),vn.init(e,t)});function P8(e){return u8(R8,e)}const j8=re("ZodISOTime",(e,t)=>{iD.init(e,t),vn.init(e,t)});function z8(e){return c8(j8,e)}const L8=re("ZodISODuration",(e,t)=>{oD.init(e,t),vn.init(e,t)});function F8(e){return d8(L8,e)}const $8=(e,t)=>{aE.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>QN(e,n)},flatten:{value:n=>YN(e,n)},addIssue:{value:n=>e.issues.push(n)},addIssues:{value:n=>e.issues.push(...n)},isEmpty:{get(){return e.issues.length===0}}})},vp=re("ZodError",$8,{Parent:Error}),B8=XN(vp),U8=eI(vp),V8=uE(vp),CE=cE(vp),pn=re("ZodType",(e,t)=>(rn.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),e.clone=(n,r)=>Pa(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>B8(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>V8(e,n,r),e.parseAsync=async(n,r)=>U8(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>CE(e,n,r),e.spa=e.safeParseAsync,e.refine=(n,r)=>e.check(LO(n,r)),e.superRefine=n=>e.check(FO(n)),e.overwrite=n=>e.check(Yc(n)),e.optional=()=>Qk(e),e.nullable=()=>Xk(e),e.nullish=()=>Qk(Xk(e)),e.nonoptional=n=>MO(e,n),e.array=()=>Kl(e),e.or=n=>vr([e,n]),e.and=n=>bO(e,n),e.transform=n=>ew(e,CO(n)),e.default=n=>_O(e,n),e.prefault=n=>AO(e,n),e.catch=n=>IO(e,n),e.pipe=n=>ew(e,n),e.readonly=()=>RO(e),e.describe=n=>{const r=e.clone();return Wu.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){var n;return(n=Wu.get(e))==null?void 0:n.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Wu.get(e);const r=e.clone();return Wu.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),SE=re("_ZodString",(e,t)=>{my.init(e,t),pn.init(e,t);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(x8(...r)),e.includes=(...r)=>e.check(k8(...r)),e.startsWith=(...r)=>e.check(w8(...r)),e.endsWith=(...r)=>e.check(C8(...r)),e.min=(...r)=>e.check(ih(...r)),e.max=(...r)=>e.check(kE(...r)),e.length=(...r)=>e.check(wE(...r)),e.nonempty=(...r)=>e.check(ih(1,...r)),e.lowercase=r=>e.check(b8(r)),e.uppercase=r=>e.check(v8(r)),e.trim=()=>e.check(E8()),e.normalize=(...r)=>e.check(S8(...r)),e.toLowerCase=()=>e.check(_8()),e.toUpperCase=()=>e.check(T8())}),H8=re("ZodString",(e,t)=>{my.init(e,t),SE.init(e,t),e.email=n=>e.check(BD(W8,n)),e.url=n=>e.check(qD(q8,n)),e.jwt=n=>e.check(a8(aO,n)),e.emoji=n=>e.check(ZD(Z8,n)),e.guid=n=>e.check(Wk(Gk,n)),e.uuid=n=>e.check(UD(kf,n)),e.uuidv4=n=>e.check(VD(kf,n)),e.uuidv6=n=>e.check(HD(kf,n)),e.uuidv7=n=>e.check(WD(kf,n)),e.nanoid=n=>e.check(JD(J8,n)),e.guid=n=>e.check(Wk(Gk,n)),e.cuid=n=>e.check(KD(K8,n)),e.cuid2=n=>e.check(GD(G8,n)),e.ulid=n=>e.check(YD(Y8,n)),e.base64=n=>e.check(i8(iO,n)),e.base64url=n=>e.check(o8(oO,n)),e.xid=n=>e.check(QD(Q8,n)),e.ksuid=n=>e.check(XD(X8,n)),e.ipv4=n=>e.check(e8(eO,n)),e.ipv6=n=>e.check(t8(tO,n)),e.cidrv4=n=>e.check(n8(nO,n)),e.cidrv6=n=>e.check(r8(rO,n)),e.e164=n=>e.check(s8(sO,n)),e.datetime=n=>e.check(O8(n)),e.date=n=>e.check(P8(n)),e.time=n=>e.check(z8(n)),e.duration=n=>e.check(F8(n))});function Ne(e){return $D(H8,e)}const vn=re("ZodStringFormat",(e,t)=>{hn.init(e,t),SE.init(e,t)}),W8=re("ZodEmail",(e,t)=>{ZI.init(e,t),vn.init(e,t)}),Gk=re("ZodGUID",(e,t)=>{WI.init(e,t),vn.init(e,t)}),kf=re("ZodUUID",(e,t)=>{qI.init(e,t),vn.init(e,t)}),q8=re("ZodURL",(e,t)=>{JI.init(e,t),vn.init(e,t)}),Z8=re("ZodEmoji",(e,t)=>{KI.init(e,t),vn.init(e,t)}),J8=re("ZodNanoID",(e,t)=>{GI.init(e,t),vn.init(e,t)}),K8=re("ZodCUID",(e,t)=>{YI.init(e,t),vn.init(e,t)}),G8=re("ZodCUID2",(e,t)=>{QI.init(e,t),vn.init(e,t)}),Y8=re("ZodULID",(e,t)=>{XI.init(e,t),vn.init(e,t)}),Q8=re("ZodXID",(e,t)=>{eD.init(e,t),vn.init(e,t)}),X8=re("ZodKSUID",(e,t)=>{tD.init(e,t),vn.init(e,t)}),eO=re("ZodIPv4",(e,t)=>{sD.init(e,t),vn.init(e,t)}),tO=re("ZodIPv6",(e,t)=>{aD.init(e,t),vn.init(e,t)}),nO=re("ZodCIDRv4",(e,t)=>{lD.init(e,t),vn.init(e,t)}),rO=re("ZodCIDRv6",(e,t)=>{uD.init(e,t),vn.init(e,t)}),iO=re("ZodBase64",(e,t)=>{cD.init(e,t),vn.init(e,t)}),oO=re("ZodBase64URL",(e,t)=>{fD.init(e,t),vn.init(e,t)}),sO=re("ZodE164",(e,t)=>{hD.init(e,t),vn.init(e,t)}),aO=re("ZodJWT",(e,t)=>{mD.init(e,t),vn.init(e,t)}),EE=re("ZodNumber",(e,t)=>{xE.init(e,t),pn.init(e,t),e.gt=(r,i)=>e.check(Zk(r,i)),e.gte=(r,i)=>e.check(I0(r,i)),e.min=(r,i)=>e.check(I0(r,i)),e.lt=(r,i)=>e.check(qk(r,i)),e.lte=(r,i)=>e.check(N0(r,i)),e.max=(r,i)=>e.check(N0(r,i)),e.int=r=>e.check(Yk(r)),e.safe=r=>e.check(Yk(r)),e.positive=r=>e.check(Zk(0,r)),e.nonnegative=r=>e.check(I0(0,r)),e.negative=r=>e.check(qk(0,r)),e.nonpositive=r=>e.check(N0(0,r)),e.multipleOf=(r,i)=>e.check(Jk(r,i)),e.step=(r,i)=>e.check(Jk(r,i)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function lO(e){return f8(EE,e)}const uO=re("ZodNumberFormat",(e,t)=>{gD.init(e,t),EE.init(e,t)});function Yk(e){return h8(uO,e)}const cO=re("ZodBoolean",(e,t)=>{yD.init(e,t),pn.init(e,t)});function yr(e){return p8(cO,e)}const dO=re("ZodNull",(e,t)=>{xD.init(e,t),pn.init(e,t)});function fO(e){return m8(dO,e)}const hO=re("ZodUnknown",(e,t)=>{bD.init(e,t),pn.init(e,t)});function Gi(){return g8(hO)}const pO=re("ZodNever",(e,t)=>{vD.init(e,t),pn.init(e,t)});function _E(e){return y8(pO,e)}const mO=re("ZodArray",(e,t)=>{kD.init(e,t),pn.init(e,t),e.element=t.element,e.min=(n,r)=>e.check(ih(n,r)),e.nonempty=n=>e.check(ih(1,n)),e.max=(n,r)=>e.check(kE(n,r)),e.length=(n,r)=>e.check(wE(n,r)),e.unwrap=()=>e.element});function Kl(e,t){return A8(mO,e,t)}const TE=re("ZodObject",(e,t)=>{wD.init(e,t),pn.init(e,t),Ht(e,"shape",()=>t.shape),e.keyof=()=>ME(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Gi()}),e.loose=()=>e.clone({...e._zod.def,catchall:Gi()}),e.strict=()=>e.clone({...e._zod.def,catchall:_E()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>ZN(e,n),e.merge=n=>JN(e,n),e.pick=n=>WN(e,n),e.omit=n=>qN(e,n),e.partial=(...n)=>KN(NE,e,n[0]),e.required=(...n)=>GN(IE,e,n[0])});function Yt(e,t){const n={type:"object",get shape(){return xp(this,"shape",{...e}),this.shape},...st(t)};return new TE(n)}function ln(e,t){return new TE({type:"object",get shape(){return xp(this,"shape",{...e}),this.shape},catchall:_E(),...st(t)})}const AE=re("ZodUnion",(e,t)=>{bE.init(e,t),pn.init(e,t),e.options=t.options});function vr(e,t){return new AE({type:"union",options:e,...st(t)})}const gO=re("ZodDiscriminatedUnion",(e,t)=>{AE.init(e,t),CD.init(e,t)});function yO(e,t,n){return new gO({type:"union",options:t,discriminator:e,...st(n)})}const xO=re("ZodIntersection",(e,t)=>{SD.init(e,t),pn.init(e,t)});function bO(e,t){return new xO({type:"intersection",left:e,right:t})}const vO=re("ZodRecord",(e,t)=>{ED.init(e,t),pn.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function Cc(e,t,n){return new vO({type:"record",keyType:e,valueType:t,...st(n)})}const Qg=re("ZodEnum",(e,t)=>{_D.init(e,t),pn.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,i)=>{const o={};for(const s of r)if(n.has(s))o[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new Qg({...t,checks:[],...st(i),entries:o})},e.exclude=(r,i)=>{const o={...t.entries};for(const s of r)if(n.has(s))delete o[s];else throw new Error(`Key ${s} not found in enum`);return new Qg({...t,checks:[],...st(i),entries:o})}});function ME(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Qg({type:"enum",entries:n,...st(t)})}const kO=re("ZodLiteral",(e,t)=>{TD.init(e,t),pn.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function mt(e,t){return new kO({type:"literal",values:Array.isArray(e)?e:[e],...st(t)})}const wO=re("ZodTransform",(e,t)=>{AD.init(e,t),pn.init(e,t),e._zod.parse=(n,r)=>{n.addIssue=o=>{if(typeof o=="string")n.issues.push(wc(o,n.value,t));else{const s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=e),s.continue??(s.continue=!0),n.issues.push(wc(s))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(o=>(n.value=o,n)):(n.value=i,n)}});function CO(e){return new wO({type:"transform",transform:e})}const NE=re("ZodOptional",(e,t)=>{MD.init(e,t),pn.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Qk(e){return new NE({type:"optional",innerType:e})}const SO=re("ZodNullable",(e,t)=>{ND.init(e,t),pn.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Xk(e){return new SO({type:"nullable",innerType:e})}const EO=re("ZodDefault",(e,t)=>{ID.init(e,t),pn.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function _O(e,t){return new EO({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}const TO=re("ZodPrefault",(e,t)=>{DD.init(e,t),pn.init(e,t),e.unwrap=()=>e._zod.def.innerType});function AO(e,t){return new TO({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}const IE=re("ZodNonOptional",(e,t)=>{OD.init(e,t),pn.init(e,t),e.unwrap=()=>e._zod.def.innerType});function MO(e,t){return new IE({type:"nonoptional",innerType:e,...st(t)})}const NO=re("ZodCatch",(e,t)=>{RD.init(e,t),pn.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function IO(e,t){return new NO({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const DO=re("ZodPipe",(e,t)=>{PD.init(e,t),pn.init(e,t),e.in=t.in,e.out=t.out});function ew(e,t){return new DO({type:"pipe",in:e,out:t})}const OO=re("ZodReadonly",(e,t)=>{jD.init(e,t),pn.init(e,t)});function RO(e){return new OO({type:"readonly",innerType:e})}const PO=re("ZodLazy",(e,t)=>{zD.init(e,t),pn.init(e,t),e.unwrap=()=>e._zod.def.getter()});function jO(e){return new PO({type:"lazy",getter:e})}const gy=re("ZodCustom",(e,t)=>{LD.init(e,t),pn.init(e,t)});function zO(e){const t=new Br({check:"custom"});return t._zod.check=e,t}function DE(e,t){return M8(gy,e??(()=>!0),t)}function LO(e,t={}){return N8(gy,e,t)}function FO(e){const t=zO(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(wc(r,n.value,t._zod.def));else{const i=r;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=t),i.continue??(i.continue=!t._zod.def.abort),n.issues.push(wc(i))}},e(n.value,n)));return t}function oh(e,t={error:`Input not instance of ${e.name}`}){const n=new gy({type:"custom",check:"custom",fn:r=>r instanceof e,abort:!0,...st(t)});return n._zod.bag.Class=e,n}var Vt;(function(e){e.assertEqual=i=>{};function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const o={};for(const s of i)o[s]=s;return o},e.getValidEnumValues=i=>{const o=e.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),s={};for(const a of o)s[a]=i[a];return e.objectValues(s)},e.objectValues=i=>e.objectKeys(i).map(function(o){return i[o]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const o=[];for(const s in i)Object.prototype.hasOwnProperty.call(i,s)&&o.push(s);return o},e.find=(i,o)=>{for(const s of i)if(o(s))return s},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(Vt||(Vt={}));var tw;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(tw||(tw={}));const et=Vt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),hs=e=>{switch(typeof e){case"undefined":return et.undefined;case"string":return et.string;case"number":return Number.isNaN(e)?et.nan:et.number;case"boolean":return et.boolean;case"function":return et.function;case"bigint":return et.bigint;case"symbol":return et.symbol;case"object":return Array.isArray(e)?et.array:e===null?et.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?et.promise:typeof Map<"u"&&e instanceof Map?et.map:typeof Set<"u"&&e instanceof Set?et.set:typeof Date<"u"&&e instanceof Date?et.date:et.object;default:return et.unknown}},Se=Vt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class zo extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(o){return o.message},r={_errors:[]},i=o=>{for(const s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let a=r,u=0;for(;u<s.path.length;){const d=s.path[u];u===s.path.length-1?(a[d]=a[d]||{_errors:[]},a[d]._errors.push(n(s))):a[d]=a[d]||{_errors:[]},a=a[d],u++}}};return i(this),r}static assert(t){if(!(t instanceof zo))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Vt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const i of this.issues)if(i.path.length>0){const o=i.path[0];n[o]=n[o]||[],n[o].push(t(i))}else r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}zo.create=e=>new zo(e);const Xg=(e,t)=>{let n;switch(e.code){case Se.invalid_type:e.received===et.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case Se.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Vt.jsonStringifyReplacer)}`;break;case Se.unrecognized_keys:n=`Unrecognized key(s) in object: ${Vt.joinValues(e.keys,", ")}`;break;case Se.invalid_union:n="Invalid input";break;case Se.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Vt.joinValues(e.options)}`;break;case Se.invalid_enum_value:n=`Invalid enum value. Expected ${Vt.joinValues(e.options)}, received '${e.received}'`;break;case Se.invalid_arguments:n="Invalid function arguments";break;case Se.invalid_return_type:n="Invalid function return type";break;case Se.invalid_date:n="Invalid date";break;case Se.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Vt.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case Se.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case Se.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case Se.custom:n="Invalid input";break;case Se.invalid_intersection_types:n="Intersection results could not be merged";break;case Se.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Se.not_finite:n="Number must be finite";break;default:n=t.defaultError,Vt.assertNever(e)}return{message:n}};let $O=Xg;function BO(){return $O}const UO=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,o=[...n,...i.path||[]],s={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let a="";const u=r.filter(d=>!!d).slice().reverse();for(const d of u)a=d(s,{data:t,defaultError:a}).message;return{...i,path:o,message:a}};function Ue(e,t){const n=BO(),r=UO({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Xg?void 0:Xg].filter(i=>!!i)});e.common.issues.push(r)}class kr{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return xt;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n){const o=await i.key,s=await i.value;r.push({key:o,value:s})}return kr.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:o,value:s}=i;if(o.status==="aborted"||s.status==="aborted")return xt;o.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(r[o.value]=s.value)}return{status:t.value,value:r}}}const xt=Object.freeze({status:"aborted"}),qu=e=>({status:"dirty",value:e}),vi=e=>({status:"valid",value:e}),nw=e=>e.status==="aborted",rw=e=>e.status==="dirty",Ol=e=>e.status==="valid",sh=e=>typeof Promise<"u"&&e instanceof Promise;var ot;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(ot||(ot={}));class to{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const iw=(e,t)=>{if(Ol(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new zo(e.common.issues);return this._error=n,this._error}}};function Mt(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(s,a)=>{const{message:u}=e;return s.code==="invalid_enum_value"?{message:u??a.defaultError}:typeof a.data>"u"?{message:u??r??a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:u??n??a.defaultError}},description:i}}class Ft{get description(){return this._def.description}_getType(t){return hs(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:hs(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new kr,ctx:{common:t.parent.common,data:t.data,parsedType:hs(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(sh(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:hs(t)},i=this._parseSync({data:t,path:r.path,parent:r});return iw(r,i)}"~validate"(t){var r,i;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:hs(t)};if(!this["~standard"].async)try{const o=this._parseSync({data:t,path:[],parent:n});return Ol(o)?{value:o.value}:{issues:n.common.issues}}catch(o){(i=(r=o==null?void 0:o.message)==null?void 0:r.toLowerCase())!=null&&i.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(o=>Ol(o)?{value:o.value}:{issues:n.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:hs(t)},i=this._parse({data:t,path:r.path,parent:r}),o=await(sh(i)?i:Promise.resolve(i));return iw(r,o)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{const s=t(i),a=()=>o.addIssue({code:Se.custom,...r(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(u=>u?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new Pl({schema:this,typeName:Ee.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Ts.create(this,this._def)}nullable(){return jl.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Xi.create(this)}promise(){return dh.create(this,this._def)}or(t){return lh.create([this,t],this._def)}and(t){return uh.create(this,t,this._def)}transform(t){return new Pl({...Mt(this._def),schema:this,typeName:Ee.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new r1({...Mt(this._def),innerType:this,defaultValue:n,typeName:Ee.ZodDefault})}brand(){return new d5({typeName:Ee.ZodBranded,type:this,...Mt(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new i1({...Mt(this._def),innerType:this,catchValue:n,typeName:Ee.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return yy.create(this,t)}readonly(){return o1.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const VO=/^c[^\s-]{8,}$/i,HO=/^[0-9a-z]+$/,WO=/^[0-9A-HJKMNP-TV-Z]{26}$/i,qO=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,ZO=/^[a-z0-9_-]{21}$/i,JO=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,KO=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,GO=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,YO="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let D0;const QO=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,XO=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,e5=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,t5=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,n5=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,r5=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,OE="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",i5=new RegExp(`^${OE}$`);function RE(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function o5(e){return new RegExp(`^${RE(e)}$`)}function s5(e){let t=`${OE}T${RE(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function a5(e,t){return!!((t==="v4"||!t)&&QO.test(e)||(t==="v6"||!t)&&e5.test(e))}function l5(e,t){if(!JO.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||"typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||t&&i.alg!==t)}catch{return!1}}function u5(e,t){return!!((t==="v4"||!t)&&XO.test(e)||(t==="v6"||!t)&&t5.test(e))}class Io extends Ft{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==et.string){const o=this._getOrReturnCtx(t);return Ue(o,{code:Se.invalid_type,expected:et.string,received:o.parsedType}),xt}const r=new kr;let i;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(i=this._getOrReturnCtx(t,i),Ue(i,{code:Se.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")t.data.length>o.value&&(i=this._getOrReturnCtx(t,i),Ue(i,{code:Se.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const s=t.data.length>o.value,a=t.data.length<o.value;(s||a)&&(i=this._getOrReturnCtx(t,i),s?Ue(i,{code:Se.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&Ue(i,{code:Se.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")GO.test(t.data)||(i=this._getOrReturnCtx(t,i),Ue(i,{validation:"email",code:Se.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")D0||(D0=new RegExp(YO,"u")),D0.test(t.data)||(i=this._getOrReturnCtx(t,i),Ue(i,{validation:"emoji",code:Se.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")qO.test(t.data)||(i=this._getOrReturnCtx(t,i),Ue(i,{validation:"uuid",code:Se.invalid_string,message:o.message}),r.dirty());else if(o.kind==="nanoid")ZO.test(t.data)||(i=this._getOrReturnCtx(t,i),Ue(i,{validation:"nanoid",code:Se.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")VO.test(t.data)||(i=this._getOrReturnCtx(t,i),Ue(i,{validation:"cuid",code:Se.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")HO.test(t.data)||(i=this._getOrReturnCtx(t,i),Ue(i,{validation:"cuid2",code:Se.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")WO.test(t.data)||(i=this._getOrReturnCtx(t,i),Ue(i,{validation:"ulid",code:Se.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),Ue(i,{validation:"url",code:Se.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),Ue(i,{validation:"regex",code:Se.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(t,i),Ue(i,{code:Se.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(i=this._getOrReturnCtx(t,i),Ue(i,{code:Se.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(i=this._getOrReturnCtx(t,i),Ue(i,{code:Se.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?s5(o).test(t.data)||(i=this._getOrReturnCtx(t,i),Ue(i,{code:Se.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="date"?i5.test(t.data)||(i=this._getOrReturnCtx(t,i),Ue(i,{code:Se.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?o5(o).test(t.data)||(i=this._getOrReturnCtx(t,i),Ue(i,{code:Se.invalid_string,validation:"time",message:o.message}),r.dirty()):o.kind==="duration"?KO.test(t.data)||(i=this._getOrReturnCtx(t,i),Ue(i,{validation:"duration",code:Se.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?a5(t.data,o.version)||(i=this._getOrReturnCtx(t,i),Ue(i,{validation:"ip",code:Se.invalid_string,message:o.message}),r.dirty()):o.kind==="jwt"?l5(t.data,o.alg)||(i=this._getOrReturnCtx(t,i),Ue(i,{validation:"jwt",code:Se.invalid_string,message:o.message}),r.dirty()):o.kind==="cidr"?u5(t.data,o.version)||(i=this._getOrReturnCtx(t,i),Ue(i,{validation:"cidr",code:Se.invalid_string,message:o.message}),r.dirty()):o.kind==="base64"?n5.test(t.data)||(i=this._getOrReturnCtx(t,i),Ue(i,{validation:"base64",code:Se.invalid_string,message:o.message}),r.dirty()):o.kind==="base64url"?r5.test(t.data)||(i=this._getOrReturnCtx(t,i),Ue(i,{validation:"base64url",code:Se.invalid_string,message:o.message}),r.dirty()):Vt.assertNever(o);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(i=>t.test(i),{validation:n,code:Se.invalid_string,...ot.errToObj(r)})}_addCheck(t){return new Io({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...ot.errToObj(t)})}url(t){return this._addCheck({kind:"url",...ot.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...ot.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...ot.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...ot.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...ot.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...ot.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...ot.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...ot.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...ot.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...ot.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...ot.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...ot.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...ot.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...ot.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...ot.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...ot.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...ot.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...ot.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...ot.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...ot.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...ot.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...ot.errToObj(n)})}nonempty(t){return this.min(1,ot.errToObj(t))}trim(){return new Io({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Io({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Io({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Io.create=e=>new Io({checks:[],typeName:Ee.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...Mt(e)});function c5(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,o=Number.parseInt(e.toFixed(i).replace(".","")),s=Number.parseInt(t.toFixed(i).replace(".",""));return o%s/10**i}class Sc extends Ft{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==et.number){const o=this._getOrReturnCtx(t);return Ue(o,{code:Se.invalid_type,expected:et.number,received:o.parsedType}),xt}let r;const i=new kr;for(const o of this._def.checks)o.kind==="int"?Vt.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),Ue(r,{code:Se.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),Ue(r,{code:Se.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),Ue(r,{code:Se.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?c5(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),Ue(r,{code:Se.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),Ue(r,{code:Se.not_finite,message:o.message}),i.dirty()):Vt.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,ot.toString(n))}gt(t,n){return this.setLimit("min",t,!1,ot.toString(n))}lte(t,n){return this.setLimit("max",t,!0,ot.toString(n))}lt(t,n){return this.setLimit("max",t,!1,ot.toString(n))}setLimit(t,n,r,i){return new Sc({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:ot.toString(i)}]})}_addCheck(t){return new Sc({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:ot.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ot.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ot.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ot.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ot.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:ot.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:ot.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ot.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ot.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Vt.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}Sc.create=e=>new Sc({checks:[],typeName:Ee.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Mt(e)});class Ec extends Ft{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==et.bigint)return this._getInvalidInput(t);let r;const i=new kr;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),Ue(r,{code:Se.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),Ue(r,{code:Se.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),Ue(r,{code:Se.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):Vt.assertNever(o);return{status:i.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return Ue(n,{code:Se.invalid_type,expected:et.bigint,received:n.parsedType}),xt}gte(t,n){return this.setLimit("min",t,!0,ot.toString(n))}gt(t,n){return this.setLimit("min",t,!1,ot.toString(n))}lte(t,n){return this.setLimit("max",t,!0,ot.toString(n))}lt(t,n){return this.setLimit("max",t,!1,ot.toString(n))}setLimit(t,n,r,i){return new Ec({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:ot.toString(i)}]})}_addCheck(t){return new Ec({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ot.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ot.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ot.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ot.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:ot.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Ec.create=e=>new Ec({checks:[],typeName:Ee.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...Mt(e)});class e1 extends Ft{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==et.boolean){const r=this._getOrReturnCtx(t);return Ue(r,{code:Se.invalid_type,expected:et.boolean,received:r.parsedType}),xt}return vi(t.data)}}e1.create=e=>new e1({typeName:Ee.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Mt(e)});class ah extends Ft{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==et.date){const o=this._getOrReturnCtx(t);return Ue(o,{code:Se.invalid_type,expected:et.date,received:o.parsedType}),xt}if(Number.isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return Ue(o,{code:Se.invalid_date}),xt}const r=new kr;let i;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(i=this._getOrReturnCtx(t,i),Ue(i,{code:Se.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(i=this._getOrReturnCtx(t,i),Ue(i,{code:Se.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):Vt.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new ah({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:ot.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:ot.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}ah.create=e=>new ah({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Ee.ZodDate,...Mt(e)});class ow extends Ft{_parse(t){if(this._getType(t)!==et.symbol){const r=this._getOrReturnCtx(t);return Ue(r,{code:Se.invalid_type,expected:et.symbol,received:r.parsedType}),xt}return vi(t.data)}}ow.create=e=>new ow({typeName:Ee.ZodSymbol,...Mt(e)});class sw extends Ft{_parse(t){if(this._getType(t)!==et.undefined){const r=this._getOrReturnCtx(t);return Ue(r,{code:Se.invalid_type,expected:et.undefined,received:r.parsedType}),xt}return vi(t.data)}}sw.create=e=>new sw({typeName:Ee.ZodUndefined,...Mt(e)});class aw extends Ft{_parse(t){if(this._getType(t)!==et.null){const r=this._getOrReturnCtx(t);return Ue(r,{code:Se.invalid_type,expected:et.null,received:r.parsedType}),xt}return vi(t.data)}}aw.create=e=>new aw({typeName:Ee.ZodNull,...Mt(e)});class _c extends Ft{constructor(){super(...arguments),this._any=!0}_parse(t){return vi(t.data)}}_c.create=e=>new _c({typeName:Ee.ZodAny,...Mt(e)});class t1 extends Ft{constructor(){super(...arguments),this._unknown=!0}_parse(t){return vi(t.data)}}t1.create=e=>new t1({typeName:Ee.ZodUnknown,...Mt(e)});class js extends Ft{_parse(t){const n=this._getOrReturnCtx(t);return Ue(n,{code:Se.invalid_type,expected:et.never,received:n.parsedType}),xt}}js.create=e=>new js({typeName:Ee.ZodNever,...Mt(e)});class lw extends Ft{_parse(t){if(this._getType(t)!==et.undefined){const r=this._getOrReturnCtx(t);return Ue(r,{code:Se.invalid_type,expected:et.void,received:r.parsedType}),xt}return vi(t.data)}}lw.create=e=>new lw({typeName:Ee.ZodVoid,...Mt(e)});class Xi extends Ft{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==et.array)return Ue(n,{code:Se.invalid_type,expected:et.array,received:n.parsedType}),xt;if(i.exactLength!==null){const s=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(s||a)&&(Ue(n,{code:s?Se.too_big:Se.too_small,minimum:a?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(Ue(n,{code:Se.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(Ue(n,{code:Se.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((s,a)=>i.type._parseAsync(new to(n,s,n.path,a)))).then(s=>kr.mergeArray(r,s));const o=[...n.data].map((s,a)=>i.type._parseSync(new to(n,s,n.path,a)));return kr.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new Xi({...this._def,minLength:{value:t,message:ot.toString(n)}})}max(t,n){return new Xi({...this._def,maxLength:{value:t,message:ot.toString(n)}})}length(t,n){return new Xi({...this._def,exactLength:{value:t,message:ot.toString(n)}})}nonempty(t){return this.min(1,t)}}Xi.create=(e,t)=>new Xi({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ee.ZodArray,...Mt(t)});function bl(e){if(e instanceof Mn){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Ts.create(bl(r))}return new Mn({...e._def,shape:()=>t})}else return e instanceof Xi?new Xi({...e._def,type:bl(e.element)}):e instanceof Ts?Ts.create(bl(e.unwrap())):e instanceof jl?jl.create(bl(e.unwrap())):e instanceof Sa?Sa.create(e.items.map(t=>bl(t))):e}class Mn extends Ft{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Vt.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==et.object){const d=this._getOrReturnCtx(t);return Ue(d,{code:Se.invalid_type,expected:et.object,received:d.parsedType}),xt}const{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof js&&this._def.unknownKeys==="strip"))for(const d in i.data)s.includes(d)||a.push(d);const u=[];for(const d of s){const f=o[d],h=i.data[d];u.push({key:{status:"valid",value:d},value:f._parse(new to(i,h,i.path,d)),alwaysSet:d in i.data})}if(this._def.catchall instanceof js){const d=this._def.unknownKeys;if(d==="passthrough")for(const f of a)u.push({key:{status:"valid",value:f},value:{status:"valid",value:i.data[f]}});else if(d==="strict")a.length>0&&(Ue(i,{code:Se.unrecognized_keys,keys:a}),r.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const d=this._def.catchall;for(const f of a){const h=i.data[f];u.push({key:{status:"valid",value:f},value:d._parse(new to(i,h,i.path,f)),alwaysSet:f in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const d=[];for(const f of u){const h=await f.key,m=await f.value;d.push({key:h,value:m,alwaysSet:f.alwaysSet})}return d}).then(d=>kr.mergeObjectSync(r,d)):kr.mergeObjectSync(r,u)}get shape(){return this._def.shape()}strict(t){return ot.errToObj,new Mn({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var o,s;const i=((s=(o=this._def).errorMap)==null?void 0:s.call(o,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:ot.errToObj(t).message??i}:{message:i}}}:{}})}strip(){return new Mn({...this._def,unknownKeys:"strip"})}passthrough(){return new Mn({...this._def,unknownKeys:"passthrough"})}extend(t){return new Mn({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Mn({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Ee.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Mn({...this._def,catchall:t})}pick(t){const n={};for(const r of Vt.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new Mn({...this._def,shape:()=>n})}omit(t){const n={};for(const r of Vt.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new Mn({...this._def,shape:()=>n})}deepPartial(){return bl(this)}partial(t){const n={};for(const r of Vt.objectKeys(this.shape)){const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}return new Mn({...this._def,shape:()=>n})}required(t){const n={};for(const r of Vt.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof Ts;)o=o._def.innerType;n[r]=o}return new Mn({...this._def,shape:()=>n})}keyof(){return PE(Vt.objectKeys(this.shape))}}Mn.create=(e,t)=>new Mn({shape:()=>e,unknownKeys:"strip",catchall:js.create(),typeName:Ee.ZodObject,...Mt(t)});Mn.strictCreate=(e,t)=>new Mn({shape:()=>e,unknownKeys:"strict",catchall:js.create(),typeName:Ee.ZodObject,...Mt(t)});Mn.lazycreate=(e,t)=>new Mn({shape:e,unknownKeys:"strip",catchall:js.create(),typeName:Ee.ZodObject,...Mt(t)});class lh extends Ft{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(o){for(const a of o)if(a.result.status==="valid")return a.result;for(const a of o)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const s=o.map(a=>new zo(a.ctx.common.issues));return Ue(n,{code:Se.invalid_union,unionErrors:s}),xt}if(n.common.async)return Promise.all(r.map(async o=>{const s={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(i);{let o;const s=[];for(const u of r){const d={...n,common:{...n.common,issues:[]},parent:null},f=u._parseSync({data:n.data,path:n.path,parent:d});if(f.status==="valid")return f;f.status==="dirty"&&!o&&(o={result:f,ctx:d}),d.common.issues.length&&s.push(d.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const a=s.map(u=>new zo(u));return Ue(n,{code:Se.invalid_union,unionErrors:a}),xt}}get options(){return this._def.options}}lh.create=(e,t)=>new lh({options:e,typeName:Ee.ZodUnion,...Mt(t)});function n1(e,t){const n=hs(e),r=hs(t);if(e===t)return{valid:!0,data:e};if(n===et.object&&r===et.object){const i=Vt.objectKeys(t),o=Vt.objectKeys(e).filter(a=>i.indexOf(a)!==-1),s={...e,...t};for(const a of o){const u=n1(e[a],t[a]);if(!u.valid)return{valid:!1};s[a]=u.data}return{valid:!0,data:s}}else if(n===et.array&&r===et.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let o=0;o<e.length;o++){const s=e[o],a=t[o],u=n1(s,a);if(!u.valid)return{valid:!1};i.push(u.data)}return{valid:!0,data:i}}else return n===et.date&&r===et.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class uh extends Ft{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=(o,s)=>{if(nw(o)||nw(s))return xt;const a=n1(o.value,s.value);return a.valid?((rw(o)||rw(s))&&n.dirty(),{status:n.value,value:a.data}):(Ue(r,{code:Se.invalid_intersection_types}),xt)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,s])=>i(o,s)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}uh.create=(e,t,n)=>new uh({left:e,right:t,typeName:Ee.ZodIntersection,...Mt(n)});class Sa extends Ft{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==et.array)return Ue(r,{code:Se.invalid_type,expected:et.array,received:r.parsedType}),xt;if(r.data.length<this._def.items.length)return Ue(r,{code:Se.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),xt;!this._def.rest&&r.data.length>this._def.items.length&&(Ue(r,{code:Se.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((s,a)=>{const u=this._def.items[a]||this._def.rest;return u?u._parse(new to(r,s,r.path,a)):null}).filter(s=>!!s);return r.common.async?Promise.all(o).then(s=>kr.mergeArray(n,s)):kr.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new Sa({...this._def,rest:t})}}Sa.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Sa({items:e,typeName:Ee.ZodTuple,rest:null,...Mt(t)})};class ch extends Ft{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==et.object)return Ue(r,{code:Se.invalid_type,expected:et.object,received:r.parsedType}),xt;const i=[],o=this._def.keyType,s=this._def.valueType;for(const a in r.data)i.push({key:o._parse(new to(r,a,r.path,a)),value:s._parse(new to(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?kr.mergeObjectAsync(n,i):kr.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Ft?new ch({keyType:t,valueType:n,typeName:Ee.ZodRecord,...Mt(r)}):new ch({keyType:Io.create(),valueType:t,typeName:Ee.ZodRecord,...Mt(n)})}}class uw extends Ft{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==et.map)return Ue(r,{code:Se.invalid_type,expected:et.map,received:r.parsedType}),xt;const i=this._def.keyType,o=this._def.valueType,s=[...r.data.entries()].map(([a,u],d)=>({key:i._parse(new to(r,a,r.path,[d,"key"])),value:o._parse(new to(r,u,r.path,[d,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const u of s){const d=await u.key,f=await u.value;if(d.status==="aborted"||f.status==="aborted")return xt;(d.status==="dirty"||f.status==="dirty")&&n.dirty(),a.set(d.value,f.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const u of s){const d=u.key,f=u.value;if(d.status==="aborted"||f.status==="aborted")return xt;(d.status==="dirty"||f.status==="dirty")&&n.dirty(),a.set(d.value,f.value)}return{status:n.value,value:a}}}}uw.create=(e,t,n)=>new uw({valueType:t,keyType:e,typeName:Ee.ZodMap,...Mt(n)});class Tc extends Ft{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==et.set)return Ue(r,{code:Se.invalid_type,expected:et.set,received:r.parsedType}),xt;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(Ue(r,{code:Se.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(Ue(r,{code:Se.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const o=this._def.valueType;function s(u){const d=new Set;for(const f of u){if(f.status==="aborted")return xt;f.status==="dirty"&&n.dirty(),d.add(f.value)}return{status:n.value,value:d}}const a=[...r.data.values()].map((u,d)=>o._parse(new to(r,u,r.path,d)));return r.common.async?Promise.all(a).then(u=>s(u)):s(a)}min(t,n){return new Tc({...this._def,minSize:{value:t,message:ot.toString(n)}})}max(t,n){return new Tc({...this._def,maxSize:{value:t,message:ot.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Tc.create=(e,t)=>new Tc({valueType:e,minSize:null,maxSize:null,typeName:Ee.ZodSet,...Mt(t)});class cw extends Ft{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}cw.create=(e,t)=>new cw({getter:e,typeName:Ee.ZodLazy,...Mt(t)});class dw extends Ft{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return Ue(n,{received:n.data,code:Se.invalid_literal,expected:this._def.value}),xt}return{status:"valid",value:t.data}}get value(){return this._def.value}}dw.create=(e,t)=>new dw({value:e,typeName:Ee.ZodLiteral,...Mt(t)});function PE(e,t){return new Rl({values:e,typeName:Ee.ZodEnum,...Mt(t)})}class Rl extends Ft{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return Ue(n,{expected:Vt.joinValues(r),received:n.parsedType,code:Se.invalid_type}),xt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return Ue(n,{received:n.data,code:Se.invalid_enum_value,options:r}),xt}return vi(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return Rl.create(t,{...this._def,...n})}exclude(t,n=this._def){return Rl.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}Rl.create=PE;class fw extends Ft{_parse(t){const n=Vt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==et.string&&r.parsedType!==et.number){const i=Vt.objectValues(n);return Ue(r,{expected:Vt.joinValues(i),received:r.parsedType,code:Se.invalid_type}),xt}if(this._cache||(this._cache=new Set(Vt.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const i=Vt.objectValues(n);return Ue(r,{received:r.data,code:Se.invalid_enum_value,options:i}),xt}return vi(t.data)}get enum(){return this._def.values}}fw.create=(e,t)=>new fw({values:e,typeName:Ee.ZodNativeEnum,...Mt(t)});class dh extends Ft{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==et.promise&&n.common.async===!1)return Ue(n,{code:Se.invalid_type,expected:et.promise,received:n.parsedType}),xt;const r=n.parsedType===et.promise?n.data:Promise.resolve(n.data);return vi(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}dh.create=(e,t)=>new dh({type:e,typeName:Ee.ZodPromise,...Mt(t)});class Pl extends Ft{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ee.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null,o={addIssue:s=>{Ue(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){const s=i.transform(r.data,o);if(r.common.async)return Promise.resolve(s).then(async a=>{if(n.value==="aborted")return xt;const u=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return u.status==="aborted"?xt:u.status==="dirty"||n.value==="dirty"?qu(u.value):u});{if(n.value==="aborted")return xt;const a=this._def.schema._parseSync({data:s,path:r.path,parent:r});return a.status==="aborted"?xt:a.status==="dirty"||n.value==="dirty"?qu(a.value):a}}if(i.type==="refinement"){const s=a=>{const u=i.refinement(a,o);if(r.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?xt:(a.status==="dirty"&&n.dirty(),s(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?xt:(a.status==="dirty"&&n.dirty(),s(a.value).then(()=>({status:n.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Ol(s))return xt;const a=i.transform(s.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>Ol(s)?Promise.resolve(i.transform(s.value,o)).then(a=>({status:n.value,value:a})):xt);Vt.assertNever(i)}}Pl.create=(e,t,n)=>new Pl({schema:e,typeName:Ee.ZodEffects,effect:t,...Mt(n)});Pl.createWithPreprocess=(e,t,n)=>new Pl({schema:t,effect:{type:"preprocess",transform:e},typeName:Ee.ZodEffects,...Mt(n)});class Ts extends Ft{_parse(t){return this._getType(t)===et.undefined?vi(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Ts.create=(e,t)=>new Ts({innerType:e,typeName:Ee.ZodOptional,...Mt(t)});class jl extends Ft{_parse(t){return this._getType(t)===et.null?vi(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}jl.create=(e,t)=>new jl({innerType:e,typeName:Ee.ZodNullable,...Mt(t)});class r1 extends Ft{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===et.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}r1.create=(e,t)=>new r1({innerType:e,typeName:Ee.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Mt(t)});class i1 extends Ft{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return sh(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new zo(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new zo(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}i1.create=(e,t)=>new i1({innerType:e,typeName:Ee.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Mt(t)});class hw extends Ft{_parse(t){if(this._getType(t)!==et.nan){const r=this._getOrReturnCtx(t);return Ue(r,{code:Se.invalid_type,expected:et.nan,received:r.parsedType}),xt}return{status:"valid",value:t.data}}}hw.create=e=>new hw({typeName:Ee.ZodNaN,...Mt(e)});class d5 extends Ft{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class yy extends Ft{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?xt:o.status==="dirty"?(n.dirty(),qu(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?xt:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new yy({in:t,out:n,typeName:Ee.ZodPipeline})}}class o1 extends Ft{_parse(t){const n=this._def.innerType._parse(t),r=i=>(Ol(i)&&(i.value=Object.freeze(i.value)),i);return sh(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}o1.create=(e,t)=>new o1({innerType:e,typeName:Ee.ZodReadonly,...Mt(t)});function pw(e,t){const n=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof n=="string"?{message:n}:n}function f5(e,t={},n){return e?_c.create().superRefine((r,i)=>{const o=e(r);if(o instanceof Promise)return o.then(s=>{if(!s){const a=pw(t,r),u=a.fatal??n??!0;i.addIssue({code:"custom",...a,fatal:u})}});if(!o){const s=pw(t,r),a=s.fatal??n??!0;i.addIssue({code:"custom",...s,fatal:a})}}):_c.create()}var Ee;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Ee||(Ee={}));const xn=Io.create,jE=e1.create;_c.create;const zE=t1.create;js.create;const xy=Xi.create,ja=Mn.create;lh.create;uh.create;Sa.create;const Ea=ch.create,Ac=Rl.create;dh.create;Ts.create;jl.create;class mw extends Error{constructor(t,n){super(t),this.name="ParseError",this.type=n.type,this.field=n.field,this.value=n.value,this.line=n.line}}function O0(e){}function h5(e){if(typeof e=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:t=O0,onError:n=O0,onRetry:r=O0,onComment:i}=e;let o="",s=!0,a,u="",d="";function f(b){const v=s?b.replace(/^\xEF\xBB\xBF/,""):b,[C,_]=p5(`${o}${v}`);for(const E of C)h(E);o=_,s=!1}function h(b){if(b===""){g();return}if(b.startsWith(":")){i&&i(b.slice(b.startsWith(": ")?2:1));return}const v=b.indexOf(":");if(v!==-1){const C=b.slice(0,v),_=b[v+1]===" "?2:1,E=b.slice(v+_);m(C,E,b);return}m(b,"",b)}function m(b,v,C){switch(b){case"event":d=v;break;case"data":u=`${u}${v}
70
+ `;break;case"id":a=v.includes("\0")?void 0:v;break;case"retry":/^\d+$/.test(v)?r(parseInt(v,10)):n(new mw(`Invalid \`retry\` value: "${v}"`,{type:"invalid-retry",value:v,line:C}));break;default:n(new mw(`Unknown field "${b.length>20?`${b.slice(0,20)}…`:b}"`,{type:"unknown-field",field:b,value:v,line:C}));break}}function g(){u.length>0&&t({id:a,event:d||void 0,data:u.endsWith(`
71
+ `)?u.slice(0,-1):u}),a=void 0,u="",d=""}function x(b={}){o&&b.consume&&h(o),s=!0,a=void 0,u="",d="",o=""}return{feed:f,reset:x}}function p5(e){const t=[];let n="",r=0;for(;r<e.length;){const i=e.indexOf("\r",r),o=e.indexOf(`
72
+ `,r);let s=-1;if(i!==-1&&o!==-1?s=Math.min(i,o):i!==-1?i===e.length-1?s=-1:s=i:o!==-1&&(s=o),s===-1){n=e.slice(r);break}else{const a=e.slice(r,s);t.push(a),r=s+1,e[r-1]==="\r"&&e[r]===`
73
+ `&&r++}}return[t,n]}class m5 extends TransformStream{constructor({onError:t,onRetry:n,onComment:r}={}){let i;super({start(o){i=h5({onEvent:s=>{o.enqueue(s)},onError(s){t==="terminate"?o.error(s):typeof t=="function"&&t(s)},onRetry:n,onComment:r})},transform(o){i.feed(o)}})}}var Qc=({prefix:e,size:t=16,alphabet:n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const i=()=>{const o=n.length,s=new Array(t);for(let a=0;a<t;a++)s[a]=n[Math.random()*o|0];return s.join("")};if(e==null)return i;if(n.includes(r))throw new jN({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${n}".`});return()=>`${e}${r}${i()}`},g5=Qc();function gw(e=globalThis){var t,n,r;return e.window?"runtime/browser":(t=e.navigator)!=null&&t.userAgent?`runtime/${e.navigator.userAgent.toLowerCase()}`:(r=(n=e.process)==null?void 0:n.versions)!=null&&r.node?`runtime/node.js/${e.process.version.substring(0)}`:e.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function fa(e){if(e==null)return{};const t={};if(e instanceof Headers)e.forEach((n,r)=>{t[r.toLowerCase()]=n});else{Array.isArray(e)||(e=Object.entries(e));for(const[n,r]of e)r!=null&&(t[n.toLowerCase()]=r)}return t}function yw(e,...t){const n=new Headers(fa(e)),r=n.get("user-agent")||"";return n.set("user-agent",[r,...t].filter(Boolean).join(" ")),Object.fromEntries(n.entries())}var y5=/"__proto__"\s*:/,x5=/"constructor"\s*:/;function xw(e){const t=JSON.parse(e);return t===null||typeof t!="object"||y5.test(e)===!1&&x5.test(e)===!1?t:b5(t)}function b5(e){let t=[e];for(;t.length;){const n=t;t=[];for(const r of n){if(Object.prototype.hasOwnProperty.call(r,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(r,"constructor")&&Object.prototype.hasOwnProperty.call(r.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const i in r){const o=r[i];o&&typeof o=="object"&&t.push(o)}}}return e}function v5(e){const{stackTraceLimit:t}=Error;try{Error.stackTraceLimit=0}catch{return xw(e)}try{return xw(e)}finally{Error.stackTraceLimit=t}}function by(e){if(e.type==="object"||Array.isArray(e.type)&&e.type.includes("object")){e.additionalProperties=!1;const{properties:n}=e;if(n!=null)for(const r of Object.keys(n))n[r]=la(n[r])}e.items!=null&&(e.items=Array.isArray(e.items)?e.items.map(la):la(e.items)),e.anyOf!=null&&(e.anyOf=e.anyOf.map(la)),e.allOf!=null&&(e.allOf=e.allOf.map(la)),e.oneOf!=null&&(e.oneOf=e.oneOf.map(la));const{definitions:t}=e;if(t!=null)for(const n of Object.keys(t))t[n]=la(t[n]);return e}function la(e){return typeof e=="boolean"?e:by(e)}var k5=Symbol("Let zodToJsonSchema decide on which parser to use"),bw={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},w5=e=>typeof e=="string"?{...bw,name:e}:{...bw,...e};function Qr(){return{}}function C5(e,t){var n,r,i;const o={type:"array"};return(n=e.type)!=null&&n._def&&((i=(r=e.type)==null?void 0:r._def)==null?void 0:i.typeName)!==Ee.ZodAny&&(o.items=Jt(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&(o.minItems=e.minLength.value),e.maxLength&&(o.maxItems=e.maxLength.value),e.exactLength&&(o.minItems=e.exactLength.value,o.maxItems=e.exactLength.value),o}function S5(e){const t={type:"integer",format:"int64"};if(!e.checks)return t;for(const n of e.checks)switch(n.kind){case"min":n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case"max":n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case"multipleOf":t.multipleOf=n.value;break}return t}function E5(){return{type:"boolean"}}function LE(e,t){return Jt(e.type._def,t)}var _5=(e,t)=>Jt(e.innerType._def,t);function FE(e,t,n){const r=n??t.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((i,o)=>FE(e,t,i))};switch(r){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return T5(e)}}var T5=e=>{const t={type:"integer",format:"unix-time"};for(const n of e.checks)switch(n.kind){case"min":t.minimum=n.value;break;case"max":t.maximum=n.value;break}return t};function A5(e,t){return{...Jt(e.innerType._def,t),default:e.defaultValue()}}function M5(e,t){return t.effectStrategy==="input"?Jt(e.schema._def,t):Qr()}function N5(e){return{type:"string",enum:Array.from(e.values)}}var I5=e=>"type"in e&&e.type==="string"?!1:"allOf"in e;function D5(e,t){const n=[Jt(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),Jt(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(i=>!!i),r=[];return n.forEach(i=>{if(I5(i))r.push(...i.allOf);else{let o=i;if("additionalProperties"in i&&i.additionalProperties===!1){const{additionalProperties:s,...a}=i;o=a}r.push(o)}}),r.length?{allOf:r}:void 0}function O5(e){const t=typeof e.value;return t!=="bigint"&&t!=="number"&&t!=="boolean"&&t!=="string"?{type:Array.isArray(e.value)?"array":"object"}:{type:t==="bigint"?"integer":t,const:e.value}}var R0=void 0,Ri={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(R0===void 0&&(R0=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),R0),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function $E(e,t){const n={type:"string"};if(e.checks)for(const r of e.checks)switch(r.kind){case"min":n.minLength=typeof n.minLength=="number"?Math.max(n.minLength,r.value):r.value;break;case"max":n.maxLength=typeof n.maxLength=="number"?Math.min(n.maxLength,r.value):r.value;break;case"email":switch(t.emailStrategy){case"format:email":Pi(n,"email",r.message,t);break;case"format:idn-email":Pi(n,"idn-email",r.message,t);break;case"pattern:zod":gr(n,Ri.email,r.message,t);break}break;case"url":Pi(n,"uri",r.message,t);break;case"uuid":Pi(n,"uuid",r.message,t);break;case"regex":gr(n,r.regex,r.message,t);break;case"cuid":gr(n,Ri.cuid,r.message,t);break;case"cuid2":gr(n,Ri.cuid2,r.message,t);break;case"startsWith":gr(n,RegExp(`^${P0(r.value,t)}`),r.message,t);break;case"endsWith":gr(n,RegExp(`${P0(r.value,t)}$`),r.message,t);break;case"datetime":Pi(n,"date-time",r.message,t);break;case"date":Pi(n,"date",r.message,t);break;case"time":Pi(n,"time",r.message,t);break;case"duration":Pi(n,"duration",r.message,t);break;case"length":n.minLength=typeof n.minLength=="number"?Math.max(n.minLength,r.value):r.value,n.maxLength=typeof n.maxLength=="number"?Math.min(n.maxLength,r.value):r.value;break;case"includes":{gr(n,RegExp(P0(r.value,t)),r.message,t);break}case"ip":{r.version!=="v6"&&Pi(n,"ipv4",r.message,t),r.version!=="v4"&&Pi(n,"ipv6",r.message,t);break}case"base64url":gr(n,Ri.base64url,r.message,t);break;case"jwt":gr(n,Ri.jwt,r.message,t);break;case"cidr":{r.version!=="v6"&&gr(n,Ri.ipv4Cidr,r.message,t),r.version!=="v4"&&gr(n,Ri.ipv6Cidr,r.message,t);break}case"emoji":gr(n,Ri.emoji(),r.message,t);break;case"ulid":{gr(n,Ri.ulid,r.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{Pi(n,"binary",r.message,t);break}case"contentEncoding:base64":{n.contentEncoding="base64";break}case"pattern:zod":{gr(n,Ri.base64,r.message,t);break}}break}case"nanoid":gr(n,Ri.nanoid,r.message,t)}return n}function P0(e,t){return t.patternStrategy==="escape"?P5(e):e}var R5=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function P5(e){let t="";for(let n=0;n<e.length;n++)R5.has(e[n])||(t+="\\"),t+=e[n];return t}function Pi(e,t,n,r){var i;e.format||(i=e.anyOf)!=null&&i.some(o=>o.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format}),delete e.format),e.anyOf.push({format:t,...n&&r.errorMessages&&{errorMessage:{format:n}}})):e.format=t}function gr(e,t,n,r){var i;e.pattern||(i=e.allOf)!=null&&i.some(o=>o.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern}),delete e.pattern),e.allOf.push({pattern:vw(t,r),...n&&r.errorMessages&&{errorMessage:{pattern:n}}})):e.pattern=vw(t,r)}function vw(e,t){var n;if(!t.applyRegexFlags||!e.flags)return e.source;const r={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},i=r.i?e.source.toLowerCase():e.source;let o="",s=!1,a=!1,u=!1;for(let d=0;d<i.length;d++){if(s){o+=i[d],s=!1;continue}if(r.i){if(a){if(i[d].match(/[a-z]/)){u?(o+=i[d],o+=`${i[d-2]}-${i[d]}`.toUpperCase(),u=!1):i[d+1]==="-"&&((n=i[d+2])!=null&&n.match(/[a-z]/))?(o+=i[d],u=!0):o+=`${i[d]}${i[d].toUpperCase()}`;continue}}else if(i[d].match(/[a-z]/)){o+=`[${i[d]}${i[d].toUpperCase()}]`;continue}}if(r.m){if(i[d]==="^"){o+=`(^|(?<=[\r
74
+ ]))`;continue}else if(i[d]==="$"){o+=`($|(?=[\r
75
+ ]))`;continue}}if(r.s&&i[d]==="."){o+=a?`${i[d]}\r
76
+ `:`[${i[d]}\r
77
+ ]`;continue}o+=i[d],i[d]==="\\"?s=!0:a&&i[d]==="]"?a=!1:!a&&i[d]==="["&&(a=!0)}try{new RegExp(o)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return o}function BE(e,t){var n,r,i,o,s,a;const u={type:"object",additionalProperties:(n=Jt(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))!=null?n:t.allowedAdditionalProperties};if(((r=e.keyType)==null?void 0:r._def.typeName)===Ee.ZodString&&((i=e.keyType._def.checks)!=null&&i.length)){const{type:d,...f}=$E(e.keyType._def,t);return{...u,propertyNames:f}}else{if(((o=e.keyType)==null?void 0:o._def.typeName)===Ee.ZodEnum)return{...u,propertyNames:{enum:e.keyType._def.values}};if(((s=e.keyType)==null?void 0:s._def.typeName)===Ee.ZodBranded&&e.keyType._def.type._def.typeName===Ee.ZodString&&((a=e.keyType._def.type._def.checks)!=null&&a.length)){const{type:d,...f}=LE(e.keyType._def,t);return{...u,propertyNames:f}}}return u}function j5(e,t){if(t.mapStrategy==="record")return BE(e,t);const n=Jt(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||Qr(),r=Jt(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||Qr();return{type:"array",maxItems:125,items:{type:"array",items:[n,r],minItems:2,maxItems:2}}}function z5(e){const t=e.values,r=Object.keys(e.values).filter(o=>typeof t[t[o]]!="number").map(o=>t[o]),i=Array.from(new Set(r.map(o=>typeof o)));return{type:i.length===1?i[0]==="string"?"string":"number":["string","number"],enum:r}}function L5(){return{not:Qr()}}function F5(){return{type:"null"}}var s1={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function $5(e,t){const n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(r=>r._def.typeName in s1&&(!r._def.checks||!r._def.checks.length))){const r=n.reduce((i,o)=>{const s=s1[o._def.typeName];return s&&!i.includes(s)?[...i,s]:i},[]);return{type:r.length>1?r:r[0]}}else if(n.every(r=>r._def.typeName==="ZodLiteral"&&!r.description)){const r=n.reduce((i,o)=>{const s=typeof o._def.value;switch(s){case"string":case"number":case"boolean":return[...i,s];case"bigint":return[...i,"integer"];case"object":if(o._def.value===null)return[...i,"null"];case"symbol":case"undefined":case"function":default:return i}},[]);if(r.length===n.length){const i=r.filter((o,s,a)=>a.indexOf(o)===s);return{type:i.length>1?i:i[0],enum:n.reduce((o,s)=>o.includes(s._def.value)?o:[...o,s._def.value],[])}}}else if(n.every(r=>r._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((r,i)=>[...r,...i._def.values.filter(o=>!r.includes(o))],[])};return B5(e,t)}var B5=(e,t)=>{const n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((r,i)=>Jt(r._def,{...t,currentPath:[...t.currentPath,"anyOf",`${i}`]})).filter(r=>!!r&&(!t.strictUnions||typeof r=="object"&&Object.keys(r).length>0));return n.length?{anyOf:n}:void 0};function U5(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[s1[e.innerType._def.typeName],"null"]};const n=Jt(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}function V5(e){const t={type:"number"};if(!e.checks)return t;for(const n of e.checks)switch(n.kind){case"int":t.type="integer";break;case"min":n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case"max":n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case"multipleOf":t.multipleOf=n.value;break}return t}function H5(e,t){const n={type:"object",properties:{}},r=[],i=e.shape();for(const s in i){let a=i[s];if(a===void 0||a._def===void 0)continue;const u=q5(a),d=Jt(a._def,{...t,currentPath:[...t.currentPath,"properties",s],propertyPath:[...t.currentPath,"properties",s]});d!==void 0&&(n.properties[s]=d,u||r.push(s))}r.length&&(n.required=r);const o=W5(e,t);return o!==void 0&&(n.additionalProperties=o),n}function W5(e,t){if(e.catchall._def.typeName!=="ZodNever")return Jt(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function q5(e){try{return e.isOptional()}catch{return!0}}var Z5=(e,t)=>{var n;if(t.currentPath.toString()===((n=t.propertyPath)==null?void 0:n.toString()))return Jt(e.innerType._def,t);const r=Jt(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return r?{anyOf:[{not:Qr()},r]}:Qr()},J5=(e,t)=>{if(t.pipeStrategy==="input")return Jt(e.in._def,t);if(t.pipeStrategy==="output")return Jt(e.out._def,t);const n=Jt(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),r=Jt(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,r].filter(i=>i!==void 0)}};function K5(e,t){return Jt(e.type._def,t)}function G5(e,t){const r={type:"array",uniqueItems:!0,items:Jt(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&(r.minItems=e.minSize.value),e.maxSize&&(r.maxItems=e.maxSize.value),r}function Y5(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((n,r)=>Jt(n._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[]),additionalItems:Jt(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((n,r)=>Jt(n._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[])}}function Q5(){return{not:Qr()}}function X5(){return Qr()}var eR=(e,t)=>Jt(e.innerType._def,t),tR=(e,t,n)=>{switch(t){case Ee.ZodString:return $E(e,n);case Ee.ZodNumber:return V5(e);case Ee.ZodObject:return H5(e,n);case Ee.ZodBigInt:return S5(e);case Ee.ZodBoolean:return E5();case Ee.ZodDate:return FE(e,n);case Ee.ZodUndefined:return Q5();case Ee.ZodNull:return F5();case Ee.ZodArray:return C5(e,n);case Ee.ZodUnion:case Ee.ZodDiscriminatedUnion:return $5(e,n);case Ee.ZodIntersection:return D5(e,n);case Ee.ZodTuple:return Y5(e,n);case Ee.ZodRecord:return BE(e,n);case Ee.ZodLiteral:return O5(e);case Ee.ZodEnum:return N5(e);case Ee.ZodNativeEnum:return z5(e);case Ee.ZodNullable:return U5(e,n);case Ee.ZodOptional:return Z5(e,n);case Ee.ZodMap:return j5(e,n);case Ee.ZodSet:return G5(e,n);case Ee.ZodLazy:return()=>e.getter()._def;case Ee.ZodPromise:return K5(e,n);case Ee.ZodNaN:case Ee.ZodNever:return L5();case Ee.ZodEffects:return M5(e,n);case Ee.ZodAny:return Qr();case Ee.ZodUnknown:return X5();case Ee.ZodDefault:return A5(e,n);case Ee.ZodBranded:return LE(e,n);case Ee.ZodReadonly:return eR(e,n);case Ee.ZodCatch:return _5(e,n);case Ee.ZodPipeline:return J5(e,n);case Ee.ZodFunction:case Ee.ZodVoid:case Ee.ZodSymbol:return;default:return(r=>{})()}},nR=(e,t)=>{let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];n++);return[(e.length-n).toString(),...t.slice(n)].join("/")};function Jt(e,t,n=!1){var r;const i=t.seen.get(e);if(t.override){const u=(r=t.override)==null?void 0:r.call(t,e,t,i,n);if(u!==k5)return u}if(i&&!n){const u=rR(i,t);if(u!==void 0)return u}const o={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,o);const s=tR(e,e.typeName,t),a=typeof s=="function"?Jt(s(),t):s;if(a&&iR(e,t,a),t.postProcess){const u=t.postProcess(a,e,t);return o.jsonSchema=a,u}return o.jsonSchema=a,a}var rR=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:nR(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((n,r)=>t.currentPath[r]===n)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),Qr()):t.$refStrategy==="seen"?Qr():void 0}},iR=(e,t,n)=>(e.description&&(n.description=e.description),n),oR=e=>{const t=w5(e),n=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([r,i])=>[i._def,{def:i._def,path:[...t.basePath,t.definitionPath,r],jsonSchema:void 0}]))}},sR=(e,t)=>{var n;const r=oR(t);let i=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((d,[f,h])=>{var m;return{...d,[f]:(m=Jt(h._def,{...r,currentPath:[...r.basePath,r.definitionPath,f]},!0))!=null?m:Qr()}},{}):void 0;const o=typeof t=="string"?t:(t==null?void 0:t.nameStrategy)==="title"||t==null?void 0:t.name,s=(n=Jt(e._def,o===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,o]},!1))!=null?n:Qr(),a=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;a!==void 0&&(s.title=a);const u=o===void 0?i?{...s,[r.definitionPath]:i}:s:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,o].join("/"),[r.definitionPath]:{...i,[o]:s}};return u.$schema="http://json-schema.org/draft-07/schema#",u},a1=Symbol.for("vercel.ai.schema");function aR(e){let t;return()=>(t==null&&(t=e()),t)}function kp(e,{validate:t}={}){return{[a1]:!0,_type:void 0,get jsonSchema(){return typeof e=="function"&&(e=e()),e},validate:t}}function lR(e){return typeof e=="object"&&e!==null&&a1 in e&&e[a1]===!0&&"jsonSchema"in e&&"validate"in e}function vy(e){return e==null?kp({properties:{},additionalProperties:!1}):lR(e)?e:"~standard"in e?e["~standard"].vendor==="zod"?UE(e):uR(e):e()}function uR(e){return kp(()=>by(e["~standard"].jsonSchema.input({target:"draft-07"})),{validate:async t=>{const n=await e["~standard"].validate(t);return"value"in n?{success:!0,value:n.value}:{success:!1,error:new Dl({value:t,cause:n.issues})}}})}function cR(e,t){var n;const r=(n=void 0)!=null?n:!1;return kp(()=>sR(e,{$refStrategy:r?"root":"none"}),{validate:async i=>{const o=await e.safeParseAsync(i);return o.success?{success:!0,value:o.data}:{success:!1,error:o.error}}})}function dR(e,t){var n;const r=(n=void 0)!=null?n:!1;return kp(()=>by(I8(e,{target:"draft-7",io:"input",reused:r?"ref":"inline"})),{validate:async i=>{const o=await CE(e,i);return o.success?{success:!0,value:o.data}:{success:!1,error:o.error}}})}function fR(e){return"_zod"in e}function UE(e,t){return fR(e)?dR(e):cR(e)}async function kw({value:e,schema:t,context:n}){const r=await Mc({value:e,schema:t,context:n});if(!r.success)throw Dl.wrap({value:e,cause:r.error,context:n});return r.value}async function Mc({value:e,schema:t,context:n}){const r=vy(t);try{if(r.validate==null)return{success:!0,value:e,rawValue:e};const i=await r.validate(e);return i.success?{success:!0,value:i.value,rawValue:e}:{success:!1,error:Dl.wrap({value:e,cause:i.error,context:n}),rawValue:e}}catch(i){return{success:!1,error:Dl.wrap({value:e,cause:i,context:n}),rawValue:e}}}async function _a({text:e,schema:t}){try{const n=v5(e);return t==null?{success:!0,value:n,rawValue:n}:await Mc({value:n,schema:t})}catch(n){return{success:!1,error:Dk.isInstance(n)?n:new Dk({text:e,cause:n}),rawValue:void 0}}}function hR({stream:e,schema:t}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new m5).pipeThrough(new TransformStream({async transform({data:n},r){n!=="[DONE]"&&r.enqueue(await _a({text:n,schema:t}))}}))}async function ps(e){return typeof e=="function"&&(e=e()),Promise.resolve(e)}var pR=Object.defineProperty,mR=(e,t)=>{for(var n in t)pR(e,n,{get:t[n],enumerable:!0})},VE="AI_NoObjectGeneratedError",HE=`vercel.ai.error.${VE}`,gR=Symbol.for(HE),WE,As=class extends eo{constructor({message:e="No object generated.",cause:t,text:n,response:r,usage:i,finishReason:o}){super({name:VE,message:e,cause:t}),this[WE]=!0,this.text=n,this.response=r,this.usage=i,this.finishReason=o}static isInstance(e){return eo.hasMarker(e,HE)}};WE=gR;var qE="AI_UIMessageStreamError",ZE=`vercel.ai.error.${qE}`,yR=Symbol.for(ZE),JE,cl=class extends eo{constructor({chunkType:e,chunkId:t,message:n}){super({name:qE,message:n}),this[JE]=!0,this.chunkType=e,this.chunkId=t}static isInstance(e){return eo.hasMarker(e,ZE)}};JE=yR;var ww="6.0.91",KE=vr([Ne(),oh(Uint8Array),oh(ArrayBuffer),DE(e=>{var t,n;return(n=(t=globalThis.Buffer)==null?void 0:t.isBuffer(e))!=null?n:!1},{message:"Must be a Buffer"})]),Nc=jO(()=>vr([fO(),Ne(),lO(),yr(),Cc(Ne(),Nc.optional()),Kl(Nc)])),Lt=Cc(Ne(),Cc(Ne(),Nc.optional())),GE=Yt({type:mt("text"),text:Ne(),providerOptions:Lt.optional()}),xR=Yt({type:mt("image"),image:vr([KE,oh(URL)]),mediaType:Ne().optional(),providerOptions:Lt.optional()}),YE=Yt({type:mt("file"),data:vr([KE,oh(URL)]),filename:Ne().optional(),mediaType:Ne(),providerOptions:Lt.optional()}),bR=Yt({type:mt("reasoning"),text:Ne(),providerOptions:Lt.optional()}),vR=Yt({type:mt("tool-call"),toolCallId:Ne(),toolName:Ne(),input:Gi(),providerOptions:Lt.optional(),providerExecuted:yr().optional()}),kR=yO("type",[Yt({type:mt("text"),value:Ne(),providerOptions:Lt.optional()}),Yt({type:mt("json"),value:Nc,providerOptions:Lt.optional()}),Yt({type:mt("execution-denied"),reason:Ne().optional(),providerOptions:Lt.optional()}),Yt({type:mt("error-text"),value:Ne(),providerOptions:Lt.optional()}),Yt({type:mt("error-json"),value:Nc,providerOptions:Lt.optional()}),Yt({type:mt("content"),value:Kl(vr([Yt({type:mt("text"),text:Ne(),providerOptions:Lt.optional()}),Yt({type:mt("media"),data:Ne(),mediaType:Ne()}),Yt({type:mt("file-data"),data:Ne(),mediaType:Ne(),filename:Ne().optional(),providerOptions:Lt.optional()}),Yt({type:mt("file-url"),url:Ne(),providerOptions:Lt.optional()}),Yt({type:mt("file-id"),fileId:vr([Ne(),Cc(Ne(),Ne())]),providerOptions:Lt.optional()}),Yt({type:mt("image-data"),data:Ne(),mediaType:Ne(),providerOptions:Lt.optional()}),Yt({type:mt("image-url"),url:Ne(),providerOptions:Lt.optional()}),Yt({type:mt("image-file-id"),fileId:vr([Ne(),Cc(Ne(),Ne())]),providerOptions:Lt.optional()}),Yt({type:mt("custom"),providerOptions:Lt.optional()})]))})]),QE=Yt({type:mt("tool-result"),toolCallId:Ne(),toolName:Ne(),output:kR,providerOptions:Lt.optional()}),wR=Yt({type:mt("tool-approval-request"),approvalId:Ne(),toolCallId:Ne()}),CR=Yt({type:mt("tool-approval-response"),approvalId:Ne(),approved:yr(),reason:Ne().optional()}),SR=Yt({role:mt("system"),content:Ne(),providerOptions:Lt.optional()}),ER=Yt({role:mt("user"),content:vr([Ne(),Kl(vr([GE,xR,YE]))]),providerOptions:Lt.optional()}),_R=Yt({role:mt("assistant"),content:vr([Ne(),Kl(vr([GE,YE,bR,vR,QE,wR]))]),providerOptions:Lt.optional()}),TR=Yt({role:mt("tool"),content:Kl(vr([QE,CR])),providerOptions:Lt.optional()});vr([SR,ER,_R,TR]);function XE(e,t){if(e===void 0&&t===void 0)return;if(e===void 0)return t;if(t===void 0)return e;const n={...e};for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)){const i=t[r];if(i===void 0)continue;const o=r in e?e[r]:void 0,s=i!==null&&typeof i=="object"&&!Array.isArray(i)&&!(i instanceof Date)&&!(i instanceof RegExp),a=o!=null&&typeof o=="object"&&!Array.isArray(o)&&!(o instanceof Date)&&!(o instanceof RegExp);s&&a?n[r]=XE(o,i):n[r]=i}return n}var AR={};mR(AR,{array:()=>DR,choice:()=>OR,json:()=>RR,object:()=>IR,text:()=>NR});function MR(e){const t=["ROOT"];let n=-1,r=null;function i(u,d,f){switch(u){case'"':{n=d,t.pop(),t.push(f),t.push("INSIDE_STRING");break}case"f":case"t":case"n":{n=d,r=d,t.pop(),t.push(f),t.push("INSIDE_LITERAL");break}case"-":{t.pop(),t.push(f),t.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=d,t.pop(),t.push(f),t.push("INSIDE_NUMBER");break}case"{":{n=d,t.pop(),t.push(f),t.push("INSIDE_OBJECT_START");break}case"[":{n=d,t.pop(),t.push(f),t.push("INSIDE_ARRAY_START");break}}}function o(u,d){switch(u){case",":{t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{n=d,t.pop();break}}}function s(u,d){switch(u){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=d,t.pop();break}}}for(let u=0;u<e.length;u++){const d=e[u];switch(t[t.length-1]){case"ROOT":i(d,u,"FINISH");break;case"INSIDE_OBJECT_START":{switch(d){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}case"}":{n=u,t.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{switch(d){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}}break}case"INSIDE_OBJECT_KEY":{switch(d){case'"':{t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY");break}}break}case"INSIDE_OBJECT_AFTER_KEY":{switch(d){case":":{t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE");break}}break}case"INSIDE_OBJECT_BEFORE_VALUE":{i(d,u,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{o(d,u);break}case"INSIDE_STRING":{switch(d){case'"':{t.pop(),n=u;break}case"\\":{t.push("INSIDE_STRING_ESCAPE");break}default:n=u}break}case"INSIDE_ARRAY_START":{switch(d){case"]":{n=u,t.pop();break}default:{n=u,i(d,u,"INSIDE_ARRAY_AFTER_VALUE");break}}break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(d){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=u,t.pop();break}default:{n=u;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{i(d,u,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{t.pop(),n=u;break}case"INSIDE_NUMBER":{switch(d){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=u;break}case"e":case"E":case"-":case".":break;case",":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(d,u),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&o(d,u);break}case"}":{t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&o(d,u);break}case"]":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(d,u);break}default:{t.pop();break}}break}case"INSIDE_LITERAL":{const h=e.substring(r,u+1);!"false".startsWith(h)&&!"true".startsWith(h)&&!"null".startsWith(h)?(t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?o(d,u):t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(d,u)):n=u;break}}}let a=e.slice(0,n+1);for(let u=t.length-1;u>=0;u--)switch(t[u]){case"INSIDE_STRING":{a+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{a+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{a+="]";break}case"INSIDE_LITERAL":{const f=e.substring(r,e.length);"true".startsWith(f)?a+="true".slice(f.length):"false".startsWith(f)?a+="false".slice(f.length):"null".startsWith(f)&&(a+="null".slice(f.length))}}return a}async function Xc(e){if(e===void 0)return{value:void 0,state:"undefined-input"};let t=await _a({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=await _a({text:MR(e)}),t.success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var NR=()=>({name:"text",responseFormat:Promise.resolve({type:"text"}),async parseCompleteOutput({text:e}){return e},async parsePartialOutput({text:e}){return{partial:e}},createElementStreamTransform(){}}),IR=({schema:e,name:t,description:n})=>{const r=vy(e);return{name:"object",responseFormat:ps(r.jsonSchema).then(i=>({type:"json",schema:i,...t!=null&&{name:t},...n!=null&&{description:n}})),async parseCompleteOutput({text:i},o){const s=await _a({text:i});if(!s.success)throw new As({message:"No object generated: could not parse the response.",cause:s.error,text:i,response:o.response,usage:o.usage,finishReason:o.finishReason});const a=await Mc({value:s.value,schema:r});if(!a.success)throw new As({message:"No object generated: response did not match schema.",cause:a.error,text:i,response:o.response,usage:o.usage,finishReason:o.finishReason});return a.value},async parsePartialOutput({text:i}){const o=await Xc(i);switch(o.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:o.value}}},createElementStreamTransform(){}}},DR=({element:e,name:t,description:n})=>{const r=vy(e);return{name:"array",responseFormat:ps(r.jsonSchema).then(i=>{const{$schema:o,...s}=i;return{type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{elements:{type:"array",items:s}},required:["elements"],additionalProperties:!1},...t!=null&&{name:t},...n!=null&&{description:n}}}),async parseCompleteOutput({text:i},o){const s=await _a({text:i});if(!s.success)throw new As({message:"No object generated: could not parse the response.",cause:s.error,text:i,response:o.response,usage:o.usage,finishReason:o.finishReason});const a=s.value;if(a==null||typeof a!="object"||!("elements"in a)||!Array.isArray(a.elements))throw new As({message:"No object generated: response did not match schema.",cause:new Dl({value:a,cause:"response must be an object with an elements array"}),text:i,response:o.response,usage:o.usage,finishReason:o.finishReason});for(const u of a.elements){const d=await Mc({value:u,schema:r});if(!d.success)throw new As({message:"No object generated: response did not match schema.",cause:d.error,text:i,response:o.response,usage:o.usage,finishReason:o.finishReason})}return a.elements},async parsePartialOutput({text:i}){const o=await Xc(i);switch(o.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const s=o.value;if(s==null||typeof s!="object"||!("elements"in s)||!Array.isArray(s.elements))return;const a=o.state==="repaired-parse"&&s.elements.length>0?s.elements.slice(0,-1):s.elements,u=[];for(const d of a){const f=await Mc({value:d,schema:r});f.success&&u.push(f.value)}return{partial:u}}}},createElementStreamTransform(){let i=0;return new TransformStream({transform({partialOutput:o},s){if(o!=null)for(;i<o.length;i++)s.enqueue(o[i])}})}}},OR=({options:e,name:t,description:n})=>({name:"choice",responseFormat:Promise.resolve({type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{result:{type:"string",enum:e}},required:["result"],additionalProperties:!1},...t!=null&&{name:t},...n!=null&&{description:n}}),async parseCompleteOutput({text:r},i){const o=await _a({text:r});if(!o.success)throw new As({message:"No object generated: could not parse the response.",cause:o.error,text:r,response:i.response,usage:i.usage,finishReason:i.finishReason});const s=o.value;if(s==null||typeof s!="object"||!("result"in s)||typeof s.result!="string"||!e.includes(s.result))throw new As({message:"No object generated: response did not match schema.",cause:new Dl({value:s,cause:"response must be an object that contains a choice value."}),text:r,response:i.response,usage:i.usage,finishReason:i.finishReason});return s.result},async parsePartialOutput({text:r}){const i=await Xc(r);switch(i.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const o=i.value;if(o==null||typeof o!="object"||!("result"in o)||typeof o.result!="string")return;const s=e.filter(a=>a.startsWith(o.result));return i.state==="successful-parse"?s.includes(o.result)?{partial:o.result}:void 0:s.length===1?{partial:s[0]}:void 0}}},createElementStreamTransform(){}}),RR=({name:e,description:t}={})=>({name:"json",responseFormat:Promise.resolve({type:"json",...e!=null&&{name:e},...t!=null&&{description:t}}),async parseCompleteOutput({text:n},r){const i=await _a({text:n});if(!i.success)throw new As({message:"No object generated: could not parse the response.",cause:i.error,text:n,response:r.response,usage:r.usage,finishReason:r.finishReason});return i.value},async parsePartialOutput({text:n}){const r=await Xc(n);switch(r.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return r.value===void 0?void 0:{partial:r.value}}},createElementStreamTransform(){}});Qc({prefix:"aitxt",size:24});(class extends TransformStream{constructor(){super({transform(e,t){t.enqueue(`data: ${JSON.stringify(e)}
78
+
79
+ `)},flush(e){e.enqueue(`data: [DONE]
80
+
81
+ `)}})}});var PR=aR(()=>UE(vr([ln({type:mt("text-start"),id:Ne(),providerMetadata:Lt.optional()}),ln({type:mt("text-delta"),id:Ne(),delta:Ne(),providerMetadata:Lt.optional()}),ln({type:mt("text-end"),id:Ne(),providerMetadata:Lt.optional()}),ln({type:mt("error"),errorText:Ne()}),ln({type:mt("tool-input-start"),toolCallId:Ne(),toolName:Ne(),providerExecuted:yr().optional(),providerMetadata:Lt.optional(),dynamic:yr().optional(),title:Ne().optional()}),ln({type:mt("tool-input-delta"),toolCallId:Ne(),inputTextDelta:Ne()}),ln({type:mt("tool-input-available"),toolCallId:Ne(),toolName:Ne(),input:Gi(),providerExecuted:yr().optional(),providerMetadata:Lt.optional(),dynamic:yr().optional(),title:Ne().optional()}),ln({type:mt("tool-input-error"),toolCallId:Ne(),toolName:Ne(),input:Gi(),providerExecuted:yr().optional(),providerMetadata:Lt.optional(),dynamic:yr().optional(),errorText:Ne(),title:Ne().optional()}),ln({type:mt("tool-approval-request"),approvalId:Ne(),toolCallId:Ne()}),ln({type:mt("tool-output-available"),toolCallId:Ne(),output:Gi(),providerExecuted:yr().optional(),dynamic:yr().optional(),preliminary:yr().optional()}),ln({type:mt("tool-output-error"),toolCallId:Ne(),errorText:Ne(),providerExecuted:yr().optional(),dynamic:yr().optional()}),ln({type:mt("tool-output-denied"),toolCallId:Ne()}),ln({type:mt("reasoning-start"),id:Ne(),providerMetadata:Lt.optional()}),ln({type:mt("reasoning-delta"),id:Ne(),delta:Ne(),providerMetadata:Lt.optional()}),ln({type:mt("reasoning-end"),id:Ne(),providerMetadata:Lt.optional()}),ln({type:mt("source-url"),sourceId:Ne(),url:Ne(),title:Ne().optional(),providerMetadata:Lt.optional()}),ln({type:mt("source-document"),sourceId:Ne(),mediaType:Ne(),title:Ne(),filename:Ne().optional(),providerMetadata:Lt.optional()}),ln({type:mt("file"),url:Ne(),mediaType:Ne(),providerMetadata:Lt.optional()}),ln({type:DE(e=>typeof e=="string"&&e.startsWith("data-"),{message:'Type must start with "data-"'}),id:Ne().optional(),data:Gi(),transient:yr().optional()}),ln({type:mt("start-step")}),ln({type:mt("finish-step")}),ln({type:mt("start"),messageId:Ne().optional(),messageMetadata:Gi().optional()}),ln({type:mt("finish"),finishReason:ME(["stop","length","content-filter","tool-calls","error","other"]).optional(),messageMetadata:Gi().optional()}),ln({type:mt("abort"),reason:Ne().optional()}),ln({type:mt("message-metadata"),messageMetadata:Gi()})])));function jR(e){return e.type.startsWith("data-")}function l1(e){return e.type.startsWith("tool-")}function zR(e){return e.type==="dynamic-tool"}function u1(e){return l1(e)||zR(e)}function Cw(e){return e.type.split("-").slice(1).join("-")}function LR({lastMessage:e,messageId:t}){return{message:(e==null?void 0:e.role)==="assistant"?e:{id:t,metadata:void 0,role:"assistant",parts:[]},activeTextParts:{},activeReasoningParts:{},partialToolCalls:{}}}function FR({stream:e,messageMetadataSchema:t,dataPartSchemas:n,runUpdateMessageJob:r,onError:i,onToolCall:o,onData:s}){return e.pipeThrough(new TransformStream({async transform(a,u){await r(async({state:d,write:f})=>{var h,m,g,x;function b(E){const N=d.message.parts.filter(u1).find(M=>M.toolCallId===E);if(N==null)throw new cl({chunkType:"tool-invocation",chunkId:E,message:`No tool invocation found for tool call ID "${E}".`});return N}function v(E){var I;const N=d.message.parts.find(R=>l1(R)&&R.toolCallId===E.toolCallId),M=E,F=N;N!=null?(N.state=E.state,F.input=M.input,F.output=M.output,F.errorText=M.errorText,F.rawInput=M.rawInput,F.preliminary=M.preliminary,E.title!==void 0&&(F.title=E.title),F.providerExecuted=(I=M.providerExecuted)!=null?I:N.providerExecuted,M.providerMetadata!=null&&(N.callProviderMetadata=M.providerMetadata)):d.message.parts.push({type:`tool-${E.toolName}`,toolCallId:E.toolCallId,state:E.state,title:E.title,input:M.input,output:M.output,rawInput:M.rawInput,errorText:M.errorText,providerExecuted:M.providerExecuted,preliminary:M.preliminary,...M.providerMetadata!=null?{callProviderMetadata:M.providerMetadata}:{}})}function C(E){var I,N;const M=d.message.parts.find(D=>D.type==="dynamic-tool"&&D.toolCallId===E.toolCallId),F=E,R=M;M!=null?(M.state=E.state,R.toolName=E.toolName,R.input=F.input,R.output=F.output,R.errorText=F.errorText,R.rawInput=(I=F.rawInput)!=null?I:R.rawInput,R.preliminary=F.preliminary,E.title!==void 0&&(R.title=E.title),R.providerExecuted=(N=F.providerExecuted)!=null?N:M.providerExecuted,F.providerMetadata!=null&&(M.callProviderMetadata=F.providerMetadata)):d.message.parts.push({type:"dynamic-tool",toolName:E.toolName,toolCallId:E.toolCallId,state:E.state,input:F.input,output:F.output,errorText:F.errorText,preliminary:F.preliminary,providerExecuted:F.providerExecuted,title:E.title,...F.providerMetadata!=null?{callProviderMetadata:F.providerMetadata}:{}})}async function _(E){if(E!=null){const I=d.message.metadata!=null?XE(d.message.metadata,E):E;t!=null&&await kw({value:I,schema:t,context:{field:"message.metadata",entityId:d.message.id}}),d.message.metadata=I}}switch(a.type){case"text-start":{const E={type:"text",text:"",providerMetadata:a.providerMetadata,state:"streaming"};d.activeTextParts[a.id]=E,d.message.parts.push(E),f();break}case"text-delta":{const E=d.activeTextParts[a.id];if(E==null)throw new cl({chunkType:"text-delta",chunkId:a.id,message:`Received text-delta for missing text part with ID "${a.id}". Ensure a "text-start" chunk is sent before any "text-delta" chunks.`});E.text+=a.delta,E.providerMetadata=(h=a.providerMetadata)!=null?h:E.providerMetadata,f();break}case"text-end":{const E=d.activeTextParts[a.id];if(E==null)throw new cl({chunkType:"text-end",chunkId:a.id,message:`Received text-end for missing text part with ID "${a.id}". Ensure a "text-start" chunk is sent before any "text-end" chunks.`});E.state="done",E.providerMetadata=(m=a.providerMetadata)!=null?m:E.providerMetadata,delete d.activeTextParts[a.id],f();break}case"reasoning-start":{const E={type:"reasoning",text:"",providerMetadata:a.providerMetadata,state:"streaming"};d.activeReasoningParts[a.id]=E,d.message.parts.push(E),f();break}case"reasoning-delta":{const E=d.activeReasoningParts[a.id];if(E==null)throw new cl({chunkType:"reasoning-delta",chunkId:a.id,message:`Received reasoning-delta for missing reasoning part with ID "${a.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-delta" chunks.`});E.text+=a.delta,E.providerMetadata=(g=a.providerMetadata)!=null?g:E.providerMetadata,f();break}case"reasoning-end":{const E=d.activeReasoningParts[a.id];if(E==null)throw new cl({chunkType:"reasoning-end",chunkId:a.id,message:`Received reasoning-end for missing reasoning part with ID "${a.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-end" chunks.`});E.providerMetadata=(x=a.providerMetadata)!=null?x:E.providerMetadata,E.state="done",delete d.activeReasoningParts[a.id],f();break}case"file":{d.message.parts.push({type:"file",mediaType:a.mediaType,url:a.url}),f();break}case"source-url":{d.message.parts.push({type:"source-url",sourceId:a.sourceId,url:a.url,title:a.title,providerMetadata:a.providerMetadata}),f();break}case"source-document":{d.message.parts.push({type:"source-document",sourceId:a.sourceId,mediaType:a.mediaType,title:a.title,filename:a.filename,providerMetadata:a.providerMetadata}),f();break}case"tool-input-start":{const E=d.message.parts.filter(l1);d.partialToolCalls[a.toolCallId]={text:"",toolName:a.toolName,index:E.length,dynamic:a.dynamic,title:a.title},a.dynamic?C({toolCallId:a.toolCallId,toolName:a.toolName,state:"input-streaming",input:void 0,providerExecuted:a.providerExecuted,title:a.title,providerMetadata:a.providerMetadata}):v({toolCallId:a.toolCallId,toolName:a.toolName,state:"input-streaming",input:void 0,providerExecuted:a.providerExecuted,title:a.title,providerMetadata:a.providerMetadata}),f();break}case"tool-input-delta":{const E=d.partialToolCalls[a.toolCallId];if(E==null)throw new cl({chunkType:"tool-input-delta",chunkId:a.toolCallId,message:`Received tool-input-delta for missing tool call with ID "${a.toolCallId}". Ensure a "tool-input-start" chunk is sent before any "tool-input-delta" chunks.`});E.text+=a.inputTextDelta;const{value:I}=await Xc(E.text);E.dynamic?C({toolCallId:a.toolCallId,toolName:E.toolName,state:"input-streaming",input:I,title:E.title}):v({toolCallId:a.toolCallId,toolName:E.toolName,state:"input-streaming",input:I,title:E.title}),f();break}case"tool-input-available":{a.dynamic?C({toolCallId:a.toolCallId,toolName:a.toolName,state:"input-available",input:a.input,providerExecuted:a.providerExecuted,providerMetadata:a.providerMetadata,title:a.title}):v({toolCallId:a.toolCallId,toolName:a.toolName,state:"input-available",input:a.input,providerExecuted:a.providerExecuted,providerMetadata:a.providerMetadata,title:a.title}),f(),o&&!a.providerExecuted&&await o({toolCall:a});break}case"tool-input-error":{a.dynamic?C({toolCallId:a.toolCallId,toolName:a.toolName,state:"output-error",input:a.input,errorText:a.errorText,providerExecuted:a.providerExecuted,providerMetadata:a.providerMetadata}):v({toolCallId:a.toolCallId,toolName:a.toolName,state:"output-error",input:void 0,rawInput:a.input,errorText:a.errorText,providerExecuted:a.providerExecuted,providerMetadata:a.providerMetadata}),f();break}case"tool-approval-request":{const E=b(a.toolCallId);E.state="approval-requested",E.approval={id:a.approvalId},f();break}case"tool-output-denied":{const E=b(a.toolCallId);E.state="output-denied",f();break}case"tool-output-available":{const E=b(a.toolCallId);E.type==="dynamic-tool"?C({toolCallId:a.toolCallId,toolName:E.toolName,state:"output-available",input:E.input,output:a.output,preliminary:a.preliminary,providerExecuted:a.providerExecuted,title:E.title}):v({toolCallId:a.toolCallId,toolName:Cw(E),state:"output-available",input:E.input,output:a.output,providerExecuted:a.providerExecuted,preliminary:a.preliminary,title:E.title}),f();break}case"tool-output-error":{const E=b(a.toolCallId);E.type==="dynamic-tool"?C({toolCallId:a.toolCallId,toolName:E.toolName,state:"output-error",input:E.input,errorText:a.errorText,providerExecuted:a.providerExecuted,title:E.title}):v({toolCallId:a.toolCallId,toolName:Cw(E),state:"output-error",input:E.input,rawInput:E.rawInput,errorText:a.errorText,providerExecuted:a.providerExecuted,title:E.title}),f();break}case"start-step":{d.message.parts.push({type:"step-start"});break}case"finish-step":{d.activeTextParts={},d.activeReasoningParts={};break}case"start":{a.messageId!=null&&(d.message.id=a.messageId),await _(a.messageMetadata),(a.messageId!=null||a.messageMetadata!=null)&&f();break}case"finish":{a.finishReason!=null&&(d.finishReason=a.finishReason),await _(a.messageMetadata),a.messageMetadata!=null&&f();break}case"message-metadata":{await _(a.messageMetadata),a.messageMetadata!=null&&f();break}case"error":{i==null||i(new Error(a.errorText));break}default:if(jR(a)){if((n==null?void 0:n[a.type])!=null){const N=d.message.parts.findIndex(F=>"id"in F&&"data"in F&&F.id===a.id&&F.type===a.type),M=N>=0?N:d.message.parts.length;await kw({value:a.data,schema:n[a.type],context:{field:`message.parts[${M}].data`,entityName:a.type,entityId:a.id}})}const E=a;if(E.transient){s==null||s(E);break}const I=E.id!=null?d.message.parts.find(N=>E.type===N.type&&E.id===N.id):void 0;I!=null?I.data=E.data:d.message.parts.push(E),s==null||s(E),f()}}u.enqueue(a)})}}))}async function $R({stream:e,onError:t}){const n=e.getReader();try{for(;;){const{done:r}=await n.read();if(r)break}}catch(r){t==null||t(r)}finally{n.releaseLock()}}Qc({prefix:"aitxt",size:24});Qc({prefix:"aiobj",size:24});var BR=class{constructor(){this.queue=[],this.isProcessing=!1}async processQueue(){if(!this.isProcessing){for(this.isProcessing=!0;this.queue.length>0;)await this.queue[0](),this.queue.shift();this.isProcessing=!1}}async run(e){return new Promise((t,n)=>{this.queue.push(async()=>{try{await e(),t()}catch(r){n(r)}}),this.processQueue()})}};Qc({prefix:"aiobj",size:24});async function UR(e){if(e==null)return[];if(!globalThis.FileList||!(e instanceof globalThis.FileList))throw new Error("FileList is not supported in the current environment");return Promise.all(Array.from(e).map(async t=>{const{name:n,type:r}=t,i=await new Promise((o,s)=>{const a=new FileReader;a.onload=u=>{var d;o((d=u.target)==null?void 0:d.result)},a.onerror=u=>s(u),a.readAsDataURL(t)});return{type:"file",mediaType:r,filename:n,url:i}}))}var VR=class{constructor({api:e="/api/chat",credentials:t,headers:n,body:r,fetch:i,prepareSendMessagesRequest:o,prepareReconnectToStreamRequest:s}){this.api=e,this.credentials=t,this.headers=n,this.body=r,this.fetch=i,this.prepareSendMessagesRequest=o,this.prepareReconnectToStreamRequest=s}async sendMessages({abortSignal:e,...t}){var n,r,i,o,s;const a=await ps(this.body),u=await ps(this.headers),d=await ps(this.credentials),f={...fa(u),...fa(t.headers)},h=await((n=this.prepareSendMessagesRequest)==null?void 0:n.call(this,{api:this.api,id:t.chatId,messages:t.messages,body:{...a,...t.body},headers:f,credentials:d,requestMetadata:t.metadata,trigger:t.trigger,messageId:t.messageId})),m=(r=h==null?void 0:h.api)!=null?r:this.api,g=(h==null?void 0:h.headers)!==void 0?fa(h.headers):f,x=(h==null?void 0:h.body)!==void 0?h.body:{...a,...t.body,id:t.chatId,messages:t.messages,trigger:t.trigger,messageId:t.messageId},b=(i=h==null?void 0:h.credentials)!=null?i:d,C=await((o=this.fetch)!=null?o:globalThis.fetch)(m,{method:"POST",headers:yw({"Content-Type":"application/json",...g},`ai-sdk/${ww}`,gw()),body:JSON.stringify(x),credentials:b,signal:e});if(!C.ok)throw new Error((s=await C.text())!=null?s:"Failed to fetch the chat response.");if(!C.body)throw new Error("The response body is empty.");return this.processResponseStream(C.body)}async reconnectToStream(e){var t,n,r,i,o;const s=await ps(this.body),a=await ps(this.headers),u=await ps(this.credentials),d={...fa(a),...fa(e.headers)},f=await((t=this.prepareReconnectToStreamRequest)==null?void 0:t.call(this,{api:this.api,id:e.chatId,body:{...s,...e.body},headers:d,credentials:u,requestMetadata:e.metadata})),h=(n=f==null?void 0:f.api)!=null?n:`${this.api}/${e.chatId}/stream`,m=(f==null?void 0:f.headers)!==void 0?fa(f.headers):d,g=(r=f==null?void 0:f.credentials)!=null?r:u,b=await((i=this.fetch)!=null?i:globalThis.fetch)(h,{method:"GET",headers:yw(m,`ai-sdk/${ww}`,gw()),credentials:g});if(b.status===204)return null;if(!b.ok)throw new Error((o=await b.text())!=null?o:"Failed to fetch the chat response.");if(!b.body)throw new Error("The response body is empty.");return this.processResponseStream(b.body)}},e_=class extends VR{constructor(e={}){super(e)}processResponseStream(e){return hR({stream:e,schema:PR}).pipeThrough(new TransformStream({async transform(t,n){if(!t.success)throw t.error;n.enqueue(t.value)}}))}},HR=class{constructor({generateId:e=g5,id:t=e(),transport:n=new e_,messageMetadataSchema:r,dataPartSchemas:i,state:o,onError:s,onToolCall:a,onFinish:u,onData:d,sendAutomaticallyWhen:f}){this.activeResponse=void 0,this.jobExecutor=new BR,this.sendMessage=async(h,m)=>{var g,x,b,v;if(h==null){await this.makeRequest({trigger:"submit-message",messageId:(g=this.lastMessage)==null?void 0:g.id,...m});return}let C;if("text"in h||"files"in h?C={parts:[...Array.isArray(h.files)?h.files:await UR(h.files),..."text"in h&&h.text!=null?[{type:"text",text:h.text}]:[]]}:C=h,h.messageId!=null){const _=this.state.messages.findIndex(E=>E.id===h.messageId);if(_===-1)throw new Error(`message with id ${h.messageId} not found`);if(this.state.messages[_].role!=="user")throw new Error(`message with id ${h.messageId} is not a user message`);this.state.messages=this.state.messages.slice(0,_+1),this.state.replaceMessage(_,{...C,id:h.messageId,role:(x=C.role)!=null?x:"user",metadata:h.metadata})}else this.state.pushMessage({...C,id:(b=C.id)!=null?b:this.generateId(),role:(v=C.role)!=null?v:"user",metadata:h.metadata});await this.makeRequest({trigger:"submit-message",messageId:h.messageId,...m})},this.regenerate=async({messageId:h,...m}={})=>{const g=h==null?this.state.messages.length-1:this.state.messages.findIndex(x=>x.id===h);if(g===-1)throw new Error(`message ${h} not found`);this.state.messages=this.state.messages.slice(0,this.messages[g].role==="assistant"?g:g+1),await this.makeRequest({trigger:"regenerate-message",messageId:h,...m})},this.resumeStream=async(h={})=>{await this.makeRequest({trigger:"resume-stream",...h})},this.clearError=()=>{this.status==="error"&&(this.state.error=void 0,this.setStatus({status:"ready"}))},this.addToolApprovalResponse=async({id:h,approved:m,reason:g})=>this.jobExecutor.run(async()=>{const x=this.state.messages,b=x[x.length-1],v=C=>u1(C)&&C.state==="approval-requested"&&C.approval.id===h?{...C,state:"approval-responded",approval:{id:h,approved:m,reason:g}}:C;this.state.replaceMessage(x.length-1,{...b,parts:b.parts.map(v)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(v)),this.status!=="streaming"&&this.status!=="submitted"&&this.sendAutomaticallyWhen&&this.shouldSendAutomatically().then(C=>{var _;C&&this.makeRequest({trigger:"submit-message",messageId:(_=this.lastMessage)==null?void 0:_.id})})}),this.addToolOutput=async({state:h="output-available",tool:m,toolCallId:g,output:x,errorText:b})=>this.jobExecutor.run(async()=>{const v=this.state.messages,C=v[v.length-1],_=E=>u1(E)&&E.toolCallId===g?{...E,state:h,output:x,errorText:b}:E;this.state.replaceMessage(v.length-1,{...C,parts:C.parts.map(_)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(_)),this.status!=="streaming"&&this.status!=="submitted"&&this.sendAutomaticallyWhen&&this.shouldSendAutomatically().then(E=>{var I;E&&this.makeRequest({trigger:"submit-message",messageId:(I=this.lastMessage)==null?void 0:I.id})})}),this.addToolResult=this.addToolOutput,this.stop=async()=>{var h;this.status!=="streaming"&&this.status!=="submitted"||(h=this.activeResponse)!=null&&h.abortController&&this.activeResponse.abortController.abort()},this.id=t,this.transport=n,this.generateId=e,this.messageMetadataSchema=r,this.dataPartSchemas=i,this.state=o,this.onError=s,this.onToolCall=a,this.onFinish=u,this.onData=d,this.sendAutomaticallyWhen=f}get status(){return this.state.status}setStatus({status:e,error:t}){this.status!==e&&(this.state.status=e,this.state.error=t)}get error(){return this.state.error}get messages(){return this.state.messages}get lastMessage(){return this.state.messages[this.state.messages.length-1]}set messages(e){this.state.messages=e}async shouldSendAutomatically(){if(!this.sendAutomaticallyWhen)return!1;const e=this.sendAutomaticallyWhen({messages:this.state.messages});return e&&typeof e=="object"&&"then"in e?await e:e}async makeRequest({trigger:e,metadata:t,headers:n,body:r,messageId:i}){var o,s,a;let u;if(e==="resume-stream")try{const g=await this.transport.reconnectToStream({chatId:this.id,metadata:t,headers:n,body:r});if(g==null)return;u=g}catch(g){this.onError&&g instanceof Error&&this.onError(g),this.setStatus({status:"error",error:g});return}this.setStatus({status:"submitted",error:void 0});const d=this.lastMessage;let f=!1,h=!1,m=!1;try{const g={state:LR({lastMessage:this.state.snapshot(d),messageId:this.generateId()}),abortController:new AbortController};g.abortController.signal.addEventListener("abort",()=>{f=!0}),this.activeResponse=g;let x;e==="resume-stream"?x=u:x=await this.transport.sendMessages({chatId:this.id,messages:this.state.messages,abortSignal:g.abortController.signal,metadata:t,headers:n,body:r,trigger:e,messageId:i});const b=v=>this.jobExecutor.run(()=>v({state:g.state,write:()=>{var C;this.setStatus({status:"streaming"}),g.state.message.id===((C=this.lastMessage)==null?void 0:C.id)?this.state.replaceMessage(this.state.messages.length-1,g.state.message):this.state.pushMessage(g.state.message)}}));await $R({stream:FR({stream:x,onToolCall:this.onToolCall,onData:this.onData,messageMetadataSchema:this.messageMetadataSchema,dataPartSchemas:this.dataPartSchemas,runUpdateMessageJob:b,onError:v=>{throw v}}),onError:v=>{throw v}}),this.setStatus({status:"ready"})}catch(g){if(f||g.name==="AbortError")return f=!0,this.setStatus({status:"ready"}),null;m=!0,g instanceof TypeError&&(g.message.toLowerCase().includes("fetch")||g.message.toLowerCase().includes("network"))&&(h=!0),this.onError&&g instanceof Error&&this.onError(g),this.setStatus({status:"error",error:g})}finally{try{(s=this.onFinish)==null||s.call(this,{message:this.activeResponse.state.message,messages:this.state.messages,isAbort:f,isDisconnect:h,isError:m,finishReason:(o=this.activeResponse)==null?void 0:o.state.finishReason})}catch(g){console.error(g)}this.activeResponse=void 0}!m&&await this.shouldSendAutomatically()&&await this.makeRequest({trigger:"submit-message",messageId:(a=this.lastMessage)==null?void 0:a.id,metadata:t,headers:n,body:r})}},j0,Sw;function WR(){if(Sw)return j0;Sw=1;function e(t,n){if(typeof t!="function")throw new TypeError(`Expected the first argument to be a \`function\`, got \`${typeof t}\`.`);let r,i=0;return function(...s){clearTimeout(r);const a=Date.now(),u=a-i,d=n-u;d<=0?(i=a,t.apply(this,s)):r=setTimeout(()=>{i=Date.now(),t.apply(this,s)},d)}}return j0=e,j0}var qR=WR();const ZR=Ra(qR);var z0={exports:{}},L0={};/**
82
+ * @license React
83
+ * use-sync-external-store-shim.production.js
84
+ *
85
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
86
+ *
87
+ * This source code is licensed under the MIT license found in the
88
+ * LICENSE file in the root directory of this source tree.
89
+ */var Ew;function JR(){if(Ew)return L0;Ew=1;var e=Kc();function t(h,m){return h===m&&(h!==0||1/h===1/m)||h!==h&&m!==m}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function a(h,m){var g=m(),x=r({inst:{value:g,getSnapshot:m}}),b=x[0].inst,v=x[1];return o(function(){b.value=g,b.getSnapshot=m,u(b)&&v({inst:b})},[h,g,m]),i(function(){return u(b)&&v({inst:b}),h(function(){u(b)&&v({inst:b})})},[h]),s(g),g}function u(h){var m=h.getSnapshot;h=h.value;try{var g=m();return!n(h,g)}catch{return!0}}function d(h,m){return m()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:a;return L0.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,L0}var _w;function t_(){return _w||(_w=1,z0.exports=JR()),z0.exports}var ky=t_(),n_=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},un=(e,t,n)=>(n_(e,t,"read from private field"),n?n.call(e):t.get(e)),Wi=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},ds=(e,t,n,r)=>(n_(e,t,"write to private field"),t.set(e,n),n);function KR(e,t){return t!=null?ZR(e,t):e}var fi,Zf,Jf,Zu,Ju,Ku,vl,c1,d1,GR=class{constructor(e=[]){Wi(this,fi,void 0),Wi(this,Zf,"ready"),Wi(this,Jf,void 0),Wi(this,Zu,new Set),Wi(this,Ju,new Set),Wi(this,Ku,new Set),this.pushMessage=t=>{ds(this,fi,un(this,fi).concat(t)),un(this,vl).call(this)},this.popMessage=()=>{ds(this,fi,un(this,fi).slice(0,-1)),un(this,vl).call(this)},this.replaceMessage=(t,n)=>{ds(this,fi,[...un(this,fi).slice(0,t),this.snapshot(n),...un(this,fi).slice(t+1)]),un(this,vl).call(this)},this.snapshot=t=>structuredClone(t),this["~registerMessagesCallback"]=(t,n)=>{const r=n?KR(t,n):t;return un(this,Zu).add(r),()=>{un(this,Zu).delete(r)}},this["~registerStatusCallback"]=t=>(un(this,Ju).add(t),()=>{un(this,Ju).delete(t)}),this["~registerErrorCallback"]=t=>(un(this,Ku).add(t),()=>{un(this,Ku).delete(t)}),Wi(this,vl,()=>{un(this,Zu).forEach(t=>t())}),Wi(this,c1,()=>{un(this,Ju).forEach(t=>t())}),Wi(this,d1,()=>{un(this,Ku).forEach(t=>t())}),ds(this,fi,e)}get status(){return un(this,Zf)}set status(e){ds(this,Zf,e),un(this,c1).call(this)}get error(){return un(this,Jf)}set error(e){ds(this,Jf,e),un(this,d1).call(this)}get messages(){return un(this,fi)}set messages(e){ds(this,fi,[...e]),un(this,vl).call(this)}};fi=new WeakMap;Zf=new WeakMap;Jf=new WeakMap;Zu=new WeakMap;Ju=new WeakMap;Ku=new WeakMap;vl=new WeakMap;c1=new WeakMap;d1=new WeakMap;var kl,Tw=class extends HR{constructor({messages:e,...t}){const n=new GR(e);super({...t,state:n}),Wi(this,kl,void 0),this["~registerMessagesCallback"]=(r,i)=>un(this,kl)["~registerMessagesCallback"](r,i),this["~registerStatusCallback"]=r=>un(this,kl)["~registerStatusCallback"](r),this["~registerErrorCallback"]=r=>un(this,kl)["~registerErrorCallback"](r),ds(this,kl,n)}};kl=new WeakMap;function YR({experimental_throttle:e,resume:t=!1,...n}={}){const r=A.useRef("chat"in n?{}:{onToolCall:n.onToolCall,onData:n.onData,onFinish:n.onFinish,onError:n.onError,sendAutomaticallyWhen:n.sendAutomaticallyWhen});"chat"in n||(r.current={onToolCall:n.onToolCall,onData:n.onData,onFinish:n.onFinish,onError:n.onError,sendAutomaticallyWhen:n.sendAutomaticallyWhen});const i={...n,onToolCall:m=>{var g,x;return(x=(g=r.current).onToolCall)==null?void 0:x.call(g,m)},onData:m=>{var g,x;return(x=(g=r.current).onData)==null?void 0:x.call(g,m)},onFinish:m=>{var g,x;return(x=(g=r.current).onFinish)==null?void 0:x.call(g,m)},onError:m=>{var g,x;return(x=(g=r.current).onError)==null?void 0:x.call(g,m)},sendAutomaticallyWhen:m=>{var g,x,b;return(b=(x=(g=r.current).sendAutomaticallyWhen)==null?void 0:x.call(g,m))!=null?b:!1}},o=A.useRef("chat"in n?n.chat:new Tw(i));("chat"in n&&n.chat!==o.current||"id"in n&&o.current.id!==n.id)&&(o.current="chat"in n?n.chat:new Tw(i));const a=A.useCallback(m=>o.current["~registerMessagesCallback"](m,e),[e,o.current.id]),u=A.useSyncExternalStore(a,()=>o.current.messages,()=>o.current.messages),d=A.useSyncExternalStore(o.current["~registerStatusCallback"],()=>o.current.status,()=>o.current.status),f=A.useSyncExternalStore(o.current["~registerErrorCallback"],()=>o.current.error,()=>o.current.error),h=A.useCallback(m=>{typeof m=="function"&&(m=m(o.current.messages)),o.current.messages=m},[o]);return A.useEffect(()=>{t&&o.current.resumeStream()},[t,o]),{id:o.current.id,messages:u,setMessages:h,sendMessage:o.current.sendMessage,regenerate:o.current.regenerate,clearError:o.current.clearError,stop:o.current.stop,error:f,resumeStream:o.current.resumeStream,status:d,addToolResult:o.current.addToolOutput,addToolOutput:o.current.addToolOutput,addToolApprovalResponse:o.current.addToolApprovalResponse}}/**
90
+ * @license lucide-react v0.511.0 - ISC
91
+ *
92
+ * This source code is licensed under the ISC license.
93
+ * See the LICENSE file in the root directory of this source tree.
94
+ */const QR=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),XR=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Aw=e=>{const t=XR(e);return t.charAt(0).toUpperCase()+t.slice(1)},r_=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),eP=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
95
+ * @license lucide-react v0.511.0 - ISC
96
+ *
97
+ * This source code is licensed under the ISC license.
98
+ * See the LICENSE file in the root directory of this source tree.
99
+ */var tP={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"};/**
100
+ * @license lucide-react v0.511.0 - ISC
101
+ *
102
+ * This source code is licensed under the ISC license.
103
+ * See the LICENSE file in the root directory of this source tree.
104
+ */const nP=A.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:s,...a},u)=>A.createElement("svg",{ref:u,...tP,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:r_("lucide",i),...!o&&!eP(a)&&{"aria-hidden":"true"},...a},[...s.map(([d,f])=>A.createElement(d,f)),...Array.isArray(o)?o:[o]]));/**
105
+ * @license lucide-react v0.511.0 - ISC
106
+ *
107
+ * This source code is licensed under the ISC license.
108
+ * See the LICENSE file in the root directory of this source tree.
109
+ */const On=(e,t)=>{const n=A.forwardRef(({className:r,...i},o)=>A.createElement(nP,{ref:o,iconNode:t,className:r_(`lucide-${QR(Aw(e))}`,`lucide-${e}`,r),...i}));return n.displayName=Aw(e),n};/**
110
+ * @license lucide-react v0.511.0 - ISC
111
+ *
112
+ * This source code is licensed under the ISC license.
113
+ * See the LICENSE file in the root directory of this source tree.
114
+ */const rP=[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]],iP=On("brain",rP);/**
115
+ * @license lucide-react v0.511.0 - ISC
116
+ *
117
+ * This source code is licensed under the ISC license.
118
+ * See the LICENSE file in the root directory of this source tree.
119
+ */const oP=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],sP=On("check",oP);/**
120
+ * @license lucide-react v0.511.0 - ISC
121
+ *
122
+ * This source code is licensed under the ISC license.
123
+ * See the LICENSE file in the root directory of this source tree.
124
+ */const aP=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ic=On("chevron-down",aP);/**
125
+ * @license lucide-react v0.511.0 - ISC
126
+ *
127
+ * This source code is licensed under the ISC license.
128
+ * See the LICENSE file in the root directory of this source tree.
129
+ */const lP=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],uP=On("chevron-right",lP);/**
130
+ * @license lucide-react v0.511.0 - ISC
131
+ *
132
+ * This source code is licensed under the ISC license.
133
+ * See the LICENSE file in the root directory of this source tree.
134
+ */const cP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Ta=On("circle-alert",cP);/**
135
+ * @license lucide-react v0.511.0 - ISC
136
+ *
137
+ * This source code is licensed under the ISC license.
138
+ * See the LICENSE file in the root directory of this source tree.
139
+ */const dP=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],fP=On("cloud",dP);/**
140
+ * @license lucide-react v0.511.0 - ISC
141
+ *
142
+ * This source code is licensed under the ISC license.
143
+ * See the LICENSE file in the root directory of this source tree.
144
+ */const hP=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],f1=On("code",hP);/**
145
+ * @license lucide-react v0.511.0 - ISC
146
+ *
147
+ * This source code is licensed under the ISC license.
148
+ * See the LICENSE file in the root directory of this source tree.
149
+ */const pP=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],i_=On("eye",pP);/**
150
+ * @license lucide-react v0.511.0 - ISC
151
+ *
152
+ * This source code is licensed under the ISC license.
153
+ * See the LICENSE file in the root directory of this source tree.
154
+ */const mP=[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]],gP=On("file-code",mP);/**
155
+ * @license lucide-react v0.511.0 - ISC
156
+ *
157
+ * This source code is licensed under the ISC license.
158
+ * See the LICENSE file in the root directory of this source tree.
159
+ */const yP=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]],xP=On("file",yP);/**
160
+ * @license lucide-react v0.511.0 - ISC
161
+ *
162
+ * This source code is licensed under the ISC license.
163
+ * See the LICENSE file in the root directory of this source tree.
164
+ */const bP=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],vP=On("folder-tree",bP);/**
165
+ * @license lucide-react v0.511.0 - ISC
166
+ *
167
+ * This source code is licensed under the ISC license.
168
+ * See the LICENSE file in the root directory of this source tree.
169
+ */const kP=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],wP=On("folder",kP);/**
170
+ * @license lucide-react v0.511.0 - ISC
171
+ *
172
+ * This source code is licensed under the ISC license.
173
+ * See the LICENSE file in the root directory of this source tree.
174
+ */const CP=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],yi=On("loader-circle",CP);/**
175
+ * @license lucide-react v0.511.0 - ISC
176
+ *
177
+ * This source code is licensed under the ISC license.
178
+ * See the LICENSE file in the root directory of this source tree.
179
+ */const SP=[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]],EP=On("message-square",SP);/**
180
+ * @license lucide-react v0.511.0 - ISC
181
+ *
182
+ * This source code is licensed under the ISC license.
183
+ * See the LICENSE file in the root directory of this source tree.
184
+ */const _P=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],o_=On("pencil",_P);/**
185
+ * @license lucide-react v0.511.0 - ISC
186
+ *
187
+ * This source code is licensed under the ISC license.
188
+ * See the LICENSE file in the root directory of this source tree.
189
+ */const TP=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],s_=On("rotate-ccw",TP);/**
190
+ * @license lucide-react v0.511.0 - ISC
191
+ *
192
+ * This source code is licensed under the ISC license.
193
+ * See the LICENSE file in the root directory of this source tree.
194
+ */const AP=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],a_=On("send",AP);/**
195
+ * @license lucide-react v0.511.0 - ISC
196
+ *
197
+ * This source code is licensed under the ISC license.
198
+ * See the LICENSE file in the root directory of this source tree.
199
+ */const MP=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],NP=On("server",MP);/**
200
+ * @license lucide-react v0.511.0 - ISC
201
+ *
202
+ * This source code is licensed under the ISC license.
203
+ * See the LICENSE file in the root directory of this source tree.
204
+ */const IP=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],DP=On("x",IP);/**
205
+ * @license lucide-react v0.511.0 - ISC
206
+ *
207
+ * This source code is licensed under the ISC license.
208
+ * See the LICENSE file in the root directory of this source tree.
209
+ */const OP=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]],RP=On("wrench",OP);function Mw(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function wy(...e){return t=>{let n=!1;const r=e.map(i=>{const o=Mw(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():Mw(e[i],null)}}}}function $s(...e){return A.useCallback(wy(...e),e)}var PP=Symbol.for("react.lazy"),fh=cy[" use ".trim().toString()];function jP(e){return typeof e=="object"&&e!==null&&"then"in e}function l_(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===PP&&"_payload"in e&&jP(e._payload)}function u_(e){const t=LP(e),n=A.forwardRef((r,i)=>{let{children:o,...s}=r;l_(o)&&typeof fh=="function"&&(o=fh(o._payload));const a=A.Children.toArray(o),u=a.find($P);if(u){const d=u.props.children,f=a.map(h=>h===u?A.Children.count(d)>1?A.Children.only(null):A.isValidElement(d)?d.props.children:null:h);return w.jsx(t,{...s,ref:i,children:A.isValidElement(d)?A.cloneElement(d,void 0,f):null})}return w.jsx(t,{...s,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}var zP=u_("Slot");function LP(e){const t=A.forwardRef((n,r)=>{let{children:i,...o}=n;if(l_(i)&&typeof fh=="function"&&(i=fh(i._payload)),A.isValidElement(i)){const s=UP(i),a=BP(o,i.props);return i.type!==A.Fragment&&(a.ref=r?wy(r,s):s),A.cloneElement(i,a)}return A.Children.count(i)>1?A.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var FP=Symbol("radix.slottable");function $P(e){return A.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===FP}function BP(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...a)=>{const u=o(...a);return i(...a),u}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function UP(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function c_(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=c_(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function d_(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=c_(e))&&(r&&(r+=" "),r+=t);return r}const Nw=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Iw=d_,f_=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Iw(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=t,s=Object.keys(i).map(d=>{const f=n==null?void 0:n[d],h=o==null?void 0:o[d];if(f===null)return null;const m=Nw(f)||Nw(h);return i[d][m]}),a=n&&Object.entries(n).reduce((d,f)=>{let[h,m]=f;return m===void 0||(d[h]=m),d},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,f)=>{let{class:h,className:m,...g}=f;return Object.entries(g).every(x=>{let[b,v]=x;return Array.isArray(v)?v.includes({...o,...a}[b]):{...o,...a}[b]===v})?[...d,h,m]:d},[]);return Iw(e,s,u,n==null?void 0:n.class,n==null?void 0:n.className)},VP=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},HP=(e,t)=>({classGroupId:e,validator:t}),h_=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),hh="-",Dw=[],WP="arbitrary..",qP=e=>{const t=JP(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return ZP(s);const a=s.split(hh),u=a[0]===""&&a.length>1?1:0;return p_(a,u,t)},getConflictingClassGroupIds:(s,a)=>{if(a){const u=r[s],d=n[s];return u?d?VP(d,u):u:d||Dw}return n[s]||Dw}}},p_=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],o=n.nextPart.get(i);if(o){const d=p_(e,t+1,o);if(d)return d}const s=n.validators;if(s===null)return;const a=t===0?e.join(hh):e.slice(t).join(hh),u=s.length;for(let d=0;d<u;d++){const f=s[d];if(f.validator(a))return f.classGroupId}},ZP=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?WP+r:void 0})(),JP=e=>{const{theme:t,classGroups:n}=e;return KP(n,t)},KP=(e,t)=>{const n=h_();for(const r in e){const i=e[r];Cy(i,n,r,t)}return n},Cy=(e,t,n,r)=>{const i=e.length;for(let o=0;o<i;o++){const s=e[o];GP(s,t,n,r)}},GP=(e,t,n,r)=>{if(typeof e=="string"){YP(e,t,n);return}if(typeof e=="function"){QP(e,t,n,r);return}XP(e,t,n,r)},YP=(e,t,n)=>{const r=e===""?t:m_(t,e);r.classGroupId=n},QP=(e,t,n,r)=>{if(e9(e)){Cy(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(HP(n,e))},XP=(e,t,n,r)=>{const i=Object.entries(e),o=i.length;for(let s=0;s<o;s++){const[a,u]=i[s];Cy(u,m_(t,a),n,r)}},m_=(e,t)=>{let n=e;const r=t.split(hh),i=r.length;for(let o=0;o<i;o++){const s=r[o];let a=n.nextPart.get(s);a||(a=h_(),n.nextPart.set(s,a)),n=a}return n},e9=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,t9=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(o,s)=>{n[o]=s,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(o){let s=n[o];if(s!==void 0)return s;if((s=r[o])!==void 0)return i(o,s),s},set(o,s){o in n?n[o]=s:i(o,s)}}},h1="!",Ow=":",n9=[],Rw=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),r9=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const o=[];let s=0,a=0,u=0,d;const f=i.length;for(let b=0;b<f;b++){const v=i[b];if(s===0&&a===0){if(v===Ow){o.push(i.slice(u,b)),u=b+1;continue}if(v==="/"){d=b;continue}}v==="["?s++:v==="]"?s--:v==="("?a++:v===")"&&a--}const h=o.length===0?i:i.slice(u);let m=h,g=!1;h.endsWith(h1)?(m=h.slice(0,-1),g=!0):h.startsWith(h1)&&(m=h.slice(1),g=!0);const x=d&&d>u?d-u:void 0;return Rw(o,g,m,x)};if(t){const i=t+Ow,o=r;r=s=>s.startsWith(i)?o(s.slice(i.length)):Rw(n9,!1,s,void 0,!0)}if(n){const i=r;r=o=>n({className:o,parseClassName:i})}return r},i9=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let o=0;o<n.length;o++){const s=n[o],a=s[0]==="[",u=t.has(s);a||u?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(s)):i.push(s)}return i.length>0&&(i.sort(),r.push(...i)),r}},o9=e=>({cache:t9(e.cacheSize),parseClassName:r9(e),sortModifiers:i9(e),...qP(e)}),s9=/\s+/,a9=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:o}=t,s=[],a=e.trim().split(s9);let u="";for(let d=a.length-1;d>=0;d-=1){const f=a[d],{isExternal:h,modifiers:m,hasImportantModifier:g,baseClassName:x,maybePostfixModifierPosition:b}=n(f);if(h){u=f+(u.length>0?" "+u:u);continue}let v=!!b,C=r(v?x.substring(0,b):x);if(!C){if(!v){u=f+(u.length>0?" "+u:u);continue}if(C=r(x),!C){u=f+(u.length>0?" "+u:u);continue}v=!1}const _=m.length===0?"":m.length===1?m[0]:o(m).join(":"),E=g?_+h1:_,I=E+C;if(s.indexOf(I)>-1)continue;s.push(I);const N=i(C,v);for(let M=0;M<N.length;++M){const F=N[M];s.push(E+F)}u=f+(u.length>0?" "+u:u)}return u},l9=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=g_(n))&&(i&&(i+=" "),i+=r);return i},g_=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=g_(e[r]))&&(n&&(n+=" "),n+=t);return n},u9=(e,...t)=>{let n,r,i,o;const s=u=>{const d=t.reduce((f,h)=>h(f),e());return n=o9(d),r=n.cache.get,i=n.cache.set,o=a,a(u)},a=u=>{const d=r(u);if(d)return d;const f=a9(u,n);return i(u,f),f};return o=s,(...u)=>o(l9(...u))},c9=[],$n=e=>{const t=n=>n[e]||c9;return t.isThemeGetter=!0,t},y_=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,x_=/^\((?:(\w[\w-]*):)?(.+)\)$/i,d9=/^\d+\/\d+$/,f9=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,h9=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,p9=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,m9=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,g9=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,dl=e=>d9.test(e),Nt=e=>!!e&&!Number.isNaN(Number(e)),ls=e=>!!e&&Number.isInteger(Number(e)),F0=e=>e.endsWith("%")&&Nt(e.slice(0,-1)),Eo=e=>f9.test(e),b_=()=>!0,y9=e=>h9.test(e)&&!p9.test(e),Sy=()=>!1,x9=e=>m9.test(e),b9=e=>g9.test(e),v9=e=>!tt(e)&&!nt(e),k9=e=>Bs(e,w_,Sy),tt=e=>y_.test(e),ua=e=>Bs(e,C_,y9),Pw=e=>Bs(e,M9,Nt),w9=e=>Bs(e,E_,b_),C9=e=>Bs(e,S_,Sy),jw=e=>Bs(e,v_,Sy),S9=e=>Bs(e,k_,b9),wf=e=>Bs(e,__,x9),nt=e=>x_.test(e),Pu=e=>za(e,C_),E9=e=>za(e,S_),zw=e=>za(e,v_),_9=e=>za(e,w_),T9=e=>za(e,k_),Cf=e=>za(e,__,!0),A9=e=>za(e,E_,!0),Bs=(e,t,n)=>{const r=y_.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},za=(e,t,n=!1)=>{const r=x_.exec(e);return r?r[1]?t(r[1]):n:!1},v_=e=>e==="position"||e==="percentage",k_=e=>e==="image"||e==="url",w_=e=>e==="length"||e==="size"||e==="bg-size",C_=e=>e==="length",M9=e=>e==="number",S_=e=>e==="family-name",E_=e=>e==="number"||e==="weight",__=e=>e==="shadow",N9=()=>{const e=$n("color"),t=$n("font"),n=$n("text"),r=$n("font-weight"),i=$n("tracking"),o=$n("leading"),s=$n("breakpoint"),a=$n("container"),u=$n("spacing"),d=$n("radius"),f=$n("shadow"),h=$n("inset-shadow"),m=$n("text-shadow"),g=$n("drop-shadow"),x=$n("blur"),b=$n("perspective"),v=$n("aspect"),C=$n("ease"),_=$n("animate"),E=()=>["auto","avoid","all","avoid-page","page","left","right","column"],I=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],N=()=>[...I(),nt,tt],M=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto","contain","none"],R=()=>[nt,tt,u],D=()=>[dl,"full","auto",...R()],L=()=>[ls,"none","subgrid",nt,tt],X=()=>["auto",{span:["full",ls,nt,tt]},ls,nt,tt],ee=()=>[ls,"auto",nt,tt],Ie=()=>["auto","min","max","fr",nt,tt],he=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Z=()=>["start","end","center","stretch","center-safe","end-safe"],ge=()=>["auto",...R()],Oe=()=>[dl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],Y=()=>[e,nt,tt],qe=()=>[...I(),zw,jw,{position:[nt,tt]}],O=()=>["no-repeat",{repeat:["","x","y","space","round"]}],W=()=>["auto","cover","contain",_9,k9,{size:[nt,tt]}],ie=()=>[F0,Pu,ua],P=()=>["","none","full",d,nt,tt],Ze=()=>["",Nt,Pu,ua],V=()=>["solid","dashed","dotted","double"],Re=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],pe=()=>[Nt,F0,zw,jw],Pe=()=>["","none",x,nt,tt],je=()=>["none",Nt,nt,tt],$e=()=>["none",Nt,nt,tt],qt=()=>[Nt,nt,tt],Pn=()=>[dl,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Eo],breakpoint:[Eo],color:[b_],container:[Eo],"drop-shadow":[Eo],ease:["in","out","in-out"],font:[v9],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Eo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Eo],shadow:[Eo],spacing:["px",Nt],text:[Eo],"text-shadow":[Eo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",dl,tt,nt,v]}],container:["container"],columns:[{columns:[Nt,tt,nt,a]}],"break-after":[{"break-after":E()}],"break-before":[{"break-before":E()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:N()}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:F()}],"overscroll-x":[{"overscroll-x":F()}],"overscroll-y":[{"overscroll-y":F()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:D()}],"inset-x":[{"inset-x":D()}],"inset-y":[{"inset-y":D()}],start:[{start:D()}],end:[{end:D()}],top:[{top:D()}],right:[{right:D()}],bottom:[{bottom:D()}],left:[{left:D()}],visibility:["visible","invisible","collapse"],z:[{z:[ls,"auto",nt,tt]}],basis:[{basis:[dl,"full","auto",a,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Nt,dl,"auto","initial","none",tt]}],grow:[{grow:["",Nt,nt,tt]}],shrink:[{shrink:["",Nt,nt,tt]}],order:[{order:[ls,"first","last","none",nt,tt]}],"grid-cols":[{"grid-cols":L()}],"col-start-end":[{col:X()}],"col-start":[{"col-start":ee()}],"col-end":[{"col-end":ee()}],"grid-rows":[{"grid-rows":L()}],"row-start-end":[{row:X()}],"row-start":[{"row-start":ee()}],"row-end":[{"row-end":ee()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Ie()}],"auto-rows":[{"auto-rows":Ie()}],gap:[{gap:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[...he(),"normal"]}],"justify-items":[{"justify-items":[...Z(),"normal"]}],"justify-self":[{"justify-self":["auto",...Z()]}],"align-content":[{content:["normal",...he()]}],"align-items":[{items:[...Z(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Z(),{baseline:["","last"]}]}],"place-content":[{"place-content":he()}],"place-items":[{"place-items":[...Z(),"baseline"]}],"place-self":[{"place-self":["auto",...Z()]}],p:[{p:R()}],px:[{px:R()}],py:[{py:R()}],ps:[{ps:R()}],pe:[{pe:R()}],pt:[{pt:R()}],pr:[{pr:R()}],pb:[{pb:R()}],pl:[{pl:R()}],m:[{m:ge()}],mx:[{mx:ge()}],my:[{my:ge()}],ms:[{ms:ge()}],me:[{me:ge()}],mt:[{mt:ge()}],mr:[{mr:ge()}],mb:[{mb:ge()}],ml:[{ml:ge()}],"space-x":[{"space-x":R()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":R()}],"space-y-reverse":["space-y-reverse"],size:[{size:Oe()}],w:[{w:[a,"screen",...Oe()]}],"min-w":[{"min-w":[a,"screen","none",...Oe()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[s]},...Oe()]}],h:[{h:["screen","lh",...Oe()]}],"min-h":[{"min-h":["screen","lh","none",...Oe()]}],"max-h":[{"max-h":["screen","lh",...Oe()]}],"font-size":[{text:["base",n,Pu,ua]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,A9,w9]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",F0,tt]}],"font-family":[{font:[E9,C9,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,nt,tt]}],"line-clamp":[{"line-clamp":[Nt,"none",nt,Pw]}],leading:[{leading:[o,...R()]}],"list-image":[{"list-image":["none",nt,tt]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",nt,tt]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:Y()}],"text-color":[{text:Y()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...V(),"wavy"]}],"text-decoration-thickness":[{decoration:[Nt,"from-font","auto",nt,ua]}],"text-decoration-color":[{decoration:Y()}],"underline-offset":[{"underline-offset":[Nt,"auto",nt,tt]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",nt,tt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",nt,tt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:qe()}],"bg-repeat":[{bg:O()}],"bg-size":[{bg:W()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ls,nt,tt],radial:["",nt,tt],conic:[ls,nt,tt]},T9,S9]}],"bg-color":[{bg:Y()}],"gradient-from-pos":[{from:ie()}],"gradient-via-pos":[{via:ie()}],"gradient-to-pos":[{to:ie()}],"gradient-from":[{from:Y()}],"gradient-via":[{via:Y()}],"gradient-to":[{to:Y()}],rounded:[{rounded:P()}],"rounded-s":[{"rounded-s":P()}],"rounded-e":[{"rounded-e":P()}],"rounded-t":[{"rounded-t":P()}],"rounded-r":[{"rounded-r":P()}],"rounded-b":[{"rounded-b":P()}],"rounded-l":[{"rounded-l":P()}],"rounded-ss":[{"rounded-ss":P()}],"rounded-se":[{"rounded-se":P()}],"rounded-ee":[{"rounded-ee":P()}],"rounded-es":[{"rounded-es":P()}],"rounded-tl":[{"rounded-tl":P()}],"rounded-tr":[{"rounded-tr":P()}],"rounded-br":[{"rounded-br":P()}],"rounded-bl":[{"rounded-bl":P()}],"border-w":[{border:Ze()}],"border-w-x":[{"border-x":Ze()}],"border-w-y":[{"border-y":Ze()}],"border-w-s":[{"border-s":Ze()}],"border-w-e":[{"border-e":Ze()}],"border-w-t":[{"border-t":Ze()}],"border-w-r":[{"border-r":Ze()}],"border-w-b":[{"border-b":Ze()}],"border-w-l":[{"border-l":Ze()}],"divide-x":[{"divide-x":Ze()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Ze()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...V(),"hidden","none"]}],"divide-style":[{divide:[...V(),"hidden","none"]}],"border-color":[{border:Y()}],"border-color-x":[{"border-x":Y()}],"border-color-y":[{"border-y":Y()}],"border-color-s":[{"border-s":Y()}],"border-color-e":[{"border-e":Y()}],"border-color-t":[{"border-t":Y()}],"border-color-r":[{"border-r":Y()}],"border-color-b":[{"border-b":Y()}],"border-color-l":[{"border-l":Y()}],"divide-color":[{divide:Y()}],"outline-style":[{outline:[...V(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Nt,nt,tt]}],"outline-w":[{outline:["",Nt,Pu,ua]}],"outline-color":[{outline:Y()}],shadow:[{shadow:["","none",f,Cf,wf]}],"shadow-color":[{shadow:Y()}],"inset-shadow":[{"inset-shadow":["none",h,Cf,wf]}],"inset-shadow-color":[{"inset-shadow":Y()}],"ring-w":[{ring:Ze()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:Y()}],"ring-offset-w":[{"ring-offset":[Nt,ua]}],"ring-offset-color":[{"ring-offset":Y()}],"inset-ring-w":[{"inset-ring":Ze()}],"inset-ring-color":[{"inset-ring":Y()}],"text-shadow":[{"text-shadow":["none",m,Cf,wf]}],"text-shadow-color":[{"text-shadow":Y()}],opacity:[{opacity:[Nt,nt,tt]}],"mix-blend":[{"mix-blend":[...Re(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Re()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Nt]}],"mask-image-linear-from-pos":[{"mask-linear-from":pe()}],"mask-image-linear-to-pos":[{"mask-linear-to":pe()}],"mask-image-linear-from-color":[{"mask-linear-from":Y()}],"mask-image-linear-to-color":[{"mask-linear-to":Y()}],"mask-image-t-from-pos":[{"mask-t-from":pe()}],"mask-image-t-to-pos":[{"mask-t-to":pe()}],"mask-image-t-from-color":[{"mask-t-from":Y()}],"mask-image-t-to-color":[{"mask-t-to":Y()}],"mask-image-r-from-pos":[{"mask-r-from":pe()}],"mask-image-r-to-pos":[{"mask-r-to":pe()}],"mask-image-r-from-color":[{"mask-r-from":Y()}],"mask-image-r-to-color":[{"mask-r-to":Y()}],"mask-image-b-from-pos":[{"mask-b-from":pe()}],"mask-image-b-to-pos":[{"mask-b-to":pe()}],"mask-image-b-from-color":[{"mask-b-from":Y()}],"mask-image-b-to-color":[{"mask-b-to":Y()}],"mask-image-l-from-pos":[{"mask-l-from":pe()}],"mask-image-l-to-pos":[{"mask-l-to":pe()}],"mask-image-l-from-color":[{"mask-l-from":Y()}],"mask-image-l-to-color":[{"mask-l-to":Y()}],"mask-image-x-from-pos":[{"mask-x-from":pe()}],"mask-image-x-to-pos":[{"mask-x-to":pe()}],"mask-image-x-from-color":[{"mask-x-from":Y()}],"mask-image-x-to-color":[{"mask-x-to":Y()}],"mask-image-y-from-pos":[{"mask-y-from":pe()}],"mask-image-y-to-pos":[{"mask-y-to":pe()}],"mask-image-y-from-color":[{"mask-y-from":Y()}],"mask-image-y-to-color":[{"mask-y-to":Y()}],"mask-image-radial":[{"mask-radial":[nt,tt]}],"mask-image-radial-from-pos":[{"mask-radial-from":pe()}],"mask-image-radial-to-pos":[{"mask-radial-to":pe()}],"mask-image-radial-from-color":[{"mask-radial-from":Y()}],"mask-image-radial-to-color":[{"mask-radial-to":Y()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":I()}],"mask-image-conic-pos":[{"mask-conic":[Nt]}],"mask-image-conic-from-pos":[{"mask-conic-from":pe()}],"mask-image-conic-to-pos":[{"mask-conic-to":pe()}],"mask-image-conic-from-color":[{"mask-conic-from":Y()}],"mask-image-conic-to-color":[{"mask-conic-to":Y()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:qe()}],"mask-repeat":[{mask:O()}],"mask-size":[{mask:W()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",nt,tt]}],filter:[{filter:["","none",nt,tt]}],blur:[{blur:Pe()}],brightness:[{brightness:[Nt,nt,tt]}],contrast:[{contrast:[Nt,nt,tt]}],"drop-shadow":[{"drop-shadow":["","none",g,Cf,wf]}],"drop-shadow-color":[{"drop-shadow":Y()}],grayscale:[{grayscale:["",Nt,nt,tt]}],"hue-rotate":[{"hue-rotate":[Nt,nt,tt]}],invert:[{invert:["",Nt,nt,tt]}],saturate:[{saturate:[Nt,nt,tt]}],sepia:[{sepia:["",Nt,nt,tt]}],"backdrop-filter":[{"backdrop-filter":["","none",nt,tt]}],"backdrop-blur":[{"backdrop-blur":Pe()}],"backdrop-brightness":[{"backdrop-brightness":[Nt,nt,tt]}],"backdrop-contrast":[{"backdrop-contrast":[Nt,nt,tt]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Nt,nt,tt]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Nt,nt,tt]}],"backdrop-invert":[{"backdrop-invert":["",Nt,nt,tt]}],"backdrop-opacity":[{"backdrop-opacity":[Nt,nt,tt]}],"backdrop-saturate":[{"backdrop-saturate":[Nt,nt,tt]}],"backdrop-sepia":[{"backdrop-sepia":["",Nt,nt,tt]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":R()}],"border-spacing-x":[{"border-spacing-x":R()}],"border-spacing-y":[{"border-spacing-y":R()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",nt,tt]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Nt,"initial",nt,tt]}],ease:[{ease:["linear","initial",C,nt,tt]}],delay:[{delay:[Nt,nt,tt]}],animate:[{animate:["none",_,nt,tt]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,nt,tt]}],"perspective-origin":[{"perspective-origin":N()}],rotate:[{rotate:je()}],"rotate-x":[{"rotate-x":je()}],"rotate-y":[{"rotate-y":je()}],"rotate-z":[{"rotate-z":je()}],scale:[{scale:$e()}],"scale-x":[{"scale-x":$e()}],"scale-y":[{"scale-y":$e()}],"scale-z":[{"scale-z":$e()}],"scale-3d":["scale-3d"],skew:[{skew:qt()}],"skew-x":[{"skew-x":qt()}],"skew-y":[{"skew-y":qt()}],transform:[{transform:[nt,tt,"","none","gpu","cpu"]}],"transform-origin":[{origin:N()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Pn()}],"translate-x":[{"translate-x":Pn()}],"translate-y":[{"translate-y":Pn()}],"translate-z":[{"translate-z":Pn()}],"translate-none":["translate-none"],accent:[{accent:Y()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:Y()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",nt,tt]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",nt,tt]}],fill:[{fill:["none",...Y()]}],"stroke-w":[{stroke:[Nt,Pu,ua,Pw]}],stroke:[{stroke:["none",...Y()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},I9=u9(N9);function ei(...e){return I9(d_(e))}const D9=f_("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),T_=A.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},o)=>{const s=r?zP:"button";return w.jsx(s,{className:ei(D9({variant:t,size:n,className:e})),ref:o,...i})});T_.displayName="Button";var Ey=ZS();const O9=Ra(Ey);function R9(e){const t=P9(e),n=A.forwardRef((r,i)=>{const{children:o,...s}=r,a=A.Children.toArray(o),u=a.find(z9);if(u){const d=u.props.children,f=a.map(h=>h===u?A.Children.count(d)>1?A.Children.only(null):A.isValidElement(d)?d.props.children:null:h);return w.jsx(t,{...s,ref:i,children:A.isValidElement(d)?A.cloneElement(d,void 0,f):null})}return w.jsx(t,{...s,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function P9(e){const t=A.forwardRef((n,r)=>{const{children:i,...o}=n;if(A.isValidElement(i)){const s=F9(i),a=L9(o,i.props);return i.type!==A.Fragment&&(a.ref=r?wy(r,s):s),A.cloneElement(i,a)}return A.Children.count(i)>1?A.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var j9=Symbol("radix.slottable");function z9(e){return A.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===j9}function L9(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...a)=>{const u=o(...a);return i(...a),u}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function F9(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var $9=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Us=$9.reduce((e,t)=>{const n=R9(`Primitive.${t}`),r=A.forwardRef((i,o)=>{const{asChild:s,...a}=i,u=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(u,{...a,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Lo=globalThis!=null&&globalThis.document?A.useLayoutEffect:()=>{};function B9(e,t){return A.useReducer((n,r)=>t[n][r]??n,e)}var Gl=e=>{const{present:t,children:n}=e,r=U9(t),i=typeof n=="function"?n({present:r.isPresent}):A.Children.only(n),o=$s(r.ref,V9(i));return typeof n=="function"||r.isPresent?A.cloneElement(i,{ref:o}):null};Gl.displayName="Presence";function U9(e){const[t,n]=A.useState(),r=A.useRef(null),i=A.useRef(e),o=A.useRef("none"),s=e?"mounted":"unmounted",[a,u]=B9(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return A.useEffect(()=>{const d=Sf(r.current);o.current=a==="mounted"?d:"none"},[a]),Lo(()=>{const d=r.current,f=i.current;if(f!==e){const m=o.current,g=Sf(d);e?u("MOUNT"):g==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(f&&m!==g?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),Lo(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,h=g=>{const b=Sf(r.current).includes(CSS.escape(g.animationName));if(g.target===t&&b&&(u("ANIMATION_END"),!i.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",d=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},m=g=>{g.target===t&&(o.current=Sf(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{f.clearTimeout(d),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:A.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function Sf(e){return(e==null?void 0:e.animationName)||"none"}function V9(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function A_(e,t=[]){let n=[];function r(o,s){const a=A.createContext(s),u=n.length;n=[...n,s];const d=h=>{var C;const{scope:m,children:g,...x}=h,b=((C=m==null?void 0:m[e])==null?void 0:C[u])||a,v=A.useMemo(()=>x,Object.values(x));return w.jsx(b.Provider,{value:v,children:g})};d.displayName=o+"Provider";function f(h,m){var b;const g=((b=m==null?void 0:m[e])==null?void 0:b[u])||a,x=A.useContext(g);if(x)return x;if(s!==void 0)return s;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[d,f]}const i=()=>{const o=n.map(s=>A.createContext(s));return function(a){const u=(a==null?void 0:a[e])||o;return A.useMemo(()=>({[`__scope${e}`]:{...a,[e]:u}}),[a,u])}};return i.scopeName=e,[r,H9(i,...t)]}function H9(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=r.reduce((a,{useScope:u,scopeName:d})=>{const h=u(o)[`__scope${d}`];return{...a,...h}},{});return A.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function bs(e){const t=A.useRef(e);return A.useEffect(()=>{t.current=e}),A.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var W9=A.createContext(void 0);function q9(e){const t=A.useContext(W9);return e||t||"ltr"}function Z9(e,[t,n]){return Math.min(n,Math.max(t,e))}function Ms(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function J9(e,t){return A.useReducer((n,r)=>t[n][r]??n,e)}var _y="ScrollArea",[M_]=A_(_y),[K9,ki]=M_(_y),N_=A.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:o=600,...s}=e,[a,u]=A.useState(null),[d,f]=A.useState(null),[h,m]=A.useState(null),[g,x]=A.useState(null),[b,v]=A.useState(null),[C,_]=A.useState(0),[E,I]=A.useState(0),[N,M]=A.useState(!1),[F,R]=A.useState(!1),D=$s(t,X=>u(X)),L=q9(i);return w.jsx(K9,{scope:n,type:r,dir:L,scrollHideDelay:o,scrollArea:a,viewport:d,onViewportChange:f,content:h,onContentChange:m,scrollbarX:g,onScrollbarXChange:x,scrollbarXEnabled:N,onScrollbarXEnabledChange:M,scrollbarY:b,onScrollbarYChange:v,scrollbarYEnabled:F,onScrollbarYEnabledChange:R,onCornerWidthChange:_,onCornerHeightChange:I,children:w.jsx(Us.div,{dir:L,...s,ref:D,style:{position:"relative","--radix-scroll-area-corner-width":C+"px","--radix-scroll-area-corner-height":E+"px",...e.style}})})});N_.displayName=_y;var I_="ScrollAreaViewport",D_=A.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:i,...o}=e,s=ki(I_,n),a=A.useRef(null),u=$s(t,a,s.onViewportChange);return w.jsxs(w.Fragment,{children:[w.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),w.jsx(Us.div,{"data-radix-scroll-area-viewport":"",...o,ref:u,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:w.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});D_.displayName=I_;var io="ScrollAreaScrollbar",Ty=A.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=ki(io,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:s}=i,a=e.orientation==="horizontal";return A.useEffect(()=>(a?o(!0):s(!0),()=>{a?o(!1):s(!1)}),[a,o,s]),i.type==="hover"?w.jsx(G9,{...r,ref:t,forceMount:n}):i.type==="scroll"?w.jsx(Y9,{...r,ref:t,forceMount:n}):i.type==="auto"?w.jsx(O_,{...r,ref:t,forceMount:n}):i.type==="always"?w.jsx(Ay,{...r,ref:t}):null});Ty.displayName=io;var G9=A.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=ki(io,e.__scopeScrollArea),[o,s]=A.useState(!1);return A.useEffect(()=>{const a=i.scrollArea;let u=0;if(a){const d=()=>{window.clearTimeout(u),s(!0)},f=()=>{u=window.setTimeout(()=>s(!1),i.scrollHideDelay)};return a.addEventListener("pointerenter",d),a.addEventListener("pointerleave",f),()=>{window.clearTimeout(u),a.removeEventListener("pointerenter",d),a.removeEventListener("pointerleave",f)}}},[i.scrollArea,i.scrollHideDelay]),w.jsx(Gl,{present:n||o,children:w.jsx(O_,{"data-state":o?"visible":"hidden",...r,ref:t})})}),Y9=A.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=ki(io,e.__scopeScrollArea),o=e.orientation==="horizontal",s=Cp(()=>u("SCROLL_END"),100),[a,u]=J9("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return A.useEffect(()=>{if(a==="idle"){const d=window.setTimeout(()=>u("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(d)}},[a,i.scrollHideDelay,u]),A.useEffect(()=>{const d=i.viewport,f=o?"scrollLeft":"scrollTop";if(d){let h=d[f];const m=()=>{const g=d[f];h!==g&&(u("SCROLL"),s()),h=g};return d.addEventListener("scroll",m),()=>d.removeEventListener("scroll",m)}},[i.viewport,o,u,s]),w.jsx(Gl,{present:n||a!=="hidden",children:w.jsx(Ay,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Ms(e.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:Ms(e.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),O_=A.forwardRef((e,t)=>{const n=ki(io,e.__scopeScrollArea),{forceMount:r,...i}=e,[o,s]=A.useState(!1),a=e.orientation==="horizontal",u=Cp(()=>{if(n.viewport){const d=n.viewport.offsetWidth<n.viewport.scrollWidth,f=n.viewport.offsetHeight<n.viewport.scrollHeight;s(a?d:f)}},10);return zl(n.viewport,u),zl(n.content,u),w.jsx(Gl,{present:r||o,children:w.jsx(Ay,{"data-state":o?"visible":"hidden",...i,ref:t})})}),Ay=A.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,i=ki(io,e.__scopeScrollArea),o=A.useRef(null),s=A.useRef(0),[a,u]=A.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=L_(a.viewport,a.content),f={...r,sizes:a,onSizesChange:u,hasThumb:d>0&&d<1,onThumbChange:m=>o.current=m,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:m=>s.current=m};function h(m,g){return rj(m,s.current,a,g)}return n==="horizontal"?w.jsx(Q9,{...f,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const m=i.viewport.scrollLeft,g=Lw(m,a,i.dir);o.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:m=>{i.viewport&&(i.viewport.scrollLeft=m)},onDragScroll:m=>{i.viewport&&(i.viewport.scrollLeft=h(m,i.dir))}}):n==="vertical"?w.jsx(X9,{...f,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const m=i.viewport.scrollTop,g=Lw(m,a);o.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:m=>{i.viewport&&(i.viewport.scrollTop=m)},onDragScroll:m=>{i.viewport&&(i.viewport.scrollTop=h(m))}}):null}),Q9=A.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=ki(io,e.__scopeScrollArea),[s,a]=A.useState(),u=A.useRef(null),d=$s(t,u,o.onScrollbarXChange);return A.useEffect(()=>{u.current&&a(getComputedStyle(u.current))},[u]),w.jsx(P_,{"data-orientation":"horizontal",...i,ref:d,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":wp(n)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.x),onDragScroll:f=>e.onDragScroll(f.x),onWheelScroll:(f,h)=>{if(o.viewport){const m=o.viewport.scrollLeft+f.deltaX;e.onWheelScroll(m),$_(m,h)&&f.preventDefault()}},onResize:()=>{u.current&&o.viewport&&s&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:mh(s.paddingLeft),paddingEnd:mh(s.paddingRight)}})}})}),X9=A.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=ki(io,e.__scopeScrollArea),[s,a]=A.useState(),u=A.useRef(null),d=$s(t,u,o.onScrollbarYChange);return A.useEffect(()=>{u.current&&a(getComputedStyle(u.current))},[u]),w.jsx(P_,{"data-orientation":"vertical",...i,ref:d,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":wp(n)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.y),onDragScroll:f=>e.onDragScroll(f.y),onWheelScroll:(f,h)=>{if(o.viewport){const m=o.viewport.scrollTop+f.deltaY;e.onWheelScroll(m),$_(m,h)&&f.preventDefault()}},onResize:()=>{u.current&&o.viewport&&s&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:mh(s.paddingTop),paddingEnd:mh(s.paddingBottom)}})}})}),[ej,R_]=M_(io),P_=A.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:o,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:u,onDragScroll:d,onWheelScroll:f,onResize:h,...m}=e,g=ki(io,n),[x,b]=A.useState(null),v=$s(t,D=>b(D)),C=A.useRef(null),_=A.useRef(""),E=g.viewport,I=r.content-r.viewport,N=bs(f),M=bs(u),F=Cp(h,10);function R(D){if(C.current){const L=D.clientX-C.current.left,X=D.clientY-C.current.top;d({x:L,y:X})}}return A.useEffect(()=>{const D=L=>{const X=L.target;(x==null?void 0:x.contains(X))&&N(L,I)};return document.addEventListener("wheel",D,{passive:!1}),()=>document.removeEventListener("wheel",D,{passive:!1})},[E,x,I,N]),A.useEffect(M,[r,M]),zl(x,F),zl(g.content,F),w.jsx(ej,{scope:n,scrollbar:x,hasThumb:i,onThumbChange:bs(o),onThumbPointerUp:bs(s),onThumbPositionChange:M,onThumbPointerDown:bs(a),children:w.jsx(Us.div,{...m,ref:v,style:{position:"absolute",...m.style},onPointerDown:Ms(e.onPointerDown,D=>{D.button===0&&(D.target.setPointerCapture(D.pointerId),C.current=x.getBoundingClientRect(),_.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),R(D))}),onPointerMove:Ms(e.onPointerMove,R),onPointerUp:Ms(e.onPointerUp,D=>{const L=D.target;L.hasPointerCapture(D.pointerId)&&L.releasePointerCapture(D.pointerId),document.body.style.webkitUserSelect=_.current,g.viewport&&(g.viewport.style.scrollBehavior=""),C.current=null})})})}),ph="ScrollAreaThumb",j_=A.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=R_(ph,e.__scopeScrollArea);return w.jsx(Gl,{present:n||i.hasThumb,children:w.jsx(tj,{ref:t,...r})})}),tj=A.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,o=ki(ph,n),s=R_(ph,n),{onThumbPositionChange:a}=s,u=$s(t,h=>s.onThumbChange(h)),d=A.useRef(void 0),f=Cp(()=>{d.current&&(d.current(),d.current=void 0)},100);return A.useEffect(()=>{const h=o.viewport;if(h){const m=()=>{if(f(),!d.current){const g=ij(h,a);d.current=g,a()}};return a(),h.addEventListener("scroll",m),()=>h.removeEventListener("scroll",m)}},[o.viewport,f,a]),w.jsx(Us.div,{"data-state":s.hasThumb?"visible":"hidden",...i,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Ms(e.onPointerDownCapture,h=>{const g=h.target.getBoundingClientRect(),x=h.clientX-g.left,b=h.clientY-g.top;s.onThumbPointerDown({x,y:b})}),onPointerUp:Ms(e.onPointerUp,s.onThumbPointerUp)})});j_.displayName=ph;var My="ScrollAreaCorner",z_=A.forwardRef((e,t)=>{const n=ki(My,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?w.jsx(nj,{...e,ref:t}):null});z_.displayName=My;var nj=A.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=ki(My,n),[o,s]=A.useState(0),[a,u]=A.useState(0),d=!!(o&&a);return zl(i.scrollbarX,()=>{var h;const f=((h=i.scrollbarX)==null?void 0:h.offsetHeight)||0;i.onCornerHeightChange(f),u(f)}),zl(i.scrollbarY,()=>{var h;const f=((h=i.scrollbarY)==null?void 0:h.offsetWidth)||0;i.onCornerWidthChange(f),s(f)}),d?w.jsx(Us.div,{...r,ref:t,style:{width:o,height:a,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function mh(e){return e?parseInt(e,10):0}function L_(e,t){const n=e/t;return isNaN(n)?0:n}function wp(e){const t=L_(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function rj(e,t,n,r="ltr"){const i=wp(n),o=i/2,s=t||o,a=i-s,u=n.scrollbar.paddingStart+s,d=n.scrollbar.size-n.scrollbar.paddingEnd-a,f=n.content-n.viewport,h=r==="ltr"?[0,f]:[f*-1,0];return F_([u,d],h)(e)}function Lw(e,t,n="ltr"){const r=wp(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-i,s=t.content-t.viewport,a=o-r,u=n==="ltr"?[0,s]:[s*-1,0],d=Z9(e,u);return F_([0,s],[0,a])(d)}function F_(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function $_(e,t){return e>0&&e<t}var ij=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function i(){const o={left:e.scrollLeft,top:e.scrollTop},s=n.left!==o.left,a=n.top!==o.top;(s||a)&&t(),n=o,r=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(r)};function Cp(e,t){const n=bs(e),r=A.useRef(0);return A.useEffect(()=>()=>window.clearTimeout(r.current),[]),A.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function zl(e,t){const n=bs(t);Lo(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}var B_=N_,oj=D_,sj=z_;const U_=A.forwardRef(({className:e,children:t,...n},r)=>w.jsxs(B_,{ref:r,className:ei("relative overflow-hidden",e),...n,children:[w.jsx(oj,{className:"h-full w-full rounded-[inherit]",children:t}),w.jsx(V_,{}),w.jsx(sj,{})]}));U_.displayName=B_.displayName;const V_=A.forwardRef(({className:e,orientation:t="vertical",...n},r)=>w.jsx(Ty,{ref:r,orientation:t,className:ei("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:w.jsx(j_,{className:"relative flex-1 rounded-full bg-border"})}));V_.displayName=Ty.displayName;function aj(e,t=[]){let n=[];function r(o,s){const a=A.createContext(s);a.displayName=o+"Context";const u=n.length;n=[...n,s];const d=h=>{var C;const{scope:m,children:g,...x}=h,b=((C=m==null?void 0:m[e])==null?void 0:C[u])||a,v=A.useMemo(()=>x,Object.values(x));return w.jsx(b.Provider,{value:v,children:g})};d.displayName=o+"Provider";function f(h,m){var b;const g=((b=m==null?void 0:m[e])==null?void 0:b[u])||a,x=A.useContext(g);if(x)return x;if(s!==void 0)return s;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[d,f]}const i=()=>{const o=n.map(s=>A.createContext(s));return function(a){const u=(a==null?void 0:a[e])||o;return A.useMemo(()=>({[`__scope${e}`]:{...a,[e]:u}}),[a,u])}};return i.scopeName=e,[r,lj(i,...t)]}function lj(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=r.reduce((a,{useScope:u,scopeName:d})=>{const h=u(o)[`__scope${d}`];return{...a,...h}},{});return A.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var uj=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ny=uj.reduce((e,t)=>{const n=u_(`Primitive.${t}`),r=A.forwardRef((i,o)=>{const{asChild:s,...a}=i,u=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(u,{...a,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function cj(){return ky.useSyncExternalStore(dj,()=>!0,()=>!1)}function dj(){return()=>{}}var Iy="Avatar",[fj]=aj(Iy),[hj,H_]=fj(Iy),W_=A.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[i,o]=A.useState("idle");return w.jsx(hj,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:o,children:w.jsx(Ny.span,{...r,ref:t})})});W_.displayName=Iy;var q_="AvatarImage",Z_=A.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...o}=e,s=H_(q_,n),a=pj(r,o),u=bs(d=>{i(d),s.onImageLoadingStatusChange(d)});return Lo(()=>{a!=="idle"&&u(a)},[a,u]),a==="loaded"?w.jsx(Ny.img,{...o,ref:t,src:r}):null});Z_.displayName=q_;var J_="AvatarFallback",K_=A.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...i}=e,o=H_(J_,n),[s,a]=A.useState(r===void 0);return A.useEffect(()=>{if(r!==void 0){const u=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(u)}},[r]),s&&o.imageLoadingStatus!=="loaded"?w.jsx(Ny.span,{...i,ref:t}):null});K_.displayName=J_;function Fw(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function pj(e,{referrerPolicy:t,crossOrigin:n}){const r=cj(),i=A.useRef(null),o=r?(i.current||(i.current=new window.Image),i.current):null,[s,a]=A.useState(()=>Fw(o,e));return Lo(()=>{a(Fw(o,e))},[o,e]),Lo(()=>{const u=h=>()=>{a(h)};if(!o)return;const d=u("loaded"),f=u("error");return o.addEventListener("load",d),o.addEventListener("error",f),t&&(o.referrerPolicy=t),typeof n=="string"&&(o.crossOrigin=n),()=>{o.removeEventListener("load",d),o.removeEventListener("error",f)}},[o,n,t]),s}var G_=W_,Y_=Z_,Q_=K_;const gh=A.forwardRef(({className:e,...t},n)=>w.jsx(G_,{ref:n,className:ei("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));gh.displayName=G_.displayName;const mj=A.forwardRef(({className:e,...t},n)=>w.jsx(Y_,{ref:n,className:ei("aspect-square h-full w-full",e),...t}));mj.displayName=Y_.displayName;const yh=A.forwardRef(({className:e,...t},n)=>w.jsx(Q_,{ref:n,className:ei("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));yh.displayName=Q_.displayName;const X_=A.forwardRef(({className:e,...t},n)=>w.jsx("div",{ref:n,className:ei("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));X_.displayName="Card";const e3=A.forwardRef(({className:e,...t},n)=>w.jsx("div",{ref:n,className:ei("flex flex-col space-y-1.5 p-6",e),...t}));e3.displayName="CardHeader";const t3=A.forwardRef(({className:e,...t},n)=>w.jsx("h3",{ref:n,className:ei("text-2xl font-semibold leading-none tracking-tight",e),...t}));t3.displayName="CardTitle";const gj=A.forwardRef(({className:e,...t},n)=>w.jsx("p",{ref:n,className:ei("text-sm text-muted-foreground",e),...t}));gj.displayName="CardDescription";const n3=A.forwardRef(({className:e,...t},n)=>w.jsx("div",{ref:n,className:ei("p-6 pt-0",e),...t}));n3.displayName="CardContent";const yj=A.forwardRef(({className:e,...t},n)=>w.jsx("div",{ref:n,className:ei("flex items-center p-6 pt-0",e),...t}));yj.displayName="CardFooter";const xj=f_("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function bj({className:e,variant:t,...n}){return w.jsx("div",{className:ei(xj({variant:t}),e),...n})}var vj=cy[" useInsertionEffect ".trim().toString()]||Lo;function kj({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,s]=wj({defaultProp:t,onChange:n}),a=e!==void 0,u=a?e:i;{const f=A.useRef(e!==void 0);A.useEffect(()=>{const h=f.current;h!==a&&console.warn(`${r} is changing from ${h?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=a},[a,r])}const d=A.useCallback(f=>{var h;if(a){const m=Cj(f)?f(e):f;m!==e&&((h=s.current)==null||h.call(s,m))}else o(f)},[a,e,o,s]);return[u,d]}function wj({defaultProp:e,onChange:t}){const[n,r]=A.useState(e),i=A.useRef(n),o=A.useRef(t);return vj(()=>{o.current=t},[t]),A.useEffect(()=>{var s;i.current!==n&&((s=o.current)==null||s.call(o,n),i.current=n)},[n,i]),[n,r,o]}function Cj(e){return typeof e=="function"}var Sj=cy[" useId ".trim().toString()]||(()=>{}),Ej=0;function _j(e){const[t,n]=A.useState(Sj());return Lo(()=>{n(r=>r??String(Ej++))},[e]),e||(t?`radix-${t}`:"")}var Sp="Collapsible",[Tj]=A_(Sp),[Aj,Dy]=Tj(Sp),r3=A.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:s,...a}=e,[u,d]=kj({prop:r,defaultProp:i??!1,onChange:s,caller:Sp});return w.jsx(Aj,{scope:n,disabled:o,contentId:_j(),open:u,onOpenToggle:A.useCallback(()=>d(f=>!f),[d]),children:w.jsx(Us.div,{"data-state":Ry(u),"data-disabled":o?"":void 0,...a,ref:t})})});r3.displayName=Sp;var i3="CollapsibleTrigger",o3=A.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=Dy(i3,n);return w.jsx(Us.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":Ry(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:Ms(e.onClick,i.onOpenToggle)})});o3.displayName=i3;var Oy="CollapsibleContent",s3=A.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Dy(Oy,e.__scopeCollapsible);return w.jsx(Gl,{present:n||i.open,children:({present:o})=>w.jsx(Mj,{...r,ref:t,present:o})})});s3.displayName=Oy;var Mj=A.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=e,s=Dy(Oy,n),[a,u]=A.useState(r),d=A.useRef(null),f=$s(t,d),h=A.useRef(0),m=h.current,g=A.useRef(0),x=g.current,b=s.open||a,v=A.useRef(b),C=A.useRef(void 0);return A.useEffect(()=>{const _=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(_)},[]),Lo(()=>{const _=d.current;if(_){C.current=C.current||{transitionDuration:_.style.transitionDuration,animationName:_.style.animationName},_.style.transitionDuration="0s",_.style.animationName="none";const E=_.getBoundingClientRect();h.current=E.height,g.current=E.width,v.current||(_.style.transitionDuration=C.current.transitionDuration,_.style.animationName=C.current.animationName),u(r)}},[s.open,r]),w.jsx(Us.div,{"data-state":Ry(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!b,...o,ref:f,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":x?`${x}px`:void 0,...e.style},children:b&&i})});function Ry(e){return e?"open":"closed"}var Nj=r3;const a3=Nj,l3=o3,u3=s3;function Ij(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Dj=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Oj=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Rj={};function $w(e,t){return(Rj.jsx?Oj:Dj).test(e)}const Pj=/[ \t\n\f\r]/g;function jj(e){return typeof e=="object"?e.type==="text"?Bw(e.value):!1:Bw(e)}function Bw(e){return e.replace(Pj,"")===""}let ed=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};ed.prototype.normal={};ed.prototype.property={};ed.prototype.space=void 0;function c3(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new ed(n,r,t)}function p1(e){return e.toLowerCase()}class Ur{constructor(t,n){this.attribute=n,this.property=t}}Ur.prototype.attribute="";Ur.prototype.booleanish=!1;Ur.prototype.boolean=!1;Ur.prototype.commaOrSpaceSeparated=!1;Ur.prototype.commaSeparated=!1;Ur.prototype.defined=!1;Ur.prototype.mustUseProperty=!1;Ur.prototype.number=!1;Ur.prototype.overloadedBoolean=!1;Ur.prototype.property="";Ur.prototype.spaceSeparated=!1;Ur.prototype.space=void 0;let zj=0;const Et=La(),An=La(),m1=La(),we=La(),tn=La(),Tl=La(),Jr=La();function La(){return 2**++zj}const g1=Object.freeze(Object.defineProperty({__proto__:null,boolean:Et,booleanish:An,commaOrSpaceSeparated:Jr,commaSeparated:Tl,number:we,overloadedBoolean:m1,spaceSeparated:tn},Symbol.toStringTag,{value:"Module"})),$0=Object.keys(g1);class Py extends Ur{constructor(t,n,r,i){let o=-1;if(super(t,n),Uw(this,"space",i),typeof r=="number")for(;++o<$0.length;){const s=$0[o];Uw(this,$0[o],(r&g1[s])===g1[s])}}}Py.prototype.defined=!0;function Uw(e,t,n){n&&(e[t]=n)}function Yl(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new Py(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[p1(r)]=r,n[p1(o.attribute)]=r}return new ed(t,n,e.space)}const d3=Yl({properties:{ariaActiveDescendant:null,ariaAtomic:An,ariaAutoComplete:null,ariaBusy:An,ariaChecked:An,ariaColCount:we,ariaColIndex:we,ariaColSpan:we,ariaControls:tn,ariaCurrent:null,ariaDescribedBy:tn,ariaDetails:null,ariaDisabled:An,ariaDropEffect:tn,ariaErrorMessage:null,ariaExpanded:An,ariaFlowTo:tn,ariaGrabbed:An,ariaHasPopup:null,ariaHidden:An,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:tn,ariaLevel:we,ariaLive:null,ariaModal:An,ariaMultiLine:An,ariaMultiSelectable:An,ariaOrientation:null,ariaOwns:tn,ariaPlaceholder:null,ariaPosInSet:we,ariaPressed:An,ariaReadOnly:An,ariaRelevant:null,ariaRequired:An,ariaRoleDescription:tn,ariaRowCount:we,ariaRowIndex:we,ariaRowSpan:we,ariaSelected:An,ariaSetSize:we,ariaSort:null,ariaValueMax:we,ariaValueMin:we,ariaValueNow:we,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function f3(e,t){return t in e?e[t]:t}function h3(e,t){return f3(e,t.toLowerCase())}const Lj=Yl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Tl,acceptCharset:tn,accessKey:tn,action:null,allow:null,allowFullScreen:Et,allowPaymentRequest:Et,allowUserMedia:Et,alt:null,as:null,async:Et,autoCapitalize:null,autoComplete:tn,autoFocus:Et,autoPlay:Et,blocking:tn,capture:null,charSet:null,checked:Et,cite:null,className:tn,cols:we,colSpan:null,content:null,contentEditable:An,controls:Et,controlsList:tn,coords:we|Tl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Et,defer:Et,dir:null,dirName:null,disabled:Et,download:m1,draggable:An,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Et,formTarget:null,headers:tn,height:we,hidden:m1,high:we,href:null,hrefLang:null,htmlFor:tn,httpEquiv:tn,id:null,imageSizes:null,imageSrcSet:null,inert:Et,inputMode:null,integrity:null,is:null,isMap:Et,itemId:null,itemProp:tn,itemRef:tn,itemScope:Et,itemType:tn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Et,low:we,manifest:null,max:null,maxLength:we,media:null,method:null,min:null,minLength:we,multiple:Et,muted:Et,name:null,nonce:null,noModule:Et,noValidate:Et,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Et,optimum:we,pattern:null,ping:tn,placeholder:null,playsInline:Et,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Et,referrerPolicy:null,rel:tn,required:Et,reversed:Et,rows:we,rowSpan:we,sandbox:tn,scope:null,scoped:Et,seamless:Et,selected:Et,shadowRootClonable:Et,shadowRootDelegatesFocus:Et,shadowRootMode:null,shape:null,size:we,sizes:null,slot:null,span:we,spellCheck:An,src:null,srcDoc:null,srcLang:null,srcSet:null,start:we,step:null,style:null,tabIndex:we,target:null,title:null,translate:null,type:null,typeMustMatch:Et,useMap:null,value:An,width:we,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:tn,axis:null,background:null,bgColor:null,border:we,borderColor:null,bottomMargin:we,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Et,declare:Et,event:null,face:null,frame:null,frameBorder:null,hSpace:we,leftMargin:we,link:null,longDesc:null,lowSrc:null,marginHeight:we,marginWidth:we,noResize:Et,noHref:Et,noShade:Et,noWrap:Et,object:null,profile:null,prompt:null,rev:null,rightMargin:we,rules:null,scheme:null,scrolling:An,standby:null,summary:null,text:null,topMargin:we,valueType:null,version:null,vAlign:null,vLink:null,vSpace:we,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Et,disableRemotePlayback:Et,prefix:null,property:null,results:we,security:null,unselectable:null},space:"html",transform:h3}),Fj=Yl({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Jr,accentHeight:we,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:we,amplitude:we,arabicForm:null,ascent:we,attributeName:null,attributeType:null,azimuth:we,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:we,by:null,calcMode:null,capHeight:we,className:tn,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:we,diffuseConstant:we,direction:null,display:null,dur:null,divisor:we,dominantBaseline:null,download:Et,dx:null,dy:null,edgeMode:null,editable:null,elevation:we,enableBackground:null,end:null,event:null,exponent:we,externalResourcesRequired:null,fill:null,fillOpacity:we,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Tl,g2:Tl,glyphName:Tl,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:we,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:we,horizOriginX:we,horizOriginY:we,id:null,ideographic:we,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:we,k:we,k1:we,k2:we,k3:we,k4:we,kernelMatrix:Jr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:we,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:we,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:we,overlineThickness:we,paintOrder:null,panose1:null,path:null,pathLength:we,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:tn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:we,pointsAtY:we,pointsAtZ:we,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Jr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Jr,rev:Jr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Jr,requiredFeatures:Jr,requiredFonts:Jr,requiredFormats:Jr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:we,specularExponent:we,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:we,strikethroughThickness:we,string:null,stroke:null,strokeDashArray:Jr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:we,strokeOpacity:we,strokeWidth:null,style:null,surfaceScale:we,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Jr,tabIndex:we,tableValues:null,target:null,targetX:we,targetY:we,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Jr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:we,underlineThickness:we,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:we,values:null,vAlphabetic:we,vMathematical:we,vectorEffect:null,vHanging:we,vIdeographic:we,version:null,vertAdvY:we,vertOriginX:we,vertOriginY:we,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:we,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:f3}),p3=Yl({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),m3=Yl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:h3}),g3=Yl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),$j={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Bj=/[A-Z]/g,Vw=/-[a-z]/g,Uj=/^data[-\w.:]+$/i;function Vj(e,t){const n=p1(t);let r=t,i=Ur;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Uj.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Vw,Wj);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Vw.test(o)){let s=o.replace(Bj,Hj);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=Py}return new i(r,t)}function Hj(e){return"-"+e.toLowerCase()}function Wj(e){return e.charAt(1).toUpperCase()}const qj=c3([d3,Lj,p3,m3,g3],"html"),jy=c3([d3,Fj,p3,m3,g3],"svg");function Zj(e){return e.join(" ").trim()}var fl={},B0,Hw;function Jj(){if(Hw)return B0;Hw=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,a=/^\s+|\s+$/g,u=`
210
+ `,d="/",f="*",h="",m="comment",g="declaration";function x(v,C){if(typeof v!="string")throw new TypeError("First argument must be a string");if(!v)return[];C=C||{};var _=1,E=1;function I(he){var Z=he.match(t);Z&&(_+=Z.length);var ge=he.lastIndexOf(u);E=~ge?he.length-ge:E+he.length}function N(){var he={line:_,column:E};return function(Z){return Z.position=new M(he),D(),Z}}function M(he){this.start=he,this.end={line:_,column:E},this.source=C.source}M.prototype.content=v;function F(he){var Z=new Error(C.source+":"+_+":"+E+": "+he);if(Z.reason=he,Z.filename=C.source,Z.line=_,Z.column=E,Z.source=v,!C.silent)throw Z}function R(he){var Z=he.exec(v);if(Z){var ge=Z[0];return I(ge),v=v.slice(ge.length),Z}}function D(){R(n)}function L(he){var Z;for(he=he||[];Z=X();)Z!==!1&&he.push(Z);return he}function X(){var he=N();if(!(d!=v.charAt(0)||f!=v.charAt(1))){for(var Z=2;h!=v.charAt(Z)&&(f!=v.charAt(Z)||d!=v.charAt(Z+1));)++Z;if(Z+=2,h===v.charAt(Z-1))return F("End of comment missing");var ge=v.slice(2,Z-2);return E+=2,I(ge),v=v.slice(Z),E+=2,he({type:m,comment:ge})}}function ee(){var he=N(),Z=R(r);if(Z){if(X(),!R(i))return F("property missing ':'");var ge=R(o),Oe=he({type:g,property:b(Z[0].replace(e,h)),value:ge?b(ge[0].replace(e,h)):h});return R(s),Oe}}function Ie(){var he=[];L(he);for(var Z;Z=ee();)Z!==!1&&(he.push(Z),L(he));return he}return D(),Ie()}function b(v){return v?v.replace(a,h):h}return B0=x,B0}var Ww;function Kj(){if(Ww)return fl;Ww=1;var e=fl&&fl.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(fl,"__esModule",{value:!0}),fl.default=n;const t=e(Jj());function n(r,i){let o=null;if(!r||typeof r!="string")return o;const s=(0,t.default)(r),a=typeof i=="function";return s.forEach(u=>{if(u.type!=="declaration")return;const{property:d,value:f}=u;a?i(d,f,u):f&&(o=o||{},o[d]=f)}),o}return fl}var ju={},qw;function Gj(){if(qw)return ju;qw=1,Object.defineProperty(ju,"__esModule",{value:!0}),ju.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(d){return!d||n.test(d)||e.test(d)},s=function(d,f){return f.toUpperCase()},a=function(d,f){return"".concat(f,"-")},u=function(d,f){return f===void 0&&(f={}),o(d)?d:(d=d.toLowerCase(),f.reactCompat?d=d.replace(i,a):d=d.replace(r,a),d.replace(t,s))};return ju.camelCase=u,ju}var zu,Zw;function Yj(){if(Zw)return zu;Zw=1;var e=zu&&zu.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(Kj()),n=Gj();function r(i,o){var s={};return!i||typeof i!="string"||(0,t.default)(i,function(a,u){a&&u&&(s[(0,n.camelCase)(a,o)]=u)}),s}return r.default=r,zu=r,zu}var Qj=Yj();const Xj=Ra(Qj),y3=x3("end"),zy=x3("start");function x3(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function ez(e){const t=zy(e),n=y3(e);if(t&&n)return{start:t,end:n}}function oc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Jw(e.position):"start"in e||"end"in e?Jw(e):"line"in e||"column"in e?y1(e):""}function y1(e){return Kw(e&&e.line)+":"+Kw(e&&e.column)}function Jw(e){return y1(e&&e.start)+"-"+y1(e&&e.end)}function Kw(e){return e&&typeof e=="number"?e:1}class ur extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?o.ruleId=r:(o.source=r.slice(0,u),o.ruleId=r.slice(u+1))}if(!o.place&&o.ancestors&&o.ancestors){const u=o.ancestors[o.ancestors.length-1];u&&(o.place=u.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=oc(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ur.prototype.file="";ur.prototype.name="";ur.prototype.reason="";ur.prototype.message="";ur.prototype.stack="";ur.prototype.column=void 0;ur.prototype.line=void 0;ur.prototype.ancestors=void 0;ur.prototype.cause=void 0;ur.prototype.fatal=void 0;ur.prototype.place=void 0;ur.prototype.ruleId=void 0;ur.prototype.source=void 0;const Ly={}.hasOwnProperty,tz=new Map,nz=/[A-Z]/g,rz=new Set(["table","tbody","thead","tfoot","tr"]),iz=new Set(["td","th"]),b3="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function oz(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=hz(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=fz(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?jy:qj,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=v3(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function v3(e,t,n){if(t.type==="element")return sz(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return az(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return uz(e,t,n);if(t.type==="mdxjsEsm")return lz(e,t);if(t.type==="root")return cz(e,t,n);if(t.type==="text")return dz(e,t)}function sz(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=jy,e.schema=i),e.ancestors.push(t);const o=w3(e,t.tagName,!1),s=pz(e,t);let a=$y(e,t);return rz.has(t.tagName)&&(a=a.filter(function(u){return typeof u=="string"?!jj(u):!0})),k3(e,s,o,t),Fy(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function az(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Dc(e,t.position)}function lz(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Dc(e,t.position)}function uz(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=jy,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:w3(e,t.name,!0),s=mz(e,t),a=$y(e,t);return k3(e,s,o,t),Fy(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function cz(e,t,n){const r={};return Fy(r,$y(e,t)),e.create(t,e.Fragment,r,n)}function dz(e,t){return t.value}function k3(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Fy(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function fz(e,t,n){return r;function r(i,o,s,a){const d=Array.isArray(s.children)?n:t;return a?d(o,s,a):d(o,s)}}function hz(e,t){return n;function n(r,i,o,s){const a=Array.isArray(o.children),u=zy(r);return t(i,o,s,a,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function pz(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Ly.call(t.properties,i)){const o=gz(e,i,t.properties[i]);if(o){const[s,a]=o;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&iz.has(t.tagName)?r=a:n[s]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function mz(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const s=o.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Dc(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else Dc(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function $y(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:tz;for(;++r<t.children.length;){const o=t.children[r];let s;if(e.passKeys){const u=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(u){const d=i.get(u)||0;s=u+"-"+d,i.set(u,d+1)}}const a=v3(e,o,s);a!==void 0&&n.push(a)}return n}function gz(e,t,n){const r=Vj(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Ij(n):Zj(n)),r.property==="style"){let i=typeof n=="object"?n:yz(e,String(n));return e.stylePropertyNameCase==="css"&&(i=xz(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?$j[r.property]||r.property:r.attribute,n]}}function yz(e,t){try{return Xj(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new ur("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=b3+"#cannot-parse-style-attribute",i}}function w3(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,s;for(;++o<i.length;){const a=$w(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}r=s}else r=$w(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Ly.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Dc(e)}function Dc(e,t){const n=new ur("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=b3+"#cannot-handle-mdx-estrees-without-createevaluater",n}function xz(e){const t={};let n;for(n in e)Ly.call(e,n)&&(t[bz(n)]=e[n]);return t}function bz(e){let t=e.replace(nz,vz);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function vz(e){return"-"+e.toLowerCase()}const U0={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},kz={};function By(e,t){const n=kz,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return C3(e,r,i)}function C3(e,t,n){if(wz(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Gw(e.children,t,n)}return Array.isArray(e)?Gw(e,t,n):""}function Gw(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=C3(e[i],t,n);return r.join("")}function wz(e){return!!(e&&typeof e=="object")}const Yw=document.createElement("i");function Uy(e){const t="&"+e+";";Yw.innerHTML=t;const n=Yw.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Gr(e,t,n,r){const i=e.length;let o=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o<r.length;)s=r.slice(o,o+1e4),s.unshift(t,0),e.splice(...s),o+=1e4,t+=1e4}function mi(e,t){return e.length>0?(Gr(e,e.length,0,t),e):t}const Qw={}.hasOwnProperty;function S3(e){const t={};let n=-1;for(;++n<e.length;)Cz(t,e[n]);return t}function Cz(e,t){let n;for(n in t){const i=(Qw.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let s;if(o)for(s in o){Qw.call(i,s)||(i[s]=[]);const a=o[s];Sz(i[s],Array.isArray(a)?a:a?[a]:[])}}}function Sz(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Gr(e,0,0,r)}function E3(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Li(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const xr=Vs(/[A-Za-z]/),ar=Vs(/[\dA-Za-z]/),Ez=Vs(/[#-'*+\--9=?A-Z^-~]/);function xh(e){return e!==null&&(e<32||e===127)}const x1=Vs(/\d/),_z=Vs(/[\dA-Fa-f]/),Tz=Vs(/[!-/:-@[-`{-~]/);function pt(e){return e!==null&&e<-2}function Qt(e){return e!==null&&(e<0||e===32)}function Rt(e){return e===-2||e===-1||e===32}const Ep=Vs(new RegExp("\\p{P}|\\p{S}","u")),Aa=Vs(/\s/);function Vs(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ql(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let s="";if(o===37&&ar(e.charCodeAt(n+1))&&ar(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(s=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(s=String.fromCharCode(o,a),i=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function $t(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(u){return Rt(u)?(e.enter(n),a(u)):t(u)}function a(u){return Rt(u)&&o++<i?(e.consume(u),a):(e.exit(n),t(u))}}const Az={tokenize:Mz};function Mz(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),$t(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){const u=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return pt(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),s)}}const Nz={tokenize:Iz},Xw={tokenize:Dz};function Iz(e){const t=this,n=[];let r=0,i,o,s;return a;function a(E){if(r<n.length){const I=n[r];return t.containerState=I[1],e.attempt(I[0].continuation,u,d)(E)}return d(E)}function u(E){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&_();const I=t.events.length;let N=I,M;for(;N--;)if(t.events[N][0]==="exit"&&t.events[N][1].type==="chunkFlow"){M=t.events[N][1].end;break}C(r);let F=I;for(;F<t.events.length;)t.events[F][1].end={...M},F++;return Gr(t.events,N+1,0,t.events.slice(I)),t.events.length=F,d(E)}return a(E)}function d(E){if(r===n.length){if(!i)return m(E);if(i.currentConstruct&&i.currentConstruct.concrete)return x(E);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Xw,f,h)(E)}function f(E){return i&&_(),C(r),m(E)}function h(E){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,x(E)}function m(E){return t.containerState={},e.attempt(Xw,g,x)(E)}function g(E){return r++,n.push([t.currentConstruct,t.containerState]),m(E)}function x(E){if(E===null){i&&_(),C(0),e.consume(E);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),b(E)}function b(E){if(E===null){v(e.exit("chunkFlow"),!0),C(0),e.consume(E);return}return pt(E)?(e.consume(E),v(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(E),b)}function v(E,I){const N=t.sliceStream(E);if(I&&N.push(null),E.previous=o,o&&(o.next=E),o=E,i.defineSkip(E.start),i.write(N),t.parser.lazy[E.start.line]){let M=i.events.length;for(;M--;)if(i.events[M][1].start.offset<s&&(!i.events[M][1].end||i.events[M][1].end.offset>s))return;const F=t.events.length;let R=F,D,L;for(;R--;)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){if(D){L=t.events[R][1].end;break}D=!0}for(C(r),M=F;M<t.events.length;)t.events[M][1].end={...L},M++;Gr(t.events,R+1,0,t.events.slice(F)),t.events.length=M}}function C(E){let I=n.length;for(;I-- >E;){const N=n[I];t.containerState=N[1],N[0].exit.call(t,e)}n.length=E}function _(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Dz(e,t,n){return $t(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ll(e){if(e===null||Qt(e)||Aa(e))return 1;if(Ep(e))return 2}function _p(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const b1={name:"attention",resolveAll:Oz,tokenize:Rz};function Oz(e,t){let n=-1,r,i,o,s,a,u,d,f;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;u=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const h={...e[r][1].end},m={...e[n][1].start};e2(h,-u),e2(m,u),s={type:u>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:m},o={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},e[r][1].end={...s.start},e[n][1].start={...a.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=mi(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=mi(d,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),d=mi(d,_p(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=mi(d,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,d=mi(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,Gr(e,r-1,n-r+3,d),n=r+d.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Rz(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Ll(r);let o;return s;function s(u){return o=u,e.enter("attentionSequence"),a(u)}function a(u){if(u===o)return e.consume(u),a;const d=e.exit("attentionSequence"),f=Ll(u),h=!f||f===2&&i||n.includes(u),m=!i||i===2&&f||n.includes(r);return d._open=!!(o===42?h:h&&(i||!m)),d._close=!!(o===42?m:m&&(f||!h)),t(u)}}function e2(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Pz={name:"autolink",tokenize:jz};function jz(e,t,n){let r=0;return i;function i(g){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(g){return xr(g)?(e.consume(g),s):g===64?n(g):d(g)}function s(g){return g===43||g===45||g===46||ar(g)?(r=1,a(g)):d(g)}function a(g){return g===58?(e.consume(g),r=0,u):(g===43||g===45||g===46||ar(g))&&r++<32?(e.consume(g),a):(r=0,d(g))}function u(g){return g===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),t):g===null||g===32||g===60||xh(g)?n(g):(e.consume(g),u)}function d(g){return g===64?(e.consume(g),f):Ez(g)?(e.consume(g),d):n(g)}function f(g){return ar(g)?h(g):n(g)}function h(g){return g===46?(e.consume(g),r=0,f):g===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),t):m(g)}function m(g){if((g===45||ar(g))&&r++<63){const x=g===45?m:h;return e.consume(g),x}return n(g)}}const td={partial:!0,tokenize:zz};function zz(e,t,n){return r;function r(o){return Rt(o)?$t(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||pt(o)?t(o):n(o)}}const _3={continuation:{tokenize:Fz},exit:$z,name:"blockQuote",tokenize:Lz};function Lz(e,t,n){const r=this;return i;function i(s){if(s===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),o}return n(s)}function o(s){return Rt(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function Fz(e,t,n){const r=this;return i;function i(s){return Rt(s)?$t(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt(_3,t,n)(s)}}function $z(e){e.exit("blockQuote")}const T3={name:"characterEscape",tokenize:Bz};function Bz(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return Tz(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const A3={name:"characterReference",tokenize:Uz};function Uz(e,t,n){const r=this;let i=0,o,s;return a;function a(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),u}function u(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),o=31,s=ar,f(h))}function d(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,s=_z,f):(e.enter("characterReferenceValue"),o=7,s=x1,f(h))}function f(h){if(h===59&&i){const m=e.exit("characterReferenceValue");return s===ar&&!Uy(r.sliceSerialize(m))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(h)&&i++<o?(e.consume(h),f):n(h)}}const t2={partial:!0,tokenize:Hz},n2={concrete:!0,name:"codeFenced",tokenize:Vz};function Vz(e,t,n){const r=this,i={partial:!0,tokenize:N};let o=0,s=0,a;return u;function u(M){return d(M)}function d(M){const F=r.events[r.events.length-1];return o=F&&F[1].type==="linePrefix"?F[2].sliceSerialize(F[1],!0).length:0,a=M,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(M)}function f(M){return M===a?(s++,e.consume(M),f):s<3?n(M):(e.exit("codeFencedFenceSequence"),Rt(M)?$t(e,h,"whitespace")(M):h(M))}function h(M){return M===null||pt(M)?(e.exit("codeFencedFence"),r.interrupt?t(M):e.check(t2,b,I)(M)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),m(M))}function m(M){return M===null||pt(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(M)):Rt(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),$t(e,g,"whitespace")(M)):M===96&&M===a?n(M):(e.consume(M),m)}function g(M){return M===null||pt(M)?h(M):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(M))}function x(M){return M===null||pt(M)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(M)):M===96&&M===a?n(M):(e.consume(M),x)}function b(M){return e.attempt(i,I,v)(M)}function v(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),C}function C(M){return o>0&&Rt(M)?$t(e,_,"linePrefix",o+1)(M):_(M)}function _(M){return M===null||pt(M)?e.check(t2,b,I)(M):(e.enter("codeFlowValue"),E(M))}function E(M){return M===null||pt(M)?(e.exit("codeFlowValue"),_(M)):(e.consume(M),E)}function I(M){return e.exit("codeFenced"),t(M)}function N(M,F,R){let D=0;return L;function L(Z){return M.enter("lineEnding"),M.consume(Z),M.exit("lineEnding"),X}function X(Z){return M.enter("codeFencedFence"),Rt(Z)?$t(M,ee,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Z):ee(Z)}function ee(Z){return Z===a?(M.enter("codeFencedFenceSequence"),Ie(Z)):R(Z)}function Ie(Z){return Z===a?(D++,M.consume(Z),Ie):D>=s?(M.exit("codeFencedFenceSequence"),Rt(Z)?$t(M,he,"whitespace")(Z):he(Z)):R(Z)}function he(Z){return Z===null||pt(Z)?(M.exit("codeFencedFence"),F(Z)):R(Z)}}}function Hz(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const V0={name:"codeIndented",tokenize:qz},Wz={partial:!0,tokenize:Zz};function qz(e,t,n){const r=this;return i;function i(d){return e.enter("codeIndented"),$t(e,o,"linePrefix",5)(d)}function o(d){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?s(d):n(d)}function s(d){return d===null?u(d):pt(d)?e.attempt(Wz,s,u)(d):(e.enter("codeFlowValue"),a(d))}function a(d){return d===null||pt(d)?(e.exit("codeFlowValue"),s(d)):(e.consume(d),a)}function u(d){return e.exit("codeIndented"),t(d)}}function Zz(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):pt(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):$t(e,o,"linePrefix",5)(s)}function o(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):pt(s)?i(s):n(s)}}const Jz={name:"codeText",previous:Gz,resolve:Kz,tokenize:Yz};function Kz(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Gz(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Yz(e,t,n){let r=0,i,o;return s;function s(h){return e.enter("codeText"),e.enter("codeTextSequence"),a(h)}function a(h){return h===96?(e.consume(h),r++,a):(e.exit("codeTextSequence"),u(h))}function u(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),u):h===96?(o=e.enter("codeTextSequence"),i=0,f(h)):pt(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),u):(e.enter("codeTextData"),d(h))}function d(h){return h===null||h===32||h===96||pt(h)?(e.exit("codeTextData"),u(h)):(e.consume(h),d)}function f(h){return h===96?(e.consume(h),i++,f):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(o.type="codeTextData",d(h))}}class Qz{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Lu(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Lu(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Lu(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Lu(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Lu(this.left,n.reverse())}}}function Lu(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function M3(e){const t={};let n=-1,r,i,o,s,a,u,d;const f=new Qz(e);for(;++n<f.length;){for(;n in t;)n=t[n];if(r=f.get(n),n&&r[1].type==="chunkFlow"&&f.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,o=0,o<u.length&&u[o][1].type==="lineEndingBlank"&&(o+=2),o<u.length&&u[o][1].type==="content"))for(;++o<u.length&&u[o][1].type!=="content";)u[o][1].type==="chunkText"&&(u[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,Xz(f,n)),n=t[n],d=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(s=f.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(r[1].end={...f.get(i)[1].start},a=f.slice(i,n),a.unshift(r),f.splice(i,n-i+1,a))}}return Gr(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!d}function Xz(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const a=s.events,u=[],d={};let f,h,m=-1,g=n,x=0,b=0;const v=[b];for(;g;){for(;e.get(++i)[1]!==g;);o.push(i),g._tokenizer||(f=r.sliceStream(g),g.next||f.push(null),h&&s.defineSkip(g.start),g._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(f),g._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),h=g,g=g.next}for(g=n;++m<a.length;)a[m][0]==="exit"&&a[m-1][0]==="enter"&&a[m][1].type===a[m-1][1].type&&a[m][1].start.line!==a[m][1].end.line&&(b=m+1,v.push(b),g._tokenizer=void 0,g.previous=void 0,g=g.next);for(s.events=[],g?(g._tokenizer=void 0,g.previous=void 0):v.pop(),m=v.length;m--;){const C=a.slice(v[m],v[m+1]),_=o.pop();u.push([_,_+C.length-1]),e.splice(_,2,C)}for(u.reverse(),m=-1;++m<u.length;)d[x+u[m][0]]=x+u[m][1],x+=u[m][1]-u[m][0]-1;return d}const eL={resolve:nL,tokenize:rL},tL={partial:!0,tokenize:iL};function nL(e){return M3(e),e}function rL(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):pt(a)?e.check(tL,s,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function iL(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),$t(e,o,"linePrefix")}function o(s){if(s===null||pt(s))return n(s);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function N3(e,t,n,r,i,o,s,a,u){const d=u||Number.POSITIVE_INFINITY;let f=0;return h;function h(C){return C===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(C),e.exit(o),m):C===null||C===32||C===41||xh(C)?n(C):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),b(C))}function m(C){return C===62?(e.enter(o),e.consume(C),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),g(C))}function g(C){return C===62?(e.exit("chunkString"),e.exit(a),m(C)):C===null||C===60||pt(C)?n(C):(e.consume(C),C===92?x:g)}function x(C){return C===60||C===62||C===92?(e.consume(C),g):g(C)}function b(C){return!f&&(C===null||C===41||Qt(C))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(C)):f<d&&C===40?(e.consume(C),f++,b):C===41?(e.consume(C),f--,b):C===null||C===32||C===40||xh(C)?n(C):(e.consume(C),C===92?v:b)}function v(C){return C===40||C===41||C===92?(e.consume(C),b):b(C)}}function I3(e,t,n,r,i,o){const s=this;let a=0,u;return d;function d(g){return e.enter(r),e.enter(i),e.consume(g),e.exit(i),e.enter(o),f}function f(g){return a>999||g===null||g===91||g===93&&!u||g===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(g):g===93?(e.exit(o),e.enter(i),e.consume(g),e.exit(i),e.exit(r),t):pt(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),h(g))}function h(g){return g===null||g===91||g===93||pt(g)||a++>999?(e.exit("chunkString"),f(g)):(e.consume(g),u||(u=!Rt(g)),g===92?m:h)}function m(g){return g===91||g===92||g===93?(e.consume(g),a++,h):h(g)}}function D3(e,t,n,r,i,o){let s;return a;function a(m){return m===34||m===39||m===40?(e.enter(r),e.enter(i),e.consume(m),e.exit(i),s=m===40?41:m,u):n(m)}function u(m){return m===s?(e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):(e.enter(o),d(m))}function d(m){return m===s?(e.exit(o),u(s)):m===null?n(m):pt(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),$t(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(m))}function f(m){return m===s||m===null||pt(m)?(e.exit("chunkString"),d(m)):(e.consume(m),m===92?h:f)}function h(m){return m===s||m===92?(e.consume(m),f):f(m)}}function sc(e,t){let n;return r;function r(i){return pt(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Rt(i)?$t(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const oL={name:"definition",tokenize:aL},sL={partial:!0,tokenize:lL};function aL(e,t,n){const r=this;let i;return o;function o(g){return e.enter("definition"),s(g)}function s(g){return I3.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function a(g){return i=Li(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),u):n(g)}function u(g){return Qt(g)?sc(e,d)(g):d(g)}function d(g){return N3(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function f(g){return e.attempt(sL,h,h)(g)}function h(g){return Rt(g)?$t(e,m,"whitespace")(g):m(g)}function m(g){return g===null||pt(g)?(e.exit("definition"),r.parser.defined.push(i),t(g)):n(g)}}function lL(e,t,n){return r;function r(a){return Qt(a)?sc(e,i)(a):n(a)}function i(a){return D3(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return Rt(a)?$t(e,s,"whitespace")(a):s(a)}function s(a){return a===null||pt(a)?t(a):n(a)}}const uL={name:"hardBreakEscape",tokenize:cL};function cL(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return pt(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const dL={name:"headingAtx",resolve:fL,tokenize:hL};function fL(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Gr(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function hL(e,t,n){let r=0;return i;function i(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),s(f)}function s(f){return f===35&&r++<6?(e.consume(f),s):f===null||Qt(f)?(e.exit("atxHeadingSequence"),a(f)):n(f)}function a(f){return f===35?(e.enter("atxHeadingSequence"),u(f)):f===null||pt(f)?(e.exit("atxHeading"),t(f)):Rt(f)?$t(e,a,"whitespace")(f):(e.enter("atxHeadingText"),d(f))}function u(f){return f===35?(e.consume(f),u):(e.exit("atxHeadingSequence"),a(f))}function d(f){return f===null||f===35||Qt(f)?(e.exit("atxHeadingText"),a(f)):(e.consume(f),d)}}const pL=["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"],r2=["pre","script","style","textarea"],mL={concrete:!0,name:"htmlFlow",resolveTo:xL,tokenize:bL},gL={partial:!0,tokenize:kL},yL={partial:!0,tokenize:vL};function xL(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function bL(e,t,n){const r=this;let i,o,s,a,u;return d;function d(P){return f(P)}function f(P){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(P),h}function h(P){return P===33?(e.consume(P),m):P===47?(e.consume(P),o=!0,b):P===63?(e.consume(P),i=3,r.interrupt?t:O):xr(P)?(e.consume(P),s=String.fromCharCode(P),v):n(P)}function m(P){return P===45?(e.consume(P),i=2,g):P===91?(e.consume(P),i=5,a=0,x):xr(P)?(e.consume(P),i=4,r.interrupt?t:O):n(P)}function g(P){return P===45?(e.consume(P),r.interrupt?t:O):n(P)}function x(P){const Ze="CDATA[";return P===Ze.charCodeAt(a++)?(e.consume(P),a===Ze.length?r.interrupt?t:ee:x):n(P)}function b(P){return xr(P)?(e.consume(P),s=String.fromCharCode(P),v):n(P)}function v(P){if(P===null||P===47||P===62||Qt(P)){const Ze=P===47,V=s.toLowerCase();return!Ze&&!o&&r2.includes(V)?(i=1,r.interrupt?t(P):ee(P)):pL.includes(s.toLowerCase())?(i=6,Ze?(e.consume(P),C):r.interrupt?t(P):ee(P)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(P):o?_(P):E(P))}return P===45||ar(P)?(e.consume(P),s+=String.fromCharCode(P),v):n(P)}function C(P){return P===62?(e.consume(P),r.interrupt?t:ee):n(P)}function _(P){return Rt(P)?(e.consume(P),_):L(P)}function E(P){return P===47?(e.consume(P),L):P===58||P===95||xr(P)?(e.consume(P),I):Rt(P)?(e.consume(P),E):L(P)}function I(P){return P===45||P===46||P===58||P===95||ar(P)?(e.consume(P),I):N(P)}function N(P){return P===61?(e.consume(P),M):Rt(P)?(e.consume(P),N):E(P)}function M(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(e.consume(P),u=P,F):Rt(P)?(e.consume(P),M):R(P)}function F(P){return P===u?(e.consume(P),u=null,D):P===null||pt(P)?n(P):(e.consume(P),F)}function R(P){return P===null||P===34||P===39||P===47||P===60||P===61||P===62||P===96||Qt(P)?N(P):(e.consume(P),R)}function D(P){return P===47||P===62||Rt(P)?E(P):n(P)}function L(P){return P===62?(e.consume(P),X):n(P)}function X(P){return P===null||pt(P)?ee(P):Rt(P)?(e.consume(P),X):n(P)}function ee(P){return P===45&&i===2?(e.consume(P),ge):P===60&&i===1?(e.consume(P),Oe):P===62&&i===4?(e.consume(P),W):P===63&&i===3?(e.consume(P),O):P===93&&i===5?(e.consume(P),qe):pt(P)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(gL,ie,Ie)(P)):P===null||pt(P)?(e.exit("htmlFlowData"),Ie(P)):(e.consume(P),ee)}function Ie(P){return e.check(yL,he,ie)(P)}function he(P){return e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),Z}function Z(P){return P===null||pt(P)?Ie(P):(e.enter("htmlFlowData"),ee(P))}function ge(P){return P===45?(e.consume(P),O):ee(P)}function Oe(P){return P===47?(e.consume(P),s="",Y):ee(P)}function Y(P){if(P===62){const Ze=s.toLowerCase();return r2.includes(Ze)?(e.consume(P),W):ee(P)}return xr(P)&&s.length<8?(e.consume(P),s+=String.fromCharCode(P),Y):ee(P)}function qe(P){return P===93?(e.consume(P),O):ee(P)}function O(P){return P===62?(e.consume(P),W):P===45&&i===2?(e.consume(P),O):ee(P)}function W(P){return P===null||pt(P)?(e.exit("htmlFlowData"),ie(P)):(e.consume(P),W)}function ie(P){return e.exit("htmlFlow"),t(P)}}function vL(e,t,n){const r=this;return i;function i(s){return pt(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function kL(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(td,t,n)}}const wL={name:"htmlText",tokenize:CL};function CL(e,t,n){const r=this;let i,o,s;return a;function a(O){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(O),u}function u(O){return O===33?(e.consume(O),d):O===47?(e.consume(O),N):O===63?(e.consume(O),E):xr(O)?(e.consume(O),R):n(O)}function d(O){return O===45?(e.consume(O),f):O===91?(e.consume(O),o=0,x):xr(O)?(e.consume(O),_):n(O)}function f(O){return O===45?(e.consume(O),g):n(O)}function h(O){return O===null?n(O):O===45?(e.consume(O),m):pt(O)?(s=h,Oe(O)):(e.consume(O),h)}function m(O){return O===45?(e.consume(O),g):h(O)}function g(O){return O===62?ge(O):O===45?m(O):h(O)}function x(O){const W="CDATA[";return O===W.charCodeAt(o++)?(e.consume(O),o===W.length?b:x):n(O)}function b(O){return O===null?n(O):O===93?(e.consume(O),v):pt(O)?(s=b,Oe(O)):(e.consume(O),b)}function v(O){return O===93?(e.consume(O),C):b(O)}function C(O){return O===62?ge(O):O===93?(e.consume(O),C):b(O)}function _(O){return O===null||O===62?ge(O):pt(O)?(s=_,Oe(O)):(e.consume(O),_)}function E(O){return O===null?n(O):O===63?(e.consume(O),I):pt(O)?(s=E,Oe(O)):(e.consume(O),E)}function I(O){return O===62?ge(O):E(O)}function N(O){return xr(O)?(e.consume(O),M):n(O)}function M(O){return O===45||ar(O)?(e.consume(O),M):F(O)}function F(O){return pt(O)?(s=F,Oe(O)):Rt(O)?(e.consume(O),F):ge(O)}function R(O){return O===45||ar(O)?(e.consume(O),R):O===47||O===62||Qt(O)?D(O):n(O)}function D(O){return O===47?(e.consume(O),ge):O===58||O===95||xr(O)?(e.consume(O),L):pt(O)?(s=D,Oe(O)):Rt(O)?(e.consume(O),D):ge(O)}function L(O){return O===45||O===46||O===58||O===95||ar(O)?(e.consume(O),L):X(O)}function X(O){return O===61?(e.consume(O),ee):pt(O)?(s=X,Oe(O)):Rt(O)?(e.consume(O),X):D(O)}function ee(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),i=O,Ie):pt(O)?(s=ee,Oe(O)):Rt(O)?(e.consume(O),ee):(e.consume(O),he)}function Ie(O){return O===i?(e.consume(O),i=void 0,Z):O===null?n(O):pt(O)?(s=Ie,Oe(O)):(e.consume(O),Ie)}function he(O){return O===null||O===34||O===39||O===60||O===61||O===96?n(O):O===47||O===62||Qt(O)?D(O):(e.consume(O),he)}function Z(O){return O===47||O===62||Qt(O)?D(O):n(O)}function ge(O){return O===62?(e.consume(O),e.exit("htmlTextData"),e.exit("htmlText"),t):n(O)}function Oe(O){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),Y}function Y(O){return Rt(O)?$t(e,qe,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):qe(O)}function qe(O){return e.enter("htmlTextData"),s(O)}}const Vy={name:"labelEnd",resolveAll:TL,resolveTo:AL,tokenize:ML},SL={tokenize:NL},EL={tokenize:IL},_L={tokenize:DL};function TL(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Gr(e,0,e.length,n),e}function AL(e,t){let n=e.length,r=0,i,o,s,a;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const u={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[o][1].start},end:{...e[s][1].end}},f={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[s-2][1].start}};return a=[["enter",u,t],["enter",d,t]],a=mi(a,e.slice(o+1,o+r+3)),a=mi(a,[["enter",f,t]]),a=mi(a,_p(t.parser.constructs.insideSpan.null,e.slice(o+r+4,s-3),t)),a=mi(a,[["exit",f,t],e[s-2],e[s-1],["exit",d,t]]),a=mi(a,e.slice(s+1)),a=mi(a,[["exit",u,t]]),Gr(e,o,e.length,a),e}function ML(e,t,n){const r=this;let i=r.events.length,o,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(m){return o?o._inactive?h(m):(s=r.parser.defined.includes(Li(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(m),e.exit("labelMarker"),e.exit("labelEnd"),u):n(m)}function u(m){return m===40?e.attempt(SL,f,s?f:h)(m):m===91?e.attempt(EL,f,s?d:h)(m):s?f(m):h(m)}function d(m){return e.attempt(_L,f,h)(m)}function f(m){return t(m)}function h(m){return o._balanced=!0,n(m)}}function NL(e,t,n){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),i}function i(h){return Qt(h)?sc(e,o)(h):o(h)}function o(h){return h===41?f(h):N3(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function s(h){return Qt(h)?sc(e,u)(h):f(h)}function a(h){return n(h)}function u(h){return h===34||h===39||h===40?D3(e,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):f(h)}function d(h){return Qt(h)?sc(e,f)(h):f(h)}function f(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function IL(e,t,n){const r=this;return i;function i(a){return I3.call(r,e,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(Li(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function DL(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const OL={name:"labelStartImage",resolveAll:Vy.resolveAll,tokenize:RL};function RL(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const PL={name:"labelStartLink",resolveAll:Vy.resolveAll,tokenize:jL};function jL(e,t,n){const r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const H0={name:"lineEnding",tokenize:zL};function zL(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),$t(e,t,"linePrefix")}}const Kf={name:"thematicBreak",tokenize:LL};function LL(e,t,n){let r=0,i;return o;function o(d){return e.enter("thematicBreak"),s(d)}function s(d){return i=d,a(d)}function a(d){return d===i?(e.enter("thematicBreakSequence"),u(d)):r>=3&&(d===null||pt(d))?(e.exit("thematicBreak"),t(d)):n(d)}function u(d){return d===i?(e.consume(d),r++,u):(e.exit("thematicBreakSequence"),Rt(d)?$t(e,a,"whitespace")(d):a(d))}}const jr={continuation:{tokenize:UL},exit:HL,name:"list",tokenize:BL},FL={partial:!0,tokenize:WL},$L={partial:!0,tokenize:VL};function BL(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(g){const x=r.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||g===r.containerState.marker:x1(g)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),g===42||g===45?e.check(Kf,n,d)(g):d(g);if(!r.interrupt||g===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(g)}return n(g)}function u(g){return x1(g)&&++s<10?(e.consume(g),u):(!r.interrupt||s<2)&&(r.containerState.marker?g===r.containerState.marker:g===41||g===46)?(e.exit("listItemValue"),d(g)):n(g)}function d(g){return e.enter("listItemMarker"),e.consume(g),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||g,e.check(td,r.interrupt?n:f,e.attempt(FL,m,h))}function f(g){return r.containerState.initialBlankLine=!0,o++,m(g)}function h(g){return Rt(g)?(e.enter("listItemPrefixWhitespace"),e.consume(g),e.exit("listItemPrefixWhitespace"),m):n(g)}function m(g){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(g)}}function UL(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(td,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,$t(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!Rt(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt($L,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,$t(e,e.attempt(jr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function VL(e,t,n){const r=this;return $t(e,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function HL(e){e.exit(this.containerState.type)}function WL(e,t,n){const r=this;return $t(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!Rt(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const i2={name:"setextUnderline",resolveTo:qL,tokenize:ZL};function qL(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function ZL(e,t,n){const r=this;let i;return o;function o(d){let f=r.events.length,h;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){h=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),i=d,s(d)):n(d)}function s(d){return e.enter("setextHeadingLineSequence"),a(d)}function a(d){return d===i?(e.consume(d),a):(e.exit("setextHeadingLineSequence"),Rt(d)?$t(e,u,"lineSuffix")(d):u(d))}function u(d){return d===null||pt(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const JL={tokenize:KL};function KL(e){const t=this,n=e.attempt(td,r,e.attempt(this.parser.constructs.flowInitial,i,$t(e,e.attempt(this.parser.constructs.flow,i,e.attempt(eL,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const GL={resolveAll:R3()},YL=O3("string"),QL=O3("text");function O3(e){return{resolveAll:R3(e==="text"?XL:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,s,a);return s;function s(f){return d(f)?o(f):a(f)}function a(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),u}function u(f){return d(f)?(n.exit("data"),o(f)):(n.consume(f),u)}function d(f){if(f===null)return!0;const h=i[f];let m=-1;if(h)for(;++m<h.length;){const g=h[m];if(!g.previous||g.previous.call(r,r.previous))return!0}return!1}}}function R3(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function XL(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,s=-1,a=0,u;for(;o--;){const d=i[o];if(typeof d=="string"){for(s=d.length;d.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(d===-2)u=!0,a++;else if(d!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const d={type:n===e.length||u||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?s:r.start._bufferIndex+s,_index:r.start._index+o,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...d.start},r.start.offset===r.end.offset?Object.assign(r,d):(e.splice(n,0,["enter",d,t],["exit",d,t]),n+=2)}n++}return e}const eF={42:jr,43:jr,45:jr,48:jr,49:jr,50:jr,51:jr,52:jr,53:jr,54:jr,55:jr,56:jr,57:jr,62:_3},tF={91:oL},nF={[-2]:V0,[-1]:V0,32:V0},rF={35:dL,42:Kf,45:[i2,Kf],60:mL,61:i2,95:Kf,96:n2,126:n2},iF={38:A3,92:T3},oF={[-5]:H0,[-4]:H0,[-3]:H0,33:OL,38:A3,42:b1,60:[Pz,wL],91:PL,92:[uL,T3],93:Vy,95:b1,96:Jz},sF={null:[b1,GL]},aF={null:[42,95]},lF={null:[]},uF=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:aF,contentInitial:tF,disable:lF,document:eF,flow:rF,flowInitial:nF,insideSpan:sF,string:iF,text:oF},Symbol.toStringTag,{value:"Module"}));function cF(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let s=[],a=[];const u={attempt:F(N),check:F(M),consume:_,enter:E,exit:I,interrupt:F(M,{interrupt:!0})},d={code:null,containerState:{},defineSkip:b,events:[],now:x,parser:e,previous:null,sliceSerialize:m,sliceStream:g,write:h};let f=t.tokenize.call(d,u);return t.resolveAll&&o.push(t),d;function h(X){return s=mi(s,X),v(),s[s.length-1]!==null?[]:(R(t,0),d.events=_p(o,d.events,d),d.events)}function m(X,ee){return fF(g(X),ee)}function g(X){return dF(s,X)}function x(){const{_bufferIndex:X,_index:ee,line:Ie,column:he,offset:Z}=r;return{_bufferIndex:X,_index:ee,line:Ie,column:he,offset:Z}}function b(X){i[X.line]=X.column,L()}function v(){let X;for(;r._index<s.length;){const ee=s[r._index];if(typeof ee=="string")for(X=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===X&&r._bufferIndex<ee.length;)C(ee.charCodeAt(r._bufferIndex));else C(ee)}}function C(X){f=f(X)}function _(X){pt(X)?(r.line++,r.column=1,r.offset+=X===-3?2:1,L()):X!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=X}function E(X,ee){const Ie=ee||{};return Ie.type=X,Ie.start=x(),d.events.push(["enter",Ie,d]),a.push(Ie),Ie}function I(X){const ee=a.pop();return ee.end=x(),d.events.push(["exit",ee,d]),ee}function N(X,ee){R(X,ee.from)}function M(X,ee){ee.restore()}function F(X,ee){return Ie;function Ie(he,Z,ge){let Oe,Y,qe,O;return Array.isArray(he)?ie(he):"tokenize"in he?ie([he]):W(he);function W(Re){return pe;function pe(Pe){const je=Pe!==null&&Re[Pe],$e=Pe!==null&&Re.null,qt=[...Array.isArray(je)?je:je?[je]:[],...Array.isArray($e)?$e:$e?[$e]:[]];return ie(qt)(Pe)}}function ie(Re){return Oe=Re,Y=0,Re.length===0?ge:P(Re[Y])}function P(Re){return pe;function pe(Pe){return O=D(),qe=Re,Re.partial||(d.currentConstruct=Re),Re.name&&d.parser.constructs.disable.null.includes(Re.name)?V():Re.tokenize.call(ee?Object.assign(Object.create(d),ee):d,u,Ze,V)(Pe)}}function Ze(Re){return X(qe,O),Z}function V(Re){return O.restore(),++Y<Oe.length?P(Oe[Y]):ge}}}function R(X,ee){X.resolveAll&&!o.includes(X)&&o.push(X),X.resolve&&Gr(d.events,ee,d.events.length-ee,X.resolve(d.events.slice(ee),d)),X.resolveTo&&(d.events=X.resolveTo(d.events,d))}function D(){const X=x(),ee=d.previous,Ie=d.currentConstruct,he=d.events.length,Z=Array.from(a);return{from:he,restore:ge};function ge(){r=X,d.previous=ee,d.currentConstruct=Ie,d.events.length=he,a=Z,L()}}function L(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function dF(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,o)];else{if(s=e.slice(n,i),r>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function fF(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
211
+ `;break}case-3:{s=`\r
212
+ `;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,r.push(s)}return r.join("")}function hF(e){const r={constructs:S3([uF,...(e||{}).extensions||[]]),content:i(Az),defined:[],document:i(Nz),flow:i(JL),lazy:{},string:i(YL),text:i(QL)};return r;function i(o){return s;function s(a){return cF(r,o,a)}}}function pF(e){for(;!M3(e););return e}const o2=/[\0\t\n\r]/g;function mF(){let e=1,t="",n=!0,r;return i;function i(o,s,a){const u=[];let d,f,h,m,g;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),h=0,t="",n&&(o.charCodeAt(0)===65279&&h++,n=void 0);h<o.length;){if(o2.lastIndex=h,d=o2.exec(o),m=d&&d.index!==void 0?d.index:o.length,g=o.charCodeAt(m),!d){t=o.slice(h);break}if(g===10&&h===m&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),h<m&&(u.push(o.slice(h,m)),e+=m-h),g){case 0:{u.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,u.push(-2);e++<f;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}h=m+1}return a&&(r&&u.push(-5),t&&u.push(t),u.push(null)),u}}const gF=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function yF(e){return e.replace(gF,xF)}function xF(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return E3(n.slice(o?2:1),o?16:10)}return Uy(n)||e}const P3={}.hasOwnProperty;function bF(e,t,n){return typeof t!="string"&&(n=t,t=void 0),vF(n)(pF(hF(n).document().write(mF()(e,t,!0))))}function vF(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Sr),autolinkProtocol:D,autolinkEmail:D,atxHeading:o(Zs),blockQuote:o($e),characterEscape:D,characterReference:D,codeFenced:o(qt),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(qt,s),codeText:o(Pn,s),codeTextData:D,data:D,codeFlowValue:D,definition:o(ni),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(uo),hardBreakEscape:o(Js),hardBreakTrailing:o(Js),htmlFlow:o(co,s),htmlFlowData:D,htmlText:o(co,s),htmlTextData:D,image:o(fo),label:s,link:o(Sr),listItem:o(Er),listItemValue:m,listOrdered:o(wi,h),listUnordered:o(wi),paragraph:o(ri),reference:P,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(Zs),strong:o(Ks),thematicBreak:o(ho)},exit:{atxHeading:u(),atxHeadingSequence:N,autolink:u(),autolinkEmail:je,autolinkProtocol:Pe,blockQuote:u(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:V,characterReferenceMarkerNumeric:V,characterReferenceValue:Re,characterReference:pe,codeFenced:u(v),codeFencedFence:b,codeFencedFenceInfo:g,codeFencedFenceMeta:x,codeFlowValue:L,codeIndented:u(C),codeText:u(Z),codeTextData:L,data:L,definition:u(),definitionDestinationString:I,definitionLabelString:_,definitionTitleString:E,emphasis:u(),hardBreakEscape:u(ee),hardBreakTrailing:u(ee),htmlFlow:u(Ie),htmlFlowData:L,htmlText:u(he),htmlTextData:L,image:u(Oe),label:qe,labelText:Y,lineEnding:X,link:u(ge),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:Ze,resourceDestinationString:O,resourceTitleString:W,resource:ie,setextHeading:u(R),setextHeadingLineSequence:F,setextHeadingText:M,strong:u(),thematicBreak:u()}};j3(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ne){let _e={type:"root",children:[]};const dt={stack:[_e],tokenStack:[],config:t,enter:a,exit:d,buffer:s,resume:f,data:n},_t=[];let jt=-1;for(;++jt<ne.length;)if(ne[jt][1].type==="listOrdered"||ne[jt][1].type==="listUnordered")if(ne[jt][0]==="enter")_t.push(jt);else{const jn=_t.pop();jt=i(ne,jn,jt)}for(jt=-1;++jt<ne.length;){const jn=t[ne[jt][0]];P3.call(jn,ne[jt][1].type)&&jn[ne[jt][1].type].call(Object.assign({sliceSerialize:ne[jt][2].sliceSerialize},dt),ne[jt][1])}if(dt.tokenStack.length>0){const jn=dt.tokenStack[dt.tokenStack.length-1];(jn[1]||s2).call(dt,void 0,jn[0])}for(_e.position={start:us(ne.length>0?ne[0][1].start:{line:1,column:1,offset:0}),end:us(ne.length>0?ne[ne.length-2][1].end:{line:1,column:1,offset:0})},jt=-1;++jt<t.transforms.length;)_e=t.transforms[jt](_e)||_e;return _e}function i(ne,_e,dt){let _t=_e-1,jt=-1,jn=!1,Ci,Tr,$i,po;for(;++_t<=dt;){const zn=ne[_t];switch(zn[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{zn[0]==="enter"?jt++:jt--,po=void 0;break}case"lineEndingBlank":{zn[0]==="enter"&&(Ci&&!po&&!jt&&!$i&&($i=_t),po=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:po=void 0}if(!jt&&zn[0]==="enter"&&zn[1].type==="listItemPrefix"||jt===-1&&zn[0]==="exit"&&(zn[1].type==="listUnordered"||zn[1].type==="listOrdered")){if(Ci){let ii=_t;for(Tr=void 0;ii--;){const dr=ne[ii];if(dr[1].type==="lineEnding"||dr[1].type==="lineEndingBlank"){if(dr[0]==="exit")continue;Tr&&(ne[Tr][1].type="lineEndingBlank",jn=!0),dr[1].type="lineEnding",Tr=ii}else if(!(dr[1].type==="linePrefix"||dr[1].type==="blockQuotePrefix"||dr[1].type==="blockQuotePrefixWhitespace"||dr[1].type==="blockQuoteMarker"||dr[1].type==="listItemIndent"))break}$i&&(!Tr||$i<Tr)&&(Ci._spread=!0),Ci.end=Object.assign({},Tr?ne[Tr][1].start:zn[1].end),ne.splice(Tr||_t,0,["exit",Ci,zn[2]]),_t++,dt++}if(zn[1].type==="listItemPrefix"){const ii={type:"listItem",_spread:!1,start:Object.assign({},zn[1].start),end:void 0};Ci=ii,ne.splice(_t,0,["enter",ii,zn[2]]),_t++,dt++,$i=void 0,po=!0}}}return ne[_e][1]._spread=jn,dt}function o(ne,_e){return dt;function dt(_t){a.call(this,ne(_t),_t),_e&&_e.call(this,_t)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(ne,_e,dt){this.stack[this.stack.length-1].children.push(ne),this.stack.push(ne),this.tokenStack.push([_e,dt||void 0]),ne.position={start:us(_e.start),end:void 0}}function u(ne){return _e;function _e(dt){ne&&ne.call(this,dt),d.call(this,dt)}}function d(ne,_e){const dt=this.stack.pop(),_t=this.tokenStack.pop();if(_t)_t[0].type!==ne.type&&(_e?_e.call(this,ne,_t[0]):(_t[1]||s2).call(this,ne,_t[0]));else throw new Error("Cannot close `"+ne.type+"` ("+oc({start:ne.start,end:ne.end})+"): it’s not open");dt.position.end=us(ne.end)}function f(){return By(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function m(ne){if(this.data.expectingFirstListItemValue){const _e=this.stack[this.stack.length-2];_e.start=Number.parseInt(this.sliceSerialize(ne),10),this.data.expectingFirstListItemValue=void 0}}function g(){const ne=this.resume(),_e=this.stack[this.stack.length-1];_e.lang=ne}function x(){const ne=this.resume(),_e=this.stack[this.stack.length-1];_e.meta=ne}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){const ne=this.resume(),_e=this.stack[this.stack.length-1];_e.value=ne.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function C(){const ne=this.resume(),_e=this.stack[this.stack.length-1];_e.value=ne.replace(/(\r?\n|\r)$/g,"")}function _(ne){const _e=this.resume(),dt=this.stack[this.stack.length-1];dt.label=_e,dt.identifier=Li(this.sliceSerialize(ne)).toLowerCase()}function E(){const ne=this.resume(),_e=this.stack[this.stack.length-1];_e.title=ne}function I(){const ne=this.resume(),_e=this.stack[this.stack.length-1];_e.url=ne}function N(ne){const _e=this.stack[this.stack.length-1];if(!_e.depth){const dt=this.sliceSerialize(ne).length;_e.depth=dt}}function M(){this.data.setextHeadingSlurpLineEnding=!0}function F(ne){const _e=this.stack[this.stack.length-1];_e.depth=this.sliceSerialize(ne).codePointAt(0)===61?1:2}function R(){this.data.setextHeadingSlurpLineEnding=void 0}function D(ne){const dt=this.stack[this.stack.length-1].children;let _t=dt[dt.length-1];(!_t||_t.type!=="text")&&(_t=_r(),_t.position={start:us(ne.start),end:void 0},dt.push(_t)),this.stack.push(_t)}function L(ne){const _e=this.stack.pop();_e.value+=this.sliceSerialize(ne),_e.position.end=us(ne.end)}function X(ne){const _e=this.stack[this.stack.length-1];if(this.data.atHardBreak){const dt=_e.children[_e.children.length-1];dt.position.end=us(ne.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(_e.type)&&(D.call(this,ne),L.call(this,ne))}function ee(){this.data.atHardBreak=!0}function Ie(){const ne=this.resume(),_e=this.stack[this.stack.length-1];_e.value=ne}function he(){const ne=this.resume(),_e=this.stack[this.stack.length-1];_e.value=ne}function Z(){const ne=this.resume(),_e=this.stack[this.stack.length-1];_e.value=ne}function ge(){const ne=this.stack[this.stack.length-1];if(this.data.inReference){const _e=this.data.referenceType||"shortcut";ne.type+="Reference",ne.referenceType=_e,delete ne.url,delete ne.title}else delete ne.identifier,delete ne.label;this.data.referenceType=void 0}function Oe(){const ne=this.stack[this.stack.length-1];if(this.data.inReference){const _e=this.data.referenceType||"shortcut";ne.type+="Reference",ne.referenceType=_e,delete ne.url,delete ne.title}else delete ne.identifier,delete ne.label;this.data.referenceType=void 0}function Y(ne){const _e=this.sliceSerialize(ne),dt=this.stack[this.stack.length-2];dt.label=yF(_e),dt.identifier=Li(_e).toLowerCase()}function qe(){const ne=this.stack[this.stack.length-1],_e=this.resume(),dt=this.stack[this.stack.length-1];if(this.data.inReference=!0,dt.type==="link"){const _t=ne.children;dt.children=_t}else dt.alt=_e}function O(){const ne=this.resume(),_e=this.stack[this.stack.length-1];_e.url=ne}function W(){const ne=this.resume(),_e=this.stack[this.stack.length-1];_e.title=ne}function ie(){this.data.inReference=void 0}function P(){this.data.referenceType="collapsed"}function Ze(ne){const _e=this.resume(),dt=this.stack[this.stack.length-1];dt.label=_e,dt.identifier=Li(this.sliceSerialize(ne)).toLowerCase(),this.data.referenceType="full"}function V(ne){this.data.characterReferenceType=ne.type}function Re(ne){const _e=this.sliceSerialize(ne),dt=this.data.characterReferenceType;let _t;dt?(_t=E3(_e,dt==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):_t=Uy(_e);const jt=this.stack[this.stack.length-1];jt.value+=_t}function pe(ne){const _e=this.stack.pop();_e.position.end=us(ne.end)}function Pe(ne){L.call(this,ne);const _e=this.stack[this.stack.length-1];_e.url=this.sliceSerialize(ne)}function je(ne){L.call(this,ne);const _e=this.stack[this.stack.length-1];_e.url="mailto:"+this.sliceSerialize(ne)}function $e(){return{type:"blockquote",children:[]}}function qt(){return{type:"code",lang:null,meta:null,value:""}}function Pn(){return{type:"inlineCode",value:""}}function ni(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function uo(){return{type:"emphasis",children:[]}}function Zs(){return{type:"heading",depth:0,children:[]}}function Js(){return{type:"break"}}function co(){return{type:"html",value:""}}function fo(){return{type:"image",title:null,url:"",alt:null}}function Sr(){return{type:"link",title:null,url:"",children:[]}}function wi(ne){return{type:"list",ordered:ne.type==="listOrdered",start:null,spread:ne._spread,children:[]}}function Er(ne){return{type:"listItem",spread:ne._spread,checked:null,children:[]}}function ri(){return{type:"paragraph",children:[]}}function Ks(){return{type:"strong",children:[]}}function _r(){return{type:"text",value:""}}function ho(){return{type:"thematicBreak"}}}function us(e){return{line:e.line,column:e.column,offset:e.offset}}function j3(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?j3(e,r):kF(e,r)}}function kF(e,t){let n;for(n in t)if(P3.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function s2(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+oc({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+oc({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+oc({start:t.start,end:t.end})+") is still open")}function wF(e){const t=this;t.parser=n;function n(r){return bF(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function CF(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function SF(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
213
+ `}]}function EF(e,t){const n=t.value?t.value+`
214
+ `:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function _F(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function TF(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function AF(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Ql(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let s,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=o+1,a+=1,e.footnoteCounts.set(r,a);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,u);const d={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,d),e.applyData(t,d)}function MF(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function NF(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function z3(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function IF(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return z3(e,t);const i={src:Ql(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function DF(e,t){const n={src:Ql(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function OF(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function RF(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return z3(e,t);const i={href:Ql(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function PF(e,t){const n={href:Ql(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function jF(e,t,n){const r=e.all(t),i=n?zF(n):L3(t),o={},s=[];if(typeof t.checked=="boolean"){const f=r[0];let h;f&&f.type==="element"&&f.tagName==="p"?h=f:(h={type:"element",tagName:"p",properties:{},children:[]},r.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const f=r[a];(i||a!==0||f.type!=="element"||f.tagName!=="p")&&s.push({type:"text",value:`
215
+ `}),f.type==="element"&&f.tagName==="p"&&!i?s.push(...f.children):s.push(f)}const u=r[r.length-1];u&&(i||u.type!=="element"||u.tagName!=="p")&&s.push({type:"text",value:`
216
+ `});const d={type:"element",tagName:"li",properties:o,children:s};return e.patch(t,d),e.applyData(t,d)}function zF(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=L3(n[r])}return t}function L3(e){const t=e.spread;return t??e.children.length>1}function LF(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const s=r[i];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function FF(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $F(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function BF(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function UF(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=zy(t.children[1]),u=y3(t.children[t.children.length-1]);a&&u&&(s.position={start:a,end:u}),i.push(s)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function VF(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:t.children.length;let u=-1;const d=[];for(;++u<a;){const h=t.children[u],m={},g=s?s[u]:void 0;g&&(m.align=g);let x={type:"element",tagName:o,properties:m,children:[]};h&&(x.children=e.all(h),e.patch(h,x),x=e.applyData(h,x)),d.push(x)}const f={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(t,f),e.applyData(t,f)}function HF(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const a2=9,l2=32;function WF(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(u2(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(u2(t.slice(i),i>0,!1)),o.join("")}function u2(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===a2||o===l2;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===a2||o===l2;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function qF(e,t){const n={type:"text",value:WF(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function ZF(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const JF={blockquote:CF,break:SF,code:EF,delete:_F,emphasis:TF,footnoteReference:AF,heading:MF,html:NF,imageReference:IF,image:DF,inlineCode:OF,linkReference:RF,link:PF,listItem:jF,list:LF,paragraph:FF,root:$F,strong:BF,table:UF,tableCell:HF,tableRow:VF,text:qF,thematicBreak:ZF,toml:Ef,yaml:Ef,definition:Ef,footnoteDefinition:Ef};function Ef(){}const F3=-1,Tp=0,ac=1,bh=2,Hy=3,Wy=4,qy=5,Zy=6,$3=7,B3=8,c2=typeof self=="object"?self:globalThis,KF=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,s]=t[i];switch(o){case Tp:case F3:return n(s,i);case ac:{const a=n([],i);for(const u of s)a.push(r(u));return a}case bh:{const a=n({},i);for(const[u,d]of s)a[r(u)]=r(d);return a}case Hy:return n(new Date(s),i);case Wy:{const{source:a,flags:u}=s;return n(new RegExp(a,u),i)}case qy:{const a=n(new Map,i);for(const[u,d]of s)a.set(r(u),r(d));return a}case Zy:{const a=n(new Set,i);for(const u of s)a.add(r(u));return a}case $3:{const{name:a,message:u}=s;return n(new c2[a](u),i)}case B3:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:a}=new Uint8Array(s);return n(new DataView(a),s)}}return n(new c2[o](s),i)};return r},d2=e=>KF(new Map,e)(0),hl="",{toString:GF}={},{keys:YF}=Object,Fu=e=>{const t=typeof e;if(t!=="object"||!e)return[Tp,t];const n=GF.call(e).slice(8,-1);switch(n){case"Array":return[ac,hl];case"Object":return[bh,hl];case"Date":return[Hy,hl];case"RegExp":return[Wy,hl];case"Map":return[qy,hl];case"Set":return[Zy,hl];case"DataView":return[ac,n]}return n.includes("Array")?[ac,n]:n.includes("Error")?[$3,n]:[bh,n]},_f=([e,t])=>e===Tp&&(t==="function"||t==="symbol"),QF=(e,t,n,r)=>{const i=(s,a)=>{const u=r.push(s)-1;return n.set(a,u),u},o=s=>{if(n.has(s))return n.get(s);let[a,u]=Fu(s);switch(a){case Tp:{let f=s;switch(u){case"bigint":a=B3,f=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);f=null;break;case"undefined":return i([F3],s)}return i([a,f],s)}case ac:{if(u){let m=s;return u==="DataView"?m=new Uint8Array(s.buffer):u==="ArrayBuffer"&&(m=new Uint8Array(s)),i([u,[...m]],s)}const f=[],h=i([a,f],s);for(const m of s)f.push(o(m));return h}case bh:{if(u)switch(u){case"BigInt":return i([u,s.toString()],s);case"Boolean":case"Number":case"String":return i([u,s.valueOf()],s)}if(t&&"toJSON"in s)return o(s.toJSON());const f=[],h=i([a,f],s);for(const m of YF(s))(e||!_f(Fu(s[m])))&&f.push([o(m),o(s[m])]);return h}case Hy:return i([a,s.toISOString()],s);case Wy:{const{source:f,flags:h}=s;return i([a,{source:f,flags:h}],s)}case qy:{const f=[],h=i([a,f],s);for(const[m,g]of s)(e||!(_f(Fu(m))||_f(Fu(g))))&&f.push([o(m),o(g)]);return h}case Zy:{const f=[],h=i([a,f],s);for(const m of s)(e||!_f(Fu(m)))&&f.push(o(m));return h}}const{message:d}=s;return i([a,{name:u,message:d}],s)};return o},f2=(e,{json:t,lossy:n}={})=>{const r=[];return QF(!(t||n),!!t,new Map,r)(e),r},vh=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?d2(f2(e,t)):structuredClone(e):(e,t)=>d2(f2(e,t));function XF(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function e7(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function t7(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||XF,r=e.options.footnoteBackLabel||e7,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let u=-1;for(;++u<e.footnoteOrder.length;){const d=e.footnoteById.get(e.footnoteOrder[u]);if(!d)continue;const f=e.all(d),h=String(d.identifier).toUpperCase(),m=Ql(h.toLowerCase());let g=0;const x=[],b=e.footnoteCounts.get(h);for(;b!==void 0&&++g<=b;){x.length>0&&x.push({type:"text",value:" "});let _=typeof n=="string"?n:n(u,g);typeof _=="string"&&(_={type:"text",value:_}),x.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+m+(g>1?"-"+g:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,g),className:["data-footnote-backref"]},children:Array.isArray(_)?_:[_]})}const v=f[f.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const _=v.children[v.children.length-1];_&&_.type==="text"?_.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...x)}else f.push(...x);const C={type:"element",tagName:"li",properties:{id:t+"fn-"+m},children:e.wrap(f,!0)};e.patch(d,C),a.push(C)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...vh(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
217
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
218
+ `}]}}const Ap=(function(e){if(e==null)return o7;if(typeof e=="function")return Mp(e);if(typeof e=="object")return Array.isArray(e)?n7(e):r7(e);if(typeof e=="string")return i7(e);throw new Error("Expected function, string, or object as test")});function n7(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Ap(e[n]);return Mp(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function r7(e){const t=e;return Mp(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function i7(e){return Mp(t);function t(n){return n&&n.type===e}}function Mp(e){return t;function t(n,r,i){return!!(s7(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function o7(){return!0}function s7(e){return e!==null&&typeof e=="object"&&"type"in e}const U3=[],a7=!0,v1=!1,l7="skip";function V3(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=Ap(i),s=r?-1:1;a(e,void 0,[])();function a(u,d,f){const h=u&&typeof u=="object"?u:{};if(typeof h.type=="string"){const g=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(m,"name",{value:"node ("+(u.type+(g?"<"+g+">":""))+")"})}return m;function m(){let g=U3,x,b,v;if((!t||o(u,d,f[f.length-1]||void 0))&&(g=u7(n(u,f)),g[0]===v1))return g;if("children"in u&&u.children){const C=u;if(C.children&&g[0]!==l7)for(b=(r?C.children.length:-1)+s,v=f.concat(C);b>-1&&b<C.children.length;){const _=C.children[b];if(x=a(_,b,v)(),x[0]===v1)return x;b=typeof x[1]=="number"?x[1]:b+s}}return g}}}function u7(e){return Array.isArray(e)?e:typeof e=="number"?[a7,e]:e==null?U3:[e]}function Jy(e,t,n,r){let i,o,s;typeof t=="function"&&typeof n!="function"?(o=void 0,s=t,i=n):(o=t,s=n,i=r),V3(e,o,a,i);function a(u,d){const f=d[d.length-1],h=f?f.children.indexOf(u):void 0;return s(u,h,f)}}const k1={}.hasOwnProperty,c7={};function d7(e,t){const n=t||c7,r=new Map,i=new Map,o=new Map,s={...JF,...n.handlers},a={all:d,applyData:h7,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:s,one:u,options:n,patch:f7,wrap:m7};return Jy(e,function(f){if(f.type==="definition"||f.type==="footnoteDefinition"){const h=f.type==="definition"?r:i,m=String(f.identifier).toUpperCase();h.has(m)||h.set(m,f)}}),a;function u(f,h){const m=f.type,g=a.handlers[m];if(k1.call(a.handlers,m)&&g)return g(a,f,h);if(a.options.passThrough&&a.options.passThrough.includes(m)){if("children"in f){const{children:b,...v}=f,C=vh(v);return C.children=a.all(f),C}return vh(f)}return(a.options.unknownHandler||p7)(a,f,h)}function d(f){const h=[];if("children"in f){const m=f.children;let g=-1;for(;++g<m.length;){const x=a.one(m[g],f);if(x){if(g&&m[g-1].type==="break"&&(!Array.isArray(x)&&x.type==="text"&&(x.value=h2(x.value)),!Array.isArray(x)&&x.type==="element")){const b=x.children[0];b&&b.type==="text"&&(b.value=h2(b.value))}Array.isArray(x)?h.push(...x):h.push(x)}}}return h}}function f7(e,t){e.position&&(t.position=ez(e))}function h7(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&o&&Object.assign(n.properties,vh(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function p7(e,t){const n=t.data||{},r="value"in t&&!(k1.call(n,"hProperties")||k1.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function m7(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
219
+ `});++r<e.length;)r&&n.push({type:"text",value:`
220
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
221
+ `}),n}function h2(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function p2(e,t){const n=d7(e,t),r=n.one(e,void 0),i=t7(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
222
+ `},i),o}function g7(e,t){return e&&"run"in e?async function(n,r){const i=p2(n,{file:r,...t});await e.run(i,r)}:function(n,r){return p2(n,{file:r,...e||t})}}function m2(e){if(e)throw e}var W0,g2;function y7(){if(g2)return W0;g2=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(d){return typeof Array.isArray=="function"?Array.isArray(d):t.call(d)==="[object Array]"},o=function(d){if(!d||t.call(d)!=="[object Object]")return!1;var f=e.call(d,"constructor"),h=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!f&&!h)return!1;var m;for(m in d);return typeof m>"u"||e.call(d,m)},s=function(d,f){n&&f.name==="__proto__"?n(d,f.name,{enumerable:!0,configurable:!0,value:f.newValue,writable:!0}):d[f.name]=f.newValue},a=function(d,f){if(f==="__proto__")if(e.call(d,f)){if(r)return r(d,f).value}else return;return d[f]};return W0=function u(){var d,f,h,m,g,x,b=arguments[0],v=1,C=arguments.length,_=!1;for(typeof b=="boolean"&&(_=b,b=arguments[1]||{},v=2),(b==null||typeof b!="object"&&typeof b!="function")&&(b={});v<C;++v)if(d=arguments[v],d!=null)for(f in d)h=a(b,f),m=a(d,f),b!==m&&(_&&m&&(o(m)||(g=i(m)))?(g?(g=!1,x=h&&i(h)?h:[]):x=h&&o(h)?h:{},s(b,{name:f,newValue:u(_,x,m)})):typeof m<"u"&&s(b,{name:f,newValue:m}));return b},W0}var x7=y7();const q0=Ra(x7);function w1(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function b7(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...i);function a(u,...d){const f=e[++o];let h=-1;if(u){s(u);return}for(;++h<i.length;)(d[h]===null||d[h]===void 0)&&(d[h]=i[h]);i=d,f?v7(f,a)(...d):s(null,...d)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function v7(e,t){let n;return r;function r(...s){const a=e.length>s.length;let u;a&&s.push(i);try{u=e.apply(this,s)}catch(d){const f=d;if(a&&n)throw f;return i(f)}a||(u&&u.then&&typeof u.then=="function"?u.then(o,i):u instanceof Error?i(u):o(u))}function i(s,...a){n||(n=!0,t(s,...a))}function o(s){i(null,s)}}const qi={basename:k7,dirname:w7,extname:C7,join:S7,sep:"/"};function k7(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');nd(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function w7(e){if(nd(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function C7(e){nd(e);let t=e.length,n=-1,r=0,i=-1,o=0,s;for(;t--;){const a=e.codePointAt(t);if(a===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function S7(...e){let t=-1,n;for(;++t<e.length;)nd(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":E7(n)}function E7(e){nd(e);const t=e.codePointAt(0)===47;let n=_7(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function _7(e,t){let n="",r=0,i=-1,o=0,s=-1,a,u;for(;++s<=e.length;){if(s<e.length)a=e.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(i===s-1||o===1))if(i!==s-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,o=0}else a===46&&o>-1?o++:o=-1}return n}function nd(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const T7={cwd:A7};function A7(){return"/"}function C1(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function M7(e){if(typeof e=="string")e=new URL(e);else if(!C1(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return N7(e)}function N7(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Z0=["history","path","basename","stem","extname","dirname"];class H3{constructor(t){let n;t?C1(t)?n={path:t}:typeof t=="string"||I7(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":T7.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Z0.length;){const o=Z0[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)Z0.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?qi.basename(this.path):void 0}set basename(t){K0(t,"basename"),J0(t,"basename"),this.path=qi.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?qi.dirname(this.path):void 0}set dirname(t){y2(this.basename,"dirname"),this.path=qi.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?qi.extname(this.path):void 0}set extname(t){if(J0(t,"extname"),y2(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=qi.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){C1(t)&&(t=M7(t)),K0(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?qi.basename(this.path,this.extname):void 0}set stem(t){K0(t,"stem"),J0(t,"stem"),this.path=qi.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new ur(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function J0(e,t){if(e&&e.includes(qi.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+qi.sep+"`")}function K0(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function y2(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function I7(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const D7=(function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o}),O7={}.hasOwnProperty;class Ky extends D7{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=b7()}copy(){const t=new Ky;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(q0(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Q0("data",this.frozen),this.namespace[t]=n,this):O7.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Q0("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Tf(t),r=this.parser||this.Parser;return G0("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),G0("process",this.parser||this.Parser),Y0("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,s){const a=Tf(t),u=r.parse(a);r.run(u,a,function(f,h,m){if(f||!h||!m)return d(f);const g=h,x=r.stringify(g,m);j7(x)?m.value=x:m.result=x,d(f,m)});function d(f,h){f||!h?s(f):o?o(h):n(void 0,h)}}}processSync(t){let n=!1,r;return this.freeze(),G0("processSync",this.parser||this.Parser),Y0("processSync",this.compiler||this.Compiler),this.process(t,i),b2("processSync","process",n),r;function i(o,s){n=!0,m2(o),r=s}}run(t,n,r){x2(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(s,a){const u=Tf(n);i.run(t,u,d);function d(f,h,m){const g=h||t;f?a(f):s?s(g):r(void 0,g,m)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),b2("runSync","run",r),i;function o(s,a){m2(s),i=a,r=!0}}stringify(t,n){this.freeze();const r=Tf(n),i=this.compiler||this.Compiler;return Y0("stringify",i),x2(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Q0("use",this.frozen),t!=null)if(typeof t=="function")u(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(d){if(typeof d=="function")u(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[f,...h]=d;u(f,h)}else s(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function s(d){if(!("plugins"in d)&&!("settings"in d))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(d.plugins),d.settings&&(i.settings=q0(!0,i.settings,d.settings))}function a(d){let f=-1;if(d!=null)if(Array.isArray(d))for(;++f<d.length;){const h=d[f];o(h)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function u(d,f){let h=-1,m=-1;for(;++h<r.length;)if(r[h][0]===d){m=h;break}if(m===-1)r.push([d,...f]);else if(f.length>0){let[g,...x]=f;const b=r[m][1];w1(b)&&w1(g)&&(g=q0(!0,b,g)),r[m]=[d,g,...x]}}}}const R7=new Ky().freeze();function G0(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Y0(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Q0(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function x2(e){if(!w1(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function b2(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Tf(e){return P7(e)?e:new H3(e)}function P7(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function j7(e){return typeof e=="string"||z7(e)}function z7(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const L7="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",v2=[],k2={allowDangerousHtml:!0},F7=/^(https?|ircs?|mailto|xmpp)$/i,$7=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function lc(e){const t=B7(e),n=U7(e);return V7(t.runSync(t.parse(n),n),e)}function B7(e){const t=e.rehypePlugins||v2,n=e.remarkPlugins||v2,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...k2}:k2;return R7().use(wF).use(n).use(g7,r).use(t)}function U7(e){const t=e.children||"",n=new H3;return typeof t=="string"&&(n.value=t),n}function V7(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,s=t.skipHtml,a=t.unwrapDisallowed,u=t.urlTransform||H7;for(const f of $7)Object.hasOwn(t,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+L7+f.id,void 0);return Jy(e,d),oz(e,{Fragment:w.Fragment,components:i,ignoreInvalidStyle:!0,jsx:w.jsx,jsxs:w.jsxs,passKeys:!0,passNode:!0});function d(f,h,m){if(f.type==="raw"&&m&&typeof h=="number")return s?m.children.splice(h,1):m.children[h]={type:"text",value:f.value},h;if(f.type==="element"){let g;for(g in U0)if(Object.hasOwn(U0,g)&&Object.hasOwn(f.properties,g)){const x=f.properties[g],b=U0[g];(b===null||b.includes(f.tagName))&&(f.properties[g]=u(String(x||""),g,f))}}if(f.type==="element"){let g=n?!n.includes(f.tagName):o?o.includes(f.tagName):!1;if(!g&&r&&typeof h=="number"&&(g=!r(f,h,m)),g&&m&&typeof h=="number")return a&&f.children?m.children.splice(h,1,...f.children):m.children.splice(h,1),h}}}function H7(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||F7.test(e.slice(0,t))?e:""}function w2(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function W7(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function q7(e,t,n){const i=Ap((n||{}).ignore||[]),o=Z7(t);let s=-1;for(;++s<o.length;)V3(e,"text",a);function a(d,f){let h=-1,m;for(;++h<f.length;){const g=f[h],x=m?m.children:void 0;if(i(g,x?x.indexOf(g):void 0,m))return;m=g}if(m)return u(d,f)}function u(d,f){const h=f[f.length-1],m=o[s][0],g=o[s][1];let x=0;const v=h.children.indexOf(d);let C=!1,_=[];m.lastIndex=0;let E=m.exec(d.value);for(;E;){const I=E.index,N={index:E.index,input:E.input,stack:[...f,d]};let M=g(...E,N);if(typeof M=="string"&&(M=M.length>0?{type:"text",value:M}:void 0),M===!1?m.lastIndex=I+1:(x!==I&&_.push({type:"text",value:d.value.slice(x,I)}),Array.isArray(M)?_.push(...M):M&&_.push(M),x=I+E[0].length,C=!0),!m.global)break;E=m.exec(d.value)}return C?(x<d.value.length&&_.push({type:"text",value:d.value.slice(x)}),h.children.splice(v,1,..._)):_=[d],v+_.length}}function Z7(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([J7(i[0]),K7(i[1])])}return t}function J7(e){return typeof e=="string"?new RegExp(W7(e),"g"):e}function K7(e){return typeof e=="function"?e:function(){return e}}const X0="phrasing",eg=["autolink","link","image","label"];function G7(){return{transforms:[r$],enter:{literalAutolink:Q7,literalAutolinkEmail:tg,literalAutolinkHttp:tg,literalAutolinkWww:tg},exit:{literalAutolink:n$,literalAutolinkEmail:t$,literalAutolinkHttp:X7,literalAutolinkWww:e$}}}function Y7(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:X0,notInConstruct:eg},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:X0,notInConstruct:eg},{character:":",before:"[ps]",after:"\\/",inConstruct:X0,notInConstruct:eg}]}}function Q7(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function tg(e){this.config.enter.autolinkProtocol.call(this,e)}function X7(e){this.config.exit.autolinkProtocol.call(this,e)}function e$(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function t$(e){this.config.exit.autolinkEmail.call(this,e)}function n$(e){this.exit(e)}function r$(e){q7(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,i$],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),o$]],{ignore:["link","linkReference"]})}function i$(e,t,n,r,i){let o="";if(!W3(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!s$(n)))return!1;const s=a$(n+r);if(!s[0])return!1;const a={type:"link",title:null,url:o+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[a,{type:"text",value:s[1]}]:a}function o$(e,t,n,r){return!W3(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function s$(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function a$(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=w2(e,"(");let o=w2(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function W3(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Aa(n)||Ep(n))&&(!t||n!==47)}q3.peek=g$;function l$(){this.buffer()}function u$(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function c$(){this.buffer()}function d$(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function f$(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Li(this.sliceSerialize(e)).toLowerCase(),n.label=t}function h$(e){this.exit(e)}function p$(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Li(this.sliceSerialize(e)).toLowerCase(),n.label=t}function m$(e){this.exit(e)}function g$(){return"["}function q3(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const s=n.enter("footnoteReference"),a=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),a(),s(),o+=i.move("]"),o}function y$(){return{enter:{gfmFootnoteCallString:l$,gfmFootnoteCall:u$,gfmFootnoteDefinitionLabelString:c$,gfmFootnoteDefinition:d$},exit:{gfmFootnoteCallString:f$,gfmFootnoteCall:h$,gfmFootnoteDefinitionLabelString:p$,gfmFootnoteDefinition:m$}}}function x$(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:q3},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,s){const a=o.createTracker(s);let u=a.move("[^");const d=o.enter("footnoteDefinition"),f=o.enter("label");return u+=a.move(o.safe(o.associationId(r),{before:u,after:"]"})),f(),u+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),u+=a.move((t?`
223
+ `:" ")+o.indentLines(o.containerFlow(r,a.current()),t?Z3:b$))),d(),u}}function b$(e,t,n){return t===0?e:Z3(e,t,n)}function Z3(e,t,n){return(n?"":" ")+e}const v$=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];J3.peek=E$;function k$(){return{canContainEols:["delete"],enter:{strikethrough:C$},exit:{strikethrough:S$}}}function w$(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:v$}],handlers:{delete:J3}}}function C$(e){this.enter({type:"delete",children:[]},e)}function S$(e){this.exit(e)}function J3(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let s=i.move("~~");return s+=n.containerPhrasing(e,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),o(),s}function E$(){return"~"}function _$(e){return e.length}function T$(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||_$,o=[],s=[],a=[],u=[];let d=0,f=-1;for(;++f<e.length;){const b=[],v=[];let C=-1;for(e[f].length>d&&(d=e[f].length);++C<e[f].length;){const _=A$(e[f][C]);if(n.alignDelimiters!==!1){const E=i(_);v[C]=E,(u[C]===void 0||E>u[C])&&(u[C]=E)}b.push(_)}s[f]=b,a[f]=v}let h=-1;if(typeof r=="object"&&"length"in r)for(;++h<d;)o[h]=C2(r[h]);else{const b=C2(r);for(;++h<d;)o[h]=b}h=-1;const m=[],g=[];for(;++h<d;){const b=o[h];let v="",C="";b===99?(v=":",C=":"):b===108?v=":":b===114&&(C=":");let _=n.alignDelimiters===!1?1:Math.max(1,u[h]-v.length-C.length);const E=v+"-".repeat(_)+C;n.alignDelimiters!==!1&&(_=v.length+_+C.length,_>u[h]&&(u[h]=_),g[h]=_),m[h]=E}s.splice(1,0,m),a.splice(1,0,g),f=-1;const x=[];for(;++f<s.length;){const b=s[f],v=a[f];h=-1;const C=[];for(;++h<d;){const _=b[h]||"";let E="",I="";if(n.alignDelimiters!==!1){const N=u[h]-(v[h]||0),M=o[h];M===114?E=" ".repeat(N):M===99?N%2?(E=" ".repeat(N/2+.5),I=" ".repeat(N/2-.5)):(E=" ".repeat(N/2),I=E):I=" ".repeat(N)}n.delimiterStart!==!1&&!h&&C.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&_==="")&&(n.delimiterStart!==!1||h)&&C.push(" "),n.alignDelimiters!==!1&&C.push(E),C.push(_),n.alignDelimiters!==!1&&C.push(I),n.padding!==!1&&C.push(" "),(n.delimiterEnd!==!1||h!==d-1)&&C.push("|")}x.push(n.delimiterEnd===!1?C.join("").replace(/ +$/,""):C.join(""))}return x.join(`
224
+ `)}function A$(e){return e==null?"":String(e)}function C2(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function M$(e,t,n,r){const i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const s=n.indentLines(n.containerFlow(e,o.current()),N$);return i(),s}function N$(e,t,n){return">"+(n?"":" ")+e}function I$(e,t){return S2(e,t.inConstruct,!0)&&!S2(e,t.notInConstruct,!1)}function S2(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function E2(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
225
+ `&&I$(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
226
+ `}function D$(e,t){const n=String(e);let r=n.indexOf(t),i=r,o=0,s=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>s&&(s=o):o=1,i=r+t.length,r=n.indexOf(t,i);return s}function O$(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function R$(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function P$(e,t,n,r){const i=R$(n),o=e.value||"",s=i==="`"?"GraveAccent":"Tilde";if(O$(e,n)){const h=n.enter("codeIndented"),m=n.indentLines(o,j$);return h(),m}const a=n.createTracker(r),u=i.repeat(Math.max(D$(o,i)+1,3)),d=n.enter("codeFenced");let f=a.move(u);if(e.lang){const h=n.enter(`codeFencedLang${s}`);f+=a.move(n.safe(e.lang,{before:f,after:" ",encode:["`"],...a.current()})),h()}if(e.lang&&e.meta){const h=n.enter(`codeFencedMeta${s}`);f+=a.move(" "),f+=a.move(n.safe(e.meta,{before:f,after:`
227
+ `,encode:["`"],...a.current()})),h()}return f+=a.move(`
228
+ `),o&&(f+=a.move(o+`
229
+ `)),f+=a.move(u),d(),f}function j$(e,t,n){return(n?"":" ")+e}function Gy(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function z$(e,t,n,r){const i=Gy(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("definition");let a=n.enter("label");const u=n.createTracker(r);let d=u.move("[");return d+=u.move(n.safe(n.associationId(e),{before:d,after:"]",...u.current()})),d+=u.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),d+=u.move("<"),d+=u.move(n.safe(e.url,{before:d,after:">",...u.current()})),d+=u.move(">")):(a=n.enter("destinationRaw"),d+=u.move(n.safe(e.url,{before:d,after:e.title?" ":`
230
+ `,...u.current()}))),a(),e.title&&(a=n.enter(`title${o}`),d+=u.move(" "+i),d+=u.move(n.safe(e.title,{before:d,after:i,...u.current()})),d+=u.move(i),a()),s(),d}function L$(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Oc(e){return"&#x"+e.toString(16).toUpperCase()+";"}function kh(e,t,n){const r=Ll(e),i=Ll(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}K3.peek=F$;function K3(e,t,n,r){const i=L$(n),o=n.enter("emphasis"),s=n.createTracker(r),a=s.move(i);let u=s.move(n.containerPhrasing(e,{after:i,before:a,...s.current()}));const d=u.charCodeAt(0),f=kh(r.before.charCodeAt(r.before.length-1),d,i);f.inside&&(u=Oc(d)+u.slice(1));const h=u.charCodeAt(u.length-1),m=kh(r.after.charCodeAt(0),h,i);m.inside&&(u=u.slice(0,-1)+Oc(h));const g=s.move(i);return o(),n.attentionEncodeSurroundingInfo={after:m.outside,before:f.outside},a+u+g}function F$(e,t,n){return n.options.emphasis||"*"}function $$(e,t){let n=!1;return Jy(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,v1}),!!((!e.depth||e.depth<3)&&By(e)&&(t.options.setext||n))}function B$(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if($$(e,n)){const f=n.enter("headingSetext"),h=n.enter("phrasing"),m=n.containerPhrasing(e,{...o.current(),before:`
231
+ `,after:`
232
+ `});return h(),f(),m+`
233
+ `+(i===1?"=":"-").repeat(m.length-(Math.max(m.lastIndexOf("\r"),m.lastIndexOf(`
234
+ `))+1))}const s="#".repeat(i),a=n.enter("headingAtx"),u=n.enter("phrasing");o.move(s+" ");let d=n.containerPhrasing(e,{before:"# ",after:`
235
+ `,...o.current()});return/^[\t ]/.test(d)&&(d=Oc(d.charCodeAt(0))+d.slice(1)),d=d?s+" "+d:s,n.options.closeAtx&&(d+=" "+s),u(),a(),d}G3.peek=U$;function G3(e){return e.value||""}function U$(){return"<"}Y3.peek=V$;function Y3(e,t,n,r){const i=Gy(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("image");let a=n.enter("label");const u=n.createTracker(r);let d=u.move("![");return d+=u.move(n.safe(e.alt,{before:d,after:"]",...u.current()})),d+=u.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),d+=u.move("<"),d+=u.move(n.safe(e.url,{before:d,after:">",...u.current()})),d+=u.move(">")):(a=n.enter("destinationRaw"),d+=u.move(n.safe(e.url,{before:d,after:e.title?" ":")",...u.current()}))),a(),e.title&&(a=n.enter(`title${o}`),d+=u.move(" "+i),d+=u.move(n.safe(e.title,{before:d,after:i,...u.current()})),d+=u.move(i),a()),d+=u.move(")"),s(),d}function V$(){return"!"}Q3.peek=H$;function Q3(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let s=n.enter("label");const a=n.createTracker(r);let u=a.move("![");const d=n.safe(e.alt,{before:u,after:"]",...a.current()});u+=a.move(d+"]["),s();const f=n.stack;n.stack=[],s=n.enter("reference");const h=n.safe(n.associationId(e),{before:u,after:"]",...a.current()});return s(),n.stack=f,o(),i==="full"||!d||d!==h?u+=a.move(h+"]"):i==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function H$(){return"!"}X3.peek=W$;function X3(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){const s=n.unsafe[o],a=n.compilePattern(s);let u;if(s.atBreak)for(;u=a.exec(r);){let d=u.index;r.charCodeAt(d)===10&&r.charCodeAt(d-1)===13&&d--,r=r.slice(0,d)+" "+r.slice(u.index+1)}}return i+r+i}function W$(){return"`"}function e4(e,t){const n=By(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}t4.peek=q$;function t4(e,t,n,r){const i=Gy(n),o=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let a,u;if(e4(e,n)){const f=n.stack;n.stack=[],a=n.enter("autolink");let h=s.move("<");return h+=s.move(n.containerPhrasing(e,{before:h,after:">",...s.current()})),h+=s.move(">"),a(),n.stack=f,h}a=n.enter("link"),u=n.enter("label");let d=s.move("[");return d+=s.move(n.containerPhrasing(e,{before:d,after:"](",...s.current()})),d+=s.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),d+=s.move("<"),d+=s.move(n.safe(e.url,{before:d,after:">",...s.current()})),d+=s.move(">")):(u=n.enter("destinationRaw"),d+=s.move(n.safe(e.url,{before:d,after:e.title?" ":")",...s.current()}))),u(),e.title&&(u=n.enter(`title${o}`),d+=s.move(" "+i),d+=s.move(n.safe(e.title,{before:d,after:i,...s.current()})),d+=s.move(i),u()),d+=s.move(")"),a(),d}function q$(e,t,n){return e4(e,n)?"<":"["}n4.peek=Z$;function n4(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let s=n.enter("label");const a=n.createTracker(r);let u=a.move("[");const d=n.containerPhrasing(e,{before:u,after:"]",...a.current()});u+=a.move(d+"]["),s();const f=n.stack;n.stack=[],s=n.enter("reference");const h=n.safe(n.associationId(e),{before:u,after:"]",...a.current()});return s(),n.stack=f,o(),i==="full"||!d||d!==h?u+=a.move(h+"]"):i==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function Z$(){return"["}function Yy(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function J$(e){const t=Yy(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function K$(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function r4(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function G$(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let s=e.ordered?K$(n):Yy(n);const a=e.ordered?s==="."?")":".":J$(n);let u=t&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!e.ordered){const f=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&f&&(!f.children||!f.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(u=!0),r4(n)===s&&f){let h=-1;for(;++h<e.children.length;){const m=e.children[h];if(m&&m.type==="listItem"&&m.children&&m.children[0]&&m.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(s=a),n.bulletCurrent=s;const d=n.containerFlow(e,r);return n.bulletLastUsed=s,n.bulletCurrent=o,i(),d}function Y$(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function Q$(e,t,n,r){const i=Y$(n);let o=n.bulletCurrent||Yy(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let s=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);const a=n.createTracker(r);a.move(o+" ".repeat(s-o.length)),a.shift(s);const u=n.enter("listItem"),d=n.indentLines(n.containerFlow(e,a.current()),f);return u(),d;function f(h,m,g){return m?(g?"":" ".repeat(s))+h:(g?o:o+" ".repeat(s-o.length))+h}}function X$(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),s=n.containerPhrasing(e,r);return o(),i(),s}const eB=Ap(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function tB(e,t,n,r){return(e.children.some(function(s){return eB(s)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function nB(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}i4.peek=rB;function i4(e,t,n,r){const i=nB(n),o=n.enter("strong"),s=n.createTracker(r),a=s.move(i+i);let u=s.move(n.containerPhrasing(e,{after:i,before:a,...s.current()}));const d=u.charCodeAt(0),f=kh(r.before.charCodeAt(r.before.length-1),d,i);f.inside&&(u=Oc(d)+u.slice(1));const h=u.charCodeAt(u.length-1),m=kh(r.after.charCodeAt(0),h,i);m.inside&&(u=u.slice(0,-1)+Oc(h));const g=s.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:m.outside,before:f.outside},a+u+g}function rB(e,t,n){return n.options.strong||"*"}function iB(e,t,n,r){return n.safe(e.value,r)}function oB(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function sB(e,t,n){const r=(r4(n)+(n.options.ruleSpaces?" ":"")).repeat(oB(n));return n.options.ruleSpaces?r.slice(0,-1):r}const o4={blockquote:M$,break:E2,code:P$,definition:z$,emphasis:K3,hardBreak:E2,heading:B$,html:G3,image:Y3,imageReference:Q3,inlineCode:X3,link:t4,linkReference:n4,list:G$,listItem:Q$,paragraph:X$,root:tB,strong:i4,text:iB,thematicBreak:sB};function aB(){return{enter:{table:lB,tableData:_2,tableHeader:_2,tableRow:cB},exit:{codeText:dB,table:uB,tableData:ng,tableHeader:ng,tableRow:ng}}}function lB(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function uB(e){this.exit(e),this.data.inTable=void 0}function cB(e){this.enter({type:"tableRow",children:[]},e)}function ng(e){this.exit(e)}function _2(e){this.enter({type:"tableCell",children:[]},e)}function dB(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,fB));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function fB(e,t){return t==="|"?t:e}function hB(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
236
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:m,table:s,tableCell:u,tableRow:a}};function s(g,x,b,v){return d(f(g,b,v),g.align)}function a(g,x,b,v){const C=h(g,b,v),_=d([C]);return _.slice(0,_.indexOf(`
237
+ `))}function u(g,x,b,v){const C=b.enter("tableCell"),_=b.enter("phrasing"),E=b.containerPhrasing(g,{...v,before:o,after:o});return _(),C(),E}function d(g,x){return T$(g,{align:x,alignDelimiters:r,padding:n,stringLength:i})}function f(g,x,b){const v=g.children;let C=-1;const _=[],E=x.enter("table");for(;++C<v.length;)_[C]=h(v[C],x,b);return E(),_}function h(g,x,b){const v=g.children;let C=-1;const _=[],E=x.enter("tableRow");for(;++C<v.length;)_[C]=u(v[C],g,x,b);return E(),_}function m(g,x,b){let v=o4.inlineCode(g,x,b);return b.stack.includes("tableCell")&&(v=v.replace(/\|/g,"\\$&")),v}}function pB(){return{exit:{taskListCheckValueChecked:T2,taskListCheckValueUnchecked:T2,paragraph:gB}}}function mB(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:yB}}}function T2(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function gB(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let o=-1,s;for(;++o<i.length;){const a=i[o];if(a.type==="paragraph"){s=a;break}}s===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function yB(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);o&&a.move(s);let u=o4.listItem(e,t,n,{...r,...a.current()});return o&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),u;function d(f){return f+s}}function xB(){return[G7(),y$(),k$(),aB(),pB()]}function bB(e){return{extensions:[Y7(),x$(e),w$(),hB(e),mB()]}}const vB={tokenize:_B,partial:!0},s4={tokenize:TB,partial:!0},a4={tokenize:AB,partial:!0},l4={tokenize:MB,partial:!0},kB={tokenize:NB,partial:!0},u4={name:"wwwAutolink",tokenize:SB,previous:d4},c4={name:"protocolAutolink",tokenize:EB,previous:f4},Fo={name:"emailAutolink",tokenize:CB,previous:h4},oo={};function wB(){return{text:oo}}let ca=48;for(;ca<123;)oo[ca]=Fo,ca++,ca===58?ca=65:ca===91&&(ca=97);oo[43]=Fo;oo[45]=Fo;oo[46]=Fo;oo[95]=Fo;oo[72]=[Fo,c4];oo[104]=[Fo,c4];oo[87]=[Fo,u4];oo[119]=[Fo,u4];function CB(e,t,n){const r=this;let i,o;return s;function s(h){return!S1(h)||!h4.call(r,r.previous)||Qy(r.events)?n(h):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(h))}function a(h){return S1(h)?(e.consume(h),a):h===64?(e.consume(h),u):n(h)}function u(h){return h===46?e.check(kB,f,d)(h):h===45||h===95||ar(h)?(o=!0,e.consume(h),u):f(h)}function d(h){return e.consume(h),i=!0,u}function f(h){return o&&i&&xr(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(h)):n(h)}}function SB(e,t,n){const r=this;return i;function i(s){return s!==87&&s!==119||!d4.call(r,r.previous)||Qy(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(vB,e.attempt(s4,e.attempt(a4,o),n),n)(s))}function o(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function EB(e,t,n){const r=this;let i="",o=!1;return s;function s(h){return(h===72||h===104)&&f4.call(r,r.previous)&&!Qy(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(h),e.consume(h),a):n(h)}function a(h){if(xr(h)&&i.length<5)return i+=String.fromCodePoint(h),e.consume(h),a;if(h===58){const m=i.toLowerCase();if(m==="http"||m==="https")return e.consume(h),u}return n(h)}function u(h){return h===47?(e.consume(h),o?d:(o=!0,u)):n(h)}function d(h){return h===null||xh(h)||Qt(h)||Aa(h)||Ep(h)?n(h):e.attempt(s4,e.attempt(a4,f),n)(h)}function f(h){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(h)}}function _B(e,t,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),i):s===46&&r===3?(e.consume(s),o):n(s)}function o(s){return s===null?n(s):t(s)}}function TB(e,t,n){let r,i,o;return s;function s(d){return d===46||d===95?e.check(l4,u,a)(d):d===null||Qt(d)||Aa(d)||d!==45&&Ep(d)?u(d):(o=!0,e.consume(d),s)}function a(d){return d===95?r=!0:(i=r,r=void 0),e.consume(d),s}function u(d){return i||r||!o?n(d):t(d)}}function AB(e,t){let n=0,r=0;return i;function i(s){return s===40?(n++,e.consume(s),i):s===41&&r<n?o(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(l4,t,o)(s):s===null||Qt(s)||Aa(s)?t(s):(e.consume(s),i)}function o(s){return s===41&&r++,e.consume(s),i}}function MB(e,t,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),o):a===93?(e.consume(a),i):a===60||a===null||Qt(a)||Aa(a)?t(a):n(a)}function i(a){return a===null||a===40||a===91||Qt(a)||Aa(a)?t(a):r(a)}function o(a){return xr(a)?s(a):n(a)}function s(a){return a===59?(e.consume(a),r):xr(a)?(e.consume(a),s):n(a)}}function NB(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return ar(o)?n(o):t(o)}}function d4(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Qt(e)}function f4(e){return!xr(e)}function h4(e){return!(e===47||S1(e))}function S1(e){return e===43||e===45||e===46||e===95||ar(e)}function Qy(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const IB={tokenize:FB,partial:!0};function DB(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:jB,continuation:{tokenize:zB},exit:LB}},text:{91:{name:"gfmFootnoteCall",tokenize:PB},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:OB,resolveTo:RB}}}}function OB(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){s=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return a;function a(u){if(!s||!s._balanced)return n(u);const d=Li(r.sliceSerialize({start:s.end,end:r.now()}));return d.codePointAt(0)!==94||!o.includes(d.slice(1))?n(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function RB(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function PB(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,s;return a;function a(h){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),u}function u(h){return h!==94?n(h):(e.enter("gfmFootnoteCallMarker"),e.consume(h),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(h){if(o>999||h===93&&!s||h===null||h===91||Qt(h))return n(h);if(h===93){e.exit("chunkString");const m=e.exit("gfmFootnoteCallString");return i.includes(Li(r.sliceSerialize(m)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(h)}return Qt(h)||(s=!0),o++,e.consume(h),h===92?f:d}function f(h){return h===91||h===92||h===93?(e.consume(h),o++,d):d(h)}}function jB(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,s=0,a;return u;function u(x){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(x){return x===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):n(x)}function f(x){if(s>999||x===93&&!a||x===null||x===91||Qt(x))return n(x);if(x===93){e.exit("chunkString");const b=e.exit("gfmFootnoteDefinitionLabelString");return o=Li(r.sliceSerialize(b)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),m}return Qt(x)||(a=!0),s++,e.consume(x),x===92?h:f}function h(x){return x===91||x===92||x===93?(e.consume(x),s++,f):f(x)}function m(x){return x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),i.includes(o)||i.push(o),$t(e,g,"gfmFootnoteDefinitionWhitespace")):n(x)}function g(x){return t(x)}}function zB(e,t,n){return e.check(td,t,e.attempt(IB,t,n))}function LB(e){e.exit("gfmFootnoteDefinition")}function FB(e,t,n){const r=this;return $t(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(o):n(o)}}function $B(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,a){let u=-1;for(;++u<s.length;)if(s[u][0]==="enter"&&s[u][1].type==="strikethroughSequenceTemporary"&&s[u][1]._close){let d=u;for(;d--;)if(s[d][0]==="exit"&&s[d][1].type==="strikethroughSequenceTemporary"&&s[d][1]._open&&s[u][1].end.offset-s[u][1].start.offset===s[d][1].end.offset-s[d][1].start.offset){s[u][1].type="strikethroughSequence",s[d][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},s[d][1].start),end:Object.assign({},s[u][1].end)},h={type:"strikethroughText",start:Object.assign({},s[d][1].end),end:Object.assign({},s[u][1].start)},m=[["enter",f,a],["enter",s[d][1],a],["exit",s[d][1],a],["enter",h,a]],g=a.parser.constructs.insideSpan.null;g&&Gr(m,m.length,0,_p(g,s.slice(d+1,u),a)),Gr(m,m.length,0,[["exit",h,a],["enter",s[u][1],a],["exit",s[u][1],a],["exit",f,a]]),Gr(s,d-1,u-d+3,m),u=d+m.length-2;break}}for(u=-1;++u<s.length;)s[u][1].type==="strikethroughSequenceTemporary"&&(s[u][1].type="data");return s}function o(s,a,u){const d=this.previous,f=this.events;let h=0;return m;function m(x){return d===126&&f[f.length-1][1].type!=="characterEscape"?u(x):(s.enter("strikethroughSequenceTemporary"),g(x))}function g(x){const b=Ll(d);if(x===126)return h>1?u(x):(s.consume(x),h++,g);if(h<2&&!n)return u(x);const v=s.exit("strikethroughSequenceTemporary"),C=Ll(x);return v._open=!C||C===2&&!!b,v._close=!b||b===2&&!!C,a(x)}}}class BB{constructor(){this.map=[]}add(t,n,r){UB(this,t,n,r)}consume(t){if(this.map.sort(function(o,s){return o[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const o of i)t.push(o);i=r.pop()}this.map.length=0}}function UB(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function VB(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function HB(){return{flow:{null:{name:"table",tokenize:WB,resolveAll:qB}}}}function WB(e,t,n){const r=this;let i=0,o=0,s;return a;function a(L){let X=r.events.length-1;for(;X>-1;){const he=r.events[X][1].type;if(he==="lineEnding"||he==="linePrefix")X--;else break}const ee=X>-1?r.events[X][1].type:null,Ie=ee==="tableHead"||ee==="tableRow"?M:u;return Ie===M&&r.parser.lazy[r.now().line]?n(L):Ie(L)}function u(L){return e.enter("tableHead"),e.enter("tableRow"),d(L)}function d(L){return L===124||(s=!0,o+=1),f(L)}function f(L){return L===null?n(L):pt(L)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),g):n(L):Rt(L)?$t(e,f,"whitespace")(L):(o+=1,s&&(s=!1,i+=1),L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),s=!0,f):(e.enter("data"),h(L)))}function h(L){return L===null||L===124||Qt(L)?(e.exit("data"),f(L)):(e.consume(L),L===92?m:h)}function m(L){return L===92||L===124?(e.consume(L),h):h(L)}function g(L){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(L):(e.enter("tableDelimiterRow"),s=!1,Rt(L)?$t(e,x,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):x(L))}function x(L){return L===45||L===58?v(L):L===124?(s=!0,e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),b):N(L)}function b(L){return Rt(L)?$t(e,v,"whitespace")(L):v(L)}function v(L){return L===58?(o+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),C):L===45?(o+=1,C(L)):L===null||pt(L)?I(L):N(L)}function C(L){return L===45?(e.enter("tableDelimiterFiller"),_(L)):N(L)}function _(L){return L===45?(e.consume(L),_):L===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),E):(e.exit("tableDelimiterFiller"),E(L))}function E(L){return Rt(L)?$t(e,I,"whitespace")(L):I(L)}function I(L){return L===124?x(L):L===null||pt(L)?!s||i!==o?N(L):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(L)):N(L)}function N(L){return n(L)}function M(L){return e.enter("tableRow"),F(L)}function F(L){return L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),F):L===null||pt(L)?(e.exit("tableRow"),t(L)):Rt(L)?$t(e,F,"whitespace")(L):(e.enter("data"),R(L))}function R(L){return L===null||L===124||Qt(L)?(e.exit("data"),F(L)):(e.consume(L),L===92?D:R)}function D(L){return L===92||L===124?(e.consume(L),R):R(L)}}function qB(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],s=[0,0,0,0],a=!1,u=0,d,f,h;const m=new BB;for(;++n<e.length;){const g=e[n],x=g[1];g[0]==="enter"?x.type==="tableHead"?(a=!1,u!==0&&(A2(m,t,u,d,f),f=void 0,u=0),d={type:"table",start:Object.assign({},x.start),end:Object.assign({},x.end)},m.add(n,0,[["enter",d,t]])):x.type==="tableRow"||x.type==="tableDelimiterRow"?(r=!0,h=void 0,o=[0,0,0,0],s=[0,n+1,0,0],a&&(a=!1,f={type:"tableBody",start:Object.assign({},x.start),end:Object.assign({},x.end)},m.add(n,0,[["enter",f,t]])),i=x.type==="tableDelimiterRow"?2:f?3:1):i&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(o[1]!==0&&(s[0]=s[1],h=Af(m,t,o,i,void 0,h),o=[0,0,0,0]),s[2]=n)):x.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(s[0]=s[1],h=Af(m,t,o,i,void 0,h)),o=s,s=[o[1],n,0,0])):x.type==="tableHead"?(a=!0,u=n):x.type==="tableRow"||x.type==="tableDelimiterRow"?(u=n,o[1]!==0?(s[0]=s[1],h=Af(m,t,o,i,n,h)):s[1]!==0&&(h=Af(m,t,s,i,n,h)),i=0):i&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")&&(s[3]=n)}for(u!==0&&A2(m,t,u,d,f),m.consume(t.events),n=-1;++n<t.events.length;){const g=t.events[n];g[0]==="enter"&&g[1].type==="table"&&(g[1]._align=VB(t.events,n))}return e}function Af(e,t,n,r,i,o){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(o.end=Object.assign({},wl(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const u=wl(t.events,n[1]);if(o={type:s,start:Object.assign({},u),end:Object.assign({},u)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const d=wl(t.events,n[2]),f=wl(t.events,n[3]),h={type:a,start:Object.assign({},d),end:Object.assign({},f)};if(e.add(n[2],0,[["enter",h,t]]),r!==2){const m=t.events[n[2]],g=t.events[n[3]];if(m[1].end=Object.assign({},g[1].end),m[1].type="chunkText",m[1].contentType="text",n[3]>n[2]+1){const x=n[2]+1,b=n[3]-n[2]-1;e.add(x,b,[])}}e.add(n[3]+1,0,[["exit",h,t]])}return i!==void 0&&(o.end=Object.assign({},wl(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function A2(e,t,n,r,i){const o=[],s=wl(t.events,n);i&&(i.end=Object.assign({},s),o.push(["exit",i,t])),r.end=Object.assign({},s),o.push(["exit",r,t]),e.add(n+1,0,o)}function wl(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const ZB={name:"tasklistCheck",tokenize:KB};function JB(){return{text:{91:ZB}}}function KB(e,t,n){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),o)}function o(u){return Qt(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),s):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),s):n(u)}function s(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(u)}function a(u){return pt(u)?t(u):Rt(u)?e.check({tokenize:GB},t,n)(u):n(u)}}function GB(e,t,n){return $t(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function YB(e){return S3([wB(),DB(),$B(e),HB(),JB()])}const QB={};function uc(e){const t=this,n=e||QB,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(YB(n)),o.push(xB()),s.push(bB(n))}const XB="modulepreload",eU=function(e){return"/"+e},M2={},rg=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let s=function(d){return Promise.all(d.map(f=>Promise.resolve(f).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),u=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));i=s(n.map(d=>{if(d=eU(d),d in M2)return;M2[d]=!0;const f=d.endsWith(".css"),h=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${h}`))return;const m=document.createElement("link");if(m.rel=f?"stylesheet":XB,f||(m.as="script"),m.crossOrigin="",m.href=d,u&&m.setAttribute("nonce",u),document.head.appendChild(m),f)return new Promise((g,x)=>{m.addEventListener("load",g),m.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${d}`)))})}))}function o(s){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=s,window.dispatchEvent(a),!a.defaultPrevented)throw s}return i.then(s=>{for(const a of s||[])a.status==="rejected"&&o(a.reason);return t().catch(o)})};var ig={exports:{}},N2;function tU(){return N2||(N2=1,(function(e){(t=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,s=(z,$)=>{for(var q in $)n(z,q,{get:$[q],enumerable:!0})},a=(z,$,q,oe)=>{if($&&typeof $=="object"||typeof $=="function")for(let ke of i($))!o.call(z,ke)&&ke!==q&&n(z,ke,{get:()=>$[ke],enumerable:!(oe=r($,ke))||oe.enumerable});return z},u=z=>a(n({},"__esModule",{value:!0}),z),d=(z,$,q)=>new Promise((oe,ke)=>{var Te=ue=>{try{Be(q.next(ue))}catch(bt){ke(bt)}},be=ue=>{try{Be(q.throw(ue))}catch(bt){ke(bt)}},Be=ue=>ue.done?oe(ue.value):Promise.resolve(ue.value).then(Te,be);Be((q=q.apply(z,$)).next())}),f={};s(f,{analyzeMetafile:()=>$i,analyzeMetafileSync:()=>dr,build:()=>jt,buildSync:()=>po,context:()=>jn,default:()=>pd,formatMessages:()=>Tr,formatMessagesSync:()=>ii,initialize:()=>fd,stop:()=>tu,transform:()=>Ci,transformSync:()=>zn,version:()=>_t}),t.exports=u(f);function h(z){let $=oe=>{if(oe===null)q.write8(0);else if(typeof oe=="boolean")q.write8(1),q.write8(+oe);else if(typeof oe=="number")q.write8(2),q.write32(oe|0);else if(typeof oe=="string")q.write8(3),q.write(x(oe));else if(oe instanceof Uint8Array)q.write8(4),q.write(oe);else if(oe instanceof Array){q.write8(5),q.write32(oe.length);for(let ke of oe)$(ke)}else{let ke=Object.keys(oe);q.write8(6),q.write32(ke.length);for(let Te of ke)q.write(x(Te)),$(oe[Te])}},q=new g;return q.write32(0),q.write32(z.id<<1|+!z.isRequest),$(z.value),_(q.buf,q.len-4,0),q.buf.subarray(0,q.len)}function m(z){let $=()=>{switch(q.read8()){case 0:return null;case 1:return!!q.read8();case 2:return q.read32();case 3:return b(q.read());case 4:return q.read();case 5:{let be=q.read32(),Be=[];for(let ue=0;ue<be;ue++)Be.push($());return Be}case 6:{let be=q.read32(),Be={};for(let ue=0;ue<be;ue++)Be[b(q.read())]=$();return Be}default:throw new Error("Invalid packet")}},q=new g(z),oe=q.read32(),ke=(oe&1)===0;oe>>>=1;let Te=$();if(q.ptr!==z.length)throw new Error("Invalid packet");return{id:oe,isRequest:ke,value:Te}}var g=class{constructor(z=new Uint8Array(1024)){this.buf=z,this.len=0,this.ptr=0}_write(z){if(this.len+z>this.buf.length){let $=new Uint8Array((this.len+z)*2);$.set(this.buf),this.buf=$}return this.len+=z,this.len-z}write8(z){let $=this._write(1);this.buf[$]=z}write32(z){let $=this._write(4);_(this.buf,z,$)}write(z){let $=this._write(4+z.length);_(this.buf,z.length,$),this.buf.set(z,$+4)}_read(z){if(this.ptr+z>this.buf.length)throw new Error("Invalid packet");return this.ptr+=z,this.ptr-z}read8(){return this.buf[this._read(1)]}read32(){return C(this.buf,this._read(4))}read(){let z=this.read32(),$=new Uint8Array(z),q=this._read($.length);return $.set(this.buf.subarray(q,q+z)),$}},x,b,v;if(typeof TextEncoder<"u"&&typeof TextDecoder<"u"){let z=new TextEncoder,$=new TextDecoder;x=q=>z.encode(q),b=q=>$.decode(q),v='new TextEncoder().encode("")'}else if(typeof Buffer<"u")x=z=>Buffer.from(z),b=z=>{let{buffer:$,byteOffset:q,byteLength:oe}=z;return Buffer.from($,q,oe).toString()},v='Buffer.from("")';else throw new Error("No UTF-8 codec found");if(!(x("")instanceof Uint8Array))throw new Error(`Invariant violation: "${v} instanceof Uint8Array" is incorrectly false
238
+
239
+ This indicates that your JavaScript environment is broken. You cannot use
240
+ esbuild in this environment because esbuild relies on this invariant. This
241
+ is not a problem with esbuild. You need to fix your environment instead.
242
+ `);function C(z,$){return z[$++]|z[$++]<<8|z[$++]<<16|z[$++]<<24}function _(z,$,q){z[q++]=$,z[q++]=$>>8,z[q++]=$>>16,z[q++]=$>>24}var E=JSON.stringify,I="warning",N="silent";function M(z,$){const q=[];for(const oe of z){if($e(oe,$),oe.indexOf(",")>=0)throw new Error(`Invalid ${$}: ${oe}`);q.push(oe)}return q.join(",")}var F=()=>null,R=z=>typeof z=="boolean"?null:"a boolean",D=z=>typeof z=="string"?null:"a string",L=z=>z instanceof RegExp?null:"a RegExp object",X=z=>typeof z=="number"&&z===(z|0)?null:"an integer",ee=z=>typeof z=="number"&&z===(z|0)&&z>=0&&z<=65535?null:"a valid port number",Ie=z=>typeof z=="function"?null:"a function",he=z=>Array.isArray(z)?null:"an array",Z=z=>Array.isArray(z)&&z.every($=>typeof $=="string")?null:"an array of strings",ge=z=>typeof z=="object"&&z!==null&&!Array.isArray(z)?null:"an object",Oe=z=>typeof z=="object"&&z!==null?null:"an array or an object",Y=z=>z instanceof WebAssembly.Module?null:"a WebAssembly.Module",qe=z=>typeof z=="object"&&!Array.isArray(z)?null:"an object or null",O=z=>typeof z=="string"||typeof z=="boolean"?null:"a string or a boolean",W=z=>typeof z=="string"||typeof z=="object"&&z!==null&&!Array.isArray(z)?null:"a string or an object",ie=z=>typeof z=="string"||Array.isArray(z)&&z.every($=>typeof $=="string")?null:"a string or an array of strings",P=z=>typeof z=="string"||z instanceof Uint8Array?null:"a string or a Uint8Array",Ze=z=>typeof z=="string"||z instanceof URL?null:"a string or a URL";function V(z,$,q,oe){let ke=z[q];if($[q+""]=!0,ke===void 0)return;let Te=oe(ke);if(Te!==null)throw new Error(`${E(q)} must be ${Te}`);return ke}function Re(z,$,q){for(let oe in z)if(!(oe in $))throw new Error(`Invalid option ${q}: ${E(oe)}`)}function pe(z){let $=Object.create(null),q=V(z,$,"wasmURL",Ze),oe=V(z,$,"wasmModule",Y),ke=V(z,$,"worker",R);return Re(z,$,"in initialize() call"),{wasmURL:q,wasmModule:oe,worker:ke}}function Pe(z){let $;if(z!==void 0){$=Object.create(null);for(let q in z){let oe=z[q];if(typeof oe=="string"||oe===!1)$[q]=oe;else throw new Error(`Expected ${E(q)} in mangle cache to map to either a string or false`)}}return $}function je(z,$,q,oe,ke){let Te=V($,q,"color",R),be=V($,q,"logLevel",D),Be=V($,q,"logLimit",X);Te!==void 0?z.push(`--color=${Te}`):oe&&z.push("--color=true"),z.push(`--log-level=${be||ke}`),z.push(`--log-limit=${Be||0}`)}function $e(z,$,q){if(typeof z!="string")throw new Error(`Expected value for ${$}${q!==void 0?" "+E(q):""} to be a string, got ${typeof z} instead`);return z}function qt(z,$,q){let oe=V($,q,"legalComments",D),ke=V($,q,"sourceRoot",D),Te=V($,q,"sourcesContent",R),be=V($,q,"target",ie),Be=V($,q,"format",D),ue=V($,q,"globalName",D),bt=V($,q,"mangleProps",L),wt=V($,q,"reserveProps",L),ct=V($,q,"mangleQuoted",R),zt=V($,q,"minify",R),vt=V($,q,"minifySyntax",R),kt=V($,q,"minifyWhitespace",R),It=V($,q,"minifyIdentifiers",R),Ye=V($,q,"lineLimit",X),on=V($,q,"drop",Z),Ke=V($,q,"dropLabels",Z),Je=V($,q,"charset",D),Ae=V($,q,"treeShaking",R),ce=V($,q,"ignoreAnnotations",R),G=V($,q,"jsx",D),ae=V($,q,"jsxFactory",D),se=V($,q,"jsxFragment",D),ze=V($,q,"jsxImportSource",D),Fe=V($,q,"jsxDev",R),le=V($,q,"jsxSideEffects",R),ye=V($,q,"define",ge),Le=V($,q,"logOverride",ge),U=V($,q,"supported",ge),te=V($,q,"pure",Z),Me=V($,q,"keepNames",R),De=V($,q,"platform",D),Qe=V($,q,"tsconfigRaw",W),Gt=V($,q,"absPaths",Z);if(oe&&z.push(`--legal-comments=${oe}`),ke!==void 0&&z.push(`--source-root=${ke}`),Te!==void 0&&z.push(`--sources-content=${Te}`),be&&z.push(`--target=${M(Array.isArray(be)?be:[be],"target")}`),Be&&z.push(`--format=${Be}`),ue&&z.push(`--global-name=${ue}`),De&&z.push(`--platform=${De}`),Qe&&z.push(`--tsconfig-raw=${typeof Qe=="string"?Qe:JSON.stringify(Qe)}`),zt&&z.push("--minify"),vt&&z.push("--minify-syntax"),kt&&z.push("--minify-whitespace"),It&&z.push("--minify-identifiers"),Ye&&z.push(`--line-limit=${Ye}`),Je&&z.push(`--charset=${Je}`),Ae!==void 0&&z.push(`--tree-shaking=${Ae}`),ce&&z.push("--ignore-annotations"),on)for(let Ve of on)z.push(`--drop:${$e(Ve,"drop")}`);if(Ke&&z.push(`--drop-labels=${M(Ke,"drop label")}`),Gt&&z.push(`--abs-paths=${M(Gt,"abs paths")}`),bt&&z.push(`--mangle-props=${dt(bt)}`),wt&&z.push(`--reserve-props=${dt(wt)}`),ct!==void 0&&z.push(`--mangle-quoted=${ct}`),G&&z.push(`--jsx=${G}`),ae&&z.push(`--jsx-factory=${ae}`),se&&z.push(`--jsx-fragment=${se}`),ze&&z.push(`--jsx-import-source=${ze}`),Fe&&z.push("--jsx-dev"),le&&z.push("--jsx-side-effects"),ye)for(let Ve in ye){if(Ve.indexOf("=")>=0)throw new Error(`Invalid define: ${Ve}`);z.push(`--define:${Ve}=${$e(ye[Ve],"define",Ve)}`)}if(Le)for(let Ve in Le){if(Ve.indexOf("=")>=0)throw new Error(`Invalid log override: ${Ve}`);z.push(`--log-override:${Ve}=${$e(Le[Ve],"log override",Ve)}`)}if(U)for(let Ve in U){if(Ve.indexOf("=")>=0)throw new Error(`Invalid supported: ${Ve}`);const Ot=U[Ve];if(typeof Ot!="boolean")throw new Error(`Expected value for supported ${E(Ve)} to be a boolean, got ${typeof Ot} instead`);z.push(`--supported:${Ve}=${Ot}`)}if(te)for(let Ve of te)z.push(`--pure:${$e(Ve,"pure")}`);Me&&z.push("--keep-names")}function Pn(z,$,q,oe,ke){var Te;let be=[],Be=[],ue=Object.create(null),bt=null,wt=null;je(be,$,ue,q,oe),qt(be,$,ue);let ct=V($,ue,"sourcemap",O),zt=V($,ue,"bundle",R),vt=V($,ue,"splitting",R),kt=V($,ue,"preserveSymlinks",R),It=V($,ue,"metafile",R),Ye=V($,ue,"outfile",D),on=V($,ue,"outdir",D),Ke=V($,ue,"outbase",D),Je=V($,ue,"tsconfig",D),Ae=V($,ue,"resolveExtensions",Z),ce=V($,ue,"nodePaths",Z),G=V($,ue,"mainFields",Z),ae=V($,ue,"conditions",Z),se=V($,ue,"external",Z),ze=V($,ue,"packages",D),Fe=V($,ue,"alias",ge),le=V($,ue,"loader",ge),ye=V($,ue,"outExtension",ge),Le=V($,ue,"publicPath",D),U=V($,ue,"entryNames",D),te=V($,ue,"chunkNames",D),Me=V($,ue,"assetNames",D),De=V($,ue,"inject",Z),Qe=V($,ue,"banner",ge),Gt=V($,ue,"footer",ge),Ve=V($,ue,"entryPoints",Oe),Ot=V($,ue,"absWorkingDir",D),St=V($,ue,"stdin",ge),Ct=(Te=V($,ue,"write",R))!=null?Te:ke,_n=V($,ue,"allowOverwrite",R),Xt=V($,ue,"mangleCache",ge);if(ue.plugins=!0,Re($,ue,`in ${z}() call`),ct&&be.push(`--sourcemap${ct===!0?"":`=${ct}`}`),zt&&be.push("--bundle"),_n&&be.push("--allow-overwrite"),vt&&be.push("--splitting"),kt&&be.push("--preserve-symlinks"),It&&be.push("--metafile"),Ye&&be.push(`--outfile=${Ye}`),on&&be.push(`--outdir=${on}`),Ke&&be.push(`--outbase=${Ke}`),Je&&be.push(`--tsconfig=${Je}`),ze&&be.push(`--packages=${ze}`),Ae&&be.push(`--resolve-extensions=${M(Ae,"resolve extension")}`),Le&&be.push(`--public-path=${Le}`),U&&be.push(`--entry-names=${U}`),te&&be.push(`--chunk-names=${te}`),Me&&be.push(`--asset-names=${Me}`),G&&be.push(`--main-fields=${M(G,"main field")}`),ae&&be.push(`--conditions=${M(ae,"condition")}`),se)for(let at of se)be.push(`--external:${$e(at,"external")}`);if(Fe)for(let at in Fe){if(at.indexOf("=")>=0)throw new Error(`Invalid package name in alias: ${at}`);be.push(`--alias:${at}=${$e(Fe[at],"alias",at)}`)}if(Qe)for(let at in Qe){if(at.indexOf("=")>=0)throw new Error(`Invalid banner file type: ${at}`);be.push(`--banner:${at}=${$e(Qe[at],"banner",at)}`)}if(Gt)for(let at in Gt){if(at.indexOf("=")>=0)throw new Error(`Invalid footer file type: ${at}`);be.push(`--footer:${at}=${$e(Gt[at],"footer",at)}`)}if(De)for(let at of De)be.push(`--inject:${$e(at,"inject")}`);if(le)for(let at in le){if(at.indexOf("=")>=0)throw new Error(`Invalid loader extension: ${at}`);be.push(`--loader:${at}=${$e(le[at],"loader",at)}`)}if(ye)for(let at in ye){if(at.indexOf("=")>=0)throw new Error(`Invalid out extension: ${at}`);be.push(`--out-extension:${at}=${$e(ye[at],"out extension",at)}`)}if(Ve)if(Array.isArray(Ve))for(let at=0,Vr=Ve.length;at<Vr;at++){let fr=Ve[at];if(typeof fr=="object"&&fr!==null){let Ar=Object.create(null),hr=V(fr,Ar,"in",D),Mr=V(fr,Ar,"out",D);if(Re(fr,Ar,"in entry point at index "+at),hr===void 0)throw new Error('Missing property "in" for entry point at index '+at);if(Mr===void 0)throw new Error('Missing property "out" for entry point at index '+at);Be.push([Mr,hr])}else Be.push(["",$e(fr,"entry point at index "+at)])}else for(let at in Ve)Be.push([at,$e(Ve[at],"entry point",at)]);if(St){let at=Object.create(null),Vr=V(St,at,"contents",P),fr=V(St,at,"resolveDir",D),Ar=V(St,at,"sourcefile",D),hr=V(St,at,"loader",D);Re(St,at,'in "stdin" object'),Ar&&be.push(`--sourcefile=${Ar}`),hr&&be.push(`--loader=${hr}`),fr&&(wt=fr),typeof Vr=="string"?bt=x(Vr):Vr instanceof Uint8Array&&(bt=Vr)}let Ti=[];if(ce)for(let at of ce)at+="",Ti.push(at);return{entries:Be,flags:be,write:Ct,stdinContents:bt,stdinResolveDir:wt,absWorkingDir:Ot,nodePaths:Ti,mangleCache:Pe(Xt)}}function ni(z,$,q,oe){let ke=[],Te=Object.create(null);je(ke,$,Te,q,oe),qt(ke,$,Te);let be=V($,Te,"sourcemap",O),Be=V($,Te,"sourcefile",D),ue=V($,Te,"loader",D),bt=V($,Te,"banner",D),wt=V($,Te,"footer",D),ct=V($,Te,"mangleCache",ge);return Re($,Te,`in ${z}() call`),be&&ke.push(`--sourcemap=${be===!0?"external":be}`),Be&&ke.push(`--sourcefile=${Be}`),ue&&ke.push(`--loader=${ue}`),bt&&ke.push(`--banner=${bt}`),wt&&ke.push(`--footer=${wt}`),{flags:ke,mangleCache:Pe(ct)}}function uo(z){const $={},q={didClose:!1,reason:""};let oe={},ke=0,Te=0,be=new Uint8Array(16*1024),Be=0,ue=Je=>{let Ae=Be+Je.length;if(Ae>be.length){let G=new Uint8Array(Ae*2);G.set(be),be=G}be.set(Je,Be),Be+=Je.length;let ce=0;for(;ce+4<=Be;){let G=C(be,ce);if(ce+4+G>Be)break;ce+=4,kt(be.subarray(ce,ce+G)),ce+=G}ce>0&&(be.copyWithin(0,ce,Be),Be-=ce)},bt=Je=>{q.didClose=!0,Je&&(q.reason=": "+(Je.message||Je));const Ae="The service was stopped"+q.reason;for(let ce in oe)oe[ce](Ae,null);oe={}},wt=(Je,Ae,ce)=>{if(q.didClose)return ce("The service is no longer running"+q.reason,null);let G=ke++;oe[G]=(ae,se)=>{try{ce(ae,se)}finally{Je&&Je.unref()}},Je&&Je.ref(),z.writeToStdin(h({id:G,isRequest:!0,value:Ae}))},ct=(Je,Ae)=>{if(q.didClose)throw new Error("The service is no longer running"+q.reason);z.writeToStdin(h({id:Je,isRequest:!1,value:Ae}))},zt=(Je,Ae)=>d(null,null,function*(){try{if(Ae.command==="ping"){ct(Je,{});return}if(typeof Ae.key=="number"){const ce=$[Ae.key];if(!ce)return;const G=ce[Ae.command];if(G){yield G(Je,Ae);return}}throw new Error("Invalid command: "+Ae.command)}catch(ce){const G=[Sr(ce,z,null,void 0,"")];try{ct(Je,{errors:G})}catch{}}}),vt=!0,kt=Je=>{if(vt){vt=!1;let ce=String.fromCharCode(...Je);if(ce!=="0.27.3")throw new Error(`Cannot start service: Host version "0.27.3" does not match binary version ${E(ce)}`);return}let Ae=m(Je);if(Ae.isRequest)zt(Ae.id,Ae.value);else{let ce=oe[Ae.id];delete oe[Ae.id],Ae.value.error?ce(Ae.value.error,{}):ce(null,Ae.value)}};return{readFromStdout:ue,afterClose:bt,service:{buildOrContext:({callName:Je,refs:Ae,options:ce,isTTY:G,defaultWD:ae,callback:se})=>{let ze=0;const Fe=Te++,le={},ye={ref(){++ze===1&&Ae&&Ae.ref()},unref(){--ze===0&&(delete $[Fe],Ae&&Ae.unref())}};$[Fe]=le,ye.ref(),Zs(Je,Fe,wt,ct,ye,z,le,ce,G,ae,(Le,U)=>{try{se(Le,U)}finally{ye.unref()}})},transform:({callName:Je,refs:Ae,input:ce,options:G,isTTY:ae,fs:se,callback:ze})=>{const Fe=co();let le=ye=>{try{if(typeof ce!="string"&&!(ce instanceof Uint8Array))throw new Error('The input to "transform" must be a string or a Uint8Array');let{flags:Le,mangleCache:U}=ni(Je,G,ae,N),te={command:"transform",flags:Le,inputFS:ye!==null,input:ye!==null?x(ye):typeof ce=="string"?x(ce):ce};U&&(te.mangleCache=U),wt(Ae,te,(Me,De)=>{if(Me)return ze(new Error(Me),null);let Qe=ri(De.errors,Fe),Gt=ri(De.warnings,Fe),Ve=1,Ot=()=>{if(--Ve===0){let St={warnings:Gt,code:De.code,map:De.map,mangleCache:void 0,legalComments:void 0};"legalComments"in De&&(St.legalComments=De==null?void 0:De.legalComments),De.mangleCache&&(St.mangleCache=De==null?void 0:De.mangleCache),ze(null,St)}};if(Qe.length>0)return ze(Er("Transform failed",Qe,Gt),null);De.codeFS&&(Ve++,se.readFile(De.code,(St,Ct)=>{St!==null?ze(St,null):(De.code=Ct,Ot())})),De.mapFS&&(Ve++,se.readFile(De.map,(St,Ct)=>{St!==null?ze(St,null):(De.map=Ct,Ot())})),Ot()})}catch(Le){let U=[];try{je(U,G,{},ae,N)}catch{}const te=Sr(Le,z,Fe,void 0,"");wt(Ae,{command:"error",flags:U,error:te},()=>{te.detail=Fe.load(te.detail),ze(Er("Transform failed",[te],[]),null)})}};if((typeof ce=="string"||ce instanceof Uint8Array)&&ce.length>1024*1024){let ye=le;le=()=>se.writeFile(ce,ye)}le(null)},formatMessages:({callName:Je,refs:Ae,messages:ce,options:G,callback:ae})=>{if(!G)throw new Error(`Missing second argument in ${Je}() call`);let se={},ze=V(G,se,"kind",D),Fe=V(G,se,"color",R),le=V(G,se,"terminalWidth",X);if(Re(G,se,`in ${Je}() call`),ze===void 0)throw new Error(`Missing "kind" in ${Je}() call`);if(ze!=="error"&&ze!=="warning")throw new Error(`Expected "kind" to be "error" or "warning" in ${Je}() call`);let ye={command:"format-msgs",messages:_r(ce,"messages",null,"",le),isWarning:ze==="warning"};Fe!==void 0&&(ye.color=Fe),le!==void 0&&(ye.terminalWidth=le),wt(Ae,ye,(Le,U)=>{if(Le)return ae(new Error(Le),null);ae(null,U.messages)})},analyzeMetafile:({callName:Je,refs:Ae,metafile:ce,options:G,callback:ae})=>{G===void 0&&(G={});let se={},ze=V(G,se,"color",R),Fe=V(G,se,"verbose",R);Re(G,se,`in ${Je}() call`);let le={command:"analyze-metafile",metafile:ce};ze!==void 0&&(le.color=ze),Fe!==void 0&&(le.verbose=Fe),wt(Ae,le,(ye,Le)=>{if(ye)return ae(new Error(ye),null);ae(null,Le.result)})}}}}function Zs(z,$,q,oe,ke,Te,be,Be,ue,bt,wt){const ct=co(),zt=z==="context",vt=(Ye,on)=>{const Ke=[];try{je(Ke,Be,{},ue,I)}catch{}const Je=Sr(Ye,Te,ct,void 0,on);q(ke,{command:"error",flags:Ke,error:Je},()=>{Je.detail=ct.load(Je.detail),wt(Er(zt?"Context failed":"Build failed",[Je],[]),null)})};let kt;if(typeof Be=="object"){const Ye=Be.plugins;if(Ye!==void 0){if(!Array.isArray(Ye))return vt(new Error('"plugins" must be an array'),"");kt=Ye}}if(kt&&kt.length>0){if(Te.isSync)return vt(new Error("Cannot use plugins in synchronous API calls"),"");Js($,q,oe,ke,Te,be,Be,kt,ct).then(Ye=>{if(!Ye.ok)return vt(Ye.error,Ye.pluginName);try{It(Ye.requestPlugins,Ye.runOnEndCallbacks,Ye.scheduleOnDisposeCallbacks)}catch(on){vt(on,"")}},Ye=>vt(Ye,""));return}try{It(null,(Ye,on)=>on([],[]),()=>{})}catch(Ye){vt(Ye,"")}function It(Ye,on,Ke){const Je=Te.hasFS,{entries:Ae,flags:ce,write:G,stdinContents:ae,stdinResolveDir:se,absWorkingDir:ze,nodePaths:Fe,mangleCache:le}=Pn(z,Be,ue,I,Je);if(G&&!Te.hasFS)throw new Error('The "write" option is unavailable in this environment');const ye={command:"build",key:$,entries:Ae,flags:ce,write:G,stdinContents:ae,stdinResolveDir:se,absWorkingDir:ze||bt,nodePaths:Fe,context:zt};Ye&&(ye.plugins=Ye),le&&(ye.mangleCache=le);const Le=(Me,De)=>{const Qe={errors:ri(Me.errors,ct),warnings:ri(Me.warnings,ct),outputFiles:void 0,metafile:void 0,mangleCache:void 0},Gt=Qe.errors.slice(),Ve=Qe.warnings.slice();Me.outputFiles&&(Qe.outputFiles=Me.outputFiles.map(_e)),Me.metafile&&(Qe.metafile=JSON.parse(Me.metafile)),Me.mangleCache&&(Qe.mangleCache=Me.mangleCache),Me.writeToStdout!==void 0&&console.log(b(Me.writeToStdout).replace(/\n$/,"")),on(Qe,(Ot,St)=>{if(Gt.length>0||Ot.length>0){const Ct=Er("Build failed",Gt.concat(Ot),Ve.concat(St));return De(Ct,null,Ot,St)}De(null,Qe,Ot,St)})};let U,te;zt&&(be["on-end"]=(Me,De)=>new Promise(Qe=>{Le(De,(Gt,Ve,Ot,St)=>{const Ct={errors:Ot,warnings:St};te&&te(Gt,Ve),U=void 0,te=void 0,oe(Me,Ct),Qe()})})),q(ke,ye,(Me,De)=>{if(Me)return wt(new Error(Me),null);if(!zt)return Le(De,(Ve,Ot)=>(Ke(),wt(Ve,Ot)));if(De.errors.length>0)return wt(Er("Context failed",De.errors,De.warnings),null);let Qe=!1;const Gt={rebuild:()=>(U||(U=new Promise((Ve,Ot)=>{let St;te=(_n,Xt)=>{St||(St=()=>_n?Ot(_n):Ve(Xt))};const Ct=()=>{q(ke,{command:"rebuild",key:$},(Xt,Ti)=>{Xt?Ot(new Error(Xt)):St?St():Ct()})};Ct()})),U),watch:(Ve={})=>new Promise((Ot,St)=>{if(!Te.hasFS)throw new Error('Cannot use the "watch" API in this environment');const Ct={},_n=V(Ve,Ct,"delay",X);Re(Ve,Ct,"in watch() call");const Xt={command:"watch",key:$};_n&&(Xt.delay=_n),q(ke,Xt,Ti=>{Ti?St(new Error(Ti)):Ot(void 0)})}),serve:(Ve={})=>new Promise((Ot,St)=>{if(!Te.hasFS)throw new Error('Cannot use the "serve" API in this environment');const Ct={},_n=V(Ve,Ct,"port",ee),Xt=V(Ve,Ct,"host",D),Ti=V(Ve,Ct,"servedir",D),at=V(Ve,Ct,"keyfile",D),Vr=V(Ve,Ct,"certfile",D),fr=V(Ve,Ct,"fallback",D),Ar=V(Ve,Ct,"cors",ge),hr=V(Ve,Ct,"onRequest",Ie);Re(Ve,Ct,"in serve() call");const Mr={command:"serve",key:$,onRequest:!!hr};if(_n!==void 0&&(Mr.port=_n),Xt!==void 0&&(Mr.host=Xt),Ti!==void 0&&(Mr.servedir=Ti),at!==void 0&&(Mr.keyfile=at),Vr!==void 0&&(Mr.certfile=Vr),fr!==void 0&&(Mr.fallback=fr),Ar){const mo={},Pt=V(Ar,mo,"origin",ie);Re(Ar,mo,'on "cors" object'),Array.isArray(Pt)?Mr.corsOrigin=Pt:Pt!==void 0&&(Mr.corsOrigin=[Pt])}q(ke,Mr,(mo,Pt)=>{if(mo)return St(new Error(mo));hr&&(be["serve-request"]=(md,gd)=>{hr(gd.args),oe(md,{})}),Ot(Pt)})}),cancel:()=>new Promise(Ve=>{if(Qe)return Ve();q(ke,{command:"cancel",key:$},()=>{Ve()})}),dispose:()=>new Promise(Ve=>{if(Qe)return Ve();Qe=!0,q(ke,{command:"dispose",key:$},()=>{Ve(),Ke(),ke.unref()})})};ke.ref(),wt(null,Gt)})}}var Js=(z,$,q,oe,ke,Te,be,Be,ue)=>d(null,null,function*(){let bt=[],wt=[],ct={},zt={},vt=[],kt=0,It=0,Ye=[],on=!1;Be=[...Be];for(let Ae of Be){let ce={};if(typeof Ae!="object")throw new Error(`Plugin at index ${It} must be an object`);const G=V(Ae,ce,"name",D);if(typeof G!="string"||G==="")throw new Error(`Plugin at index ${It} is missing a name`);try{let ae=V(Ae,ce,"setup",Ie);if(typeof ae!="function")throw new Error("Plugin is missing a setup function");Re(Ae,ce,`on plugin ${E(G)}`);let se={name:G,onStart:!1,onEnd:!1,onResolve:[],onLoad:[]};It++;let Fe=ae({initialOptions:be,resolve:(le,ye={})=>{if(!on)throw new Error('Cannot call "resolve" before plugin setup has completed');if(typeof le!="string")throw new Error("The path to resolve must be a string");let Le=Object.create(null),U=V(ye,Le,"pluginName",D),te=V(ye,Le,"importer",D),Me=V(ye,Le,"namespace",D),De=V(ye,Le,"resolveDir",D),Qe=V(ye,Le,"kind",D),Gt=V(ye,Le,"pluginData",F),Ve=V(ye,Le,"with",ge);return Re(ye,Le,"in resolve() call"),new Promise((Ot,St)=>{const Ct={command:"resolve",path:le,key:z,pluginName:G};if(U!=null&&(Ct.pluginName=U),te!=null&&(Ct.importer=te),Me!=null&&(Ct.namespace=Me),De!=null&&(Ct.resolveDir=De),Qe!=null)Ct.kind=Qe;else throw new Error('Must specify "kind" when calling "resolve"');Gt!=null&&(Ct.pluginData=ue.store(Gt)),Ve!=null&&(Ct.with=ne(Ve,"with")),$(oe,Ct,(_n,Xt)=>{_n!==null?St(new Error(_n)):Ot({errors:ri(Xt.errors,ue),warnings:ri(Xt.warnings,ue),path:Xt.path,external:Xt.external,sideEffects:Xt.sideEffects,namespace:Xt.namespace,suffix:Xt.suffix,pluginData:ue.load(Xt.pluginData)})})})},onStart(le){let ye='This error came from the "onStart" callback registered here:',Le=fo(new Error(ye),ke,"onStart");bt.push({name:G,callback:le,note:Le}),se.onStart=!0},onEnd(le){let ye='This error came from the "onEnd" callback registered here:',Le=fo(new Error(ye),ke,"onEnd");wt.push({name:G,callback:le,note:Le}),se.onEnd=!0},onResolve(le,ye){let Le='This error came from the "onResolve" callback registered here:',U=fo(new Error(Le),ke,"onResolve"),te={},Me=V(le,te,"filter",L),De=V(le,te,"namespace",D);if(Re(le,te,`in onResolve() call for plugin ${E(G)}`),Me==null)throw new Error("onResolve() call is missing a filter");let Qe=kt++;ct[Qe]={name:G,callback:ye,note:U},se.onResolve.push({id:Qe,filter:dt(Me),namespace:De||""})},onLoad(le,ye){let Le='This error came from the "onLoad" callback registered here:',U=fo(new Error(Le),ke,"onLoad"),te={},Me=V(le,te,"filter",L),De=V(le,te,"namespace",D);if(Re(le,te,`in onLoad() call for plugin ${E(G)}`),Me==null)throw new Error("onLoad() call is missing a filter");let Qe=kt++;zt[Qe]={name:G,callback:ye,note:U},se.onLoad.push({id:Qe,filter:dt(Me),namespace:De||""})},onDispose(le){vt.push(le)},esbuild:ke.esbuild});Fe&&(yield Fe),Ye.push(se)}catch(ae){return{ok:!1,error:ae,pluginName:G}}}Te["on-start"]=(Ae,ce)=>d(null,null,function*(){ue.clear();let G={errors:[],warnings:[]};yield Promise.all(bt.map(ae=>d(null,[ae],function*({name:se,callback:ze,note:Fe}){try{let le=yield ze();if(le!=null){if(typeof le!="object")throw new Error(`Expected onStart() callback in plugin ${E(se)} to return an object`);let ye={},Le=V(le,ye,"errors",he),U=V(le,ye,"warnings",he);Re(le,ye,`from onStart() callback in plugin ${E(se)}`),Le!=null&&G.errors.push(..._r(Le,"errors",ue,se,void 0)),U!=null&&G.warnings.push(..._r(U,"warnings",ue,se,void 0))}}catch(le){G.errors.push(Sr(le,ke,ue,Fe&&Fe(),se))}}))),q(Ae,G)}),Te["on-resolve"]=(Ae,ce)=>d(null,null,function*(){let G={},ae="",se,ze;for(let Fe of ce.ids)try{({name:ae,callback:se,note:ze}=ct[Fe]);let le=yield se({path:ce.path,importer:ce.importer,namespace:ce.namespace,resolveDir:ce.resolveDir,kind:ce.kind,pluginData:ue.load(ce.pluginData),with:ce.with});if(le!=null){if(typeof le!="object")throw new Error(`Expected onResolve() callback in plugin ${E(ae)} to return an object`);let ye={},Le=V(le,ye,"pluginName",D),U=V(le,ye,"path",D),te=V(le,ye,"namespace",D),Me=V(le,ye,"suffix",D),De=V(le,ye,"external",R),Qe=V(le,ye,"sideEffects",R),Gt=V(le,ye,"pluginData",F),Ve=V(le,ye,"errors",he),Ot=V(le,ye,"warnings",he),St=V(le,ye,"watchFiles",Z),Ct=V(le,ye,"watchDirs",Z);Re(le,ye,`from onResolve() callback in plugin ${E(ae)}`),G.id=Fe,Le!=null&&(G.pluginName=Le),U!=null&&(G.path=U),te!=null&&(G.namespace=te),Me!=null&&(G.suffix=Me),De!=null&&(G.external=De),Qe!=null&&(G.sideEffects=Qe),Gt!=null&&(G.pluginData=ue.store(Gt)),Ve!=null&&(G.errors=_r(Ve,"errors",ue,ae,void 0)),Ot!=null&&(G.warnings=_r(Ot,"warnings",ue,ae,void 0)),St!=null&&(G.watchFiles=ho(St,"watchFiles")),Ct!=null&&(G.watchDirs=ho(Ct,"watchDirs"));break}}catch(le){G={id:Fe,errors:[Sr(le,ke,ue,ze&&ze(),ae)]};break}q(Ae,G)}),Te["on-load"]=(Ae,ce)=>d(null,null,function*(){let G={},ae="",se,ze;for(let Fe of ce.ids)try{({name:ae,callback:se,note:ze}=zt[Fe]);let le=yield se({path:ce.path,namespace:ce.namespace,suffix:ce.suffix,pluginData:ue.load(ce.pluginData),with:ce.with});if(le!=null){if(typeof le!="object")throw new Error(`Expected onLoad() callback in plugin ${E(ae)} to return an object`);let ye={},Le=V(le,ye,"pluginName",D),U=V(le,ye,"contents",P),te=V(le,ye,"resolveDir",D),Me=V(le,ye,"pluginData",F),De=V(le,ye,"loader",D),Qe=V(le,ye,"errors",he),Gt=V(le,ye,"warnings",he),Ve=V(le,ye,"watchFiles",Z),Ot=V(le,ye,"watchDirs",Z);Re(le,ye,`from onLoad() callback in plugin ${E(ae)}`),G.id=Fe,Le!=null&&(G.pluginName=Le),U instanceof Uint8Array?G.contents=U:U!=null&&(G.contents=x(U)),te!=null&&(G.resolveDir=te),Me!=null&&(G.pluginData=ue.store(Me)),De!=null&&(G.loader=De),Qe!=null&&(G.errors=_r(Qe,"errors",ue,ae,void 0)),Gt!=null&&(G.warnings=_r(Gt,"warnings",ue,ae,void 0)),Ve!=null&&(G.watchFiles=ho(Ve,"watchFiles")),Ot!=null&&(G.watchDirs=ho(Ot,"watchDirs"));break}}catch(le){G={id:Fe,errors:[Sr(le,ke,ue,ze&&ze(),ae)]};break}q(Ae,G)});let Ke=(Ae,ce)=>ce([],[]);wt.length>0&&(Ke=(Ae,ce)=>{d(null,null,function*(){const G=[],ae=[];for(const{name:se,callback:ze,note:Fe}of wt){let le,ye;try{const Le=yield ze(Ae);if(Le!=null){if(typeof Le!="object")throw new Error(`Expected onEnd() callback in plugin ${E(se)} to return an object`);let U={},te=V(Le,U,"errors",he),Me=V(Le,U,"warnings",he);Re(Le,U,`from onEnd() callback in plugin ${E(se)}`),te!=null&&(le=_r(te,"errors",ue,se,void 0)),Me!=null&&(ye=_r(Me,"warnings",ue,se,void 0))}}catch(Le){le=[Sr(Le,ke,ue,Fe&&Fe(),se)]}if(le){G.push(...le);try{Ae.errors.push(...le)}catch{}}if(ye){ae.push(...ye);try{Ae.warnings.push(...ye)}catch{}}}ce(G,ae)})});let Je=()=>{for(const Ae of vt)setTimeout(()=>Ae(),0)};return on=!0,{ok:!0,requestPlugins:Ye,runOnEndCallbacks:Ke,scheduleOnDisposeCallbacks:Je}});function co(){const z=new Map;let $=0;return{clear(){z.clear()},load(q){return z.get(q)},store(q){if(q===void 0)return-1;const oe=$++;return z.set(oe,q),oe}}}function fo(z,$,q){let oe,ke=!1;return()=>{if(ke)return oe;ke=!0;try{let Te=(z.stack+"").split(`
243
+ `);Te.splice(1,1);let be=wi($,Te,q);if(be)return oe={text:z.message,location:be},oe}catch{}}}function Sr(z,$,q,oe,ke){let Te="Internal error",be=null;try{Te=(z&&z.message||z)+""}catch{}try{be=wi($,(z.stack+"").split(`
244
+ `),"")}catch{}return{id:"",pluginName:ke,text:Te,location:be,notes:oe?[oe]:[],detail:q?q.store(z):-1}}function wi(z,$,q){let oe=" at ";if(z.readFileSync&&!$[0].startsWith(oe)&&$[1].startsWith(oe))for(let ke=1;ke<$.length;ke++){let Te=$[ke];if(Te.startsWith(oe))for(Te=Te.slice(oe.length);;){let be=/^(?:new |async )?\S+ \((.*)\)$/.exec(Te);if(be){Te=be[1];continue}if(be=/^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(Te),be){Te=be[1];continue}if(be=/^(\S+):(\d+):(\d+)$/.exec(Te),be){let Be;try{Be=z.readFileSync(be[1],"utf8")}catch{break}let ue=Be.split(/\r\n|\r|\n|\u2028|\u2029/)[+be[2]-1]||"",bt=+be[3]-1,wt=ue.slice(bt,bt+q.length)===q?q.length:0;return{file:be[1],namespace:"file",line:+be[2],column:x(ue.slice(0,bt)).length,length:x(ue.slice(bt,bt+wt)).length,lineText:ue+`
245
+ `+$.slice(1).join(`
246
+ `),suggestion:""}}break}}return null}function Er(z,$,q){let oe=5;z+=$.length<1?"":` with ${$.length} error${$.length<2?"":"s"}:`+$.slice(0,oe+1).map((Te,be)=>{if(be===oe)return`
247
+ ...`;if(!Te.location)return`
248
+ error: ${Te.text}`;let{file:Be,line:ue,column:bt}=Te.location,wt=Te.pluginName?`[plugin: ${Te.pluginName}] `:"";return`
249
+ ${Be}:${ue}:${bt}: ERROR: ${wt}${Te.text}`}).join("");let ke=new Error(z);for(const[Te,be]of[["errors",$],["warnings",q]])Object.defineProperty(ke,Te,{configurable:!0,enumerable:!0,get:()=>be,set:Be=>Object.defineProperty(ke,Te,{configurable:!0,enumerable:!0,value:Be})});return ke}function ri(z,$){for(const q of z)q.detail=$.load(q.detail);return z}function Ks(z,$,q){if(z==null)return null;let oe={},ke=V(z,oe,"file",D),Te=V(z,oe,"namespace",D),be=V(z,oe,"line",X),Be=V(z,oe,"column",X),ue=V(z,oe,"length",X),bt=V(z,oe,"lineText",D),wt=V(z,oe,"suggestion",D);if(Re(z,oe,$),bt){const ct=bt.slice(0,(Be&&Be>0?Be:0)+(ue&&ue>0?ue:0)+(q&&q>0?q:80));!/[\x7F-\uFFFF]/.test(ct)&&!/\n/.test(bt)&&(bt=ct)}return{file:ke||"",namespace:Te||"",line:be||0,column:Be||0,length:ue||0,lineText:bt||"",suggestion:wt||""}}function _r(z,$,q,oe,ke){let Te=[],be=0;for(const Be of z){let ue={},bt=V(Be,ue,"id",D),wt=V(Be,ue,"pluginName",D),ct=V(Be,ue,"text",D),zt=V(Be,ue,"location",qe),vt=V(Be,ue,"notes",he),kt=V(Be,ue,"detail",F),It=`in element ${be} of "${$}"`;Re(Be,ue,It);let Ye=[];if(vt)for(const on of vt){let Ke={},Je=V(on,Ke,"text",D),Ae=V(on,Ke,"location",qe);Re(on,Ke,It),Ye.push({text:Je||"",location:Ks(Ae,It,ke)})}Te.push({id:bt||"",pluginName:wt||oe,text:ct||"",location:Ks(zt,It,ke),notes:Ye,detail:q?q.store(kt):-1}),be++}return Te}function ho(z,$){const q=[];for(const oe of z){if(typeof oe!="string")throw new Error(`${E($)} must be an array of strings`);q.push(oe)}return q}function ne(z,$){const q=Object.create(null);for(const oe in z){const ke=z[oe];if(typeof ke!="string")throw new Error(`key ${E(oe)} in object ${E($)} must be a string`);q[oe]=ke}return q}function _e({path:z,contents:$,hash:q}){let oe=null;return{path:z,contents:$,hash:q,get text(){const ke=this.contents;return(oe===null||ke!==$)&&($=ke,oe=b(ke)),oe}}}function dt(z){let $=z.source;return z.flags&&($=`(?${z.flags})${$}`),$}var _t="0.27.3",jt=z=>Bo().build(z),jn=z=>Bo().context(z),Ci=(z,$)=>Bo().transform(z,$),Tr=(z,$)=>Bo().formatMessages(z,$),$i=(z,$)=>Bo().analyzeMetafile(z,$),po=()=>{throw new Error('The "buildSync" API only works in node')},zn=()=>{throw new Error('The "transformSync" API only works in node')},ii=()=>{throw new Error('The "formatMessagesSync" API only works in node')},dr=()=>{throw new Error('The "analyzeMetafileSync" API only works in node')},tu=()=>(Ei&&Ei(),Promise.resolve()),Si,Ei,_i,Bo=()=>{if(_i)return _i;throw Si?new Error('You need to wait for the promise returned from "initialize" to be resolved before calling this'):new Error('You need to call "initialize" before calling this')},fd=z=>{z=pe(z||{});let $=z.wasmURL,q=z.wasmModule,oe=z.worker!==!1;if(!$&&!q)throw new Error('Must provide either the "wasmURL" option or the "wasmModule" option');if(Si)throw new Error('Cannot call "initialize" more than once');return Si=hd($||"",q,oe),Si.catch(()=>{Si=void 0}),Si},hd=(z,$,q)=>d(null,null,function*(){let oe,ke;const Te=new Promise(ct=>ke=ct);if(q){let ct=new Blob([`onmessage=((postMessage) => {
250
+ // Copyright 2018 The Go Authors. All rights reserved.
251
+ // Use of this source code is governed by a BSD-style
252
+ // license that can be found in the LICENSE file.
253
+ var __async = (__this, __arguments, generator) => {
254
+ return new Promise((resolve, reject) => {
255
+ var fulfilled = (value) => {
256
+ try {
257
+ step(generator.next(value));
258
+ } catch (e) {
259
+ reject(e);
260
+ }
261
+ };
262
+ var rejected = (value) => {
263
+ try {
264
+ step(generator.throw(value));
265
+ } catch (e) {
266
+ reject(e);
267
+ }
268
+ };
269
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
270
+ step((generator = generator.apply(__this, __arguments)).next());
271
+ });
272
+ };
273
+ let onmessage;
274
+ let globalThis = {};
275
+ for (let o = self; o; o = Object.getPrototypeOf(o))
276
+ for (let k of Object.getOwnPropertyNames(o))
277
+ if (!(k in globalThis))
278
+ Object.defineProperty(globalThis, k, { get: () => self[k] });
279
+ "use strict";
280
+ (() => {
281
+ const enosys = () => {
282
+ const err = new Error("not implemented");
283
+ err.code = "ENOSYS";
284
+ return err;
285
+ };
286
+ if (!globalThis.fs) {
287
+ let outputBuf = "";
288
+ globalThis.fs = {
289
+ constants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1, O_DIRECTORY: -1 },
290
+ // unused
291
+ writeSync(fd, buf) {
292
+ outputBuf += decoder.decode(buf);
293
+ const nl = outputBuf.lastIndexOf("\\n");
294
+ if (nl != -1) {
295
+ console.log(outputBuf.substring(0, nl));
296
+ outputBuf = outputBuf.substring(nl + 1);
297
+ }
298
+ return buf.length;
299
+ },
300
+ write(fd, buf, offset, length, position, callback) {
301
+ if (offset !== 0 || length !== buf.length || position !== null) {
302
+ callback(enosys());
303
+ return;
304
+ }
305
+ const n = this.writeSync(fd, buf);
306
+ callback(null, n);
307
+ },
308
+ chmod(path, mode, callback) {
309
+ callback(enosys());
310
+ },
311
+ chown(path, uid, gid, callback) {
312
+ callback(enosys());
313
+ },
314
+ close(fd, callback) {
315
+ callback(enosys());
316
+ },
317
+ fchmod(fd, mode, callback) {
318
+ callback(enosys());
319
+ },
320
+ fchown(fd, uid, gid, callback) {
321
+ callback(enosys());
322
+ },
323
+ fstat(fd, callback) {
324
+ callback(enosys());
325
+ },
326
+ fsync(fd, callback) {
327
+ callback(null);
328
+ },
329
+ ftruncate(fd, length, callback) {
330
+ callback(enosys());
331
+ },
332
+ lchown(path, uid, gid, callback) {
333
+ callback(enosys());
334
+ },
335
+ link(path, link, callback) {
336
+ callback(enosys());
337
+ },
338
+ lstat(path, callback) {
339
+ callback(enosys());
340
+ },
341
+ mkdir(path, perm, callback) {
342
+ callback(enosys());
343
+ },
344
+ open(path, flags, mode, callback) {
345
+ callback(enosys());
346
+ },
347
+ read(fd, buffer, offset, length, position, callback) {
348
+ callback(enosys());
349
+ },
350
+ readdir(path, callback) {
351
+ callback(enosys());
352
+ },
353
+ readlink(path, callback) {
354
+ callback(enosys());
355
+ },
356
+ rename(from, to, callback) {
357
+ callback(enosys());
358
+ },
359
+ rmdir(path, callback) {
360
+ callback(enosys());
361
+ },
362
+ stat(path, callback) {
363
+ callback(enosys());
364
+ },
365
+ symlink(path, link, callback) {
366
+ callback(enosys());
367
+ },
368
+ truncate(path, length, callback) {
369
+ callback(enosys());
370
+ },
371
+ unlink(path, callback) {
372
+ callback(enosys());
373
+ },
374
+ utimes(path, atime, mtime, callback) {
375
+ callback(enosys());
376
+ }
377
+ };
378
+ }
379
+ if (!globalThis.process) {
380
+ globalThis.process = {
381
+ getuid() {
382
+ return -1;
383
+ },
384
+ getgid() {
385
+ return -1;
386
+ },
387
+ geteuid() {
388
+ return -1;
389
+ },
390
+ getegid() {
391
+ return -1;
392
+ },
393
+ getgroups() {
394
+ throw enosys();
395
+ },
396
+ pid: -1,
397
+ ppid: -1,
398
+ umask() {
399
+ throw enosys();
400
+ },
401
+ cwd() {
402
+ throw enosys();
403
+ },
404
+ chdir() {
405
+ throw enosys();
406
+ }
407
+ };
408
+ }
409
+ if (!globalThis.path) {
410
+ globalThis.path = {
411
+ resolve(...pathSegments) {
412
+ return pathSegments.join("/");
413
+ }
414
+ };
415
+ }
416
+ if (!globalThis.crypto) {
417
+ throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");
418
+ }
419
+ if (!globalThis.performance) {
420
+ throw new Error("globalThis.performance is not available, polyfill required (performance.now only)");
421
+ }
422
+ if (!globalThis.TextEncoder) {
423
+ throw new Error("globalThis.TextEncoder is not available, polyfill required");
424
+ }
425
+ if (!globalThis.TextDecoder) {
426
+ throw new Error("globalThis.TextDecoder is not available, polyfill required");
427
+ }
428
+ const encoder = new TextEncoder("utf-8");
429
+ const decoder = new TextDecoder("utf-8");
430
+ globalThis.Go = class {
431
+ constructor() {
432
+ this.argv = ["js"];
433
+ this.env = {};
434
+ this.exit = (code) => {
435
+ if (code !== 0) {
436
+ console.warn("exit code:", code);
437
+ }
438
+ };
439
+ this._exitPromise = new Promise((resolve) => {
440
+ this._resolveExitPromise = resolve;
441
+ });
442
+ this._pendingEvent = null;
443
+ this._scheduledTimeouts = /* @__PURE__ */ new Map();
444
+ this._nextCallbackTimeoutID = 1;
445
+ const setInt64 = (addr, v) => {
446
+ this.mem.setUint32(addr + 0, v, true);
447
+ this.mem.setUint32(addr + 4, Math.floor(v / 4294967296), true);
448
+ };
449
+ const setInt32 = (addr, v) => {
450
+ this.mem.setUint32(addr + 0, v, true);
451
+ };
452
+ const getInt64 = (addr) => {
453
+ const low = this.mem.getUint32(addr + 0, true);
454
+ const high = this.mem.getInt32(addr + 4, true);
455
+ return low + high * 4294967296;
456
+ };
457
+ const loadValue = (addr) => {
458
+ const f = this.mem.getFloat64(addr, true);
459
+ if (f === 0) {
460
+ return void 0;
461
+ }
462
+ if (!isNaN(f)) {
463
+ return f;
464
+ }
465
+ const id = this.mem.getUint32(addr, true);
466
+ return this._values[id];
467
+ };
468
+ const storeValue = (addr, v) => {
469
+ const nanHead = 2146959360;
470
+ if (typeof v === "number" && v !== 0) {
471
+ if (isNaN(v)) {
472
+ this.mem.setUint32(addr + 4, nanHead, true);
473
+ this.mem.setUint32(addr, 0, true);
474
+ return;
475
+ }
476
+ this.mem.setFloat64(addr, v, true);
477
+ return;
478
+ }
479
+ if (v === void 0) {
480
+ this.mem.setFloat64(addr, 0, true);
481
+ return;
482
+ }
483
+ let id = this._ids.get(v);
484
+ if (id === void 0) {
485
+ id = this._idPool.pop();
486
+ if (id === void 0) {
487
+ id = this._values.length;
488
+ }
489
+ this._values[id] = v;
490
+ this._goRefCounts[id] = 0;
491
+ this._ids.set(v, id);
492
+ }
493
+ this._goRefCounts[id]++;
494
+ let typeFlag = 0;
495
+ switch (typeof v) {
496
+ case "object":
497
+ if (v !== null) {
498
+ typeFlag = 1;
499
+ }
500
+ break;
501
+ case "string":
502
+ typeFlag = 2;
503
+ break;
504
+ case "symbol":
505
+ typeFlag = 3;
506
+ break;
507
+ case "function":
508
+ typeFlag = 4;
509
+ break;
510
+ }
511
+ this.mem.setUint32(addr + 4, nanHead | typeFlag, true);
512
+ this.mem.setUint32(addr, id, true);
513
+ };
514
+ const loadSlice = (addr) => {
515
+ const array = getInt64(addr + 0);
516
+ const len = getInt64(addr + 8);
517
+ return new Uint8Array(this._inst.exports.mem.buffer, array, len);
518
+ };
519
+ const loadSliceOfValues = (addr) => {
520
+ const array = getInt64(addr + 0);
521
+ const len = getInt64(addr + 8);
522
+ const a = new Array(len);
523
+ for (let i = 0; i < len; i++) {
524
+ a[i] = loadValue(array + i * 8);
525
+ }
526
+ return a;
527
+ };
528
+ const loadString = (addr) => {
529
+ const saddr = getInt64(addr + 0);
530
+ const len = getInt64(addr + 8);
531
+ return decoder.decode(new DataView(this._inst.exports.mem.buffer, saddr, len));
532
+ };
533
+ const testCallExport = (a, b) => {
534
+ this._inst.exports.testExport0();
535
+ return this._inst.exports.testExport(a, b);
536
+ };
537
+ const timeOrigin = Date.now() - performance.now();
538
+ this.importObject = {
539
+ _gotest: {
540
+ add: (a, b) => a + b,
541
+ callExport: testCallExport
542
+ },
543
+ gojs: {
544
+ // Go's SP does not change as long as no Go code is running. Some operations (e.g. calls, getters and setters)
545
+ // may synchronously trigger a Go event handler. This makes Go code get executed in the middle of the imported
546
+ // function. A goroutine can switch to a new stack if the current stack is too small (see morestack function).
547
+ // This changes the SP, thus we have to update the SP used by the imported function.
548
+ // func wasmExit(code int32)
549
+ "runtime.wasmExit": (sp) => {
550
+ sp >>>= 0;
551
+ const code = this.mem.getInt32(sp + 8, true);
552
+ this.exited = true;
553
+ delete this._inst;
554
+ delete this._values;
555
+ delete this._goRefCounts;
556
+ delete this._ids;
557
+ delete this._idPool;
558
+ this.exit(code);
559
+ },
560
+ // func wasmWrite(fd uintptr, p unsafe.Pointer, n int32)
561
+ "runtime.wasmWrite": (sp) => {
562
+ sp >>>= 0;
563
+ const fd = getInt64(sp + 8);
564
+ const p = getInt64(sp + 16);
565
+ const n = this.mem.getInt32(sp + 24, true);
566
+ globalThis.fs.writeSync(fd, new Uint8Array(this._inst.exports.mem.buffer, p, n));
567
+ },
568
+ // func resetMemoryDataView()
569
+ "runtime.resetMemoryDataView": (sp) => {
570
+ sp >>>= 0;
571
+ this.mem = new DataView(this._inst.exports.mem.buffer);
572
+ },
573
+ // func nanotime1() int64
574
+ "runtime.nanotime1": (sp) => {
575
+ sp >>>= 0;
576
+ setInt64(sp + 8, (timeOrigin + performance.now()) * 1e6);
577
+ },
578
+ // func walltime() (sec int64, nsec int32)
579
+ "runtime.walltime": (sp) => {
580
+ sp >>>= 0;
581
+ const msec = (/* @__PURE__ */ new Date()).getTime();
582
+ setInt64(sp + 8, msec / 1e3);
583
+ this.mem.setInt32(sp + 16, msec % 1e3 * 1e6, true);
584
+ },
585
+ // func scheduleTimeoutEvent(delay int64) int32
586
+ "runtime.scheduleTimeoutEvent": (sp) => {
587
+ sp >>>= 0;
588
+ const id = this._nextCallbackTimeoutID;
589
+ this._nextCallbackTimeoutID++;
590
+ this._scheduledTimeouts.set(id, setTimeout(
591
+ () => {
592
+ this._resume();
593
+ while (this._scheduledTimeouts.has(id)) {
594
+ console.warn("scheduleTimeoutEvent: missed timeout event");
595
+ this._resume();
596
+ }
597
+ },
598
+ getInt64(sp + 8)
599
+ ));
600
+ this.mem.setInt32(sp + 16, id, true);
601
+ },
602
+ // func clearTimeoutEvent(id int32)
603
+ "runtime.clearTimeoutEvent": (sp) => {
604
+ sp >>>= 0;
605
+ const id = this.mem.getInt32(sp + 8, true);
606
+ clearTimeout(this._scheduledTimeouts.get(id));
607
+ this._scheduledTimeouts.delete(id);
608
+ },
609
+ // func getRandomData(r []byte)
610
+ "runtime.getRandomData": (sp) => {
611
+ sp >>>= 0;
612
+ crypto.getRandomValues(loadSlice(sp + 8));
613
+ },
614
+ // func finalizeRef(v ref)
615
+ "syscall/js.finalizeRef": (sp) => {
616
+ sp >>>= 0;
617
+ const id = this.mem.getUint32(sp + 8, true);
618
+ this._goRefCounts[id]--;
619
+ if (this._goRefCounts[id] === 0) {
620
+ const v = this._values[id];
621
+ this._values[id] = null;
622
+ this._ids.delete(v);
623
+ this._idPool.push(id);
624
+ }
625
+ },
626
+ // func stringVal(value string) ref
627
+ "syscall/js.stringVal": (sp) => {
628
+ sp >>>= 0;
629
+ storeValue(sp + 24, loadString(sp + 8));
630
+ },
631
+ // func valueGet(v ref, p string) ref
632
+ "syscall/js.valueGet": (sp) => {
633
+ sp >>>= 0;
634
+ const result = Reflect.get(loadValue(sp + 8), loadString(sp + 16));
635
+ sp = this._inst.exports.getsp() >>> 0;
636
+ storeValue(sp + 32, result);
637
+ },
638
+ // func valueSet(v ref, p string, x ref)
639
+ "syscall/js.valueSet": (sp) => {
640
+ sp >>>= 0;
641
+ Reflect.set(loadValue(sp + 8), loadString(sp + 16), loadValue(sp + 32));
642
+ },
643
+ // func valueDelete(v ref, p string)
644
+ "syscall/js.valueDelete": (sp) => {
645
+ sp >>>= 0;
646
+ Reflect.deleteProperty(loadValue(sp + 8), loadString(sp + 16));
647
+ },
648
+ // func valueIndex(v ref, i int) ref
649
+ "syscall/js.valueIndex": (sp) => {
650
+ sp >>>= 0;
651
+ storeValue(sp + 24, Reflect.get(loadValue(sp + 8), getInt64(sp + 16)));
652
+ },
653
+ // valueSetIndex(v ref, i int, x ref)
654
+ "syscall/js.valueSetIndex": (sp) => {
655
+ sp >>>= 0;
656
+ Reflect.set(loadValue(sp + 8), getInt64(sp + 16), loadValue(sp + 24));
657
+ },
658
+ // func valueCall(v ref, m string, args []ref) (ref, bool)
659
+ "syscall/js.valueCall": (sp) => {
660
+ sp >>>= 0;
661
+ try {
662
+ const v = loadValue(sp + 8);
663
+ const m = Reflect.get(v, loadString(sp + 16));
664
+ const args = loadSliceOfValues(sp + 32);
665
+ const result = Reflect.apply(m, v, args);
666
+ sp = this._inst.exports.getsp() >>> 0;
667
+ storeValue(sp + 56, result);
668
+ this.mem.setUint8(sp + 64, 1);
669
+ } catch (err) {
670
+ sp = this._inst.exports.getsp() >>> 0;
671
+ storeValue(sp + 56, err);
672
+ this.mem.setUint8(sp + 64, 0);
673
+ }
674
+ },
675
+ // func valueInvoke(v ref, args []ref) (ref, bool)
676
+ "syscall/js.valueInvoke": (sp) => {
677
+ sp >>>= 0;
678
+ try {
679
+ const v = loadValue(sp + 8);
680
+ const args = loadSliceOfValues(sp + 16);
681
+ const result = Reflect.apply(v, void 0, args);
682
+ sp = this._inst.exports.getsp() >>> 0;
683
+ storeValue(sp + 40, result);
684
+ this.mem.setUint8(sp + 48, 1);
685
+ } catch (err) {
686
+ sp = this._inst.exports.getsp() >>> 0;
687
+ storeValue(sp + 40, err);
688
+ this.mem.setUint8(sp + 48, 0);
689
+ }
690
+ },
691
+ // func valueNew(v ref, args []ref) (ref, bool)
692
+ "syscall/js.valueNew": (sp) => {
693
+ sp >>>= 0;
694
+ try {
695
+ const v = loadValue(sp + 8);
696
+ const args = loadSliceOfValues(sp + 16);
697
+ const result = Reflect.construct(v, args);
698
+ sp = this._inst.exports.getsp() >>> 0;
699
+ storeValue(sp + 40, result);
700
+ this.mem.setUint8(sp + 48, 1);
701
+ } catch (err) {
702
+ sp = this._inst.exports.getsp() >>> 0;
703
+ storeValue(sp + 40, err);
704
+ this.mem.setUint8(sp + 48, 0);
705
+ }
706
+ },
707
+ // func valueLength(v ref) int
708
+ "syscall/js.valueLength": (sp) => {
709
+ sp >>>= 0;
710
+ setInt64(sp + 16, parseInt(loadValue(sp + 8).length));
711
+ },
712
+ // valuePrepareString(v ref) (ref, int)
713
+ "syscall/js.valuePrepareString": (sp) => {
714
+ sp >>>= 0;
715
+ const str = encoder.encode(String(loadValue(sp + 8)));
716
+ storeValue(sp + 16, str);
717
+ setInt64(sp + 24, str.length);
718
+ },
719
+ // valueLoadString(v ref, b []byte)
720
+ "syscall/js.valueLoadString": (sp) => {
721
+ sp >>>= 0;
722
+ const str = loadValue(sp + 8);
723
+ loadSlice(sp + 16).set(str);
724
+ },
725
+ // func valueInstanceOf(v ref, t ref) bool
726
+ "syscall/js.valueInstanceOf": (sp) => {
727
+ sp >>>= 0;
728
+ this.mem.setUint8(sp + 24, loadValue(sp + 8) instanceof loadValue(sp + 16) ? 1 : 0);
729
+ },
730
+ // func copyBytesToGo(dst []byte, src ref) (int, bool)
731
+ "syscall/js.copyBytesToGo": (sp) => {
732
+ sp >>>= 0;
733
+ const dst = loadSlice(sp + 8);
734
+ const src = loadValue(sp + 32);
735
+ if (!(src instanceof Uint8Array || src instanceof Uint8ClampedArray)) {
736
+ this.mem.setUint8(sp + 48, 0);
737
+ return;
738
+ }
739
+ const toCopy = src.subarray(0, dst.length);
740
+ dst.set(toCopy);
741
+ setInt64(sp + 40, toCopy.length);
742
+ this.mem.setUint8(sp + 48, 1);
743
+ },
744
+ // func copyBytesToJS(dst ref, src []byte) (int, bool)
745
+ "syscall/js.copyBytesToJS": (sp) => {
746
+ sp >>>= 0;
747
+ const dst = loadValue(sp + 8);
748
+ const src = loadSlice(sp + 16);
749
+ if (!(dst instanceof Uint8Array || dst instanceof Uint8ClampedArray)) {
750
+ this.mem.setUint8(sp + 48, 0);
751
+ return;
752
+ }
753
+ const toCopy = src.subarray(0, dst.length);
754
+ dst.set(toCopy);
755
+ setInt64(sp + 40, toCopy.length);
756
+ this.mem.setUint8(sp + 48, 1);
757
+ },
758
+ "debug": (value) => {
759
+ console.log(value);
760
+ }
761
+ }
762
+ };
763
+ }
764
+ run(instance) {
765
+ return __async(this, null, function* () {
766
+ if (!(instance instanceof WebAssembly.Instance)) {
767
+ throw new Error("Go.run: WebAssembly.Instance expected");
768
+ }
769
+ this._inst = instance;
770
+ this.mem = new DataView(this._inst.exports.mem.buffer);
771
+ this._values = [
772
+ // JS values that Go currently has references to, indexed by reference id
773
+ NaN,
774
+ 0,
775
+ null,
776
+ true,
777
+ false,
778
+ globalThis,
779
+ this
780
+ ];
781
+ this._goRefCounts = new Array(this._values.length).fill(Infinity);
782
+ this._ids = /* @__PURE__ */ new Map([
783
+ // mapping from JS values to reference ids
784
+ [0, 1],
785
+ [null, 2],
786
+ [true, 3],
787
+ [false, 4],
788
+ [globalThis, 5],
789
+ [this, 6]
790
+ ]);
791
+ this._idPool = [];
792
+ this.exited = false;
793
+ let offset = 4096;
794
+ const strPtr = (str) => {
795
+ const ptr = offset;
796
+ const bytes = encoder.encode(str + "\\0");
797
+ new Uint8Array(this.mem.buffer, offset, bytes.length).set(bytes);
798
+ offset += bytes.length;
799
+ if (offset % 8 !== 0) {
800
+ offset += 8 - offset % 8;
801
+ }
802
+ return ptr;
803
+ };
804
+ const argc = this.argv.length;
805
+ const argvPtrs = [];
806
+ this.argv.forEach((arg) => {
807
+ argvPtrs.push(strPtr(arg));
808
+ });
809
+ argvPtrs.push(0);
810
+ const keys = Object.keys(this.env).sort();
811
+ keys.forEach((key) => {
812
+ argvPtrs.push(strPtr(\`\${key}=\${this.env[key]}\`));
813
+ });
814
+ argvPtrs.push(0);
815
+ const argv = offset;
816
+ argvPtrs.forEach((ptr) => {
817
+ this.mem.setUint32(offset, ptr, true);
818
+ this.mem.setUint32(offset + 4, 0, true);
819
+ offset += 8;
820
+ });
821
+ const wasmMinDataAddr = 4096 + 8192;
822
+ if (offset >= wasmMinDataAddr) {
823
+ throw new Error("total length of command line and environment variables exceeds limit");
824
+ }
825
+ this._inst.exports.run(argc, argv);
826
+ if (this.exited) {
827
+ this._resolveExitPromise();
828
+ }
829
+ yield this._exitPromise;
830
+ });
831
+ }
832
+ _resume() {
833
+ if (this.exited) {
834
+ throw new Error("Go program has already exited");
835
+ }
836
+ this._inst.exports.resume();
837
+ if (this.exited) {
838
+ this._resolveExitPromise();
839
+ }
840
+ }
841
+ _makeFuncWrapper(id) {
842
+ const go = this;
843
+ return function() {
844
+ const event = { id, this: this, args: arguments };
845
+ go._pendingEvent = event;
846
+ go._resume();
847
+ return event.result;
848
+ };
849
+ }
850
+ };
851
+ })();
852
+ onmessage = ({ data: wasm }) => {
853
+ let decoder = new TextDecoder();
854
+ let fs = globalThis.fs;
855
+ let stderr = "";
856
+ fs.writeSync = (fd, buffer) => {
857
+ if (fd === 1) {
858
+ postMessage(buffer);
859
+ } else if (fd === 2) {
860
+ stderr += decoder.decode(buffer);
861
+ let parts = stderr.split("\\n");
862
+ if (parts.length > 1) console.log(parts.slice(0, -1).join("\\n"));
863
+ stderr = parts[parts.length - 1];
864
+ } else {
865
+ throw new Error("Bad write");
866
+ }
867
+ return buffer.length;
868
+ };
869
+ let stdin = [];
870
+ let resumeStdin;
871
+ let stdinPos = 0;
872
+ onmessage = ({ data }) => {
873
+ if (data.length > 0) {
874
+ stdin.push(data);
875
+ if (resumeStdin) resumeStdin();
876
+ }
877
+ return go;
878
+ };
879
+ fs.read = (fd, buffer, offset, length, position, callback) => {
880
+ if (fd !== 0 || offset !== 0 || length !== buffer.length || position !== null) {
881
+ throw new Error("Bad read");
882
+ }
883
+ if (stdin.length === 0) {
884
+ resumeStdin = () => fs.read(fd, buffer, offset, length, position, callback);
885
+ return;
886
+ }
887
+ let first = stdin[0];
888
+ let count = Math.max(0, Math.min(length, first.length - stdinPos));
889
+ buffer.set(first.subarray(stdinPos, stdinPos + count), offset);
890
+ stdinPos += count;
891
+ if (stdinPos === first.length) {
892
+ stdin.shift();
893
+ stdinPos = 0;
894
+ }
895
+ callback(null, count);
896
+ };
897
+ let go = new globalThis.Go();
898
+ go.argv = ["", \`--service=\${"0.27.3"}\`];
899
+ tryToInstantiateModule(wasm, go).then(
900
+ (instance) => {
901
+ postMessage(null);
902
+ go.run(instance);
903
+ },
904
+ (error) => {
905
+ postMessage(error);
906
+ }
907
+ );
908
+ return go;
909
+ };
910
+ function tryToInstantiateModule(wasm, go) {
911
+ return __async(this, null, function* () {
912
+ if (wasm instanceof WebAssembly.Module) {
913
+ return WebAssembly.instantiate(wasm, go.importObject);
914
+ }
915
+ const res = yield fetch(wasm);
916
+ if (!res.ok) throw new Error(\`Failed to download \${JSON.stringify(wasm)}\`);
917
+ if ("instantiateStreaming" in WebAssembly && /^application\\/wasm($|;)/i.test(res.headers.get("Content-Type") || "")) {
918
+ const result2 = yield WebAssembly.instantiateStreaming(res, go.importObject);
919
+ return result2.instance;
920
+ }
921
+ const bytes = yield res.arrayBuffer();
922
+ const result = yield WebAssembly.instantiate(bytes, go.importObject);
923
+ return result.instance;
924
+ });
925
+ }
926
+ return (m) => onmessage(m);
927
+ })(postMessage)`],{type:"text/javascript"});oe=new Worker(URL.createObjectURL(ct))}else{let ct=(vt=>{var kt=(Ke,Je,Ae)=>new Promise((ce,G)=>{var ae=Fe=>{try{ze(Ae.next(Fe))}catch(le){G(le)}},se=Fe=>{try{ze(Ae.throw(Fe))}catch(le){G(le)}},ze=Fe=>Fe.done?ce(Fe.value):Promise.resolve(Fe.value).then(ae,se);ze((Ae=Ae.apply(Ke,Je)).next())});let It,Ye={};for(let Ke=self;Ke;Ke=Object.getPrototypeOf(Ke))for(let Je of Object.getOwnPropertyNames(Ke))Je in Ye||Object.defineProperty(Ye,Je,{get:()=>self[Je]});(()=>{const Ke=()=>{const ce=new Error("not implemented");return ce.code="ENOSYS",ce};if(!Ye.fs){let ce="";Ye.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1,O_DIRECTORY:-1},writeSync(G,ae){ce+=Ae.decode(ae);const se=ce.lastIndexOf(`
928
+ `);return se!=-1&&(console.log(ce.substring(0,se)),ce=ce.substring(se+1)),ae.length},write(G,ae,se,ze,Fe,le){if(se!==0||ze!==ae.length||Fe!==null){le(Ke());return}const ye=this.writeSync(G,ae);le(null,ye)},chmod(G,ae,se){se(Ke())},chown(G,ae,se,ze){ze(Ke())},close(G,ae){ae(Ke())},fchmod(G,ae,se){se(Ke())},fchown(G,ae,se,ze){ze(Ke())},fstat(G,ae){ae(Ke())},fsync(G,ae){ae(null)},ftruncate(G,ae,se){se(Ke())},lchown(G,ae,se,ze){ze(Ke())},link(G,ae,se){se(Ke())},lstat(G,ae){ae(Ke())},mkdir(G,ae,se){se(Ke())},open(G,ae,se,ze){ze(Ke())},read(G,ae,se,ze,Fe,le){le(Ke())},readdir(G,ae){ae(Ke())},readlink(G,ae){ae(Ke())},rename(G,ae,se){se(Ke())},rmdir(G,ae){ae(Ke())},stat(G,ae){ae(Ke())},symlink(G,ae,se){se(Ke())},truncate(G,ae,se){se(Ke())},unlink(G,ae){ae(Ke())},utimes(G,ae,se,ze){ze(Ke())}}}if(Ye.process||(Ye.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw Ke()},pid:-1,ppid:-1,umask(){throw Ke()},cwd(){throw Ke()},chdir(){throw Ke()}}),Ye.path||(Ye.path={resolve(...ce){return ce.join("/")}}),!Ye.crypto)throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");if(!Ye.performance)throw new Error("globalThis.performance is not available, polyfill required (performance.now only)");if(!Ye.TextEncoder)throw new Error("globalThis.TextEncoder is not available, polyfill required");if(!Ye.TextDecoder)throw new Error("globalThis.TextDecoder is not available, polyfill required");const Je=new TextEncoder("utf-8"),Ae=new TextDecoder("utf-8");Ye.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=U=>{U!==0&&console.warn("exit code:",U)},this._exitPromise=new Promise(U=>{this._resolveExitPromise=U}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const ce=(U,te)=>{this.mem.setUint32(U+0,te,!0),this.mem.setUint32(U+4,Math.floor(te/4294967296),!0)},G=U=>{const te=this.mem.getUint32(U+0,!0),Me=this.mem.getInt32(U+4,!0);return te+Me*4294967296},ae=U=>{const te=this.mem.getFloat64(U,!0);if(te===0)return;if(!isNaN(te))return te;const Me=this.mem.getUint32(U,!0);return this._values[Me]},se=(U,te)=>{if(typeof te=="number"&&te!==0){if(isNaN(te)){this.mem.setUint32(U+4,2146959360,!0),this.mem.setUint32(U,0,!0);return}this.mem.setFloat64(U,te,!0);return}if(te===void 0){this.mem.setFloat64(U,0,!0);return}let De=this._ids.get(te);De===void 0&&(De=this._idPool.pop(),De===void 0&&(De=this._values.length),this._values[De]=te,this._goRefCounts[De]=0,this._ids.set(te,De)),this._goRefCounts[De]++;let Qe=0;switch(typeof te){case"object":te!==null&&(Qe=1);break;case"string":Qe=2;break;case"symbol":Qe=3;break;case"function":Qe=4;break}this.mem.setUint32(U+4,2146959360|Qe,!0),this.mem.setUint32(U,De,!0)},ze=U=>{const te=G(U+0),Me=G(U+8);return new Uint8Array(this._inst.exports.mem.buffer,te,Me)},Fe=U=>{const te=G(U+0),Me=G(U+8),De=new Array(Me);for(let Qe=0;Qe<Me;Qe++)De[Qe]=ae(te+Qe*8);return De},le=U=>{const te=G(U+0),Me=G(U+8);return Ae.decode(new DataView(this._inst.exports.mem.buffer,te,Me))},ye=(U,te)=>(this._inst.exports.testExport0(),this._inst.exports.testExport(U,te)),Le=Date.now()-performance.now();this.importObject={_gotest:{add:(U,te)=>U+te,callExport:ye},gojs:{"runtime.wasmExit":U=>{U>>>=0;const te=this.mem.getInt32(U+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(te)},"runtime.wasmWrite":U=>{U>>>=0;const te=G(U+8),Me=G(U+16),De=this.mem.getInt32(U+24,!0);Ye.fs.writeSync(te,new Uint8Array(this._inst.exports.mem.buffer,Me,De))},"runtime.resetMemoryDataView":U=>{this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":U=>{U>>>=0,ce(U+8,(Le+performance.now())*1e6)},"runtime.walltime":U=>{U>>>=0;const te=new Date().getTime();ce(U+8,te/1e3),this.mem.setInt32(U+16,te%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":U=>{U>>>=0;const te=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(te,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(te);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},G(U+8))),this.mem.setInt32(U+16,te,!0)},"runtime.clearTimeoutEvent":U=>{U>>>=0;const te=this.mem.getInt32(U+8,!0);clearTimeout(this._scheduledTimeouts.get(te)),this._scheduledTimeouts.delete(te)},"runtime.getRandomData":U=>{U>>>=0,crypto.getRandomValues(ze(U+8))},"syscall/js.finalizeRef":U=>{U>>>=0;const te=this.mem.getUint32(U+8,!0);if(this._goRefCounts[te]--,this._goRefCounts[te]===0){const Me=this._values[te];this._values[te]=null,this._ids.delete(Me),this._idPool.push(te)}},"syscall/js.stringVal":U=>{U>>>=0,se(U+24,le(U+8))},"syscall/js.valueGet":U=>{U>>>=0;const te=Reflect.get(ae(U+8),le(U+16));U=this._inst.exports.getsp()>>>0,se(U+32,te)},"syscall/js.valueSet":U=>{U>>>=0,Reflect.set(ae(U+8),le(U+16),ae(U+32))},"syscall/js.valueDelete":U=>{U>>>=0,Reflect.deleteProperty(ae(U+8),le(U+16))},"syscall/js.valueIndex":U=>{U>>>=0,se(U+24,Reflect.get(ae(U+8),G(U+16)))},"syscall/js.valueSetIndex":U=>{U>>>=0,Reflect.set(ae(U+8),G(U+16),ae(U+24))},"syscall/js.valueCall":U=>{U>>>=0;try{const te=ae(U+8),Me=Reflect.get(te,le(U+16)),De=Fe(U+32),Qe=Reflect.apply(Me,te,De);U=this._inst.exports.getsp()>>>0,se(U+56,Qe),this.mem.setUint8(U+64,1)}catch(te){U=this._inst.exports.getsp()>>>0,se(U+56,te),this.mem.setUint8(U+64,0)}},"syscall/js.valueInvoke":U=>{U>>>=0;try{const te=ae(U+8),Me=Fe(U+16),De=Reflect.apply(te,void 0,Me);U=this._inst.exports.getsp()>>>0,se(U+40,De),this.mem.setUint8(U+48,1)}catch(te){U=this._inst.exports.getsp()>>>0,se(U+40,te),this.mem.setUint8(U+48,0)}},"syscall/js.valueNew":U=>{U>>>=0;try{const te=ae(U+8),Me=Fe(U+16),De=Reflect.construct(te,Me);U=this._inst.exports.getsp()>>>0,se(U+40,De),this.mem.setUint8(U+48,1)}catch(te){U=this._inst.exports.getsp()>>>0,se(U+40,te),this.mem.setUint8(U+48,0)}},"syscall/js.valueLength":U=>{U>>>=0,ce(U+16,parseInt(ae(U+8).length))},"syscall/js.valuePrepareString":U=>{U>>>=0;const te=Je.encode(String(ae(U+8)));se(U+16,te),ce(U+24,te.length)},"syscall/js.valueLoadString":U=>{U>>>=0;const te=ae(U+8);ze(U+16).set(te)},"syscall/js.valueInstanceOf":U=>{U>>>=0,this.mem.setUint8(U+24,ae(U+8)instanceof ae(U+16)?1:0)},"syscall/js.copyBytesToGo":U=>{U>>>=0;const te=ze(U+8),Me=ae(U+32);if(!(Me instanceof Uint8Array||Me instanceof Uint8ClampedArray)){this.mem.setUint8(U+48,0);return}const De=Me.subarray(0,te.length);te.set(De),ce(U+40,De.length),this.mem.setUint8(U+48,1)},"syscall/js.copyBytesToJS":U=>{U>>>=0;const te=ae(U+8),Me=ze(U+16);if(!(te instanceof Uint8Array||te instanceof Uint8ClampedArray)){this.mem.setUint8(U+48,0);return}const De=Me.subarray(0,te.length);te.set(De),ce(U+40,De.length),this.mem.setUint8(U+48,1)},debug:U=>{console.log(U)}}}}run(ce){return kt(this,null,function*(){if(!(ce instanceof WebAssembly.Instance))throw new Error("Go.run: WebAssembly.Instance expected");this._inst=ce,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,Ye,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[Ye,5],[this,6]]),this._idPool=[],this.exited=!1;let G=4096;const ae=Le=>{const U=G,te=Je.encode(Le+"\0");return new Uint8Array(this.mem.buffer,G,te.length).set(te),G+=te.length,G%8!==0&&(G+=8-G%8),U},se=this.argv.length,ze=[];this.argv.forEach(Le=>{ze.push(ae(Le))}),ze.push(0),Object.keys(this.env).sort().forEach(Le=>{ze.push(ae(`${Le}=${this.env[Le]}`))}),ze.push(0);const le=G;if(ze.forEach(Le=>{this.mem.setUint32(G,Le,!0),this.mem.setUint32(G+4,0,!0),G+=8}),G>=12288)throw new Error("total length of command line and environment variables exceeds limit");this._inst.exports.run(se,le),this.exited&&this._resolveExitPromise(),yield this._exitPromise})}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(ce){const G=this;return function(){const ae={id:ce,this:this,args:arguments};return G._pendingEvent=ae,G._resume(),ae.result}}}})(),It=({data:Ke})=>{let Je=new TextDecoder,Ae=Ye.fs,ce="";Ae.writeSync=(Fe,le)=>{if(Fe===1)vt(le);else if(Fe===2){ce+=Je.decode(le);let ye=ce.split(`
929
+ `);ye.length>1&&console.log(ye.slice(0,-1).join(`
930
+ `)),ce=ye[ye.length-1]}else throw new Error("Bad write");return le.length};let G=[],ae,se=0;It=({data:Fe})=>(Fe.length>0&&(G.push(Fe),ae&&ae()),ze),Ae.read=(Fe,le,ye,Le,U,te)=>{if(Fe!==0||ye!==0||Le!==le.length||U!==null)throw new Error("Bad read");if(G.length===0){ae=()=>Ae.read(Fe,le,ye,Le,U,te);return}let Me=G[0],De=Math.max(0,Math.min(Le,Me.length-se));le.set(Me.subarray(se,se+De),ye),se+=De,se===Me.length&&(G.shift(),se=0),te(null,De)};let ze=new Ye.Go;return ze.argv=["","--service=0.27.3"],on(Ke,ze).then(Fe=>{vt(null),ze.run(Fe)},Fe=>{vt(Fe)}),ze};function on(Ke,Je){return kt(this,null,function*(){if(Ke instanceof WebAssembly.Module)return WebAssembly.instantiate(Ke,Je.importObject);const Ae=yield fetch(Ke);if(!Ae.ok)throw new Error(`Failed to download ${JSON.stringify(Ke)}`);if("instantiateStreaming"in WebAssembly&&/^application\/wasm($|;)/i.test(Ae.headers.get("Content-Type")||""))return(yield WebAssembly.instantiateStreaming(Ae,Je.importObject)).instance;const ce=yield Ae.arrayBuffer();return(yield WebAssembly.instantiate(ce,Je.importObject)).instance})}return Ke=>It(Ke)})(vt=>oe.onmessage({data:vt})),zt;oe={onmessage:null,postMessage:vt=>setTimeout(()=>{try{zt=ct({data:vt})}catch(kt){ke(kt)}}),terminate(){if(zt)for(let vt of zt._scheduledTimeouts.values())clearTimeout(vt)}}}let be,Be;const ue=new Promise((ct,zt)=>{be=ct,Be=zt});oe.onmessage=({data:ct})=>{oe.onmessage=({data:zt})=>bt(zt),ct?Be(ct):be()},oe.postMessage($||new URL(z,location.href).toString());let{readFromStdout:bt,service:wt}=uo({writeToStdin(ct){oe.postMessage(ct)},isSync:!1,hasFS:!1,esbuild:f});yield ue,Ei=()=>{oe.terminate(),Si=void 0,Ei=void 0,_i=void 0},_i={build:ct=>new Promise((zt,vt)=>{Te.then(vt),wt.buildOrContext({callName:"build",refs:null,options:ct,isTTY:!1,defaultWD:"/",callback:(kt,It)=>kt?vt(kt):zt(It)})}),context:ct=>new Promise((zt,vt)=>{Te.then(vt),wt.buildOrContext({callName:"context",refs:null,options:ct,isTTY:!1,defaultWD:"/",callback:(kt,It)=>kt?vt(kt):zt(It)})}),transform:(ct,zt)=>new Promise((vt,kt)=>{Te.then(kt),wt.transform({callName:"transform",refs:null,input:ct,options:zt||{},isTTY:!1,fs:{readFile(It,Ye){Ye(new Error("Internal error"),null)},writeFile(It,Ye){Ye(null)}},callback:(It,Ye)=>It?kt(It):vt(Ye)})}),formatMessages:(ct,zt)=>new Promise((vt,kt)=>{Te.then(kt),wt.formatMessages({callName:"formatMessages",refs:null,messages:ct,options:zt,callback:(It,Ye)=>It?kt(It):vt(Ye)})}),analyzeMetafile:(ct,zt)=>new Promise((vt,kt)=>{Te.then(kt),wt.analyzeMetafile({callName:"analyzeMetafile",refs:null,metafile:typeof ct=="string"?ct:JSON.stringify(ct),options:zt,callback:(It,Ye)=>It?kt(It):vt(Ye)})})}}),pd=f})(e)})(ig)),ig.exports}var p4=tU();function nU(e){const t=Array.from(e.keys()),n=t.find(o=>/\bmain\.(tsx?|jsx?)$/.test(o));if(n)return n;const r=t.find(o=>/\bindex\.(tsx?|jsx?)$/.test(o));if(r)return r;const i=t.find(o=>/\.(tsx|jsx)$/.test(o));return i||t[0]||"main.tsx"}function wh(e,t="main.tsx",n="inline"){return{id:n,entry:t,files:new Map([[t,{path:t,content:e}]])}}var m4=Ac(["browser","cli"]),rU=ja({target:xn().optional(),format:Ac(["esm","cjs","iife"]).optional(),jsx:Ac(["automatic","transform","preserve"]).optional(),jsxFactory:xn().optional(),jsxFragment:xn().optional()}).strict().optional(),iU=ja({globals:Ea(xn(),xn()).optional(),preload:xy(xn()).optional(),deps:Ea(xn(),xn()).optional()}).strict().optional(),oU=Ea(xn(),xn()).optional(),sU=Ea(xn(),xn()).optional(),aU=ja({platform:m4,dependencies:sU,esbuild:rU,framework:iU,aliases:oU}).strict(),lU=ja({type:Ac(["string","number","boolean","object","array"]),default:zE().optional(),required:jE().optional(),description:xn().optional()});ja({name:xn(),version:xn(),description:xn().optional(),platform:m4,image:xn(),inputs:Ea(xn(),lU).optional(),services:xy(xn()).optional(),packages:Ea(xn(),xn()).optional()});ja({typescript:jE().optional()}).strict().optional();var uU=Ac(["embedded","iframe"]);ja({target:f5(e=>e instanceof HTMLElement,{message:"Expected HTMLElement"}),mode:uU,sandbox:xy(xn()).optional(),inputs:Ea(xn(),zE()).optional()});function g4(e){const t=aU.safeParse(e);return t.success?t.data:null}var y4={platform:"browser",esbuild:{target:"es2020",format:"esm",jsx:"automatic"},framework:{}},cU="https://esm.sh",Xy=cU;function dU(e){Xy=e}function Gu(e){if(e.startsWith("@")){const n=e.split("/");if(n.length>=2){const r=n[0],i=n.slice(1).join("/"),o=i.lastIndexOf("@");return o>0?{name:`${r}/${i.slice(0,o)}`,version:i.slice(o+1)}:{name:`${r}/${i}`}}}const t=e.lastIndexOf("@");return t>0?{name:e.slice(0,t),version:e.slice(t+1)}:{name:e}}async function fU(e,t){const n=t?`@${t}`:"",r=`${Xy}/${e}${n}/package.json`,i=await fetch(r);if(!i.ok)throw new Error(`Failed to fetch package.json for ${e}: ${i.statusText}`);return i.json()}async function hU(e){if(typeof globalThis.require>"u"&&typeof process>"u")return null;try{const{createRequire:t}=await rg(async()=>{const{createRequire:g}=await import("./__vite-browser-external-BIHI7g3E.js");return{createRequire:g}},[]),{readFile:n}=await rg(async()=>{const{readFile:g}=await import("./__vite-browser-external-BIHI7g3E.js");return{readFile:g}},[]),{dirname:r,join:i}=await rg(async()=>{const{dirname:g,join:x}=await import("./__vite-browser-external-BIHI7g3E.js");return{dirname:g,join:x}},[]),o=t(import.meta.url);let s;try{s=o.resolve(`${e}/package.json`)}catch{return null}const a=await n(s,"utf-8"),u=JSON.parse(a),d=g4(u.patchwork)||y4;let f,h;const m=r(s);if(u.main)try{const x=await import(i(m,u.main));typeof x.setup=="function"&&(f=x.setup),typeof x.mount=="function"&&(h=x.mount)}catch{}return{name:u.name,version:u.version,config:d,dependencies:u.dependencies||{},setup:f,mount:h}}catch{return null}}async function pU(e){const{name:t,version:n}=Gu(e),r=await hU(t);if(r)return r;const i=await fU(t,n),o=g4(i.patchwork)||y4;let s,a,u;if(i.main&&typeof window<"u")try{const d=n?`@${n}`:"",f=i.main.startsWith("./")?i.main.slice(2):i.main,h=`${Xy}/${t}${d}/${f}`;u=h;const m=await import(h);typeof m.setup=="function"&&(s=m.setup),typeof m.mount=="function"&&(a=m.mount)}catch(d){console.error("[patchwork-compiler] Failed to load image module:",d)}return{name:i.name,version:i.version,moduleUrl:u,config:o,dependencies:i.dependencies||{},setup:s,mount:a}}var mU=class{constructor(){So(this,"images",new Map);So(this,"loading",new Map)}get(e){const{name:t}=Gu(e);return this.images.get(t)}has(e){const{name:t}=Gu(e);return this.images.has(t)}async load(e){const{name:t}=Gu(e),n=this.images.get(t);if(n)return n;const r=this.loading.get(t);if(r)return r;const i=pU(e).then(o=>(this.images.set(t,o),this.loading.delete(t),o));return this.loading.set(t,i),i}async preload(e){await this.load(e)}clear(e){const{name:t}=Gu(e);this.images.delete(t),this.loading.delete(t)}clearAll(){this.images.clear(),this.loading.clear()}getLoadedNames(){return Array.from(this.images.keys())}},og=null;function gU(){return og||(og=new mU),og}var yU="https://esm.sh",x4=yU;function I2(e){x4=e}var xU=new Set(["react","react-dom","ink"]),bU=new Set(["assert","buffer","child_process","cluster","crypto","dgram","dns","events","fs","http","http2","https","net","os","path","perf_hooks","process","querystring","readline","stream","string_decoder","timers","tls","tty","url","util","v8","vm","worker_threads","zlib"]);function E1(e,t,n,r){let i=`${x4}/${e}`;if(t&&(i+=`@${t}`),n&&(i+=`/${n}`),r&&Object.keys(r).length>0){const o=Object.entries(r).map(([s,a])=>`${s}@${a}`).join(",");i+=`?deps=${o}`}return i}function D2(e){return!(e.startsWith(".")||e.startsWith("/")||e.startsWith("http://")||e.startsWith("https://"))}function Mf(e){if(e.startsWith("@")){const i=e.split("/");if(i.length>=2){const o=`${i[0]}/${i[1]}`,s=i.slice(2).join("/");return{packageName:o,subpath:s||void 0}}}const t=e.split("/"),n=t[0],r=t.slice(1).join("/");return{packageName:n,subpath:r||void 0}}function vU(e,t){for(const[n,r]of Object.entries(t)){if(n.endsWith("/*")){const i=n.slice(0,-2);if(e===i||e.startsWith(i+"/"))return r}if(e===n)return r}return null}function kU(e={}){const{packages:t={},external:n=[],bundle:r=!1,globals:i={},deps:o={},aliases:s={}}=e,a=new Set([...xU,...n]),u=new Set(Object.keys(i));return{name:"cdn-transform",setup(d){d.onResolve({filter:/.*/},f=>{const h=vU(f.path,s);if(h){const{packageName:m,subpath:g}=Mf(h);if(u.has(m))return{path:h,namespace:"global-inject"};const x=t[m];let b=E1(m,x,g,Object.keys(o).length>0?o:void 0);return r&&(b+=b.includes("?")?"&bundle":"?bundle"),{path:b,external:!0}}return null}),d.onResolve({filter:/.*/},f=>{if(!D2(f.path))return null;const{packageName:h}=Mf(f.path);return u.has(h)?{path:f.path,namespace:"global-inject"}:null}),d.onLoad({filter:/.*/,namespace:"global-inject"},f=>{const{packageName:h,subpath:m}=Mf(f.path),g=i[h];return g?m?{contents:`export * from '${h}'; export { default } from '${h}';`,loader:"js"}:{contents:`
931
+ const mod = window.${g};
932
+ export default mod;
933
+ // Re-export all properties as named exports
934
+ const { ${O2(h).join(", ")} } = mod;
935
+ export { ${O2(h).join(", ")} };
936
+ `,loader:"js"}:null}),d.onResolve({filter:/.*/},f=>{if(!D2(f.path))return null;if(bU.has(f.path))return{external:!0};const{packageName:h,subpath:m}=Mf(f.path);if(u.has(h))return null;if(a.has(h))return{external:!0};const g=t[h];let x=E1(h,g,m,Object.keys(o).length>0?o:void 0);return r&&(x+=x.includes("?")?"&bundle":"?bundle"),{path:x,external:!0}})}}}function O2(e){return{react:["useState","useEffect","useCallback","useMemo","useRef","useContext","useReducer","useLayoutEffect","useId","createContext","createElement","cloneElement","createRef","forwardRef","lazy","memo","Fragment","Suspense","StrictMode","Component","PureComponent","Children","isValidElement"],"react-dom":["createPortal","flushSync","render","hydrate","unmountComponentAtNode"]}[e]||[]}function wU(e){const t={};for(const[n,r]of Object.entries(e))t[n]=E1(n,r);return t}function CU(e){const t=e.lastIndexOf("/");return t===-1?".":e.slice(0,t)||"."}function SU(e){const t=[];for(const n of e.split("/"))n===".."?t.pop():n&&n!=="."&&t.push(n);return t.join("/")}function EU(e,t){if(t)switch(t){case"typescript":case"ts":return"ts";case"tsx":return"tsx";case"javascript":case"js":return"js";case"jsx":return"jsx";case"json":return"json";case"css":return"css"}switch(e.split(".").pop()){case"ts":return"ts";case"tsx":return"tsx";case"js":return"js";case"jsx":return"jsx";case"json":return"json";case"css":return"css";default:return"tsx"}}function b4(e){return e.startsWith("@/")?e.slice(2):e}function _U(e,t){const n=CU(b4(e)),r=n==="."?t:`${n}/${t}`;return SU(r)}function TU(e,t){if(!t)return null;for(const[n,r]of Object.entries(t)){if(n.endsWith("/*")){const i=n.slice(0,-2);if(e===i||e.startsWith(i+"/"))return r}if(e===n)return r}return null}function AU(e,t){if(e.files.has(t))return t;const n=[".tsx",".ts",".jsx",".js",".json"];for(const r of n)if(e.files.has(t+r))return t+r;for(const r of n){const i=`${t}/index${r}`;if(e.files.has(i))return i}return null}function MU(e,t={}){return{name:"patchwork-vfs",setup(n){n.onResolve({filter:/^@\//},r=>TU(r.path,t.aliases)?null:{path:r.path,namespace:"vfs"}),n.onResolve({filter:/^\./},r=>r.namespace!=="vfs"?null:{path:_U(r.importer,r.path),namespace:"vfs"}),n.onLoad({filter:/.*/,namespace:"vfs"},r=>{const i=b4(r.path),o=AU(e,i);if(!o)throw new Error(`File not found in VFS: ${r.path}`);const s=e.files.get(o);return{contents:s.content,loader:EU(o,s.language)}})}}}function NU(e){return{async call(t,n,r){const i=`${e}/${t}/${n}`,o=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({args:r[0]??{}})});if(!o.ok)throw new Error(`Service call failed: ${o.status} ${o.statusText}`);return await o.json()}}}function IU(e,t){function n(r){const i=(...o)=>t(e,r,...o);return new Proxy(i,{get(o,s){if(typeof s=="symbol")return;const a=r?`${r}.${s}`:s;return n(a)}})}return new Proxy({},{get(r,i){if(typeof i!="symbol")return n(i)}})}function DU(e,t){const n={},r=ex(e);for(const i of r)n[i]=IU(i,(o,s,...a)=>t.call(o,s,a));return n}function OU(e,t){for(const[n,r]of Object.entries(t))e[n]=r}function RU(e,t){for(const n of t)delete e[n]}function ex(e){const t=new Set;for(const n of e){const r=n.split(".");r[0]&&t.add(r[0])}return Array.from(t)}var PU=class{constructor(e){So(this,"proxy");So(this,"pendingCalls",new Map);So(this,"iframes",new Set);So(this,"messageHandler");this.proxy=e,this.messageHandler=this.handleMessage.bind(this),typeof window<"u"&&window.addEventListener("message",this.messageHandler)}registerIframe(e){this.iframes.add(e)}unregisterIframe(e){this.iframes.delete(e)}async handleMessage(e){var r,i;const t=Array.from(this.iframes).find(o=>o.contentWindow===e.source);if(!t)return;const n=e.data;if(!(!n||typeof n!="object")&&n.type==="service-call"){const o=n.payload;try{const s=await this.proxy.call(o.namespace,o.procedure,o.args),a={type:"service-result",id:n.id,payload:{result:s}};(r=t.contentWindow)==null||r.postMessage(a,"*")}catch(s){const a={type:"service-result",id:n.id,payload:{error:s instanceof Error?s.message:String(s)}};(i=t.contentWindow)==null||i.postMessage(a,"*")}}}dispose(){typeof window<"u"&&window.removeEventListener("message",this.messageHandler),this.iframes.clear(),this.pendingCalls.clear()}};function jU(e){return`
937
+ (function() {
938
+ const pendingCalls = new Map();
939
+
940
+ window.addEventListener('message', function(event) {
941
+ const message = event.data;
942
+ if (!message || typeof message !== 'object') return;
943
+
944
+ if (message.type === 'service-result') {
945
+ const pending = pendingCalls.get(message.id);
946
+ if (pending) {
947
+ pendingCalls.delete(message.id);
948
+ if (message.payload.error) {
949
+ pending.reject(new Error(message.payload.error));
950
+ } else {
951
+ pending.resolve(message.payload.result);
952
+ }
953
+ }
954
+ }
955
+ });
956
+
957
+ function proxyCall(namespace, procedure, args) {
958
+ return new Promise(function(resolve, reject) {
959
+ const id = Date.now() + '-' + Math.random().toString(36).slice(2, 11);
960
+ pendingCalls.set(id, { resolve: resolve, reject: reject });
961
+
962
+ window.parent.postMessage({
963
+ type: 'service-call',
964
+ id: id,
965
+ payload: { namespace: namespace, procedure: procedure, args: args }
966
+ }, '*');
967
+
968
+ setTimeout(function() {
969
+ if (pendingCalls.has(id)) {
970
+ pendingCalls.delete(id);
971
+ reject(new Error('Service call timeout: ' + namespace + '.' + procedure));
972
+ }
973
+ }, 30000);
974
+ });
975
+ }
976
+
977
+ // Create a dynamic proxy for a namespace that supports arbitrary nested method calls
978
+ function createNamespaceProxy(namespace) {
979
+ function createNestedProxy(path) {
980
+ var fn = function() {
981
+ return proxyCall(namespace, path, Array.prototype.slice.call(arguments));
982
+ };
983
+
984
+ return new Proxy(fn, {
985
+ get: function(_, nestedName) {
986
+ if (typeof nestedName === 'symbol') return undefined;
987
+ var newPath = path ? path + '.' + nestedName : nestedName;
988
+ return createNestedProxy(newPath);
989
+ }
990
+ });
991
+ }
992
+
993
+ return new Proxy({}, {
994
+ get: function(_, fieldName) {
995
+ if (typeof fieldName === 'symbol') return undefined;
996
+ return createNestedProxy(fieldName);
997
+ }
998
+ });
999
+ }
1000
+
1001
+ ${ex(e).map(r=>`window.${r} = createNamespaceProxy('${r}');`).join(`
1002
+ `)}
1003
+ })();
1004
+ `}var zU=0,sg=!1;function LU(e,t,n){if(sg)return;if(document.querySelector('script[type="importmap"]')){sg=!0;return}const i={};Object.keys(e).forEach((a,u)=>{t[u]?i[a]=t[u]:n!=null&&n[a]?i[a]=`https://esm.sh/${a}@${n[a]}`:i[a]=`https://esm.sh/${a}`}),i["react-dom"]&&(i["react-dom/client"]=i["react-dom"]);const s=document.createElement("script");s.type="importmap",s.textContent=JSON.stringify({imports:i},null,2),document.head.insertBefore(s,document.head.firstChild),sg=!0}function FU(){return`pw-mount-${Date.now()}-${++zU}`}function $U(e){for(const t of e){const n=t==null?void 0:t.createElement;if(typeof n=="function")return n;const r=t==null?void 0:t.default;if(r&&typeof r.createElement=="function")return r.createElement}return null}function BU(e){for(const t of e){if(t&&typeof t.createRoot=="function")return{kind:"root",createRoot:t.createRoot};if(t&&typeof t.render=="function")return{kind:"render",render:t.render};const n=t==null?void 0:t.default;if(n&&typeof n.createRoot=="function")return{kind:"root",createRoot:n.createRoot};if(n&&typeof n.render=="function")return{kind:"render",render:n.render}}return null}async function v4(e,t,n,r){var F;const{target:i,inputs:o={}}=t,s=FU(),a=document.createElement("div");if(a.id=s,a.className="patchwork-widget patchwork-embedded",i.appendChild(a),n!=null&&n.setup&&await n.setup(a),n!=null&&n.css){const R=document.createElement("style");R.id=`${s}-style`,R.textContent=n.css,document.head.appendChild(R)}const u=e.manifest.services||[],d=ex(u),f=DU(u,r);OU(window,f);const h=((F=n==null?void 0:n.config)==null?void 0:F.framework)||{},m=h.preload||[],g=h.globals||{},x=h.deps||{};LU(g,m,x);const b=await Promise.all(m.map(R=>import(R))),v=window,C=Object.values(g);b.forEach((R,D)=>{if(C[D]){const L=C[D];v[L]=R}});const _=new Blob([e.code],{type:"application/javascript"}),E=URL.createObjectURL(_);let I;const N=C.map(R=>v[R]).filter(Boolean);try{const R=await import(E);if(n!=null&&n.mount){const D=await n.mount(R,a,o);typeof D=="function"&&(I=D)}else if(typeof R.mount=="function"){const D=await R.mount(a,o);typeof D=="function"&&(I=D)}else if(typeof R.render=="function"){const D=await R.render(a,o);typeof D=="function"&&(I=D)}else if(typeof R.default=="function"){const D=R.default,L=$U(N),X=BU(N);if(L&&(X==null?void 0:X.kind)==="root"){const ee=X.createRoot(a);ee.render(L(D,o)),typeof ee.unmount=="function"&&(I=()=>ee.unmount())}else if(L&&(X==null?void 0:X.kind)==="render")X.render(L(D,o),a);else{const ee=D(o);ee instanceof HTMLElement?a.appendChild(ee):typeof ee=="string"&&(a.innerHTML=ee)}}}finally{URL.revokeObjectURL(E)}return{id:s,widget:e,mode:"embedded",target:i,inputs:o,unmount:()=>{I&&I(),RU(window,d);const R=document.getElementById(`${s}-style`);R&&R.remove(),a.remove()}}}async function UU(e,t,n,r){return e.unmount(),v4(t,{target:e.target,inputs:e.inputs},n,r)}var VU=0,ag=null;function HU(e){return ag||(ag=new PU(e)),ag}function WU(){return`pw-iframe-${Date.now()}-${++VU}`}var qU=["allow-scripts"];function ZU(e,t,n,r){var x;const i=jU(n),o={...(e==null?void 0:e.dependencies)||{}},s=wU(o),a=(e==null?void 0:e.css)||"",u=((x=e==null?void 0:e.config)==null?void 0:x.framework)||{},d=u.preload||[],f=u.globals||{},h=Object.values(f),m=(e==null?void 0:e.moduleUrl)||"",g=`
1005
+ // Run image setup inside the iframe (styling/runtime)
1006
+ const imageModuleUrl = ${JSON.stringify(m)};
1007
+
1008
+ // Preload framework modules declared by the image (if any)
1009
+ const preloadUrls = ${JSON.stringify(d)};
1010
+ const globalNames = ${JSON.stringify(h)};
1011
+ for (let i = 0; i < preloadUrls.length; i++) {
1012
+ const url = preloadUrls[i];
1013
+ const name = globalNames[i];
1014
+ if (!url || !name) continue;
1015
+ try {
1016
+ const mod = await import(/* webpackIgnore: true */ url);
1017
+ window[name] = mod;
1018
+ } catch (e) {
1019
+ console.error('[patchwork-iframe] Failed to preload:', url, e);
1020
+ }
1021
+ }
1022
+
1023
+ const root = document.getElementById('root');
1024
+ const inputs = window.__PATCHWORK_INPUTS__ || {};
1025
+
1026
+ if (imageModuleUrl && root) {
1027
+ try {
1028
+ const img = await import(/* webpackIgnore: true */ imageModuleUrl);
1029
+ if (typeof img?.setup === 'function') {
1030
+ await img.setup(root);
1031
+ }
1032
+ } catch (e) {
1033
+ console.error('[patchwork-iframe] Failed to run image setup:', e);
1034
+ }
1035
+ }
1036
+
1037
+ function pickCreateElement(globals) {
1038
+ for (const obj of globals) {
1039
+ if (obj && typeof obj.createElement === 'function') return obj.createElement.bind(obj);
1040
+ if (obj?.default && typeof obj.default.createElement === 'function') return obj.default.createElement.bind(obj.default);
1041
+ }
1042
+ return null;
1043
+ }
1044
+
1045
+ function pickRenderer(globals) {
1046
+ for (const obj of globals) {
1047
+ if (obj && typeof obj.createRoot === 'function') {
1048
+ return {
1049
+ kind: 'root',
1050
+ createRoot: obj.createRoot.bind(obj),
1051
+ };
1052
+ }
1053
+ if (obj && typeof obj.render === 'function') {
1054
+ return {
1055
+ kind: 'render',
1056
+ render: obj.render.bind(obj),
1057
+ };
1058
+ }
1059
+ if (obj?.default && typeof obj.default.createRoot === 'function') {
1060
+ return {
1061
+ kind: 'root',
1062
+ createRoot: obj.default.createRoot.bind(obj.default),
1063
+ };
1064
+ }
1065
+ if (obj?.default && typeof obj.default.render === 'function') {
1066
+ return {
1067
+ kind: 'render',
1068
+ render: obj.default.render.bind(obj.default),
1069
+ };
1070
+ }
1071
+ }
1072
+ return null;
1073
+ }
1074
+
1075
+ function getGlobalsFromConfig() {
1076
+ const names = ${JSON.stringify(h)};
1077
+ return names.map((n) => window[n]).filter(Boolean);
1078
+ }
1079
+
1080
+ async function mountModule(mod) {
1081
+ if (!root) throw new Error('No #root element');
1082
+
1083
+ if (typeof mod?.mount === 'function') {
1084
+ const cleanup = await mod.mount(root, inputs);
1085
+ if (typeof cleanup === 'function') window.__PATCHWORK_CLEANUP__ = cleanup;
1086
+ return;
1087
+ }
1088
+
1089
+ if (typeof mod?.render === 'function') {
1090
+ const cleanup = await mod.render(root, inputs);
1091
+ if (typeof cleanup === 'function') window.__PATCHWORK_CLEANUP__ = cleanup;
1092
+ return;
1093
+ }
1094
+
1095
+ const Component = mod?.default;
1096
+ if (typeof Component !== 'function') {
1097
+ root.textContent = 'Widget did not export a default component.';
1098
+ return;
1099
+ }
1100
+
1101
+ const globals = getGlobalsFromConfig();
1102
+ const createElement = pickCreateElement(globals);
1103
+ const renderer = pickRenderer(globals);
1104
+
1105
+ if (createElement && renderer?.kind === 'root') {
1106
+ const r = renderer.createRoot(root);
1107
+ r.render(createElement(Component, inputs));
1108
+ if (typeof r.unmount === 'function') window.__PATCHWORK_CLEANUP__ = () => r.unmount();
1109
+ return;
1110
+ }
1111
+
1112
+ if (createElement && renderer?.kind === 'render') {
1113
+ renderer.render(createElement(Component, inputs), root);
1114
+ return;
1115
+ }
1116
+
1117
+ const result = Component(inputs);
1118
+ if (result instanceof HTMLElement) {
1119
+ root.appendChild(result);
1120
+ return;
1121
+ }
1122
+ if (typeof result === 'string') {
1123
+ root.innerHTML = result;
1124
+ return;
1125
+ }
1126
+
1127
+ root.textContent = 'No framework renderer available for this widget.';
1128
+ }
1129
+
1130
+ // Wait for widget code via postMessage (more efficient than inline in srcdoc)
1131
+ // We convert relative URLs to absolute so they work inside blob URL context
1132
+ window.addEventListener('message', async function handleWidgetCode(event) {
1133
+ if (!event.data || event.data.type !== 'widget-code') return;
1134
+ window.removeEventListener('message', handleWidgetCode);
1135
+
1136
+ const widgetCode = event.data.code;
1137
+ const origin = event.data.origin || ''; // Parent sends the origin
1138
+
1139
+ // Convert relative URLs (starting with /) to absolute URLs
1140
+ // This is necessary because blob: URLs can't resolve relative imports
1141
+ // and srcdoc iframes have null origin
1142
+ const absoluteCode = widgetCode.replace(
1143
+ /from\\s*["'](\\/[^"']+)["']/g,
1144
+ (_, path) => 'from "' + origin + path + '"'
1145
+ ).replace(
1146
+ /import\\s*["'](\\/[^"']+)["']/g,
1147
+ (_, path) => 'import "' + origin + path + '"'
1148
+ );
1149
+
1150
+ const blob = new Blob([absoluteCode], { type: 'application/javascript' });
1151
+ const url = URL.createObjectURL(blob);
1152
+
1153
+ try {
1154
+ const mod = await import(/* webpackIgnore: true */ url);
1155
+ await mountModule(mod);
1156
+ window.parent.postMessage({ type: 'widget-mounted' }, '*');
1157
+ } catch (e) {
1158
+ console.error('[patchwork-iframe] Failed to mount widget:', e);
1159
+ window.parent.postMessage({ type: 'widget-error', error: e.message }, '*');
1160
+ } finally {
1161
+ URL.revokeObjectURL(url);
1162
+ }
1163
+ });
1164
+
1165
+ // Signal ready to receive widget code
1166
+ window.parent.postMessage({ type: 'widget-ready' }, '*');
1167
+
1168
+ // Set up ResizeObserver to report body size changes to parent
1169
+ const resizeObserver = new ResizeObserver((entries) => {
1170
+ for (const entry of entries) {
1171
+ const { width, height } = entry.contentRect;
1172
+ window.parent.postMessage({
1173
+ type: 'widget-resize',
1174
+ width: Math.ceil(width),
1175
+ height: Math.ceil(height)
1176
+ }, '*');
1177
+ }
1178
+ });
1179
+ resizeObserver.observe(document.body);
1180
+ `;return`<!DOCTYPE html>
1181
+ <html>
1182
+ <head>
1183
+ <base href="${r}">
1184
+ <meta charset="UTF-8">
1185
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
1186
+ <style>
1187
+ * { box-sizing: border-box; margin: 0; padding: 0; }
1188
+ body { font-family: system-ui, -apple-system, sans-serif; }
1189
+ ${a}
1190
+ </style>
1191
+ <script type="importmap">
1192
+ ${JSON.stringify({imports:s},null,2)}
1193
+ <\/script>
1194
+ </head>
1195
+ <body>
1196
+ <div id="root"></div>
1197
+
1198
+ <!-- Service Bridge -->
1199
+ <script>
1200
+ ${i}
1201
+ <\/script>
1202
+
1203
+ <!-- Widget Inputs -->
1204
+ <script>
1205
+ window.__PATCHWORK_INPUTS__ = ${JSON.stringify(t)};
1206
+ <\/script>
1207
+
1208
+ <script type="module">
1209
+ ${g}
1210
+ <\/script>
1211
+ </body>
1212
+ </html>`}async function k4(e,t,n,r){const{target:i,sandbox:o=qU,inputs:s={}}=t,a=WU(),u=document.createElement("iframe");u.id=a,u.className="patchwork-widget patchwork-iframe",u.style.cssText="width: 100%; border: none; overflow: hidden;",u.sandbox.add(...o);const d=HU(r);d.registerIframe(u);const f=e.manifest.services||[],h=typeof window<"u"?window.location.origin:"",m=ZU(n,s,f,h);u.srcdoc=m,i.appendChild(u);const g=b=>{var v;if(b.source===u.contentWindow&&((v=b.data)==null?void 0:v.type)==="widget-resize"){const{height:C}=b.data;typeof C=="number"&&C>0&&(u.style.height=`${C}px`)}};return window.addEventListener("message",g),await new Promise((b,v)=>{const C=setTimeout(()=>{E(),v(new Error("Iframe mount timeout"))},3e4),_=I=>{var N,M,F,R;I.source===u.contentWindow&&(((N=I.data)==null?void 0:N.type)==="widget-ready"?(M=u.contentWindow)==null||M.postMessage({type:"widget-code",code:e.code,origin:h},"*"):((F=I.data)==null?void 0:F.type)==="widget-mounted"?(E(),b()):((R=I.data)==null?void 0:R.type)==="widget-error"&&(E(),v(new Error(I.data.error||"Widget mount failed"))))},E=()=>{clearTimeout(C),window.removeEventListener("message",_)};window.addEventListener("message",_)}),{id:a,widget:e,mode:"iframe",target:i,iframe:u,inputs:s,sandbox:o,unmount:()=>{window.removeEventListener("message",g),d.unregisterIframe(u),u.remove()}}}async function JU(e,t,n,r){return e.unmount(),k4(t,{target:e.target,sandbox:e.sandbox,inputs:e.inputs},n,r)}var lg=!1,Nf=null;async function KU(){if(!lg)return Nf||(Nf=(async()=>{try{await p4.initialize({wasmURL:"https://unpkg.com/esbuild-wasm/esbuild.wasm"}),lg=!0}catch(e){if(e instanceof Error&&e.message.includes("initialized"))lg=!0;else throw e}})(),Nf)}function GU(e){const n=new TextEncoder().encode(e);let r=0;for(let i=0;i<n.length;i++)r=(r<<5)-r+(n[i]??0)|0;return Math.abs(r).toString(16).padStart(8,"0")}async function YU(e){await KU();const{image:t,proxyUrl:n,cdnBaseUrl:r,widgetCdnBaseUrl:i}=e;r&&dU(r),i?I2(i):r&&I2(r);const o=gU();await o.preload(t);const s=NU(n);return new QU(s,o)}var QU=class{constructor(e,t){So(this,"proxy");So(this,"registry");this.proxy=e,this.registry=t}async preloadImage(e){await this.registry.preload(e)}isImageLoaded(e){return this.registry.has(e)}async compile(e,t,n={}){var I,N;const r=typeof e=="string"?wh(e):e,i=r.entry.split(".").pop(),o=i==="ts"||i==="tsx"?"tsx":"jsx",s=this.registry.get(t.image)||null,a=(s==null?void 0:s.config.esbuild)||{},u=(s==null?void 0:s.config.framework)||{},d=a.target||"es2020",f=a.format||"esm",h=a.jsx??"automatic",m={...(s==null?void 0:s.dependencies)||{},...t.packages||{}},g=u.globals||{},x=u.deps||{},b=(s==null?void 0:s.config.aliases)||{},v=r.files.get(r.entry);if(!v)throw new Error(`Entry file not found: ${r.entry}`);const _=((N=(I=(await p4.build({stdin:{contents:v.content,loader:o,sourcefile:r.entry},bundle:!0,format:f,target:d,platform:t.platform==="cli"?"node":"browser",jsx:h,...a.jsxFactory?{jsxFactory:a.jsxFactory}:{},...a.jsxFragment?{jsxFragment:a.jsxFragment}:{},write:!1,sourcemap:"inline",plugins:[MU(r,{aliases:b}),kU({packages:m,globals:g,deps:x,aliases:b})]})).outputFiles)==null?void 0:I[0])==null?void 0:N.text)||"",E=GU(_);return{code:_,hash:E,manifest:t}}async mount(e,t){const n=this.registry.get(e.manifest.image)||null;return t.mode==="iframe"?k4(e,t,n,this.proxy):v4(e,t,n,this.proxy)}unmount(e){e.unmount()}async reload(e,t,n){const r=await this.compile(t,n),i=this.registry.get(r.manifest.image)||null;e.mode==="iframe"?await JU(e,r,i,this.proxy):await UU(e,r,i,this.proxy)}},XU=class{constructor(e,t=""){this.backend=e,this.root=t}key(e){return this.root?`${this.root}/${e}`:e}async getFile(e){const t=await this.backend.get(this.key(e));return t?{path:e,content:t}:null}async putFile(e){await this.backend.put(this.key(e.path),e.content)}async deleteFile(e){await this.backend.delete(this.key(e))}async listFiles(e){const t=e?this.key(e):this.root;return(await this.backend.list(t)).map(r=>this.root?r.slice(this.root.length+1):r)}async loadProject(e){const t=await this.listFiles(e);if(t.length===0)return null;const n=new Map;return await Promise.all(t.map(async r=>{const i=await this.getFile(r);i&&n.set(r.slice(e.length+1),i)})),{id:e,entry:nU(n),files:n}}async saveProject(e){await Promise.all(Array.from(e.files.values()).map(t=>this.putFile({...t,path:`${e.id}/${t.path}`})))}},eV=class{constructor(e){this.config=e}async get(e){const t=await fetch(`${this.config.baseUrl}/${e}`);return t.ok?t.text():null}async put(e,t){await fetch(`${this.config.baseUrl}/${e}`,{method:"PUT",body:t})}async delete(e){await fetch(`${this.config.baseUrl}/${e}`,{method:"DELETE"})}async list(e){const t=e?`${this.config.baseUrl}?prefix=${encodeURIComponent(e)}`:this.config.baseUrl;return(await fetch(t)).json()}async exists(e){return(await fetch(`${this.config.baseUrl}/${e}`,{method:"HEAD"})).ok}};function Qn(e){this.content=e}Qn.prototype={constructor:Qn,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),o=r.content.slice();return i==-1?o.push(n||e,t):(o[i+1]=t,n&&(o[i]=n)),new Qn(o)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new Qn(n)},addToStart:function(e,t){return new Qn([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new Qn(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),o=r.find(e);return i.splice(o==-1?i.length:o,0,t,n),new Qn(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=Qn.from(e),e.size?new Qn(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=Qn.from(e),e.size?new Qn(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=Qn.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}};Qn.from=function(e){if(e instanceof Qn)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Qn(t)};function w4(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),o=t.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=w4(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function C4(e,t,n,r){for(let i=e.childCount,o=t.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let s=e.child(--i),a=t.child(--o),u=s.nodeSize;if(s==a){n-=u,r-=u;continue}if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let d=0,f=Math.min(s.text.length,a.text.length);for(;d<f&&s.text[s.text.length-d-1]==a.text[a.text.length-d-1];)d++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){let d=C4(s.content,a.content,n-1,r-1);if(d)return d}n-=u,r-=u}}class fe{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let r=0;r<t.length;r++)this.size+=t[r].nodeSize}nodesBetween(t,n,r,i=0,o){for(let s=0,a=0;a<n;s++){let u=this.content[s],d=a+u.nodeSize;if(d>t&&r(u,i+a,o||null,s)!==!1&&u.content.size){let f=a+1;u.nodesBetween(Math.max(0,t-f),Math.min(u.content.size,n-f),r,i+f)}a=d}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,r,i){let o="",s=!0;return this.nodesBetween(t,n,(a,u)=>{let d=a.isText?a.text.slice(Math.max(t,u)-u,n-u):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&d||a.isTextblock)&&r&&(s?s=!1:o+=r),o+=d},0),o}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.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);o<t.content.length;o++)i.push(t.content[o]);return new fe(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let o=0,s=0;s<n;o++){let a=this.content[o],u=s+a.nodeSize;u>t&&((s<t||u>n)&&(a.isText?a=a.cut(Math.max(0,t-s),Math.min(a.text.length,n-s)):a=a.cut(Math.max(0,t-s-1),Math.min(a.content.size,n-s-1))),r.push(a),i+=a.nodeSize),s=u}return new fe(r,i)}cutByIndex(t,n){return t==n?fe.empty:t==0&&n==this.content.length?this:new fe(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new fe(i,o)}addToStart(t){return new fe([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new fe(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(t.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let n=this.content[t];if(!n)throw new RangeError("Index "+t+" out of range for "+this);return n}maybeChild(t){return this.content[t]||null}forEach(t){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];t(i,r,n),r+=i.nodeSize}}findDiffStart(t,n=0){return w4(this,t,n)}findDiffEnd(t,n=this.size,r=t.size){return C4(this,t,n,r)}findIndex(t){if(t==0)return If(0,t);if(t==this.size)return If(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),o=r+i.nodeSize;if(o>=t)return o==t?If(n+1,o):If(n,r);r=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return fe.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new fe(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return fe.empty;let n,r=0;for(let i=0;i<t.length;i++){let o=t[i];r+=o.nodeSize,i&&o.isText&&t[i-1].sameMarkup(o)?(n||(n=t.slice(0,i)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new fe(n||t,r)}static from(t){if(!t)return fe.empty;if(t instanceof fe)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new fe([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}fe.empty=new fe([],0);const ug={index:0,offset:0};function If(e,t){return ug.index=e,ug.offset=t,ug}function Ch(e,t){if(e===t)return!0;if(!(e&&typeof e=="object")||!(t&&typeof t=="object"))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!Ch(e[r],t[r]))return!1}else{for(let r in e)if(!(r in t)||!Ch(e[r],t[r]))return!1;for(let r in t)if(!(r in e))return!1}return!0}let Wt=class _1{constructor(t,n){this.type=t,this.attrs=n}addToSet(t){let n,r=!1;for(let i=0;i<t.length;i++){let o=t[i];if(this.eq(o))return t;if(this.type.excludes(o.type))n||(n=t.slice(0,i));else{if(o.type.excludes(this.type))return t;!r&&o.type.rank>this.type.rank&&(n||(n=t.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=t.slice()),r||n.push(this),n}removeFromSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return t.slice(0,n).concat(t.slice(n+1));return t}isInSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return!0;return!1}eq(t){return this==t||this.type==t.type&&Ch(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=t.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(t,n){if(t==n)return!0;if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].eq(n[r]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return _1.none;if(t instanceof _1)return[t];let n=t.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};Wt.none=[];class Sh extends Error{}class We{constructor(t,n,r){this.content=t,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=E4(this.content,t+this.openStart,n);return r&&new We(r,this.openStart,this.openEnd)}removeBetween(t,n){return new We(S4(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return We.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 We(fe.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let o=t.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=t.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new We(t,r,i)}}We.empty=new We(fe.empty,0,0);function S4(e,t,n){let{index:r,offset:i}=e.findIndex(t),o=e.maybeChild(r),{index:s,offset:a}=e.findIndex(n);if(i==t||o.isText){if(a!=n&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(r,o.copy(S4(o.content,t-i-1,n-i-1)))}function E4(e,t,n,r){let{index:i,offset:o}=e.findIndex(t),s=e.maybeChild(i);if(o==t||s.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let a=E4(s.content,t-o-1,n,s);return a&&e.replaceChild(i,s.copy(a))}function tV(e,t,n){if(n.openStart>e.depth)throw new Sh("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Sh("Inconsistent open depths");return _4(e,t,n,0)}function _4(e,t,n,r){let i=e.index(r),o=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let s=_4(e,t,n,r+1);return o.copy(o.content.replaceChild(i,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let s=e.parent,a=s.content;return va(s,a.cut(0,e.parentOffset).append(n.content).append(a.cut(t.parentOffset)))}else{let{start:s,end:a}=nV(n,e);return va(o,A4(e,s,a,t,r))}else return va(o,Eh(e,t,r))}function T4(e,t){if(!t.type.compatibleContent(e.type))throw new Sh("Cannot join "+t.type.name+" onto "+e.type.name)}function T1(e,t,n){let r=e.node(n);return T4(r,t.node(n)),r}function ba(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function cc(e,t,n,r){let i=(t||e).node(n),o=0,s=t?t.index(n):i.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(ba(e.nodeAfter,r),o++));for(let a=o;a<s;a++)ba(i.child(a),r);t&&t.depth==n&&t.textOffset&&ba(t.nodeBefore,r)}function va(e,t){return e.type.checkContent(t),e.copy(t)}function A4(e,t,n,r,i){let o=e.depth>i&&T1(e,t,i+1),s=r.depth>i&&T1(n,r,i+1),a=[];return cc(null,e,i,a),o&&s&&t.index(i)==n.index(i)?(T4(o,s),ba(va(o,A4(e,t,n,r,i+1)),a)):(o&&ba(va(o,Eh(e,t,i+1)),a),cc(t,n,i,a),s&&ba(va(s,Eh(n,r,i+1)),a)),cc(r,null,i,a),new fe(a)}function Eh(e,t,n){let r=[];if(cc(null,e,n,r),e.depth>n){let i=T1(e,t,n+1);ba(va(i,Eh(e,t,n+1)),r)}return cc(t,null,n,r),new fe(r)}function nV(e,t){let n=t.depth-e.openStart,i=t.node(n).copy(e.content);for(let o=n-1;o>=0;o--)i=t.node(o).copy(fe.from(i));return{start:i.resolveNoCache(e.openStart+n),end:i.resolveNoCache(i.content.size-e.openEnd-n)}}class Rc{constructor(t,n,r){this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=t.child(n);return r?t.child(n).cut(r):i}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o<t;o++)i+=r.child(o).nodeSize;return i}marks(){let t=this.parent,n=this.index();if(t.content.size==0)return Wt.none;if(this.textOffset)return t.child(n).marks;let r=t.maybeChild(n-1),i=t.maybeChild(n);if(!r){let a=r;r=i,i=a}let o=r.marks;for(var s=0;s<o.length;s++)o[s].type.spec.inclusive===!1&&(!i||!o[s].isInSet(i.marks))&&(o=o[s--].removeFromSet(o));return o}marksAcross(t){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=t.parent.maybeChild(t.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(t){for(let n=this.depth;n>0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos<this.pos)return t.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);r>=0;r--)if(t.pos<=this.end(r)&&(!n||n(this.node(r))))return new _h(this,t,r);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let n=1;n<=this.depth;n++)t+=(t?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return t+":"+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let s=t;;){let{index:a,offset:u}=s.content.findIndex(o),d=o-u;if(r.push(s,a,i+u),!d||(s=s.child(a),s.isText))break;o=d-1,i+=u+1}return new Rc(n,r,o)}static resolveCached(t,n){let r=R2.get(t);if(r)for(let o=0;o<r.elts.length;o++){let s=r.elts[o];if(s.pos==n)return s}else R2.set(t,r=new rV);let i=r.elts[r.i]=Rc.resolve(t,n);return r.i=(r.i+1)%iV,i}}class rV{constructor(){this.elts=[],this.i=0}}const iV=12,R2=new WeakMap;class _h{constructor(t,n,r){this.$from=t,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const oV=Object.create(null);let Ns=class A1{constructor(t,n,r,i=Wt.none){this.type=t,this.attrs=n,this.marks=i,this.content=r||fe.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,n,r,i=0){this.content.nodesBetween(t,n,r,i,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,n,r,i){return this.content.textBetween(t,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,n,r){return this.type==t&&Ch(this.attrs,n||t.defaultAttrs||oV)&&Wt.sameSet(this.marks,r||Wt.none)}copy(t=null){return t==this.content?this:new A1(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new A1(this.type,this.attrs,this.content,t)}cut(t,n=this.content.size){return t==0&&n==this.content.size?this:this.copy(this.content.cut(t,n))}slice(t,n=this.content.size,r=!1){if(t==n)return We.empty;let i=this.resolve(t),o=this.resolve(n),s=r?0:i.sharedDepth(n),a=i.start(s),d=i.node(s).content.cut(i.pos-a,o.pos-a);return new We(d,i.depth-s,o.depth-s)}replace(t,n,r){return tV(this.resolve(t),this.resolve(n),r)}nodeAt(t){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(t);if(n=n.maybeChild(r),!n)return null;if(i==t||n.isText)return n;t-=i+1}}childAfter(t){let{index:n,offset:r}=this.content.findIndex(t);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(t){if(t==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(t);if(r<t)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(t){return Rc.resolveCached(this,t)}resolveNoCache(t){return Rc.resolve(this,t)}rangeHasMark(t,n,r){let i=!1;return n>t&&this.nodesBetween(t,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 t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),M4(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,r=fe.empty,i=0,o=r.childCount){let s=this.contentMatchAt(t).matchFragment(r,i,o),a=s&&s.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let u=i;u<o;u++)if(!this.type.allowsMarks(r.child(u).marks))return!1;return!0}canReplaceWith(t,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(t).matchType(r),s=o&&o.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let t=Wt.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),t=r.addToSet(t)}if(!Wt.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,r)}let i=fe.fromJSON(t,n.content),o=t.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};Ns.prototype.text=void 0;class Th extends Ns{constructor(t,n,r,i){if(super(t,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):M4(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new Th(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new Th(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function M4(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class Ma{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new sV(t,n);if(r.next==null)return Ma.empty;let i=N4(r);r.next&&r.err("Unexpected trailing text");let o=hV(fV(i));return pV(o,r),o}matchType(t){for(let n=0;n<this.next.length;n++)if(this.next[n].type==t)return this.next[n].next;return null}matchFragment(t,n=0,r=t.childCount){let i=this;for(let o=n;i&&o<r;o++)i=i.matchType(t.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:n}=this.next[t];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(t){for(let n=0;n<this.next.length;n++)for(let r=0;r<t.next.length;r++)if(this.next[n].type==t.next[r].type)return!0;return!1}fillBefore(t,n=!1,r=0){let i=[this];function o(s,a){let u=s.matchFragment(t,r);if(u&&(!n||u.validEnd))return fe.from(a.map(d=>d.createAndFill()));for(let d=0;d<s.next.length;d++){let{type:f,next:h}=s.next[d];if(!(f.isText||f.hasRequiredAttrs())&&i.indexOf(h)==-1){i.push(h);let m=o(h,a.concat(f));if(m)return m}}return null}return o(this,[])}findWrapping(t){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==t)return this.wrapCache[r+1];let n=this.computeWrapping(t);return this.wrapCache.push(t,n),n}computeWrapping(t){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(t)){let s=[];for(let a=i;a.type;a=a.via)s.push(a.type);return s.reverse()}for(let s=0;s<o.next.length;s++){let{type:a,next:u}=o.next[s];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!i.type||u.validEnd)&&(r.push({match:a.contentMatch,type:a,via:i}),n[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(r){t.push(r);for(let i=0;i<r.next.length;i++)t.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),t.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)o+=(s?", ":"")+r.next[s].type.name+"->"+t.indexOf(r.next[s].next);return o}).join(`
1213
+ `)}}Ma.empty=new Ma(!0);class sV{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function N4(e){let t=[];do t.push(aV(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function aV(e){let t=[];do t.push(lV(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function lV(e){let t=dV(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=uV(e,t);else break;return t}function P2(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function uV(e,t){let n=P2(e),r=n;return e.eat(",")&&(e.next!="}"?r=P2(e):r=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function cV(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let o in n){let s=n[o];s.isInGroup(t)&&i.push(s)}return i.length==0&&e.err("No node type or group '"+t+"' found"),i}function dV(e){if(e.eat("(")){let t=N4(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=cV(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function fV(e){let t=[[]];return i(o(e,0),n()),t;function n(){return t.push([])-1}function r(s,a,u){let d={term:u,to:a};return t[s].push(d),d}function i(s,a){s.forEach(u=>u.to=a)}function o(s,a){if(s.type=="choice")return s.exprs.reduce((u,d)=>u.concat(o(d,a)),[]);if(s.type=="seq")for(let u=0;;u++){let d=o(s.exprs[u],a);if(u==s.exprs.length-1)return d;i(d,a=n())}else if(s.type=="star"){let u=n();return r(a,u),i(o(s.expr,u),u),[r(u)]}else if(s.type=="plus"){let u=n();return i(o(s.expr,a),u),i(o(s.expr,u),u),[r(u)]}else{if(s.type=="opt")return[r(a)].concat(o(s.expr,a));if(s.type=="range"){let u=a;for(let d=0;d<s.min;d++){let f=n();i(o(s.expr,u),f),u=f}if(s.max==-1)i(o(s.expr,u),u);else for(let d=s.min;d<s.max;d++){let f=n();r(u,f),i(o(s.expr,u),f),u=f}return[r(u)]}else{if(s.type=="name")return[r(a,void 0,s.value)];throw new Error("Unknown expr type")}}}}function I4(e,t){return t-e}function j2(e,t){let n=[];return r(t),n.sort(I4);function r(i){let o=e[i];if(o.length==1&&!o[0].term)return r(o[0].to);n.push(i);for(let s=0;s<o.length;s++){let{term:a,to:u}=o[s];!a&&n.indexOf(u)==-1&&r(u)}}}function hV(e){let t=Object.create(null);return n(j2(e,0));function n(r){let i=[];r.forEach(s=>{e[s].forEach(({term:a,to:u})=>{if(!a)return;let d;for(let f=0;f<i.length;f++)i[f][0]==a&&(d=i[f][1]);j2(e,u).forEach(f=>{d||i.push([a,d=[]]),d.indexOf(f)==-1&&d.push(f)})})});let o=t[r.join(",")]=new Ma(r.indexOf(e.length-1)>-1);for(let s=0;s<i.length;s++){let a=i[s][1].sort(I4);o.next.push({type:i[s][0],next:t[a.join(",")]||n(a)})}return o}}function pV(e,t){for(let n=0,r=[e];n<r.length;n++){let i=r[n],o=!i.validEnd,s=[];for(let a=0;a<i.next.length;a++){let{type:u,next:d}=i.next[a];s.push(u.name),o&&!(u.isText||u.hasRequiredAttrs())&&(o=!1),r.indexOf(d)==-1&&r.push(d)}o&&t.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function D4(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function O4(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let o=e[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function R4(e,t,n,r){for(let i in t)if(!(i in e))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let i in e){let o=e[i];o.validate&&o.validate(t[i])}}function P4(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new gV(e,r,t[r]);return n}let z2=class j4{constructor(t,n,r){this.name=t,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=P4(t,r.attrs),this.defaultAttrs=D4(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||t=="text"),this.isText=t=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Ma.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(t){return this.groups.indexOf(t)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:O4(this.attrs,t)}create(t=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Ns(this,this.computeAttrs(t),fe.from(n),Wt.setFrom(r))}createChecked(t=null,n,r){return n=fe.from(n),this.checkContent(n),new Ns(this,this.computeAttrs(t),n,Wt.setFrom(r))}createAndFill(t=null,n,r){if(t=this.computeAttrs(t),n=fe.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let i=this.contentMatch.matchFragment(n),o=i&&i.fillBefore(fe.empty,!0);return o?new Ns(this,t,n.append(o),Wt.setFrom(r)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let r=0;r<t.childCount;r++)if(!this.allowsMarks(t.child(r).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw new RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}checkAttrs(t){R4(this.attrs,t,"node",this.name)}allowsMarkType(t){return this.markSet==null||this.markSet.indexOf(t)>-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;n<t.length;n++)if(!this.allowsMarkType(t[n].type))return!1;return!0}allowedMarks(t){if(this.markSet==null)return t;let n;for(let r=0;r<t.length;r++)this.allowsMarkType(t[r].type)?n&&n.push(t[r]):n||(n=t.slice(0,r));return n?n.length?n:Wt.none:t}static compile(t,n){let r=Object.create(null);t.forEach((o,s)=>r[o]=new j4(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 mV(e,t,n){let r=n.split("|");return i=>{let o=i===null?"null":typeof i;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${o}`)}}class gV{constructor(t,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?mV(t,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Np{constructor(t,n,r,i){this.name=t,this.rank=n,this.schema=r,this.spec=i,this.attrs=P4(t,i.attrs),this.excluded=null;let o=D4(this.attrs);this.instance=o?new Wt(this,o):null}create(t=null){return!t&&this.instance?this.instance:new Wt(this,O4(this.attrs,t))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((o,s)=>r[o]=new Np(o,i++,n,s)),r}removeFromSet(t){for(var n=0;n<t.length;n++)t[n].type==this&&(t=t.slice(0,n).concat(t.slice(n+1)),n--);return t}isInSet(t){for(let n=0;n<t.length;n++)if(t[n].type==this)return t[n]}checkAttrs(t){R4(this.attrs,t,"mark",this.name)}excludes(t){return this.excluded.indexOf(t)>-1}}class tx{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in t)n[i]=t[i];n.nodes=Qn.from(t.nodes),n.marks=Qn.from(t.marks||{}),this.nodes=z2.compile(this.spec.nodes,this),this.marks=Np.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]=Ma.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?L2(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==""?[]:L2(this,s.split(" "))}this.nodeFromJSON=i=>Ns.fromJSON(this,i),this.markFromJSON=i=>Wt.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,r,i){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof z2){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,r,i)}text(t,n){let r=this.nodes.text;return new Th(r,r.defaultAttrs,t,Wt.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}}function L2(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],o=e.marks[i],s=o;if(o)n.push(o);else for(let a in e.marks){let u=e.marks[a];(i=="_"||u.spec.group&&u.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=u)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}function yV(e){return e.tag!=null}function xV(e){return e.style!=null}class Oo{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(yV(i))this.tags.push(i);else if(xV(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=t.nodes[i.node];return o.contentMatch.matchType(o)})}parse(t,n={}){let r=new $2(this,n,!1);return r.addAll(t,Wt.none,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new $2(this,n,!0);return r.addAll(t,Wt.none,n.from,n.to),We.maxOpen(r.finish())}matchTag(t,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(kV(t,o.tag)&&(o.namespace===void 0||t.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let s=o.getAttrs(t);if(s===!1)continue;o.attrs=s||void 0}return o}}}matchStyle(t,n,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let s=this.styles[o],a=s.style;if(!(a.indexOf(t)!=0||s.context&&!r.matchesContext(s.context)||a.length>t.length&&(a.charCodeAt(t.length)!=61||a.slice(t.length+1)!=n))){if(s.getAttrs){let u=s.getAttrs(n);if(u===!1)continue;s.attrs=u||void 0}return s}}}static schemaRules(t){let n=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s<n.length;s++){let a=n[s];if((a.priority==null?50:a.priority)<o)break}n.splice(s,0,i)}for(let i in t.marks){let o=t.marks[i].spec.parseDOM;o&&o.forEach(s=>{r(s=B2(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in t.nodes){let o=t.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=B2(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new Oo(t,Oo.schemaRules(t)))}}const z4={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},bV={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},L4={ol:!0,ul:!0},Pc=1,M1=2,dc=4;function F2(e,t,n){return t!=null?(t?Pc:0)|(t==="full"?M1:0):e&&e.whitespace=="pre"?Pc|M1:n&~dc}class Df{constructor(t,n,r,i,o,s){this.type=t,this.attrs=n,this.marks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=Wt.none,this.match=o||(s&dc?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(fe.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(t.type))?(this.match=r,i):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&Pc)){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=fe.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(fe.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!z4.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class $2{constructor(t,n,r){this.parser=t,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,o,s=F2(null,n.preserveWhitespace,0)|(r?dc:0);i?o=new Df(i.type,i.attrs,Wt.none,!0,n.topMatch||i.type.contentMatch,s):r?o=new Df(null,null,Wt.none,!0,null,s):o=new Df(t.schema.topNodeType,null,Wt.none,!0,null,s),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,n){t.nodeType==3?this.addTextNode(t,n):t.nodeType==1&&this.addElement(t,n)}addTextNode(t,n){let r=t.nodeValue,i=this.top,o=i.options&M1?"full":this.localPreserveWS||(i.options&Pc)>0,{schema:s}=this.parser;if(o==="full"||i.inlineContext(t)||/[^ \t\r\n\u000c]/.test(r)){if(o)if(o==="full")r=r.replace(/\r\n?/g,`
1214
+ `);else if(s.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(s.linebreakReplacement.create())){let a=r.split(/\r?\n|\r/);for(let u=0;u<a.length;u++)u&&this.insertNode(s.linebreakReplacement.create(),n,!0),a[u]&&this.insertNode(s.text(a[u]),n,!/\S/.test(a[u]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let a=i.content[i.content.length-1],u=t.previousSibling;(!a||u&&u.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(r=r.slice(1))}r&&this.insertNode(s.text(r),n,!/\S/.test(r)),this.findInText(t)}else this.findInside(t)}addElement(t,n,r){let i=this.localPreserveWS,o=this.top;(t.tagName=="PRE"||/pre/.test(t.style&&t.style.whiteSpace))&&(this.localPreserveWS=!0);let s=t.nodeName.toLowerCase(),a;L4.hasOwnProperty(s)&&this.parser.normalizeLists&&vV(t);let u=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(a=this.parser.matchTag(t,this,r));e:if(u?u.ignore:bV.hasOwnProperty(s))this.findInside(t),this.ignoreFallback(t,n);else if(!u||u.skip||u.closeParent){u&&u.closeParent?this.open=Math.max(0,this.open-1):u&&u.skip.nodeType&&(t=u.skip);let d,f=this.needsBlock;if(z4.hasOwnProperty(s))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),d=!0,o.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t,n);break e}let h=u&&u.skip?n:this.readStyles(t,n);h&&this.addAll(t,h),d&&this.sync(o),this.needsBlock=f}else{let d=this.readStyles(t,n);d&&this.addElementByRule(t,u,d,u.consuming===!1?a:void 0)}this.localPreserveWS=i}leafFallback(t,n){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(`
1215
+ `),n)}ignoreFallback(t,n){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(t,n){let r=t.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let o=this.parser.matchedStyles[i],s=r.getPropertyValue(o);if(s)for(let a=void 0;;){let u=this.parser.matchStyle(o,s,this,a);if(!u)break;if(u.ignore)return null;if(u.clearMark?n=n.filter(d=>!u.clearMark(d)):n=n.concat(this.parser.schema.marks[u.mark].create(u.attrs)),u.consuming===!1)a=u;else break}}return n}addElementByRule(t,n,r,i){let o,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r,t.nodeName=="BR")||this.leafFallback(t,r);else{let u=this.enter(s,n.attrs||null,r,n.preserveWhitespace);u&&(o=!0,r=u)}else{let u=this.parser.schema.marks[n.mark];r=r.concat(u.create(n.attrs))}let a=this.top;if(s&&s.isLeaf)this.findInside(t);else if(i)this.addElement(t,r,i);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(u=>this.insertNode(u,r,!1));else{let u=t;typeof n.contentElement=="string"?u=t.querySelector(n.contentElement):typeof n.contentElement=="function"?u=n.contentElement(t):n.contentElement&&(u=n.contentElement),this.findAround(t,u,!0),this.addAll(u,r),this.findAround(t,u,!1)}o&&this.sync(a)&&this.open--}addAll(t,n,r,i){let o=r||0;for(let s=r?t.childNodes[r]:t.firstChild,a=i==null?null:t.childNodes[i];s!=a;s=s.nextSibling,++o)this.findAtPoint(t,o),this.addDOM(s,n);this.findAtPoint(t,o)}findPlace(t,n,r){let i,o;for(let s=this.open,a=0;s>=0;s--){let u=this.nodes[s],d=u.findWrapping(t);if(d&&(!i||i.length>d.length+a)&&(i=d,o=u,!d.length))break;if(u.solid){if(r)break;a+=2}}if(!i)return null;this.sync(o);for(let s=0;s<i.length;s++)n=this.enterInner(i[s],null,n,!1);return n}insertNode(t,n,r){if(t.isInline&&this.needsBlock&&!this.top.type){let o=this.textblockFromContext();o&&(n=this.enterInner(o,null,n))}let i=this.findPlace(t,n,r);if(i){this.closeExtra();let o=this.top;o.match&&(o.match=o.match.matchType(t.type));let s=Wt.none;for(let a of i.concat(t.marks))(o.type?o.type.allowsMarkType(a.type):U2(a.type,t.type))&&(s=a.addToSet(s));return o.content.push(t.mark(s)),!0}return!1}enter(t,n,r,i){let o=this.findPlace(t.create(n),r,!1);return o&&(o=this.enterInner(t,n,r,!0,i)),o}enterInner(t,n,r,i=!1,o){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(t);let a=F2(t,o,s.options);s.options&dc&&s.content.length==0&&(a|=dc);let u=Wt.none;return r=r.filter(d=>(s.type?s.type.allowsMarkType(d.type):U2(d.type,t))?(u=d.addToSet(u),!1):!0),this.nodes.push(new Df(t,n,u,i,null,a)),this.open++,r}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(t){for(let n=this.open;n>=0;n--){if(this.nodes[n]==t)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=Pc)}return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)t+=r[i].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==t&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&t.nodeType==1&&t.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(t,n,r){if(t!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&t.nodeType==1&&t.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&(this.find[n].pos=this.currentPos-(t.nodeValue.length-this.find[n].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(a,u)=>{for(;a>=0;a--){let d=n[a];if(d==""){if(a==n.length-1||a==0)continue;for(;u>=o;u--)if(s(a-1,u))return!0;return!1}else{let f=u>0||u==0&&i?this.nodes[u].type:r&&u>=o?r.node(u-o).type:null;if(!f||f.name!=d&&!f.isInGroup(d))return!1;u--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function vV(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&L4.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):r=="li"?n=t:r&&(n=null)}}function kV(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function B2(e){let t={};for(let n in e)t[n]=e[n];return t}function U2(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let o=[],s=a=>{o.push(a);for(let u=0;u<a.edgeCount;u++){let{type:d,next:f}=a.edge(u);if(d==t||o.indexOf(f)<0&&s(f))return!0}};if(s(i.contentMatch))return!0}}class Fa{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},r){r||(r=cg(n).createDocumentFragment());let i=r,o=[];return t.forEach(s=>{if(o.length||s.marks.length){let a=0,u=0;for(;a<o.length&&u<s.marks.length;){let d=s.marks[u];if(!this.marks[d.type.name]){u++;continue}if(!d.eq(o[a][0])||d.type.spec.spanning===!1)break;a++,u++}for(;a<o.length;)i=o.pop()[1];for(;u<s.marks.length;){let d=s.marks[u++],f=this.serializeMark(d,s.isInline,n);f&&(o.push([d,i]),i.appendChild(f.dom),i=f.contentDOM||f.dom)}}i.appendChild(this.serializeNodeInner(s,n))}),r}serializeNodeInner(t,n){let{dom:r,contentDOM:i}=Gf(cg(n),this.nodes[t.type.name](t),null,t.attrs);if(i){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,n,i)}return r}serializeNode(t,n={}){let r=this.serializeNodeInner(t,n);for(let i=t.marks.length-1;i>=0;i--){let o=this.serializeMark(t.marks[i],t.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(t,n,r={}){let i=this.marks[t.type.name];return i&&Gf(cg(r),i(t,n),null,t.attrs)}static renderSpec(t,n,r=null,i){return Gf(t,n,r,i)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new Fa(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=V2(t.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(t){return V2(t.marks)}}function V2(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function cg(e){return e.document||window.document}const H2=new WeakMap;function wV(e){let t=H2.get(e);return t===void 0&&H2.set(e,t=CV(e)),t}function CV(e){let t=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")t||(t=[]),t.push(r);else for(let i=0;i<r.length;i++)n(r[i]);else for(let i in r)n(r[i])}return n(e),t}function Gf(e,t,n,r){if(typeof t=="string")return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],o;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(o=wV(r))&&o.indexOf(t)>-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,u=n?e.createElementNS(n,i):e.createElement(i),d=t[1],f=1;if(d&&typeof d=="object"&&d.nodeType==null&&!Array.isArray(d)){f=2;for(let h in d)if(d[h]!=null){let m=h.indexOf(" ");m>0?u.setAttributeNS(h.slice(0,m),h.slice(m+1),d[h]):h=="style"&&u.style?u.style.cssText=d[h]:u.setAttribute(h,d[h])}}for(let h=f;h<t.length;h++){let m=t[h];if(m===0){if(h<t.length-1||h>f)throw new RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u}}else{let{dom:g,contentDOM:x}=Gf(e,m,n,r);if(u.appendChild(g),x){if(a)throw new RangeError("Multiple content holes");a=x}}}return{dom:u,contentDOM:a}}const F4=65535,$4=Math.pow(2,16);function SV(e,t){return e+t*$4}function W2(e){return e&F4}function EV(e){return(e-(e&F4))/$4}const B4=1,U4=2,Yf=4,V4=8;class N1{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&V4)>0}get deletedBefore(){return(this.delInfo&(B4|Yf))>0}get deletedAfter(){return(this.delInfo&(U4|Yf))>0}get deletedAcross(){return(this.delInfo&Yf)>0}}class Kr{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&Kr.empty)return Kr.empty}recover(t){let n=0,r=W2(t);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+EV(t)}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,r){let i=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let u=this.ranges[a]-(this.inverted?i:0);if(u>t)break;let d=this.ranges[a+o],f=this.ranges[a+s],h=u+d;if(t<=h){let m=d?t==u?-1:t==h?1:n:n,g=u+i+(m<0?0:f);if(r)return g;let x=t==(n<0?u:h)?null:SV(a/3,t-u),b=t==u?U4:t==h?B4:Yf;return(n<0?t!=u:t!=h)&&(b|=V4),new N1(g,b,x)}i+=f-d}return r?t+i:new N1(t+i,0,null)}touches(t,n){let r=0,i=W2(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let u=this.ranges[a]-(this.inverted?r:0);if(u>t)break;let d=this.ranges[a+o],f=u+d;if(t<=f&&a==i*3)return!0;r+=this.ranges[a+s]-d}return!1}forEach(t){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let s=this.ranges[i],a=s-(this.inverted?o:0),u=s+(this.inverted?0:o),d=this.ranges[i+n],f=this.ranges[i+r];t(a,a+d,u,u+f),o+=f-d}}invert(){return new Kr(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?Kr.empty:new Kr(t<0?[0,-t,0]:[0,0,t])}}Kr.empty=new Kr([]);class jc{constructor(t,n,r=0,i=t?t.length:0){this.mirror=n,this.from=r,this.to=i,this._maps=t||[],this.ownData=!(t||n)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new jc(this._maps,this.mirror,t,n)}appendMap(t,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(t),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(t){for(let n=0,r=this._maps.length;n<t._maps.length;n++){let i=t.getMirror(n);this.appendMap(t._maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(t){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==t)return this.mirror[n+(n%2?-1:1)]}}setMirror(t,n){this.mirror||(this.mirror=[]),this.mirror.push(t,n)}appendMappingInverted(t){for(let n=t.maps.length-1,r=this._maps.length+t._maps.length;n>=0;n--){let i=t.getMirror(n);this.appendMap(t._maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let t=new jc;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let r=this.from;r<this.to;r++)t=this._maps[r].map(t,n);return t}mapResult(t,n=1){return this._map(t,n,!1)}_map(t,n,r){let i=0;for(let o=this.from;o<this.to;o++){let s=this._maps[o],a=s.mapResult(t,n);if(a.recover!=null){let u=this.getMirror(o);if(u!=null&&u>o&&u<this.to){o=u,t=this._maps[u].recover(a.recover);continue}}i|=a.delInfo,t=a.pos}return r?t:new N1(t,i,null)}}const dg=Object.create(null);class cr{getMap(){return Kr.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=dg[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in dg)throw new RangeError("Duplicate use of step JSON ID "+t);return dg[t]=n,n.prototype.jsonID=t,n}}class Nn{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new Nn(t,null)}static fail(t){return new Nn(null,t)}static fromReplace(t,n,r,i){try{return Nn.ok(t.replace(n,r,i))}catch(o){if(o instanceof Sh)return Nn.fail(o.message);throw o}}}function nx(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(nx(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return fe.fromArray(r)}class Cs extends cr{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=t.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new We(nx(n.content,(s,a)=>!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return Nn.fromReplace(t,this.from,this.to,o)}invert(){return new zi(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Cs(n.pos,r.pos,this.mark)}merge(t){return t instanceof Cs&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Cs(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Cs(n.from,n.to,t.markFromJSON(n.mark))}}cr.jsonID("addMark",Cs);class zi extends cr{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=new We(nx(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),n.openStart,n.openEnd);return Nn.fromReplace(t,this.from,this.to,r)}invert(){return new Cs(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new zi(n.pos,r.pos,this.mark)}merge(t){return t instanceof zi&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new zi(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new zi(n.from,n.to,t.markFromJSON(n.mark))}}cr.jsonID("removeMark",zi);class Ss extends cr{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Nn.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Nn.fromReplace(t,this.pos,this.pos+1,new We(fe.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new Ss(this.pos,n.marks[i]);return new Ss(this.pos,this.mark)}}return new Na(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Ss(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Ss(n.pos,t.markFromJSON(n.mark))}}cr.jsonID("addNodeMark",Ss);class Na extends cr{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Nn.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Nn.fromReplace(t,this.pos,this.pos+1,new We(fe.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Ss(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Na(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Na(n.pos,t.markFromJSON(n.mark))}}cr.jsonID("removeNodeMark",Na);class qn extends cr{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&I1(t,this.from,this.to)?Nn.fail("Structure replace would overwrite content"):Nn.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new Kr([this.from,this.to-this.from,this.slice.size])}invert(t){return new qn(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new qn(n.pos,Math.max(n.pos,r.pos),this.slice,this.structure)}merge(t){if(!(t instanceof qn)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?We.empty:new We(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new qn(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?We.empty:new We(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new qn(t.from,this.to,n,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new qn(n.from,n.to,We.fromJSON(t,n.slice),!!n.structure)}}cr.jsonID("replace",qn);class Jn extends cr{constructor(t,n,r,i,o,s,a=!1){super(),this.from=t,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=s,this.structure=a}apply(t){if(this.structure&&(I1(t,this.from,this.gapFrom)||I1(t,this.gapTo,this.to)))return Nn.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Nn.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Nn.fromReplace(t,this.from,this.to,r):Nn.fail("Content does not fit in gap")}getMap(){return new Kr([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new Jn(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||o>r.pos?null:new Jn(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Jn(n.from,n.to,n.gapFrom,n.gapTo,We.fromJSON(t,n.slice),n.insert,!!n.structure)}}cr.jsonID("replaceAround",Jn);function I1(e,t,n){let r=e.resolve(t),i=n-t,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 _V(e,t,n,r){let i=[],o=[],s,a;e.doc.nodesBetween(t,n,(u,d,f)=>{if(!u.isInline)return;let h=u.marks;if(!r.isInSet(h)&&f.type.allowsMarkType(r.type)){let m=Math.max(d,t),g=Math.min(d+u.nodeSize,n),x=r.addToSet(h);for(let b=0;b<h.length;b++)h[b].isInSet(x)||(s&&s.to==m&&s.mark.eq(h[b])?s.to=g:i.push(s=new zi(m,g,h[b])));a&&a.to==m?a.to=g:o.push(a=new Cs(m,g,r))}}),i.forEach(u=>e.step(u)),o.forEach(u=>e.step(u))}function TV(e,t,n,r){let i=[],o=0;e.doc.nodesBetween(t,n,(s,a)=>{if(!s.isInline)return;o++;let u=null;if(r instanceof Np){let d=s.marks,f;for(;f=r.isInSet(d);)(u||(u=[])).push(f),d=f.removeFromSet(d)}else r?r.isInSet(s.marks)&&(u=[r]):u=s.marks;if(u&&u.length){let d=Math.min(a+s.nodeSize,n);for(let f=0;f<u.length;f++){let h=u[f],m;for(let g=0;g<i.length;g++){let x=i[g];x.step==o-1&&h.eq(i[g].style)&&(m=x)}m?(m.to=d,m.step=o):i.push({style:h,from:Math.max(a,t),to:d,step:o})}}}),i.forEach(s=>e.step(new zi(s.from,s.to,s.style)))}function rx(e,t,n,r=n.contentMatch,i=!0){let o=e.doc.nodeAt(t),s=[],a=t+1;for(let u=0;u<o.childCount;u++){let d=o.child(u),f=a+d.nodeSize,h=r.matchType(d.type);if(!h)s.push(new qn(a,f,We.empty));else{r=h;for(let m=0;m<d.marks.length;m++)n.allowsMarkType(d.marks[m].type)||e.step(new zi(a,f,d.marks[m]));if(i&&d.isText&&n.whitespace!="pre"){let m,g=/\r?\n|\r/g,x;for(;m=g.exec(d.text);)x||(x=new We(fe.from(n.schema.text(" ",n.allowedMarks(d.marks))),0,0)),s.push(new qn(a+m.index,a+m.index+m[0].length,x))}}a=f}if(!r.validEnd){let u=r.fillBefore(fe.empty,!0);e.replace(a,a,new We(u,0,0))}for(let u=s.length-1;u>=0;u--)e.step(s[u])}function AV(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Xl(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let r=e.depth,i=0,o=0;;--r){let s=e.$from.node(r),a=e.$from.index(r)+i,u=e.$to.indexAfter(r)-o;if(r<e.depth&&s.canReplace(a,u,n))return r;if(r==0||s.type.spec.isolating||!AV(s,a,u))break;a&&(i=1),u<s.childCount&&(o=1)}return null}function MV(e,t,n){let{$from:r,$to:i,depth:o}=t,s=r.before(o+1),a=i.after(o+1),u=s,d=a,f=fe.empty,h=0;for(let x=o,b=!1;x>n;x--)b||r.index(x)>0?(b=!0,f=fe.from(r.node(x).copy(f)),h++):u--;let m=fe.empty,g=0;for(let x=o,b=!1;x>n;x--)b||i.after(x+1)<i.end(x)?(b=!0,m=fe.from(i.node(x).copy(m)),g++):d++;e.step(new Jn(u,d,s,a,new We(f.append(m),h,g),f.size-h,!0))}function ix(e,t,n=null,r=e){let i=NV(e,t),o=i&&IV(r,t);return o?i.map(q2).concat({type:t,attrs:n}).concat(o.map(q2)):null}function q2(e){return{type:e,attrs:null}}function NV(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.contentMatchAt(r).findWrapping(t);if(!o)return null;let s=o.length?o[0]:t;return n.canReplaceWith(r,i,s)?o:null}function IV(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.child(r),s=t.contentMatch.findWrapping(o.type);if(!s)return null;let u=(s.length?s[s.length-1]:t).contentMatch;for(let d=r;u&&d<i;d++)u=u.matchType(n.child(d).type);return!u||!u.validEnd?null:s}function DV(e,t,n){let r=fe.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let a=n[s].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=fe.from(n[s].type.create(n[s].attrs,r))}let i=t.start,o=t.end;e.step(new Jn(i,o,i,o,new We(r,0,0),n.length,!0))}function OV(e,t,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=e.steps.length;e.doc.nodesBetween(t,n,(s,a)=>{let u=typeof i=="function"?i(s):i;if(s.isTextblock&&!s.hasMarkup(r,u)&&RV(e.doc,e.mapping.slice(o).map(a),r)){let d=null;if(r.schema.linebreakReplacement){let g=r.whitespace=="pre",x=!!r.contentMatch.matchType(r.schema.linebreakReplacement);g&&!x?d=!1:!g&&x&&(d=!0)}d===!1&&W4(e,s,a,o),rx(e,e.mapping.slice(o).map(a,1),r,void 0,d===null);let f=e.mapping.slice(o),h=f.map(a,1),m=f.map(a+s.nodeSize,1);return e.step(new Jn(h,m,h+1,m-1,new We(fe.from(r.create(u,null,s.marks)),0,0),1,!0)),d===!0&&H4(e,s,a,o),!1}})}function H4(e,t,n,r){t.forEach((i,o)=>{if(i.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(i.text);){let u=e.mapping.slice(r).map(n+1+o+s.index);e.replaceWith(u,u+1,t.type.schema.linebreakReplacement.create())}}})}function W4(e,t,n,r){t.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let s=e.mapping.slice(r).map(n+1+o);e.replaceWith(s,s+1,t.type.schema.text(`
1216
+ `))}})}function RV(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function PV(e,t,n,r,i){let o=e.doc.nodeAt(t);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 e.replaceWith(t,t+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new Jn(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new We(fe.from(s),0,0),1,!0))}function Ro(e,t,n=1,r){let i=e.resolve(t),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 d=i.depth-1,f=n-2;d>o;d--,f--){let h=i.node(d),m=i.index(d);if(h.type.spec.isolating)return!1;let g=h.content.cutByIndex(m,h.childCount),x=r&&r[f+1];x&&(g=g.replaceChild(0,x.type.create(x.attrs)));let b=r&&r[f]||h;if(!h.canReplace(m+1,h.childCount)||!b.type.validContent(g))return!1}let a=i.indexAfter(o),u=r&&r[0];return i.node(o).canReplaceWith(a,a,u?u.type:i.node(o+1).type)}function jV(e,t,n=1,r){let i=e.doc.resolve(t),o=fe.empty,s=fe.empty;for(let a=i.depth,u=i.depth-n,d=n-1;a>u;a--,d--){o=fe.from(i.node(a).copy(o));let f=r&&r[d];s=fe.from(f?f.type.create(f.attrs,s):i.node(a).copy(s))}e.step(new qn(t,t,new We(o.append(s),n,n),!0))}function Hs(e,t){let n=e.resolve(t),r=n.index();return q4(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function zV(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let o=t.child(i),s=o.type==r?e.type.schema.nodes.text:o.type;if(n=n.matchType(s),!n||!e.type.allowsMarks(o.marks))return!1}return n.validEnd}function q4(e,t){return!!(e&&t&&!e.isLeaf&&zV(e,t))}function Ip(e,t,n=-1){let r=e.resolve(t);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&&q4(o,s)&&r.node(i).canReplace(a,a+1))return t;if(i==0)break;t=n<0?r.before(i):r.after(i)}}function LV(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,o=e.doc.resolve(t-n),s=o.node().type;if(i&&s.inlineContent){let f=s.whitespace=="pre",h=!!s.contentMatch.matchType(i);f&&!h?r=!1:!f&&h&&(r=!0)}let a=e.steps.length;if(r===!1){let f=e.doc.resolve(t+n);W4(e,f.node(),f.before(),a)}s.inlineContent&&rx(e,t+n-1,s,o.node().contentMatchAt(o.index()),r==null);let u=e.mapping.slice(a),d=u.map(t-n);if(e.step(new qn(d,u.map(t+n,-1),We.empty,!0)),r===!0){let f=e.doc.resolve(d);H4(e,f.node(),f.before(),e.steps.length)}return e}function FV(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let 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<r.node(i).childCount)return null}return null}function Z4(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let o=0;o<n.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(n.openStart==0&&n.size?2:1);o++)for(let s=r.depth;s>=0;s--){let a=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,u=r.index(s)+(a>0?1:0),d=r.node(s),f=!1;if(o==1)f=d.canReplace(u,u,i);else{let h=d.contentMatchAt(u).findWrapping(i.firstChild.type);f=h&&d.canReplaceWith(u,u,h[0])}if(f)return a==0?r.pos:a<0?r.before(s+1):r.after(s+1)}return null}function Dp(e,t,n=t,r=We.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return J4(i,o,r)?new qn(t,n,r):new $V(i,o,r).fit()}function J4(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class $V{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=fe.empty;for(let i=0;i<=t.depth;i++){let o=t.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(t.indexAfter(i))})}for(let i=t.depth;i>0;i--)this.placed=fe.from(t.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let d=this.findFittable();d?this.placeNodes(d):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(t<0?this.$to:r.doc.resolve(t));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 u=new We(o,s,a);return t>-1?new Jn(r.pos,t,this.$to.pos,this.$to.end(),u,n):u.size||r.pos!=this.$to.pos?new qn(r.pos,i.pos,u):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<t;r++){let o=n.firstChild;if(n.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){t=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?t:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=fg(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:u,match:d}=this.frontier[a],f,h=null;if(n==1&&(s?d.matchType(s.type)||(h=d.fillBefore(fe.from(s),!1)):o&&u.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:a,parent:o,inject:h};if(n==2&&s&&(f=d.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:o,wrap:f};if(o&&d.matchType(o.type))break}}}openMore(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=fg(t,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new We(t,n+1,Math.max(r,i.size+n>=t.size-r?n+1:0)),!0)}dropNode(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=fg(t,n);if(i.childCount<=1&&n>0){let o=t.size-n<=n+i.size;this.unplaced=new We(Yu(t,n-1,1),n-1,o?n-1:r)}else this.unplaced=new We(Yu(t,n,1),n,r)}placeNodes({sliceDepth:t,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let b=0;b<o.length;b++)this.openFrontierNode(o[b]);let s=this.unplaced,a=r?r.content:s.content,u=s.openStart-t,d=0,f=[],{match:h,type:m}=this.frontier[n];if(i){for(let b=0;b<i.childCount;b++)f.push(i.child(b));h=h.matchFragment(i)}let g=a.size+t-(s.content.size-s.openEnd);for(;d<a.childCount;){let b=a.child(d),v=h.matchType(b.type);if(!v)break;d++,(d>1||u==0||b.content.size)&&(h=v,f.push(K4(b.mark(m.allowedMarks(b.marks)),d==1?u:0,d==a.childCount?g:-1)))}let x=d==a.childCount;x||(g=-1),this.placed=Qu(this.placed,n,fe.from(f)),this.frontier[n].match=h,x&&g<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let b=0,v=a;b<g;b++){let C=v.lastChild;this.frontier.push({type:C.type,match:C.contentMatchAt(C.childCount)}),v=C.content}this.unplaced=x?t==0?We.empty:new We(Yu(s.content,t-1,1),t-1,g<0?s.openEnd:t-1):new We(Yu(s.content,t,d),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t=this.frontier[this.depth],n;if(!t.type.isTextblock||!hg(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n<t.depth&&t.end(n+1)==t.pos+(t.depth-(n+1)),s=hg(t,n,i,r,o);if(s){for(let a=n-1;a>=0;a--){let{match:u,type:d}=this.frontier[a],f=hg(t,a,d,u,!0);if(!f||f.childCount)continue e}return{depth:n,fit:s,move:o?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Qu(this.placed,n.depth,n.fit)),t=n.move;for(let r=n.depth+1;r<=t.depth;r++){let i=t.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,t.index(r));this.openFrontierNode(i.type,i.attrs,o)}return t}openFrontierNode(t,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(t),this.placed=Qu(this.placed,this.depth,fe.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(fe.empty,!0);n.childCount&&(this.placed=Qu(this.placed,this.frontier.length,n))}}function Yu(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Yu(e.firstChild.content,t-1,n)))}function Qu(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Qu(e.lastChild.content,t-1,n)))}function fg(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function K4(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,K4(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(fe.empty,!0)))),e.copy(r)}function hg(e,t,n,r,i){let o=e.node(t),s=i?e.indexAfter(t):e.index(t);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!BV(n,o.content,s)?a:null}function BV(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function UV(e){return e.spec.defining||e.spec.definingForContent}function VV(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),o=e.doc.resolve(n);if(J4(i,o,r))return e.step(new qn(t,n,r));let s=Y4(i,o);s[s.length-1]==0&&s.pop();let a=-(i.depth+1);s.unshift(a);for(let m=i.depth,g=i.pos-1;m>0;m--,g--){let x=i.node(m).type.spec;if(x.defining||x.definingAsContext||x.isolating)break;s.indexOf(m)>-1?a=m:i.before(m)==g&&s.splice(1,0,-m)}let u=s.indexOf(a),d=[],f=r.openStart;for(let m=r.content,g=0;;g++){let x=m.firstChild;if(d.push(x),g==r.openStart)break;m=x.content}for(let m=f-1;m>=0;m--){let g=d[m],x=UV(g.type);if(x&&!g.sameMarkup(i.node(Math.abs(a)-1)))f=m;else if(x||!g.type.isTextblock)break}for(let m=r.openStart;m>=0;m--){let g=(m+f+1)%(r.openStart+1),x=d[g];if(x)for(let b=0;b<s.length;b++){let v=s[(b+u)%s.length],C=!0;v<0&&(C=!1,v=-v);let _=i.node(v-1),E=i.index(v-1);if(_.canReplaceWith(E,E,x.type,x.marks))return e.replace(i.before(v),C?o.after(v):n,new We(G4(r.content,0,r.openStart,g),g,r.openEnd))}}let h=e.steps.length;for(let m=s.length-1;m>=0&&(e.replace(t,n,r),!(e.steps.length>h));m--){let g=s[m];g<0||(t=i.before(g),n=o.after(g))}}function G4(e,t,n,r,i){if(t<n){let o=e.firstChild;e=e.replaceChild(0,o.copy(G4(o.content,t+1,n,r,o)))}if(t>r){let o=i.contentMatchAt(0),s=o.fillBefore(e).append(e);e=s.append(o.matchFragment(s).fillBefore(fe.empty,!0))}return e}function HV(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=FV(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new We(fe.from(r),0,0))}function WV(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n),o=Y4(r,i);for(let s=0;s<o.length;s++){let a=o[s],u=s==o.length-1;if(u&&a==0||r.node(a).type.contentMatch.validEnd)return e.delete(r.start(a),i.end(a));if(a>0&&(u||r.node(a-1).canReplace(r.index(a-1),i.indexAfter(a-1))))return e.delete(r.before(a),i.after(a))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(t-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s&&r.start(s-1)==i.start(s-1)&&r.node(s-1).canReplace(r.index(s-1),i.index(s-1)))return e.delete(r.before(s),n);e.delete(t,n)}function Y4(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let o=e.start(i);if(o<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(o==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==o-1)&&n.push(i)}return n}class Al extends cr{constructor(t,n,r){super(),this.pos=t,this.attr=n,this.value=r}apply(t){let n=t.nodeAt(this.pos);if(!n)return Nn.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 Nn.fromReplace(t,this.pos,this.pos+1,new We(fe.from(i),0,n.isLeaf?0:1))}getMap(){return Kr.empty}invert(t){return new Al(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Al(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Al(n.pos,n.attr,n.value)}}cr.jsonID("attr",Al);class zc extends cr{constructor(t,n){super(),this.attr=t,this.value=n}apply(t){let n=Object.create(null);for(let i in t.attrs)n[i]=t.attrs[i];n[this.attr]=this.value;let r=t.type.create(n,t.content,t.marks);return Nn.ok(r)}getMap(){return Kr.empty}invert(t){return new zc(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new zc(n.attr,n.value)}}cr.jsonID("docAttr",zc);let Fl=class extends Error{};Fl=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};Fl.prototype=Object.create(Error.prototype);Fl.prototype.constructor=Fl;Fl.prototype.name="TransformError";class Q4{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new jc}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new Fl(n.failed);return this}maybeStep(t){let n=t.apply(this.doc);return n.failed||this.addStep(t,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let t=1e9,n=-1e9;for(let r=0;r<this.mapping.maps.length;r++){let i=this.mapping.maps[r];r&&(t=i.map(t,1),n=i.map(n,-1)),i.forEach((o,s,a,u)=>{t=Math.min(t,a),n=Math.max(n,u)})}return t==1e9?null:{from:t,to:n}}addStep(t,n){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=n}replace(t,n=t,r=We.empty){let i=Dp(this.doc,t,n,r);return i&&this.step(i),this}replaceWith(t,n,r){return this.replace(t,n,new We(fe.from(r),0,0))}delete(t,n){return this.replace(t,n,We.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,r){return VV(this,t,n,r),this}replaceRangeWith(t,n,r){return HV(this,t,n,r),this}deleteRange(t,n){return WV(this,t,n),this}lift(t,n){return MV(this,t,n),this}join(t,n=1){return LV(this,t,n),this}wrap(t,n){return DV(this,t,n),this}setBlockType(t,n=t,r,i=null){return OV(this,t,n,r,i),this}setNodeMarkup(t,n,r=null,i){return PV(this,t,n,r,i),this}setNodeAttribute(t,n,r){return this.step(new Al(t,n,r)),this}setDocAttribute(t,n){return this.step(new zc(t,n)),this}addNodeMark(t,n){return this.step(new Ss(t,n)),this}removeNodeMark(t,n){let r=this.doc.nodeAt(t);if(!r)throw new RangeError("No node at position "+t);if(n instanceof Wt)n.isInSet(r.marks)&&this.step(new Na(t,n));else{let i=r.marks,o,s=[];for(;o=n.isInSet(i);)s.push(new Na(t,o)),i=o.removeFromSet(i);for(let a=s.length-1;a>=0;a--)this.step(s[a])}return this}split(t,n=1,r){return jV(this,t,n,r),this}addMark(t,n,r){return _V(this,t,n,r),this}removeMark(t,n,r){return TV(this,t,n,r),this}clearIncompatible(t,n,r){return rx(this,t,n,r),this}}const pg=Object.create(null);class At{constructor(t,n,r){this.$anchor=t,this.$head=n,this.ranges=r||[new qV(t.min(n),t.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let n=0;n<t.length;n++)if(t[n].$from.pos!=t[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,n=We.empty){let r=n.content.lastChild,i=null;for(let a=0;a<n.openEnd;a++)i=r,r=r.lastChild;let o=t.steps.length,s=this.ranges;for(let a=0;a<s.length;a++){let{$from:u,$to:d}=s[a],f=t.mapping.slice(o);t.replaceRange(f.map(u.pos),f.map(d.pos),a?We.empty:n),a==0&&K2(t,o,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(t,n){let r=t.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:s,$to:a}=i[o],u=t.mapping.slice(r),d=u.map(s.pos),f=u.map(a.pos);o?t.deleteRange(d,f):(t.replaceRangeWith(d,f,n),K2(t,r,n.isInline?-1:1))}}static findFrom(t,n,r=!1){let i=t.parent.inlineContent?new yt(t):Cl(t.node(0),t.parent,t.pos,t.index(),n,r);if(i)return i;for(let o=t.depth-1;o>=0;o--){let s=n<0?Cl(t.node(0),t.node(o),t.before(o+1),t.index(o),n,r):Cl(t.node(0),t.node(o),t.after(o+1),t.index(o)+1,n,r);if(s)return s}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new Yr(t.node(0))}static atStart(t){return Cl(t,t,0,0,1)||new Yr(t)}static atEnd(t){return Cl(t,t,t.content.size,t.childCount,-1)||new Yr(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=pg[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in pg)throw new RangeError("Duplicate use of selection JSON ID "+t);return pg[t]=n,n.prototype.jsonID=t,n}getBookmark(){return yt.between(this.$anchor,this.$head).getBookmark()}}At.prototype.visible=!0;class qV{constructor(t,n){this.$from=t,this.$to=n}}let Z2=!1;function J2(e){!Z2&&!e.parent.inlineContent&&(Z2=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class yt extends At{constructor(t,n=t){J2(t),J2(n),super(t,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return At.near(r);let i=t.resolve(n.map(this.anchor));return new yt(i.parent.inlineContent?i:r,r)}replace(t,n=We.empty){if(super.replace(t,n),n==We.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof yt&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Op(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new yt(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){let i=t.resolve(n);return new this(i,r==n?i:t.resolve(r))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=At.findFrom(n,r,!0)||At.findFrom(n,-r,!0);if(o)n=o.$head;else return At.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(At.findFrom(t,-r,!0)||At.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new yt(t,n)}}At.jsonID("text",yt);class Op{constructor(t,n){this.anchor=t,this.head=n}map(t){return new Op(t.map(this.anchor),t.map(this.head))}resolve(t){return yt.between(t.resolve(this.anchor),t.resolve(this.head))}}class ut extends At{constructor(t){let n=t.nodeAfter,r=t.node(0).resolve(t.pos+n.nodeSize);super(t,r),this.node=n}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),o=t.resolve(i);return r?At.near(o):new ut(o)}content(){return new We(fe.from(this.node),0,0)}eq(t){return t instanceof ut&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new ox(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new ut(t.resolve(n.anchor))}static create(t,n){return new ut(t.resolve(n))}static isSelectable(t){return!t.isText&&t.type.spec.selectable!==!1}}ut.prototype.visible=!1;At.jsonID("node",ut);class ox{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new Op(r,r):new ox(r)}resolve(t){let n=t.resolve(this.anchor),r=n.nodeAfter;return r&&ut.isSelectable(r)?new ut(n):At.near(n)}}class Yr extends At{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=We.empty){if(n==We.empty){t.delete(0,t.doc.content.size);let r=At.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new Yr(t)}map(t){return new Yr(t)}eq(t){return t instanceof Yr}getBookmark(){return ZV}}At.jsonID("all",Yr);const ZV={map(){return this},resolve(e){return new Yr(e)}};function Cl(e,t,n,r,i,o=!1){if(t.inlineContent)return yt.create(e,n);for(let s=r-(i>0?0:1);i>0?s<t.childCount:s>=0;s+=i){let a=t.child(s);if(a.isAtom){if(!o&&ut.isSelectable(a))return ut.create(e,n-(i<0?a.nodeSize:0))}else{let u=Cl(e,a,n+i,i<0?a.childCount:0,i,o);if(u)return u}n+=a.nodeSize*i}return null}function K2(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof qn||i instanceof Jn))return;let o=e.mapping.maps[r],s;o.forEach((a,u,d,f)=>{s==null&&(s=f)}),e.setSelection(At.near(e.doc.resolve(s),n))}const G2=1,Of=2,Y2=4;class JV extends Q4{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(t){if(t.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=(this.updated|G2)&~Of,this.storedMarks=null,this}get selectionSet(){return(this.updated&G2)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=Of,this}ensureMarks(t){return Wt.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Of)>0}addStep(t,n){super.addStep(t,n),this.updated=this.updated&~Of,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,n=!0){let r=this.selection;return n&&(t=t.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||Wt.none))),r.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,n,r){let i=this.doc.type.schema;if(n==null)return t?this.replaceSelectionWith(i.text(t),!0):this.deleteSelection();{if(r==null&&(r=n),!t)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(t,o)),!this.selection.empty&&this.selection.to==n+t.length&&this.setSelection(At.near(this.selection.$to)),this}}setMeta(t,n){return this.meta[typeof t=="string"?t:t.key]=n,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=Y2,this}get scrolledIntoView(){return(this.updated&Y2)>0}}function Q2(e,t){return!t||!e?e:e.bind(t)}class Xu{constructor(t,n,r){this.name=t,this.init=Q2(n.init,r),this.apply=Q2(n.apply,r)}}const KV=[new Xu("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Xu("selection",{init(e,t){return e.selection||At.atStart(t.doc)},apply(e){return e.selection}}),new Xu("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new Xu("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class mg{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=KV.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 Xu(r.key,r.spec.state,r))})}}class _l{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,t,this))return!1}return!0}applyTransaction(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};let n=[t],r=this.applyInner(t),i=null;for(;;){let o=!1;for(let s=0;s<this.config.plugins.length;s++){let a=this.config.plugins[s];if(a.spec.appendTransaction){let u=i?i[s].n:0,d=i?i[s].state:this,f=u<n.length&&a.spec.appendTransaction.call(a,u?n.slice(u):n,d,r);if(f&&r.filterTransaction(f,s)){if(f.setMeta("appendedTransaction",t),!i){i=[];for(let h=0;h<this.config.plugins.length;h++)i.push(h<s?{state:r,n:n.length}:{state:this,n:0})}n.push(f),r=r.applyInner(f),o=!0}i&&(i[s]={state:r,n:n.length})}}if(!o)return{state:r,transactions:n}}}applyInner(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new _l(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let o=r[i];n[o.name]=o.apply(t,this[o.name],this,n)}return n}get tr(){return new JV(this)}static create(t){let n=new mg(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new _l(n);for(let i=0;i<n.fields.length;i++)r[n.fields[i].name]=n.fields[i].init(t,r);return r}reconfigure(t){let n=new mg(this.schema,t.plugins),r=n.fields,i=new _l(n);for(let o=0;o<r.length;o++){let s=r[o].name;i[s]=this.hasOwnProperty(s)?this[s]:r[o].init(t,i)}return i}toJSON(t){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),t&&typeof t=="object")for(let r in t){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=t[r],o=i.spec.state;o&&o.toJSON&&(n[r]=o.toJSON.call(i,this[i.key]))}return n}static fromJSON(t,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let i=new mg(t.schema,t.plugins),o=new _l(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=Ns.fromJSON(t.schema,n.doc);else if(s.name=="selection")o.selection=At.fromJSON(o.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let a in r){let u=r[a],d=u.spec.state;if(u.key==s.name&&d&&d.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){o[s.name]=d.fromJSON.call(u,t,n[a],o);return}}o[s.name]=s.init(t,o)}}),o}}function X4(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r=="handleDOMEvents"&&(i=X4(i,t,{})),n[r]=i}return n}class mn{constructor(t){this.spec=t,this.props={},t.props&&X4(t.props,this,this.props),this.key=t.key?t.key.key:eT("plugin")}getState(t){return t[this.key]}}const gg=Object.create(null);function eT(e){return e in gg?e+"$"+ ++gg[e]:(gg[e]=0,e+"$")}class Rn{constructor(t="key"){this.key=eT(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const sx=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function tT(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const nT=(e,t,n)=>{let r=tT(e,n);if(!r)return!1;let i=ax(r);if(!i){let s=r.blockRange(),a=s&&Xl(s);return a==null?!1:(t&&t(e.tr.lift(s,a).scrollIntoView()),!0)}let o=i.nodeBefore;if(dT(e,i,t,-1))return!0;if(r.parent.content.size==0&&($l(o,"end")||ut.isSelectable(o)))for(let s=r.depth;;s--){let a=Dp(e.doc,r.before(s),r.after(s),We.empty);if(a&&a.slice.size<a.to-a.from){if(t){let u=e.tr.step(a);u.setSelection($l(o,"end")?At.findFrom(u.doc.resolve(u.mapping.map(i.pos,-1)),-1):ut.create(u.doc,i.pos-o.nodeSize)),t(u.scrollIntoView())}return!0}if(s==1||r.node(s-1).childCount>1)break}return o.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1},GV=(e,t,n)=>{let r=tT(e,n);if(!r)return!1;let i=ax(r);return i?rT(e,i,t):!1},YV=(e,t,n)=>{let r=oT(e,n);if(!r)return!1;let i=lx(r);return i?rT(e,i,t):!1};function rT(e,t,n){let r=t.nodeBefore,i=r,o=t.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let f=i.lastChild;if(!f)return!1;i=f}let s=t.nodeAfter,a=s,u=t.pos+1;for(;!a.isTextblock;u++){if(a.type.spec.isolating)return!1;let f=a.firstChild;if(!f)return!1;a=f}let d=Dp(e.doc,o,u,We.empty);if(!d||d.from!=o||d instanceof qn&&d.slice.size>=u-o)return!1;if(n){let f=e.tr.step(d);f.setSelection(yt.create(f.doc,o)),n(f.scrollIntoView())}return!0}function $l(e,t,n=!1){for(let r=e;r;r=t=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const iT=(e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;o=ax(r)}let s=o&&o.nodeBefore;return!s||!ut.isSelectable(s)?!1:(t&&t(e.tr.setSelection(ut.create(e.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function ax(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function oT(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}const sT=(e,t,n)=>{let r=oT(e,n);if(!r)return!1;let i=lx(r);if(!i)return!1;let o=i.nodeAfter;if(dT(e,i,t,1))return!0;if(r.parent.content.size==0&&($l(o,"start")||ut.isSelectable(o))){let s=Dp(e.doc,r.before(),r.after(),We.empty);if(s&&s.slice.size<s.to-s.from){if(t){let a=e.tr.step(s);a.setSelection($l(o,"start")?At.findFrom(a.doc.resolve(a.mapping.map(i.pos)),1):ut.create(a.doc,a.mapping.map(i.pos))),t(a.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0):!1},aT=(e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;o=lx(r)}let s=o&&o.nodeAfter;return!s||!ut.isSelectable(s)?!1:(t&&t(e.tr.setSelection(ut.create(e.doc,o.pos)).scrollIntoView()),!0)};function lx(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}const QV=(e,t)=>{let n=e.selection,r=n instanceof ut,i;if(r){if(n.node.isTextblock||!Hs(e.doc,n.from))return!1;i=n.from}else if(i=Ip(e.doc,n.from,-1),i==null)return!1;if(t){let o=e.tr.join(i);r&&o.setSelection(ut.create(o.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(o.scrollIntoView())}return!0},XV=(e,t)=>{let n=e.selection,r;if(n instanceof ut){if(n.node.isTextblock||!Hs(e.doc,n.to))return!1;r=n.to}else if(r=Ip(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},eH=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),o=i&&Xl(i);return o==null?!1:(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)},lT=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
1217
+ `).scrollIntoView()),!0)};function ux(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const tH=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=ux(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(t){let a=n.after(),u=e.tr.replaceWith(a,a,s.createAndFill());u.setSelection(At.near(u.doc.resolve(a),1)),t(u.scrollIntoView())}return!0},uT=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof Yr||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=ux(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let s=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,a=e.tr.insert(s,o.createAndFill());a.setSelection(yt.create(a.doc,s+1)),t(a.scrollIntoView())}return!0},cT=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(Ro(e.doc,o))return t&&t(e.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Xl(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)};function nH(e){return(t,n)=>{let{$from:r,$to:i}=t.selection;if(t.selection instanceof ut&&t.selection.node.isBlock)return!r.parentOffset||!Ro(t.doc,r.pos)?!1:(n&&n(t.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let o=[],s,a,u=!1,d=!1;for(let g=r.depth;;g--)if(r.node(g).isBlock){u=r.end(g)==r.pos+(r.depth-g),d=r.start(g)==r.pos-(r.depth-g),a=ux(r.node(g-1).contentMatchAt(r.indexAfter(g-1))),o.unshift(u&&a?{type:a}:null),s=g;break}else{if(g==1)return!1;o.unshift(null)}let f=t.tr;(t.selection instanceof yt||t.selection instanceof Yr)&&f.deleteSelection();let h=f.mapping.map(r.pos),m=Ro(f.doc,h,o.length,o);if(m||(o[0]=a?{type:a}:null,m=Ro(f.doc,h,o.length,o)),!m)return!1;if(f.split(h,o.length,o),!u&&d&&r.node(s).type!=a){let g=f.mapping.map(r.before(s)),x=f.doc.resolve(g);a&&r.node(s-1).canReplaceWith(x.index(),x.index()+1,a)&&f.setNodeMarkup(f.mapping.map(r.before(s)),a)}return n&&n(f.scrollIntoView()),!0}}const rH=nH(),iH=(e,t)=>{let{$from:n,to:r}=e.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),t&&t(e.tr.setSelection(ut.create(e.doc,i))),!0)};function oH(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,o=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(o-1,o)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(o,o+1)||!(i.isTextblock||Hs(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function dT(e,t,n,r){let i=t.nodeBefore,o=t.nodeAfter,s,a,u=i.type.spec.isolating||o.type.spec.isolating;if(!u&&oH(e,t,n))return!0;let d=!u&&t.parent.canReplace(t.index(),t.index()+1);if(d&&(s=(a=i.contentMatchAt(i.childCount)).findWrapping(o.type))&&a.matchType(s[0]||o.type).validEnd){if(n){let g=t.pos+o.nodeSize,x=fe.empty;for(let C=s.length-1;C>=0;C--)x=fe.from(s[C].create(null,x));x=fe.from(i.copy(x));let b=e.tr.step(new Jn(t.pos-1,g,t.pos,g,new We(x,1,0),s.length,!0)),v=b.doc.resolve(g+2*s.length);v.nodeAfter&&v.nodeAfter.type==i.type&&Hs(b.doc,v.pos)&&b.join(v.pos),n(b.scrollIntoView())}return!0}let f=o.type.spec.isolating||r>0&&u?null:At.findFrom(t,1),h=f&&f.$from.blockRange(f.$to),m=h&&Xl(h);if(m!=null&&m>=t.depth)return n&&n(e.tr.lift(h,m).scrollIntoView()),!0;if(d&&$l(o,"start",!0)&&$l(i,"end")){let g=i,x=[];for(;x.push(g),!g.isTextblock;)g=g.lastChild;let b=o,v=1;for(;!b.isTextblock;b=b.firstChild)v++;if(g.canReplace(g.childCount,g.childCount,b.content)){if(n){let C=fe.empty;for(let E=x.length-1;E>=0;E--)C=fe.from(x[E].copy(C));let _=e.tr.step(new Jn(t.pos-x.length,t.pos+o.nodeSize,t.pos+v,t.pos+o.nodeSize-v,new We(C,x.length,0),0,!0));n(_.scrollIntoView())}return!0}}return!1}function fT(e){return function(t,n){let r=t.selection,i=e<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(t.tr.setSelection(yt.create(t.doc,e<0?i.start(o):i.end(o)))),!0):!1}}const sH=fT(-1),aH=fT(1);function lH(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=s&&ix(s,e,t);return a?(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0):!1}}function X2(e,t=null){return function(n,r){let i=!1;for(let o=0;o<n.selection.ranges.length&&!i;o++){let{$from:{pos:s},$to:{pos:a}}=n.selection.ranges[o];n.doc.nodesBetween(s,a,(u,d)=>{if(i)return!1;if(!(!u.isTextblock||u.hasMarkup(e,t)))if(u.type==e)i=!0;else{let f=n.doc.resolve(d),h=f.index();i=f.parent.canReplaceWith(h,h+1,e)}})}if(!i)return!1;if(r){let o=n.tr;for(let s=0;s<n.selection.ranges.length;s++){let{$from:{pos:a},$to:{pos:u}}=n.selection.ranges[s];o.setBlockType(a,u,e,t)}r(o.scrollIntoView())}return!0}}function cx(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}cx(sx,nT,iT);cx(sx,sT,aT);cx(lT,uT,cT,rH);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function uH(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o);if(!s)return!1;let a=r?n.tr:null;return cH(a,s,e,t)?(r&&r(a.scrollIntoView()),!0):!1}}function cH(e,t,n,r=null){let i=!1,o=t,s=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let u=s.resolve(t.start-2);o=new _h(u,u,t.depth),t.endIndex<t.parent.childCount&&(t=new _h(t.$from,s.resolve(t.$to.end(t.depth)),t.depth)),i=!0}let a=ix(o,n,r,t);return a?(e&&dH(e,t,a,i,n),!0):!1}function dH(e,t,n,r,i){let o=fe.empty;for(let f=n.length-1;f>=0;f--)o=fe.from(n[f].type.create(n[f].attrs,o));e.step(new Jn(t.start-(r?2:0),t.end,t.start,t.end,new We(o,0,0),n.length,!0));let s=0;for(let f=0;f<n.length;f++)n[f].type==i&&(s=f+1);let a=n.length-s,u=t.start+n.length-(r?2:0),d=t.parent;for(let f=t.startIndex,h=t.endIndex,m=!0;f<h;f++,m=!1)!m&&Ro(e.doc,u,a)&&(e.split(u,a),u+=2*a),u+=d.child(f).nodeSize;return e}function fH(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,s=>s.childCount>0&&s.firstChild.type==e);return o?n?r.node(o.depth-1).type==e?hH(t,n,e,o):pH(t,n,o):!0:!1}}function hH(e,t,n,r){let i=e.tr,o=r.end,s=r.$to.end(r.depth);o<s&&(i.step(new Jn(o-1,s,o,s,new We(fe.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new _h(i.doc.resolve(r.$from.pos),i.doc.resolve(s),r.depth));const a=Xl(r);if(a==null)return!1;i.lift(r,a);let u=i.doc.resolve(i.mapping.map(o,-1)-1);return Hs(i.doc,u.pos)&&u.nodeBefore.type==u.nodeAfter.type&&i.join(u.pos),t(i.scrollIntoView()),!0}function pH(e,t,n){let r=e.tr,i=n.parent;for(let g=n.end,x=n.endIndex-1,b=n.startIndex;x>b;x--)g-=i.child(x).nodeSize,r.delete(g-1,g+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,u=n.endIndex==i.childCount,d=o.node(-1),f=o.index(-1);if(!d.canReplace(f+(a?0:1),f+1,s.content.append(u?fe.empty:fe.from(i))))return!1;let h=o.pos,m=h+s.nodeSize;return r.step(new Jn(h-(a?1:0),m+(u?1:0),h+1,m-1,new We((a?fe.empty:fe.from(i.copy(fe.empty))).append(u?fe.empty:fe.from(i.copy(fe.empty))),a?0:1,u?0:1),a?0:1)),t(r.scrollIntoView()),!0}function mH(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,d=>d.childCount>0&&d.firstChild.type==e);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let a=o.parent,u=a.child(s-1);if(u.type!=e)return!1;if(n){let d=u.lastChild&&u.lastChild.type==a.type,f=fe.from(d?e.create():null),h=new We(fe.from(e.create(null,fe.from(a.type.create(null,f)))),d?3:1,0),m=o.start,g=o.end;n(t.tr.step(new Jn(m-(d?3:1),g,m,g,h,1,!0)).scrollIntoView())}return!0}}const Xn=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},Bl=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t};let D1=null;const No=function(e,t,n){let r=D1||(D1=document.createRange());return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},gH=function(){D1=null},Ia=function(e,t,n,r){return n&&(eC(e,t,n,r,-1)||eC(e,t,n,r,1))},yH=/^(img|br|input|textarea|hr)$/i;function eC(e,t,n,r,i){for(var o;;){if(e==n&&t==r)return!0;if(t==(i<0?0:gi(e))){let s=e.parentNode;if(!s||s.nodeType!=1||rd(e)||yH.test(e.nodeName)||e.contentEditable=="false")return!1;t=Xn(e)+(i<0?0:1),e=s}else if(e.nodeType==1){let s=e.childNodes[t+(i<0?-1:0)];if(s.nodeType==1&&s.contentEditable=="false")if(!((o=s.pmViewDesc)===null||o===void 0)&&o.ignoreForSelection)t+=i;else return!1;else e=s,t=i<0?gi(e):0}else return!1}}function gi(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function xH(e,t){for(;;){if(e.nodeType==3&&t)return e;if(e.nodeType==1&&t>0){if(e.contentEditable=="false")return null;e=e.childNodes[t-1],t=gi(e)}else if(e.parentNode&&!rd(e))t=Xn(e),e=e.parentNode;else return null}}function bH(e,t){for(;;){if(e.nodeType==3&&t<e.nodeValue.length)return e;if(e.nodeType==1&&t<e.childNodes.length){if(e.contentEditable=="false")return null;e=e.childNodes[t],t=0}else if(e.parentNode&&!rd(e))t=Xn(e)+1,e=e.parentNode;else return null}}function vH(e,t,n){for(let r=t==0,i=t==gi(e);r||i;){if(e==n)return!0;let o=Xn(e);if(e=e.parentNode,!e)return!1;r=r&&o==0,i=i&&o==gi(e)}}function rd(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const Rp=function(e){return e.focusNode&&Ia(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function ha(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function kH(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function wH(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(gi(r.offsetNode),r.offset)}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(gi(r.startContainer),r.startOffset)}}}const no=typeof navigator<"u"?navigator:null,tC=typeof document<"u"?document:null,Ws=no&&no.userAgent||"",O1=/Edge\/(\d+)/.exec(Ws),hT=/MSIE \d/.exec(Ws),R1=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ws),Lr=!!(hT||R1||O1),Is=hT?document.documentMode:R1?+R1[1]:O1?+O1[1]:0,xi=!Lr&&/gecko\/(\d+)/i.test(Ws);xi&&+(/Firefox\/(\d+)/.exec(Ws)||[0,0])[1];const P1=!Lr&&/Chrome\/(\d+)/.exec(Ws),tr=!!P1,pT=P1?+P1[1]:0,lr=!Lr&&!!no&&/Apple Computer/.test(no.vendor),Ul=lr&&(/Mobile\/\w+/.test(Ws)||!!no&&no.maxTouchPoints>2),pi=Ul||(no?/Mac/.test(no.platform):!1),mT=no?/Win/.test(no.platform):!1,Do=/Android \d/.test(Ws),id=!!tC&&"webkitFontSmoothing"in tC.documentElement.style,CH=id?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function SH(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function _o(e,t){return typeof e=="number"?e:e[t]}function EH(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function nC(e,t,n){let r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,o=e.dom.ownerDocument;for(let s=n||e.dom;s;){if(s.nodeType!=1){s=Bl(s);continue}let a=s,u=a==o.body,d=u?SH(o):EH(a),f=0,h=0;if(t.top<d.top+_o(r,"top")?h=-(d.top-t.top+_o(i,"top")):t.bottom>d.bottom-_o(r,"bottom")&&(h=t.bottom-t.top>d.bottom-d.top?t.top+_o(i,"top")-d.top:t.bottom-d.bottom+_o(i,"bottom")),t.left<d.left+_o(r,"left")?f=-(d.left-t.left+_o(i,"left")):t.right>d.right-_o(r,"right")&&(f=t.right-d.right+_o(i,"right")),f||h)if(u)o.defaultView.scrollBy(f,h);else{let g=a.scrollLeft,x=a.scrollTop;h&&(a.scrollTop+=h),f&&(a.scrollLeft+=f);let b=a.scrollLeft-g,v=a.scrollTop-x;t={left:t.left-b,top:t.top-v,right:t.right-b,bottom:t.bottom-v}}let m=u?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(m))break;s=m=="absolute"?s.offsetParent:Bl(s)}}function _H(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,i;for(let o=(t.left+t.right)/2,s=n+1;s<Math.min(innerHeight,t.bottom);s+=5){let a=e.root.elementFromPoint(o,s);if(!a||a==e.dom||!e.dom.contains(a))continue;let u=a.getBoundingClientRect();if(u.top>=n-20){r=a,i=u.top;break}}return{refDOM:r,refTop:i,stack:gT(e.dom)}}function gT(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=Bl(r));return t}function TH({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;yT(n,r==0?0:r-t)}function yT(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:o}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=o&&(r.scrollLeft=o)}}let pl=null;function AH(e){if(e.setActive)return e.setActive();if(pl)return e.focus(pl);let t=gT(e);e.focus(pl==null?{get preventScroll(){return pl={preventScroll:!0},!0}}:void 0),pl||(pl=!1,yT(t,0))}function xT(e,t){let n,r=2e8,i,o=0,s=t.top,a=t.top,u,d;for(let f=e.firstChild,h=0;f;f=f.nextSibling,h++){let m;if(f.nodeType==1)m=f.getClientRects();else if(f.nodeType==3)m=No(f).getClientRects();else continue;for(let g=0;g<m.length;g++){let x=m[g];if(x.top<=s&&x.bottom>=a){s=Math.max(x.bottom,s),a=Math.min(x.top,a);let b=x.left>t.left?x.left-t.left:x.right<t.left?t.left-x.right:0;if(b<r){n=f,r=b,i=b&&n.nodeType==3?{left:x.right<t.left?x.right:x.left,top:t.top}:t,f.nodeType==1&&b&&(o=h+(t.left>=(x.left+x.right)/2?1:0));continue}}else x.top>t.top&&!u&&x.left<=t.left&&x.right>=t.left&&(u=f,d={left:Math.max(x.left,Math.min(x.right,t.left)),top:x.top});!n&&(t.left>=x.right&&t.top>=x.top||t.left>=x.left&&t.top>=x.bottom)&&(o=h+1)}}return!n&&u&&(n=u,i=d,r=0),n&&n.nodeType==3?MH(n,i):!n||r&&n.nodeType==1?{node:e,offset:o}:xT(n,i)}function MH(e,t){let n=e.nodeValue.length,r=document.createRange(),i;for(let o=0;o<n;o++){r.setEnd(e,o+1),r.setStart(e,o);let s=fs(r,1);if(s.top!=s.bottom&&dx(t,s)){i={node:e,offset:o+(t.left>=(s.left+s.right)/2?1:0)};break}}return r.detach(),i||{node:e,offset:0}}function dx(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function NH(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function IH(e,t,n){let{node:r,offset:i}=xT(t,n),o=-1;if(r.nodeType==1&&!r.firstChild){let s=r.getBoundingClientRect();o=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return e.docView.posFromDOM(r,i,o)}function DH(e,t,n,r){let i=-1;for(let o=t,s=!1;o!=e.dom;){let a=e.docView.nearestDesc(o,!0),u;if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((u=a.dom.getBoundingClientRect()).width||u.height)&&(a.node.isBlock&&a.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(a.dom.nodeName)&&(!s&&u.left>r.left||u.top>r.top?i=a.posBefore:(!s&&u.right<r.left||u.bottom<r.top)&&(i=a.posAfter),s=!0),!a.contentDOM&&i<0&&!a.node.isText))return(a.node.isBlock?r.top<(u.top+u.bottom)/2:r.left<(u.left+u.right)/2)?a.posBefore:a.posAfter;o=a.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}function bT(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),o=i;;){let s=e.childNodes[o];if(s.nodeType==1){let a=s.getClientRects();for(let u=0;u<a.length;u++){let d=a[u];if(dx(t,d))return bT(s,t,d)}}if((o=(o+1)%r)==i)break}return e}function OH(e,t){let n=e.dom.ownerDocument,r,i=0,o=wH(n,t.left,t.top);o&&({node:r,offset:i}=o);let s=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),a;if(!s||!e.dom.contains(s.nodeType!=1?s.parentNode:s)){let d=e.dom.getBoundingClientRect();if(!dx(t,d)||(s=bT(e.dom,t,d),!s))return null}if(lr)for(let d=s;r&&d;d=Bl(d))d.draggable&&(r=void 0);if(s=NH(s,t),r){if(xi&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let f=r.childNodes[i],h;f.nodeName=="IMG"&&(h=f.getBoundingClientRect()).right<=t.left&&h.bottom>t.top&&i++}let d;id&&i&&r.nodeType==1&&(d=r.childNodes[i-1]).nodeType==1&&d.contentEditable=="false"&&d.getBoundingClientRect().top>=t.top&&i--,r==e.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?a=e.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(a=DH(e,r,i,t))}a==null&&(a=IH(e,s,t));let u=e.docView.nearestDesc(s,!0);return{pos:a,inside:u?u.posAtStart-u.border:-1}}function rC(e){return e.top<e.bottom||e.left<e.right}function fs(e,t){let n=e.getClientRects();if(n.length){let r=n[t<0?0:n.length-1];if(rC(r))return r}return Array.prototype.find.call(n,rC)||e.getBoundingClientRect()}const RH=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function vT(e,t,n){let{node:r,offset:i,atom:o}=e.docView.domFromPos(t,n<0?-1:1),s=id||xi;if(r.nodeType==3)if(s&&(RH.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let u=fs(No(r,i,i),n);if(xi&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let d=fs(No(r,i-1,i-1),-1);if(d.top==u.top){let f=fs(No(r,i,i+1),-1);if(f.top!=u.top)return $u(f,f.left<d.left)}}return u}else{let u=i,d=i,f=n<0?1:-1;return n<0&&!i?(d++,f=-1):n>=0&&i==r.nodeValue.length?(u--,f=1):n<0?u--:d++,$u(fs(No(r,u,d),f),f<0)}if(!e.state.doc.resolve(t-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==gi(r))){let u=r.childNodes[i-1];if(u.nodeType==1)return yg(u.getBoundingClientRect(),!1)}if(o==null&&i<gi(r)){let u=r.childNodes[i];if(u.nodeType==1)return yg(u.getBoundingClientRect(),!0)}return yg(r.getBoundingClientRect(),n>=0)}if(o==null&&i&&(n<0||i==gi(r))){let u=r.childNodes[i-1],d=u.nodeType==3?No(u,gi(u)-(s?0:1)):u.nodeType==1&&(u.nodeName!="BR"||!u.nextSibling)?u:null;if(d)return $u(fs(d,1),!1)}if(o==null&&i<gi(r)){let u=r.childNodes[i];for(;u.pmViewDesc&&u.pmViewDesc.ignoreForCoords;)u=u.nextSibling;let d=u?u.nodeType==3?No(u,0,s?0:1):u.nodeType==1?u:null:null;if(d)return $u(fs(d,-1),!0)}return $u(fs(r.nodeType==3?No(r):r,-n),n>=0)}function $u(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function yg(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function kT(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}function PH(e,t,n){let r=t.selection,i=n=="up"?r.$from:r.$to;return kT(e,t,()=>{let{node:o}=e.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let a=e.docView.nearestDesc(o,!0);if(!a)break;if(a.node.isBlock){o=a.contentDOM||a.dom;break}o=a.dom.parentNode}let s=vT(e,i.pos,1);for(let a=o.firstChild;a;a=a.nextSibling){let u;if(a.nodeType==1)u=a.getClientRects();else if(a.nodeType==3)u=No(a,0,a.nodeValue.length).getClientRects();else continue;for(let d=0;d<u.length;d++){let f=u[d];if(f.bottom>f.top+1&&(n=="up"?s.top-f.top>(f.bottom-s.top)*2:f.bottom-s.bottom>(s.bottom-f.top)*2))return!1}}return!0})}const jH=/[\u0590-\u08ac]/;function zH(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,a=e.domSelection();return a?!jH.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?o:s:kT(e,t,()=>{let{focusNode:u,focusOffset:d,anchorNode:f,anchorOffset:h}=e.domSelectionRange(),m=a.caretBidiLevel;a.modify("move",n,"character");let g=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:x,focusOffset:b}=e.domSelectionRange(),v=x&&!g.contains(x.nodeType==1?x:x.parentNode)||u==x&&d==b;try{a.collapse(f,h),u&&(u!=f||d!=h)&&a.extend&&a.extend(u,d)}catch{}return m!=null&&(a.caretBidiLevel=m),v}):r.pos==r.start()||r.pos==r.end()}let iC=null,oC=null,sC=!1;function LH(e,t,n){return iC==t&&oC==n?sC:(iC=t,oC=n,sC=n=="up"||n=="down"?PH(e,t,n):zH(e,t,n))}const bi=0,aC=1,ma=2,ro=3;class od{constructor(t,n,r,i){this.parent=t,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=bi,r.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,n,r){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let n=0;n<this.children.length;n++)t+=this.children[n].size;return t}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let t=0;t<this.children.length;t++)this.children[t].destroy()}posBeforeChild(t){for(let n=0,r=this.posAtStart;;n++){let i=this.children[n];if(i==t)return r;r+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(t,n,r){if(this.contentDOM&&this.contentDOM.contains(t.nodeType==1?t:t.parentNode))if(r<0){let o,s;if(t==this.contentDOM)o=t.childNodes[n-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;o=t.previousSibling}for(;o&&!((s=o.pmViewDesc)&&s.parent==this);)o=o.previousSibling;return o?this.posBeforeChild(s)+s.size:this.posAtStart}else{let o,s;if(t==this.contentDOM)o=t.childNodes[n];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;o=t.nextSibling}for(;o&&!((s=o.pmViewDesc)&&s.parent==this);)o=o.nextSibling;return o?this.posBeforeChild(s):this.posAtEnd}let i;if(t==this.dom&&this.contentDOM)i=n>Xn(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=t.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let o=t;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&n==t.childNodes.length)for(let o=t;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(t,n=!1){for(let r=!0,i=t;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(t.nodeType==1?t:t.parentNode):s==t))r=!1;else return o}}getDesc(t){let n=t.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(t,n,r){for(let i=t;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(t,n,r)}return-1}descAt(t){for(let n=0,r=0;n<this.children.length;n++){let i=this.children[n],o=r+i.size;if(r==t&&o!=r){for(;!i.border&&i.children.length;)for(let s=0;s<i.children.length;s++){let a=i.children[s];if(a.size){i=a;break}}return i}if(t<o)return i.descAt(t-r-i.border);r=o}}domFromPos(t,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:t+1};let r=0,i=0;for(let o=0;r<this.children.length;r++){let s=this.children[r],a=o+s.size;if(a>t||s instanceof CT){i=t-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 wT&&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?Xn(o.dom)+1:0}}else{let o,s=!0;for(;o=r<this.children.length?this.children[r]:null,!(!o||o.dom.parentNode==this.contentDOM);r++,s=!1);return o&&s&&!o.border&&!o.domAtom?o.domFromPos(0,n):{node:this.contentDOM,offset:o?Xn(o.dom):this.contentDOM.childNodes.length}}}parseRange(t,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:t,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,o=-1;for(let s=r,a=0;;a++){let u=this.children[a],d=s+u.size;if(i==-1&&t<=d){let f=s+u.border;if(t>=f&&n<=d-u.border&&u.node&&u.contentDOM&&this.contentDOM.contains(u.contentDOM))return u.parseRange(t,n,f);t=s;for(let h=a;h>0;h--){let m=this.children[h-1];if(m.size&&m.dom.parentNode==this.contentDOM&&!m.emptyChildAt(1)){i=Xn(m.dom)+1;break}t-=m.size}i==-1&&(i=0)}if(i>-1&&(d>n||a==this.children.length-1)){n=d;for(let f=a+1;f<this.children.length;f++){let h=this.children[f];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(-1)){o=Xn(h.dom);break}n+=h.size}o==-1&&(o=this.contentDOM.childNodes.length);break}s=d}return{node:this.contentDOM,from:t,to:n,fromOffset:i,toOffset:o}}emptyChildAt(t){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[t<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(t)}domAfterPos(t){let{node:n,offset:r}=this.domFromPos(t,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+t);return n.childNodes[r]}setSelection(t,n,r,i=!1){let o=Math.min(t,n),s=Math.max(t,n);for(let g=0,x=0;g<this.children.length;g++){let b=this.children[g],v=x+b.size;if(o>x&&s<v)return b.setSelection(t-x-b.border,n-x-b.border,r,i);x=v}let a=this.domFromPos(t,t?-1:1),u=n==t?a:this.domFromPos(n,n?-1:1),d=r.root.getSelection(),f=r.domSelectionRange(),h=!1;if((xi||lr)&&t==n){let{node:g,offset:x}=a;if(g.nodeType==3){if(h=!!(x&&g.nodeValue[x-1]==`
1218
+ `),h&&x==g.nodeValue.length)for(let b=g,v;b;b=b.parentNode){if(v=b.nextSibling){v.nodeName=="BR"&&(a=u={node:v.parentNode,offset:Xn(v)+1});break}let C=b.pmViewDesc;if(C&&C.node&&C.node.isBlock)break}}else{let b=g.childNodes[x-1];h=b&&(b.nodeName=="BR"||b.contentEditable=="false")}}if(xi&&f.focusNode&&f.focusNode!=u.node&&f.focusNode.nodeType==1){let g=f.focusNode.childNodes[f.focusOffset];g&&g.contentEditable=="false"&&(i=!0)}if(!(i||h&&lr)&&Ia(a.node,a.offset,f.anchorNode,f.anchorOffset)&&Ia(u.node,u.offset,f.focusNode,f.focusOffset))return;let m=!1;if((d.extend||t==n)&&!(h&&xi)){d.collapse(a.node,a.offset);try{t!=n&&d.extend(u.node,u.offset),m=!0}catch{}}if(!m){if(t>n){let x=a;a=u,u=x}let g=document.createRange();g.setEnd(u.node,u.offset),g.setStart(a.node,a.offset),d.removeAllRanges(),d.addRange(g)}}ignoreMutation(t){return!this.contentDOM&&t.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,n){for(let r=0,i=0;i<this.children.length;i++){let o=this.children[i],s=r+o.size;if(r==s?t<=s&&n>=r:t<s&&n>r){let a=r+o.border,u=s-o.border;if(t>=a&&n<=u){this.dirty=t==r||n==s?ma:aC,t==a&&n==u&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=ro:o.markDirty(t-a,n-a);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?ma:ro}r=s}this.dirty=ma}markParentsDirty(){let t=1;for(let n=this.parent;n;n=n.parent,t++){let r=t==1?ma:aC;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(t){return!1}}class wT extends od{constructor(t,n,r,i){let o,s=n.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{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(t,[],s,null),this.widget=n,this.widget=n,o=this}matchesWidget(t){return this.dirty==bi&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let n=this.widget.spec.stopEvent;return n?n(t):!1}ignoreMutation(t){return t.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class FH extends od{constructor(t,n,r,i){super(t,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(t,n){return t!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return t.type==="characterData"&&t.target.nodeValue==t.oldValue}}class Da extends od{constructor(t,n,r,i,o){super(t,[],r,i),this.mark=n,this.spec=o}static create(t,n,r,i){let o=i.nodeViews[n.type.name],s=o&&o(n,i,r);return(!s||!s.dom)&&(s=Fa.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new Da(t,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&ro||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return this.dirty!=ro&&this.mark.eq(t)}markDirty(t,n){if(super.markDirty(t,n),this.dirty!=bi){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=bi}}slice(t,n,r){let i=Da.create(this.parent,this.mark,!0,r),o=this.children,s=this.size;n<s&&(o=z1(o,n,s,r)),t>0&&(o=z1(o,0,t,r));for(let a=0;a<o.length;a++)o[a].parent=i;return i.children=o,i}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class Ds extends od{constructor(t,n,r,i,o,s,a,u,d){super(t,[],o,s),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=a}static create(t,n,r,i,o,s){let a=o.nodeViews[n.type.name],u,d=a&&a(n,o,()=>{if(!u)return s;if(u.parent)return u.parent.posBeforeChild(u)},r,i),f=d&&d.dom,h=d&&d.contentDOM;if(n.isText){if(!f)f=document.createTextNode(n.text);else if(f.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else f||({dom:f,contentDOM:h}=Fa.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!h&&!n.isText&&f.nodeName!="BR"&&(f.hasAttribute("contenteditable")||(f.contentEditable="false"),n.type.spec.draggable&&(f.draggable=!0));let m=f;return f=_T(f,r,n),d?u=new $H(t,n,r,i,f,h||null,m,d,o,s+1):n.isText?new Pp(t,n,r,i,f,m,o):new Ds(t,n,r,i,f,h||null,m,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(t.preserveWhitespace="full"),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){t.contentElement=r.dom.parentNode;break}}t.contentElement||(t.getContent=()=>fe.empty)}return t}matchesNode(t,n,r){return this.dirty==bi&&t.eq(this.node)&&Ah(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,n){let r=this.node.inlineContent,i=n,o=t.composing?this.localCompositionInfo(t,n):null,s=o&&o.pos>-1?o:null,a=o&&o.pos<0,u=new UH(this,s&&s.node,t);WH(this.node,this.innerDeco,(d,f,h)=>{d.spec.marks?u.syncToMarks(d.spec.marks,r,t,f):d.type.side>=0&&!h&&u.syncToMarks(f==this.node.childCount?Wt.none:this.node.child(f).marks,r,t,f),u.placeWidget(d,t,i)},(d,f,h,m)=>{u.syncToMarks(d.marks,r,t,m);let g;u.findNodeMatch(d,f,h,m)||a&&t.state.selection.from>i&&t.state.selection.to<i+d.nodeSize&&(g=u.findIndexWithChild(o.node))>-1&&u.updateNodeAt(d,f,h,g,t)||u.updateNextNode(d,f,h,t,m,i)||u.addNode(d,f,h,t,i),i+=d.nodeSize}),u.syncToMarks([],r,t,0),this.node.isTextblock&&u.addTextblockHacks(),u.destroyRest(),(u.changed||this.dirty==ma)&&(s&&this.protectLocalComposition(t,s),ST(this.contentDOM,this.children,t),Ul&&qH(this.dom))}localCompositionInfo(t,n){let{from:r,to:i}=t.state.selection;if(!(t.state.selection instanceof yt)||r<n||i>n+this.node.content.size)return null;let o=t.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let s=o.nodeValue,a=ZH(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(t,{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 FH(this,o,n,i);t.input.compositionNodes.push(s),this.children=z1(this.children,r,r+i.length,t,s)}update(t,n,r,i){return this.dirty==ro||!t.sameMarkup(this.node)?!1:(this.updateInner(t,n,r,i),!0)}updateInner(t,n,r,i){this.updateOuterDeco(n),this.node=t,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=bi}updateOuterDeco(t){if(Ah(t,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=ET(this.dom,this.nodeDOM,j1(this.outerDeco,this.node,n),j1(t,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function lC(e,t,n,r,i){_T(r,t,e);let o=new Ds(void 0,e,t,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class Pp extends Ds{constructor(t,n,r,i,o,s,a){super(t,n,r,i,o,null,s,a,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,n,r,i){return this.dirty==ro||this.dirty!=bi&&!this.inParent()||!t.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=bi||t.text!=this.node.text)&&t.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=t.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=t,this.dirty=bi,!0)}inParent(){let t=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,n,r){return t==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(t,n,r)}ignoreMutation(t){return t.type!="characterData"&&t.type!="selection"}slice(t,n,r){let i=this.node.cut(t,n),o=document.createTextNode(i.text);return new Pp(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(t,n){super.markDirty(t,n),this.dom!=this.nodeDOM&&(t==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=ro)}get domAtom(){return!1}isText(t){return this.node.text==t}}class CT extends od{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==bi&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class $H extends Ds{constructor(t,n,r,i,o,s,a,u,d,f){super(t,n,r,i,o,s,a,d,f),this.spec=u}update(t,n,r,i){if(this.dirty==ro)return!1;if(this.spec.update&&(this.node.type==t.type||this.spec.multiType)){let o=this.spec.update(t,n,r);return o&&this.updateInner(t,n,r,i),o}else return!this.contentDOM&&!t.isLeaf?!1:super.update(t,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,n,r,i){this.spec.setSelection?this.spec.setSelection(t,n,r.root):super.setSelection(t,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return this.spec.stopEvent?this.spec.stopEvent(t):!1}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function ST(e,t,n){let r=e.firstChild,i=!1;for(let o=0;o<t.length;o++){let s=t[o],a=s.dom;if(a.parentNode==e){for(;a!=r;)r=uC(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(a,r);if(s instanceof Da){let u=r?r.previousSibling:e.lastChild;ST(s.contentDOM,s.children,n),r=u?u.nextSibling:e.firstChild}}for(;r;)r=uC(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}const fc=function(e){e&&(this.nodeName=e)};fc.prototype=Object.create(null);const ga=[new fc];function j1(e,t,n){if(e.length==0)return ga;let r=n?ga[0]:new fc,i=[r];for(let o=0;o<e.length;o++){let s=e[o].type.attrs;if(s){s.nodeName&&i.push(r=new fc(s.nodeName));for(let a in s){let u=s[a];u!=null&&(n&&i.length==1&&i.push(r=new fc(t.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+u:a=="style"?r.style=(r.style?r.style+";":"")+u:a!="nodeName"&&(r[a]=u))}}}return i}function ET(e,t,n,r){if(n==ga&&r==ga)return t;let i=t;for(let o=0;o<r.length;o++){let s=r[o],a=n[o];if(o){let u;a&&a.nodeName==s.nodeName&&i!=e&&(u=i.parentNode)&&u.nodeName.toLowerCase()==s.nodeName||(u=document.createElement(s.nodeName),u.pmIsDeco=!0,u.appendChild(i),a=ga[0]),i=u}BH(i,a||ga[0],s)}return i}function BH(e,t,n){for(let r in t)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&e.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let o=0;o<r.length;o++)i.indexOf(r[o])==-1&&e.classList.remove(r[o]);for(let o=0;o<i.length;o++)r.indexOf(i[o])==-1&&e.classList.add(i[o]);e.classList.length==0&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(t.style);)e.style.removeProperty(i[1])}n.style&&(e.style.cssText+=n.style)}}function _T(e,t,n){return ET(e,e,ga,j1(t,n,e.nodeType!=1))}function Ah(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function uC(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class UH{constructor(t,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=VH(t.node.content,t)}destroyBetween(t,n){if(t!=n){for(let r=t;r<n;r++)this.top.children[r].destroy();this.top.children.splice(t,n-t),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(t,n,r,i){let o=0,s=this.stack.length>>1,a=Math.min(s,t.length);for(;o<a&&(o==s-1?this.top:this.stack[o+1<<1]).matchesMark(t[o])&&t[o].type.spec.spanning!==!1;)o++;for(;o<s;)this.destroyRest(),this.top.dirty=bi,this.index=this.stack.pop(),this.top=this.stack.pop(),s--;for(;s<t.length;){this.stack.push(this.top,this.index+1);let u=-1,d=this.top.children.length;i<this.preMatch.index&&(d=Math.min(this.index+3,d));for(let f=this.index;f<d;f++){let h=this.top.children[f];if(h.matchesMark(t[s])&&!this.isLocked(h.dom)){u=f;break}}if(u>-1)u>this.index&&(this.changed=!0,this.destroyBetween(this.index,u)),this.top=this.top.children[this.index];else{let f=Da.create(this.top,t[s],n,r);this.top.children.splice(this.index,0,f),this.top=f,this.changed=!0}this.index=0,s++}}findNodeMatch(t,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(t,n,r))o=this.top.children.indexOf(s,this.index);else for(let a=this.index,u=Math.min(this.top.children.length,a+5);a<u;a++){let d=this.top.children[a];if(d.matchesNode(t,n,r)&&!this.preMatch.matched.has(d)){o=a;break}}return o<0?!1:(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(t,n,r,i,o){let s=this.top.children[i];return s.dirty==ro&&s.dom==s.contentDOM&&(s.dirty=ma),s.update(t,n,r,o)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(t){for(;;){let n=t.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=t.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}t=n}}updateNextNode(t,n,r,i,o,s){for(let a=this.index;a<this.top.children.length;a++){let u=this.top.children[a];if(u instanceof Ds){let d=this.preMatch.matched.get(u);if(d!=null&&d!=o)return!1;let f=u.dom,h,m=this.isLocked(f)&&!(t.isText&&u.node&&u.node.isText&&u.nodeDOM.nodeValue==t.text&&u.dirty!=ro&&Ah(n,u.outerDeco));if(!m&&u.update(t,n,r,i))return this.destroyBetween(this.index,a),u.dom!=f&&(this.changed=!0),this.index++,!0;if(!m&&(h=this.recreateWrapper(u,t,n,r,i,s)))return this.destroyBetween(this.index,a),this.top.children[this.index]=h,h.contentDOM&&(h.dirty=ma,h.updateChildren(i,s+1),h.dirty=bi),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(t,n,r,i,o,s){if(t.dirty||n.isAtom||!t.children.length||!t.node.content.eq(n.content)||!Ah(r,t.outerDeco)||!i.eq(t.innerDeco))return null;let a=Ds.create(this.top,n,r,i,o,s);if(a.contentDOM){a.children=t.children,t.children=[];for(let u of a.children)u.parent=a}return t.destroy(),a}addNode(t,n,r,i,o){let s=Ds.create(this.top,t,n,r,i,o);s.contentDOM&&s.updateChildren(i,o+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(t,n,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(t)&&(t==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let o=new wT(this.top,t,n,r);this.top.children.splice(this.index++,0,o),this.changed=!0}}addTextblockHacks(){let t=this.top.children[this.index-1],n=this.top;for(;t instanceof Da;)n=t,t=n.children[n.children.length-1];(!t||!(t instanceof Pp)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((lr||tr)&&t&&t.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(t,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(t))this.index++;else{let r=document.createElement(t);t=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),t=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new CT(this.top,[],r,null);n!=this.top?n.children.push(i):n.children.splice(this.index++,0,i),this.changed=!0}}isLocked(t){return this.lock&&(t==this.lock||t.nodeType==1&&t.contains(this.lock.parentNode))}}function VH(e,t){let n=t,r=n.children.length,i=e.childCount,o=new Map,s=[];e:for(;i>0;){let a;for(;;)if(r){let d=n.children[r-1];if(d instanceof Da)n=d,r=d.children.length;else{a=d,r--;break}}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let u=a.node;if(u){if(u!=e.child(i-1))break;--i,o.set(a,i),s.push(a)}}return{index:i,matched:o,matches:s.reverse()}}function HH(e,t){return e.type.side-t.type.side}function WH(e,t,n,r){let i=t.locals(e),o=0;if(i.length==0){for(let d=0;d<e.childCount;d++){let f=e.child(d);r(f,i,t.forChild(o,f),d),o+=f.nodeSize}return}let s=0,a=[],u=null;for(let d=0;;){let f,h;for(;s<i.length&&i[s].to==o;){let v=i[s++];v.widget&&(f?(h||(h=[f])).push(v):f=v)}if(f)if(h){h.sort(HH);for(let v=0;v<h.length;v++)n(h[v],d,!!u)}else n(f,d,!!u);let m,g;if(u)g=-1,m=u,u=null;else if(d<e.childCount)g=d,m=e.child(d++);else break;for(let v=0;v<a.length;v++)a[v].to<=o&&a.splice(v--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)a.push(i[s++]);let x=o+m.nodeSize;if(m.isText){let v=x;s<i.length&&i[s].from<v&&(v=i[s].from);for(let C=0;C<a.length;C++)a[C].to<v&&(v=a[C].to);v<x&&(u=m.cut(v-o),m=m.cut(0,v-o),x=v,g=-1)}else for(;s<i.length&&i[s].to<x;)s++;let b=m.isInline&&!m.isLeaf?a.filter(v=>!v.inline):a.slice();r(m,b,t.forChild(o,m),g),o=x}}function qH(e){if(e.nodeName=="UL"||e.nodeName=="OL"){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}function ZH(e,t,n,r){for(let i=0,o=0;i<e.childCount&&o<=r;){let s=e.child(i++),a=o;if(o+=s.nodeSize,!s.isText)continue;let u=s.text;for(;i<e.childCount;){let d=e.child(i++);if(o+=d.nodeSize,!d.isText)break;u+=d.text}if(o>=n){if(o>=r&&u.slice(r-t.length-a,r-a)==t)return r-t.length;let d=a<r?u.lastIndexOf(t,r-a-1):-1;if(d>=0&&d+t.length+a>=n)return a+d;if(n==r&&u.length>=r+t.length-a&&u.slice(r-a,r-a+t.length)==t)return r}}return-1}function z1(e,t,n,r,i){let o=[];for(let s=0,a=0;s<e.length;s++){let u=e[s],d=a,f=a+=u.size;d>=n||f<=t?o.push(u):(d<t&&o.push(u.slice(0,t-d,r)),i&&(o.push(i),i=void 0),f>n&&o.push(u.slice(n-d,u.size,r)))}return o}function fx(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),o=i&&i.size==0,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a=r.resolve(s),u,d;if(Rp(n)){for(u=s;i&&!i.node;)i=i.parent;let h=i.node;if(i&&h.isAtom&&ut.isSelectable(h)&&i.parent&&!(h.isInline&&vH(n.focusNode,n.focusOffset,i.dom))){let m=i.posBefore;d=new ut(s==m?a:r.resolve(m))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let h=s,m=s;for(let g=0;g<n.rangeCount;g++){let x=n.getRangeAt(g);h=Math.min(h,e.docView.posFromDOM(x.startContainer,x.startOffset,1)),m=Math.max(m,e.docView.posFromDOM(x.endContainer,x.endOffset,-1))}if(h<0)return null;[u,s]=m==e.state.selection.anchor?[m,h]:[h,m],a=r.resolve(s)}else u=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(u<0)return null}let f=r.resolve(u);if(!d){let h=t=="pointer"||e.state.selection.head<a.pos&&!o?1:-1;d=hx(e,f,a,h)}return d}function TT(e){return e.editable?e.hasFocus():MT(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Po(e,t=!1){let n=e.state.selection;if(AT(e,n),!!TT(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&tr){let r=e.domSelectionRange(),i=e.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&Ia(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)KH(e);else{let{anchor:r,head:i}=n,o,s;cC&&!(n instanceof yt)&&(n.$from.parent.inlineContent||(o=dC(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(s=dC(e,n.to))),e.docView.setSelection(r,i,e,t),cC&&(o&&fC(o),s&&fC(s)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&JH(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const cC=lr||tr&&pT<63;function dC(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(lr&&i&&i.contentEditable=="false")return xg(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return xg(i);if(o)return xg(o)}}function xg(e){return e.contentEditable="true",lr&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function fC(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function JH(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!TT(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function KH(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r=n.nodeName=="IMG";r?t.collapse(n.parentNode,Xn(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&Lr&&Is<=11&&(n.disabled=!0,n.disabled=!1)}function AT(e,t){if(t instanceof ut){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(hC(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else hC(e)}function hC(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function hx(e,t,n,r){return e.someProp("createSelectionBetween",i=>i(e,t,n))||yt.between(t,n,r)}function pC(e){return e.editable&&!e.hasFocus()?!1:MT(e)}function MT(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function GH(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return Ia(t.node,t.offset,n.anchorNode,n.anchorOffset)}function L1(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return o&&At.findFrom(o,t)}function ms(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function mC(e,t,n){let r=e.state.selection;if(r instanceof yt)if(n.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=e.state.doc.resolve(i.pos+o.nodeSize*(t<0?-1:1));return ms(e,new yt(r.$anchor,s))}else if(r.empty){if(e.endOfTextblock(t>0?"forward":"backward")){let i=L1(e.state,t);return i&&i instanceof ut?ms(e,i):!1}else if(!(pi&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return!1;let a=t<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=e.docView.descAt(a))&&!s.contentDOM?ut.isSelectable(o)?ms(e,new ut(t<0?e.state.doc.resolve(i.pos-o.nodeSize):i)):id?ms(e,new yt(e.state.doc.resolve(t<0?a:a+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof ut&&r.node.isInline)return ms(e,new yt(t>0?r.$to:r.$from));{let i=L1(e.state,t);return i?ms(e,i):!1}}}function Mh(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function hc(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!="BR")}function ml(e,t){return t<0?YH(e):QH(e)}function YH(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=!1;for(xi&&n.nodeType==1&&r<Mh(n)&&hc(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(hc(a,-1))i=n,o=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(NT(n))break;{let a=n.previousSibling;for(;a&&hc(a,-1);)i=n.parentNode,o=Xn(a),a=a.previousSibling;if(a)n=a,r=Mh(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}s?F1(e,n,r):i&&F1(e,i,o)}function QH(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=Mh(n),o,s;for(;;)if(r<i){if(n.nodeType!=1)break;let a=n.childNodes[r];if(hc(a,1))o=n,s=++r;else break}else{if(NT(n))break;{let a=n.nextSibling;for(;a&&hc(a,1);)o=a.parentNode,s=Xn(a)+1,a=a.nextSibling;if(a)n=a,r=0,i=Mh(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}}o&&F1(e,o,s)}function NT(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function XH(e,t){for(;e&&t==e.childNodes.length&&!rd(e);)t=Xn(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;e=n,t=0}}function eW(e,t){for(;e&&!t&&!rd(e);)t=Xn(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;e=n,t=e.childNodes.length}}function F1(e,t,n){if(t.nodeType!=3){let o,s;(s=XH(t,n))?(t=s,n=0):(o=eW(t,n))&&(t=o,n=o.nodeValue.length)}let r=e.domSelection();if(!r)return;if(Rp(r)){let o=document.createRange();o.setEnd(t,n),o.setStart(t,n),r.removeAllRanges(),r.addRange(o)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&Po(e)},50)}function gC(e,t){let n=e.state.doc.resolve(t);if(!(tr||mT)&&n.parent.inlineContent){let i=e.coordsAtPos(t);if(t>n.start()){let o=e.coordsAtPos(t-1),s=(o.top+o.bottom)/2;if(s>i.top&&s<i.bottom&&Math.abs(o.left-i.left)>1)return o.left<i.left?"ltr":"rtl"}if(t<n.end()){let o=e.coordsAtPos(t+1),s=(o.top+o.bottom)/2;if(s>i.top&&s<i.bottom&&Math.abs(o.left-i.left)>1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function yC(e,t,n){let r=e.state.selection;if(r instanceof yt&&!r.empty||n.indexOf("s")>-1||pi&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let s=L1(e.state,t);if(s&&s instanceof ut)return ms(e,s)}if(!i.parent.inlineContent){let s=t<0?i:o,a=r instanceof Yr?At.near(s,t):At.findFrom(s,t);return a?ms(e,a):!1}return!1}function xC(e,t){if(!(e.state.selection instanceof yt))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let o=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let s=e.state.tr;return t<0?s.delete(n.pos-o.nodeSize,n.pos):s.delete(n.pos,n.pos+o.nodeSize),e.dispatch(s),!0}return!1}function bC(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function tW(e){if(!lr||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let r=t.firstChild;bC(e,r,"true"),setTimeout(()=>bC(e,r,"false"),20)}return!1}function nW(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function rW(e,t){let n=t.keyCode,r=nW(t);if(n==8||pi&&n==72&&r=="c")return xC(e,-1)||ml(e,-1);if(n==46&&!t.shiftKey||pi&&n==68&&r=="c")return xC(e,1)||ml(e,1);if(n==13||n==27)return!0;if(n==37||pi&&n==66&&r=="c"){let i=n==37?gC(e,e.state.selection.from)=="ltr"?-1:1:-1;return mC(e,i,r)||ml(e,i)}else if(n==39||pi&&n==70&&r=="c"){let i=n==39?gC(e,e.state.selection.from)=="ltr"?1:-1:1;return mC(e,i,r)||ml(e,i)}else{if(n==38||pi&&n==80&&r=="c")return yC(e,-1,r)||ml(e,-1);if(n==40||pi&&n==78&&r=="c")return tW(e)||yC(e,1,r)||ml(e,1);if(r==(pi?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function px(e,t){e.someProp("transformCopied",g=>{t=g(t,e)});let n=[],{content:r,openStart:i,openEnd:o}=t;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let g=r.firstChild;n.push(g.type.name,g.attrs!=g.type.defaultAttrs?g.attrs:null),r=g.content}let s=e.someProp("clipboardSerializer")||Fa.fromSchema(e.state.schema),a=jT(),u=a.createElement("div");u.appendChild(s.serializeFragment(r,{document:a}));let d=u.firstChild,f,h=0;for(;d&&d.nodeType==1&&(f=PT[d.nodeName.toLowerCase()]);){for(let g=f.length-1;g>=0;g--){let x=a.createElement(f[g]);for(;u.firstChild;)x.appendChild(u.firstChild);u.appendChild(x),h++}d=u.firstChild}d&&d.nodeType==1&&d.setAttribute("data-pm-slice",`${i} ${o}${h?` -${h}`:""} ${JSON.stringify(n)}`);let m=e.someProp("clipboardTextSerializer",g=>g(t,e))||t.content.textBetween(0,t.content.size,`
1219
+
1220
+ `);return{dom:u,text:m,slice:t}}function IT(e,t,n,r,i){let o=i.parent.type.spec.code,s,a;if(!n&&!t)return null;let u=!!t&&(r||o||!n);if(u){if(e.someProp("transformPastedText",m=>{t=m(t,o||r,e)}),o)return a=new We(fe.from(e.state.schema.text(t.replace(/\r\n?/g,`
1221
+ `))),0,0),e.someProp("transformPasted",m=>{a=m(a,e,!0)}),a;let h=e.someProp("clipboardTextParser",m=>m(t,i,r,e));if(h)a=h;else{let m=i.marks(),{schema:g}=e.state,x=Fa.fromSchema(g);s=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(b=>{let v=s.appendChild(document.createElement("p"));b&&v.appendChild(x.serializeNode(g.text(b,m)))})}}else e.someProp("transformPastedHTML",h=>{n=h(n,e)}),s=aW(n),id&&lW(s);let d=s&&s.querySelector("[data-pm-slice]"),f=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(f&&f[3])for(let h=+f[3];h>0;h--){let m=s.firstChild;for(;m&&m.nodeType!=1;)m=m.nextSibling;if(!m)break;s=m}if(a||(a=(e.someProp("clipboardParser")||e.someProp("domParser")||Oo.fromSchema(e.state.schema)).parseSlice(s,{preserveWhitespace:!!(u||f),context:i,ruleFromNode(m){return m.nodeName=="BR"&&!m.nextSibling&&m.parentNode&&!iW.test(m.parentNode.nodeName)?{ignore:!0}:null}})),f)a=uW(vC(a,+f[1],+f[2]),f[4]);else if(a=We.maxOpen(oW(a.content,i),!0),a.openStart||a.openEnd){let h=0,m=0;for(let g=a.content.firstChild;h<a.openStart&&!g.type.spec.isolating;h++,g=g.firstChild);for(let g=a.content.lastChild;m<a.openEnd&&!g.type.spec.isolating;m++,g=g.lastChild);a=vC(a,h,m)}return e.someProp("transformPasted",h=>{a=h(a,e,u)}),a}const iW=/^(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 oW(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let i=t.node(n).contentMatchAt(t.index(n)),o,s=[];if(e.forEach(a=>{if(!s)return;let u=i.findWrapping(a.type),d;if(!u)return s=null;if(d=s.length&&o.length&&OT(u,o,a,s[s.length-1],0))s[s.length-1]=d;else{s.length&&(s[s.length-1]=RT(s[s.length-1],o.length));let f=DT(a,u);s.push(f),i=i.matchType(f.type),o=u}}),s)return fe.from(s)}return e}function DT(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,fe.from(e));return e}function OT(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let o=OT(e,t,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(fe.from(DT(n,e,i+1))))}}function RT(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,RT(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(fe.empty,!0);return e.copy(n.append(r))}function $1(e,t,n,r,i,o){let s=t<0?e.firstChild:e.lastChild,a=s.content;return e.childCount>1&&(o=0),i<r-1&&(a=$1(a,t,n,r,i+1,o)),i>=n&&(a=t<0?s.contentMatchAt(0).fillBefore(a,o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(fe.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function vC(e,t,n){return t<e.openStart&&(e=new We($1(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new We($1(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const PT={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let kC=null;function jT(){return kC||(kC=document.implementation.createHTMLDocument("title"))}let bg=null;function sW(e){let t=window.trustedTypes;return t?(bg||(bg=t.defaultPolicy||t.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),bg.createHTML(e)):e}function aW(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=jT().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&PT[r[1].toLowerCase()])&&(e=i.map(o=>"<"+o+">").join("")+e+i.map(o=>"</"+o+">").reverse().join("")),n.innerHTML=sW(e),i)for(let o=0;o<i.length;o++)n=n.querySelector(i[o])||n;return n}function lW(e){let t=e.querySelectorAll(tr?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}function uW(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:i,openStart:o,openEnd:s}=e;for(let a=r.length-2;a>=0;a-=2){let u=n.nodes[r[a]];if(!u||u.hasRequiredAttrs())break;i=fe.from(u.create(r[a+1],i)),o++,s++}return new We(i,o,s)}const wr={},Cr={},cW={touchstart:!0,touchmove:!0};class dW{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function fW(e){for(let t in wr){let n=wr[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=r=>{pW(e,r)&&!mx(e,r)&&(e.editable||!(r.type in Cr))&&n(e,r)},cW[t]?{passive:!0}:void 0)}lr&&e.dom.addEventListener("input",()=>null),B1(e)}function Es(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function hW(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function B1(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=r=>mx(e,r))})}function mx(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function pW(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function mW(e,t){!mx(e,t)&&wr[t.type]&&(e.editable||!(t.type in Cr))&&wr[t.type](e,t)}Cr.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!LT(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Do&&tr&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),Ul&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();e.input.lastIOSEnter=r,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==r&&(e.someProp("handleKeyDown",i=>i(e,ha(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",r=>r(e,n))||rW(e,n)?n.preventDefault():Es(e,"key")};Cr.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)};Cr.keypress=(e,t)=>{let n=t;if(LT(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||pi&&n.metaKey)return;if(e.someProp("handleKeyPress",i=>i(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof yt)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode),o=()=>e.state.tr.insertText(i).scrollIntoView();!/[\r\n]/.test(i)&&!e.someProp("handleTextInput",s=>s(e,r.$from.pos,r.$to.pos,i,o))&&e.dispatch(o()),n.preventDefault()}};function jp(e){return{left:e.clientX,top:e.clientY}}function gW(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function gx(e,t,n,r,i){if(r==-1)return!1;let o=e.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(e.someProp(t,a=>s>o.depth?a(e,n,o.nodeAfter,o.before(s),i,!0):a(e,n,o.node(s),o.before(s),i,!1)))return!0;return!1}function Ml(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);r.setMeta("pointer",!0),e.dispatch(r)}function yW(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&ut.isSelectable(r)?(Ml(e,new ut(n)),!0):!1}function xW(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof ut&&(r=n.node);let o=e.state.doc.resolve(t);for(let s=o.depth+1;s>0;s--){let a=s>o.depth?o.nodeAfter:o.node(s);if(ut.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?(Ml(e,ut.create(e.state.doc,i)),!0):!1}function bW(e,t,n,r,i){return gx(e,"handleClickOn",t,n,r)||e.someProp("handleClick",o=>o(e,t,r))||(i?xW(e,n):yW(e,n))}function vW(e,t,n,r){return gx(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",i=>i(e,t,r))}function kW(e,t,n,r){return gx(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",i=>i(e,t,r))||wW(e,n,r)}function wW(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?(Ml(e,yt.create(r,0,r.content.size)),!0):!1;let i=r.resolve(t);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)Ml(e,yt.create(r,a+1,a+1+s.content.size));else if(ut.isSelectable(s))Ml(e,ut.create(r,a));else continue;return!0}}function yx(e){return Nh(e)}const zT=pi?"metaKey":"ctrlKey";wr.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=yx(e),i=Date.now(),o="singleClick";i-e.input.lastClick.time<500&&gW(n,e.input.lastClick)&&!n[zT]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type=="singleClick"?o="doubleClick":e.input.lastClick.type=="doubleClick"&&(o="tripleClick")),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o,button:n.button};let s=e.posAtCoords(jp(n));s&&(o=="singleClick"?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new CW(e,s,n,!!r)):(o=="doubleClick"?vW:kW)(e,s.pos,s.inside,n)?n.preventDefault():Es(e,"pointer"))};class CW{constructor(t,n,r,i){this.view=t,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!r[zT],this.allowDefault=r.shiftKey;let o,s;if(n.inside>-1)o=t.state.doc.nodeAt(n.inside),s=n.inside;else{let f=t.state.doc.resolve(n.pos);o=f.parent,s=f.depth?f.before():0}const a=i?null:r.target,u=a?t.docView.nearestDesc(a,!0):null;this.target=u&&u.nodeDOM.nodeType==1?u.nodeDOM:null;let{selection:d}=t.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||d instanceof ut&&d.from<=s&&d.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&xi&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),Es(t,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Po(this.view)),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(jp(t))),this.updateAllowDefault(t),this.allowDefault||!n?Es(this.view,"pointer"):bW(this.view,n.pos,n.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||lr&&this.mightDrag&&!this.mightDrag.node.isAtom||tr&&!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)?(Ml(this.view,At.near(this.view.state.doc.resolve(n.pos))),t.preventDefault()):Es(this.view,"pointer")}move(t){this.updateAllowDefault(t),Es(this.view,"pointer"),t.buttons==0&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}wr.touchstart=e=>{e.input.lastTouch=Date.now(),yx(e),Es(e,"pointer")};wr.touchmove=e=>{e.input.lastTouch=Date.now(),Es(e,"pointer")};wr.contextmenu=e=>yx(e);function LT(e,t){return e.composing?!0:lr&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const SW=Do?5e3:-1;Cr.compositionstart=Cr.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof yt&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||tr&&mT&&EW(e)))e.markCursor=e.state.storedMarks||n.marks(),Nh(e,!0),e.markCursor=null;else if(Nh(e,!t.selection.empty),xi&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=e.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){let a=e.domSelection();a&&a.collapse(s,s.nodeValue.length);break}else i=s,o=-1}}e.input.composing=!0}FT(e,SW)};function EW(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||t.nodeType!=1||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return r.nodeType==1&&r.contentEditable=="false"}Cr.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,FT(e,20))};function FT(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Nh(e),t))}function $T(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=TW());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function _W(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=xH(t.focusNode,t.focusOffset),r=bH(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,o=e.domObserver.lastChangedTextNode;if(n==o||r==o)return o;if(!i||!i.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let s=n.pmViewDesc;if(!(!s||!s.isText(n.nodeValue)))return r}}return n||r}function TW(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function Nh(e,t=!1){if(!(Do&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),$T(e),t||e.docView&&e.docView.dirty){let n=fx(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function AW(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}const Lc=Lr&&Is<15||Ul&&CH<604;wr.copy=Cr.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type=="cut";if(r.empty)return;let o=Lc?null:n.clipboardData,s=r.content(),{dom:a,text:u}=px(e,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",u)):AW(e,a),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function MW(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function NW(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Fc(e,r.value,null,i,t):Fc(e,r.textContent,r.innerHTML,i,t)},50)}function Fc(e,t,n,r,i){let o=IT(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",u=>u(e,i,o||We.empty)))return!0;if(!o)return!1;let s=MW(o),a=s?e.state.tr.replaceSelectionWith(s,r):e.state.tr.replaceSelection(o);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function BT(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Cr.paste=(e,t)=>{let n=t;if(e.composing&&!Do)return;let r=Lc?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&Fc(e,BT(r),r.getData("text/html"),i,n)?n.preventDefault():NW(e,n)};class UT{constructor(t,n,r){this.slice=t,this.move=n,this.node=r}}const IW=pi?"altKey":"ctrlKey";function VT(e,t){let n=e.someProp("dragCopies",r=>!r(t));return n??!t[IW]}wr.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,o=i.empty?null:e.posAtCoords(jp(n)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof ut?i.to-1:i.to))){if(r&&r.mightDrag)s=ut.create(e.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let h=e.docView.nearestDesc(n.target,!0);h&&h.node.type.spec.draggable&&h!=e.docView&&(s=ut.create(e.state.doc,h.posBefore))}}let a=(s||e.state.selection).content(),{dom:u,text:d,slice:f}=px(e,a);(!n.dataTransfer.files.length||!tr||pT>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Lc?"Text":"text/html",u.innerHTML),n.dataTransfer.effectAllowed="copyMove",Lc||n.dataTransfer.setData("text/plain",d),e.dragging=new UT(f,VT(e,n),s)};wr.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)};Cr.dragover=Cr.dragenter=(e,t)=>t.preventDefault();Cr.drop=(e,t)=>{try{DW(e,t,e.dragging)}finally{e.dragging=null}};function DW(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(jp(t));if(!r)return;let i=e.state.doc.resolve(r.pos),o=n&&n.slice;o?e.someProp("transformPasted",g=>{o=g(o,e,!1)}):o=IT(e,BT(t.dataTransfer),Lc?null:t.dataTransfer.getData("text/html"),!1,i);let s=!!(n&&VT(e,t));if(e.someProp("handleDrop",g=>g(e,t,o||We.empty,s))){t.preventDefault();return}if(!o)return;t.preventDefault();let a=o?Z4(e.state.doc,i.pos,o):i.pos;a==null&&(a=i.pos);let u=e.state.tr;if(s){let{node:g}=n;g?g.replace(u):u.deleteSelection()}let d=u.mapping.map(a),f=o.openStart==0&&o.openEnd==0&&o.content.childCount==1,h=u.doc;if(f?u.replaceRangeWith(d,d,o.content.firstChild):u.replaceRange(d,d,o),u.doc.eq(h))return;let m=u.doc.resolve(d);if(f&&ut.isSelectable(o.content.firstChild)&&m.nodeAfter&&m.nodeAfter.sameMarkup(o.content.firstChild))u.setSelection(new ut(m));else{let g=u.mapping.map(a);u.mapping.maps[u.mapping.maps.length-1].forEach((x,b,v,C)=>g=C),u.setSelection(hx(e,m,u.doc.resolve(g)))}e.focus(),e.dispatch(u.setMeta("uiEvent","drop"))}wr.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&Po(e)},20))};wr.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)};wr.beforeinput=(e,t)=>{if(tr&&Do&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:r}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=r||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",o=>o(e,ha(8,"Backspace")))))return;let{$cursor:i}=e.state.selection;i&&i.pos>0&&e.dispatch(e.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let e in Cr)wr[e]=Cr[e];function $c(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class Ih{constructor(t,n){this.toDOM=t,this.spec=n||ka,this.side=this.spec.side||0}map(t,n,r,i){let{pos:o,deleted:s}=t.mapResult(n.from+i,this.side<0?-1:1);return s?null:new br(o-r,o-r,this)}valid(){return!0}eq(t){return this==t||t instanceof Ih&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&$c(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class Os{constructor(t,n){this.attrs=t,this.spec=n||ka}map(t,n,r,i){let o=t.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,s=t.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new br(o,s,this)}valid(t,n){return n.from<n.to}eq(t){return this==t||t instanceof Os&&$c(this.attrs,t.attrs)&&$c(this.spec,t.spec)}static is(t){return t.type instanceof Os}destroy(){}}class xx{constructor(t,n){this.attrs=t,this.spec=n||ka}map(t,n,r,i){let o=t.mapResult(n.from+i,1);if(o.deleted)return null;let s=t.mapResult(n.to+i,-1);return s.deleted||s.pos<=o.pos?null:new br(o.pos-r,s.pos-r,this)}valid(t,n){let{index:r,offset:i}=t.content.findIndex(n.from),o;return i==n.from&&!(o=t.child(r)).isText&&i+o.nodeSize==n.to}eq(t){return this==t||t instanceof xx&&$c(this.attrs,t.attrs)&&$c(this.spec,t.spec)}destroy(){}}class br{constructor(t,n,r){this.from=t,this.to=n,this.type=r}copy(t,n){return new br(t,n,this.type)}eq(t,n=0){return this.type.eq(t.type)&&this.from+n==t.from&&this.to+n==t.to}map(t,n,r){return this.type.map(t,this,n,r)}static widget(t,n,r){return new br(t,t,new Ih(n,r))}static inline(t,n,r,i){return new br(t,n,new Os(r,i))}static node(t,n,r,i){return new br(t,n,new xx(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Os}get widget(){return this.type instanceof Ih}}const Sl=[],ka={};class bn{constructor(t,n){this.local=t.length?t:Sl,this.children=n.length?n:Sl}static create(t,n){return n.length?Dh(n,t,0,ka):sr}find(t,n,r){let i=[];return this.findInner(t??0,n??1e9,i,0,r),i}findInner(t,n,r,i,o){for(let s=0;s<this.local.length;s++){let a=this.local[s];a.from<=n&&a.to>=t&&(!o||o(a.spec))&&r.push(a.copy(a.from+i,a.to+i))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<n&&this.children[s+1]>t){let a=this.children[s]+1;this.children[s+2].findInner(t-a,n-a,r,i+a,o)}}map(t,n,r){return this==sr||t.maps.length==0?this:this.mapInner(t,n,0,0,r||ka)}mapInner(t,n,r,i,o){let s;for(let a=0;a<this.local.length;a++){let u=this.local[a].map(t,r,i);u&&u.type.valid(n,u)?(s||(s=[])).push(u):o.onRemove&&o.onRemove(this.local[a].spec)}return this.children.length?OW(this.children,s||[],t,n,r,i,o):s?new bn(s.sort(wa),Sl):sr}add(t,n){return n.length?this==sr?bn.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,o=0;t.forEach((a,u)=>{let d=u+r,f;if(f=WT(n,a,d)){for(i||(i=this.children.slice());o<i.length&&i[o]<u;)o+=3;i[o]==u?i[o+2]=i[o+2].addInner(a,f,d+1):i.splice(o,0,u,u+a.nodeSize,Dh(f,a,d+1,ka)),o+=3}});let s=HT(o?qT(n):n,-r);for(let a=0;a<s.length;a++)s[a].type.valid(t,s[a])||s.splice(a--,1);return new bn(s.length?this.local.concat(s).sort(wa):this.local,i||this.children)}remove(t){return t.length==0||this==sr?this:this.removeInner(t,0)}removeInner(t,n){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let s,a=r[o]+n,u=r[o+1]+n;for(let f=0,h;f<t.length;f++)(h=t[f])&&h.from>a&&h.to<u&&(t[f]=null,(s||(s=[])).push(h));if(!s)continue;r==this.children&&(r=this.children.slice());let d=r[o+2].removeInner(s,a+1);d!=sr?r[o+2]=d:(r.splice(o,3),o-=3)}if(i.length){for(let o=0,s;o<t.length;o++)if(s=t[o])for(let a=0;a<i.length;a++)i[a].eq(s,n)&&(i==this.local&&(i=this.local.slice()),i.splice(a--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new bn(i,r):sr}forChild(t,n){if(this==sr)return this;if(n.isLeaf)return bn.empty;let r,i;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=t){this.children[a]==t&&(r=this.children[a+2]);break}let o=t+1,s=o+n.content.size;for(let a=0;a<this.local.length;a++){let u=this.local[a];if(u.from<s&&u.to>o&&u.type instanceof Os){let d=Math.max(o,u.from)-o,f=Math.min(s,u.to)-o;d<f&&(i||(i=[])).push(u.copy(d,f))}}if(i){let a=new bn(i.sort(wa),Sl);return r?new vs([a,r]):a}return r||sr}eq(t){if(this==t)return!0;if(!(t instanceof bn)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(t.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=t.children[n]||this.children[n+1]!=t.children[n+1]||!this.children[n+2].eq(t.children[n+2]))return!1;return!0}locals(t){return bx(this.localsInner(t))}localsInner(t){if(this==sr)return Sl;if(t.inlineContent||!this.local.some(Os.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Os||n.push(this.local[r]);return n}forEachSet(t){t(this)}}bn.empty=new bn([],[]);bn.removeOverlap=bx;const sr=bn.empty;class vs{constructor(t){this.members=t}map(t,n){const r=this.members.map(i=>i.map(t,n,ka));return vs.from(r)}forChild(t,n){if(n.isLeaf)return bn.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(t,n);o!=sr&&(o instanceof vs?r=r.concat(o.members):r.push(o))}return vs.from(r)}eq(t){if(!(t instanceof vs)||t.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(t.members[n]))return!1;return!0}locals(t){let n,r=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(t);if(o.length)if(!n)n=o;else{r&&(n=n.slice(),r=!1);for(let s=0;s<o.length;s++)n.push(o[s])}}return n?bx(r?n:n.sort(wa)):Sl}static from(t){switch(t.length){case 0:return sr;case 1:return t[0];default:return new vs(t.every(n=>n instanceof bn)?t:t.reduce((n,r)=>n.concat(r instanceof bn?r:r.members),[]))}}forEachSet(t){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(t)}}function OW(e,t,n,r,i,o,s){let a=e.slice();for(let d=0,f=o;d<n.maps.length;d++){let h=0;n.maps[d].forEach((m,g,x,b)=>{let v=b-x-(g-m);for(let C=0;C<a.length;C+=3){let _=a[C+1];if(_<0||m>_+f-h)continue;let E=a[C]+f-h;g>=E?a[C+1]=m<=E?-2:-1:m>=f&&v&&(a[C]+=v,a[C+1]+=v)}h+=v}),f=n.maps[d].map(f,-1)}let u=!1;for(let d=0;d<a.length;d+=3)if(a[d+1]<0){if(a[d+1]==-2){u=!0,a[d+1]=-1;continue}let f=n.map(e[d]+o),h=f-i;if(h<0||h>=r.content.size){u=!0;continue}let m=n.map(e[d+1]+o,-1),g=m-i,{index:x,offset:b}=r.content.findIndex(h),v=r.maybeChild(x);if(v&&b==h&&b+v.nodeSize==g){let C=a[d+2].mapInner(n,v,f+1,e[d]+o+1,s);C!=sr?(a[d]=h,a[d+1]=g,a[d+2]=C):(a[d+1]=-2,u=!0)}else u=!0}if(u){let d=RW(a,e,t,n,i,o,s),f=Dh(d,r,0,s);t=f.local;for(let h=0;h<a.length;h+=3)a[h+1]<0&&(a.splice(h,3),h-=3);for(let h=0,m=0;h<f.children.length;h+=3){let g=f.children[h];for(;m<a.length&&a[m]<g;)m+=3;a.splice(m,0,f.children[h],f.children[h+1],f.children[h+2])}}return new bn(t.sort(wa),a)}function HT(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new br(i.from+t,i.to+t,i.type))}return n}function RW(e,t,n,r,i,o,s){function a(u,d){for(let f=0;f<u.local.length;f++){let h=u.local[f].map(r,i,d);h?n.push(h):s.onRemove&&s.onRemove(u.local[f].spec)}for(let f=0;f<u.children.length;f+=3)a(u.children[f+2],u.children[f]+d+1)}for(let u=0;u<e.length;u+=3)e[u+1]==-1&&a(e[u+2],t[u]+o+1);return n}function WT(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let o=0,s;o<e.length;o++)(s=e[o])&&s.from>n&&s.to<r&&((i||(i=[])).push(s),e[o]=null);return i}function qT(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function Dh(e,t,n,r){let i=[],o=!1;t.forEach((a,u)=>{let d=WT(e,a,u+n);if(d){o=!0;let f=Dh(d,a,n+u+1,r);f!=sr&&i.push(u,u+a.nodeSize,f)}});let s=HT(o?qT(e):e,-n).sort(wa);for(let a=0;a<s.length;a++)s[a].type.valid(t,s[a])||(r.onRemove&&r.onRemove(s[a].spec),s.splice(a--,1));return s.length||i.length?new bn(s,i):sr}function wa(e,t){return e.from-t.from||e.to-t.to}function bx(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let o=t[i];if(o.from==r.from){o.to!=r.to&&(t==e&&(t=e.slice()),t[i]=o.copy(o.from,r.to),wC(t,i+1,o.copy(r.to,o.to)));continue}else{o.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,o.from),wC(t,i,r.copy(o.from,r.to)));break}}}return t}function wC(e,t,n){for(;t<e.length&&wa(n,e[t])>0;)t++;e.splice(t,0,n)}function vg(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=sr&&t.push(r)}),e.cursorWrapper&&t.push(bn.create(e.state.doc,[e.cursorWrapper.deco])),vs.from(t)}const PW={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},jW=Lr&&Is<=11;class zW{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class LW{constructor(t,n){this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new zW,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);Lr&&Is<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():lr&&t.composing&&r.some(i=>i.type=="childList"&&i.target.nodeName=="TR")?(t.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),jW&&(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,PW)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let n=0;n<t.length;n++)this.queue.push(t[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(pC(this.view)){if(this.suppressingSelectionUpdates)return Po(this.view);if(Lr&&Is<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&Ia(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let n=new Set,r;for(let o=t.focusNode;o;o=Bl(o))n.add(o);for(let o=t.anchorNode;o;o=Bl(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 t of this.observer.takeRecords())this.queue.push(t);return this.queue}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=t.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&pC(t)&&!this.ignoreSelectionChange(r),o=-1,s=-1,a=!1,u=[];if(t.editable)for(let f=0;f<n.length;f++){let h=this.registerMutation(n[f],u);h&&(o=o<0?h.from:Math.min(h.from,o),s=s<0?h.to:Math.max(h.to,s),h.typeOver&&(a=!0))}if(u.some(f=>f.nodeName=="BR")&&(t.input.lastKeyCode==8||t.input.lastKeyCode==46)){for(let f of u)if(f.nodeName=="BR"&&f.parentNode){let h=f.nextSibling;h&&h.nodeType==1&&h.contentEditable=="false"&&f.parentNode.removeChild(f)}}else if(xi&&u.length){let f=u.filter(h=>h.nodeName=="BR");if(f.length==2){let[h,m]=f;h.parentNode&&h.parentNode.parentNode==m.parentNode?m.remove():h.remove()}else{let{focusNode:h}=this.currentSelection;for(let m of f){let g=m.parentNode;g&&g.nodeName=="LI"&&(!h||BW(t,h)!=g)&&m.remove()}}}let d=null;o<0&&i&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&Rp(r)&&(d=fx(t))&&d.eq(At.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,Po(t),this.currentSelection.set(r),t.scrollToSelection()):(o>-1||i)&&(o>-1&&(t.docView.markDirty(o,s),FW(t)),t.input.badSafariComposition&&(t.input.badSafariComposition=!1,UW(t,u)),this.handleDOMChange(o,s,a,u),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(r)||Po(t),this.currentSelection.set(r))}registerMutation(t,n){if(n.indexOf(t.target)>-1)return null;let r=this.view.docView.nearestDesc(t.target);if(t.type=="attributes"&&(r==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!r||r.ignoreMutation(t))return null;if(t.type=="childList"){for(let f=0;f<t.addedNodes.length;f++){let h=t.addedNodes[f];n.push(h),h.nodeType==3&&(this.lastChangedTextNode=h)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(t.target))return{from:r.posBefore,to:r.posAfter};let i=t.previousSibling,o=t.nextSibling;if(Lr&&Is<=11&&t.addedNodes.length)for(let f=0;f<t.addedNodes.length;f++){let{previousSibling:h,nextSibling:m}=t.addedNodes[f];(!h||Array.prototype.indexOf.call(t.addedNodes,h)<0)&&(i=h),(!m||Array.prototype.indexOf.call(t.addedNodes,m)<0)&&(o=m)}let s=i&&i.parentNode==t.target?Xn(i)+1:0,a=r.localPosFromDOM(t.target,s,-1),u=o&&o.parentNode==t.target?Xn(o):t.target.childNodes.length,d=r.localPosFromDOM(t.target,u,1);return{from:a,to:d}}else return t.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=t.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:t.target.nodeValue==t.oldValue})}}let CC=new WeakMap,SC=!1;function FW(e){if(!CC.has(e)&&(CC.set(e,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=xi,SC)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),SC=!0}}function EC(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,o=t.endOffset,s=e.domAtPos(e.state.selection.anchor);return Ia(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function $W(e,t){if(t.getComposedRanges){let i=t.getComposedRanges(e.root)[0];if(i)return EC(e,i)}let n;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",r,!0),n?EC(e,n):null}function BW(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let r=e.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function UW(e,t){var n;let{focusNode:r,focusOffset:i}=e.domSelectionRange();for(let o of t)if(((n=o.parentNode)===null||n===void 0?void 0:n.nodeName)=="TR"){let s=o.nextSibling;for(;s&&s.nodeName!="TD"&&s.nodeName!="TH";)s=s.nextSibling;if(s){let a=s;for(;;){let u=a.firstChild;if(!u||u.nodeType!=1||u.contentEditable=="false"||/^(BR|IMG)$/.test(u.nodeName))break;a=u}a.insertBefore(o,a.firstChild),r==o&&e.domSelection().collapse(o,i)}else o.parentNode.removeChild(o)}}function VW(e,t,n){let{node:r,fromOffset:i,toOffset:o,from:s,to:a}=e.docView.parseRange(t,n),u=e.domSelectionRange(),d,f=u.anchorNode;if(f&&e.dom.contains(f.nodeType==1?f:f.parentNode)&&(d=[{node:f,offset:u.anchorOffset}],Rp(u)||d.push({node:u.focusNode,offset:u.focusOffset})),tr&&e.input.lastKeyCode===8)for(let v=o;v>i;v--){let C=r.childNodes[v-1],_=C.pmViewDesc;if(C.nodeName=="BR"&&!_){o=v;break}if(!_||_.size)break}let h=e.state.doc,m=e.someProp("domParser")||Oo.fromSchema(e.state.schema),g=h.resolve(s),x=null,b=m.parse(r,{topNode:g.parent,topMatch:g.parent.contentMatchAt(g.index()),topOpen:!0,from:i,to:o,preserveWhitespace:g.parent.type.whitespace=="pre"?"full":!0,findPositions:d,ruleFromNode:HW,context:g});if(d&&d[0].pos!=null){let v=d[0].pos,C=d[1]&&d[1].pos;C==null&&(C=v),x={anchor:v+s,head:C+s}}return{doc:b,sel:x,from:s,to:a}}function HW(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName=="BR"&&e.parentNode){if(lr&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(e.parentNode.lastChild==e||lr&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}const WW=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function qW(e,t,n,r,i){let o=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let F=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,R=fx(e,F);if(R&&!e.state.selection.eq(R)){if(tr&&Do&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",L=>L(e,ha(13,"Enter"))))return;let D=e.state.tr.setSelection(R);F=="pointer"?D.setMeta("pointer",!0):F=="key"&&D.scrollIntoView(),o&&D.setMeta("composition",o),e.dispatch(D)}return}let s=e.state.doc.resolve(t),a=s.sharedDepth(n);t=s.before(a+1),n=e.state.doc.resolve(n).after(a+1);let u=e.state.selection,d=VW(e,t,n),f=e.state.doc,h=f.slice(d.from,d.to),m,g;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(m=e.state.selection.to,g="end"):(m=e.state.selection.from,g="start"),e.input.lastKeyCode=null;let x=KW(h.content,d.doc.content,d.from,m,g);if(x&&e.input.domChangeCount++,(Ul&&e.input.lastIOSEnter>Date.now()-225||Do)&&i.some(F=>F.nodeType==1&&!WW.test(F.nodeName))&&(!x||x.endA>=x.endB)&&e.someProp("handleKeyDown",F=>F(e,ha(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!x)if(r&&u instanceof yt&&!u.empty&&u.$head.sameParent(u.$anchor)&&!e.composing&&!(d.sel&&d.sel.anchor!=d.sel.head))x={start:u.from,endA:u.to,endB:u.to};else{if(d.sel){let F=_C(e,e.state.doc,d.sel);if(F&&!F.eq(e.state.selection)){let R=e.state.tr.setSelection(F);o&&R.setMeta("composition",o),e.dispatch(R)}}return}e.state.selection.from<e.state.selection.to&&x.start==x.endB&&e.state.selection instanceof yt&&(x.start>e.state.selection.from&&x.start<=e.state.selection.from+2&&e.state.selection.from>=d.from?x.start=e.state.selection.from:x.endA<e.state.selection.to&&x.endA>=e.state.selection.to-2&&e.state.selection.to<=d.to&&(x.endB+=e.state.selection.to-x.endA,x.endA=e.state.selection.to)),Lr&&Is<=11&&x.endB==x.start+1&&x.endA==x.start&&x.start>d.from&&d.doc.textBetween(x.start-d.from-1,x.start-d.from+1)=="  "&&(x.start--,x.endA--,x.endB--);let b=d.doc.resolveNoCache(x.start-d.from),v=d.doc.resolveNoCache(x.endB-d.from),C=f.resolve(x.start),_=b.sameParent(v)&&b.parent.inlineContent&&C.end()>=x.endA;if((Ul&&e.input.lastIOSEnter>Date.now()-225&&(!_||i.some(F=>F.nodeName=="DIV"||F.nodeName=="P"))||!_&&b.pos<d.doc.content.size&&(!b.sameParent(v)||!b.parent.inlineContent)&&b.pos<v.pos&&!/\S/.test(d.doc.textBetween(b.pos,v.pos,"","")))&&e.someProp("handleKeyDown",F=>F(e,ha(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>x.start&&JW(f,x.start,x.endA,b,v)&&e.someProp("handleKeyDown",F=>F(e,ha(8,"Backspace")))){Do&&tr&&e.domObserver.suppressSelectionUpdates();return}tr&&x.endB==x.start&&(e.input.lastChromeDelete=Date.now()),Do&&!_&&b.start()!=v.start()&&v.parentOffset==0&&b.depth==v.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==x.endA&&(x.endB-=2,v=d.doc.resolveNoCache(x.endB-d.from),setTimeout(()=>{e.someProp("handleKeyDown",function(F){return F(e,ha(13,"Enter"))})},20));let E=x.start,I=x.endA,N=F=>{let R=F||e.state.tr.replace(E,I,d.doc.slice(x.start-d.from,x.endB-d.from));if(d.sel){let D=_C(e,R.doc,d.sel);D&&!(tr&&e.composing&&D.empty&&(x.start!=x.endB||e.input.lastChromeDelete<Date.now()-100)&&(D.head==E||D.head==R.mapping.map(I)-1)||Lr&&D.empty&&D.head==E)&&R.setSelection(D)}return o&&R.setMeta("composition",o),R.scrollIntoView()},M;if(_)if(b.pos==v.pos){Lr&&Is<=11&&b.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>Po(e),20));let F=N(e.state.tr.delete(E,I)),R=f.resolve(x.start).marksAcross(f.resolve(x.endA));R&&F.ensureMarks(R),e.dispatch(F)}else if(x.endA==x.endB&&(M=ZW(b.parent.content.cut(b.parentOffset,v.parentOffset),C.parent.content.cut(C.parentOffset,x.endA-C.start())))){let F=N(e.state.tr);M.type=="add"?F.addMark(E,I,M.mark):F.removeMark(E,I,M.mark),e.dispatch(F)}else if(b.parent.child(b.index()).isText&&b.index()==v.index()-(v.textOffset?0:1)){let F=b.parent.textBetween(b.parentOffset,v.parentOffset),R=()=>N(e.state.tr.insertText(F,E,I));e.someProp("handleTextInput",D=>D(e,E,I,F,R))||e.dispatch(R())}else e.dispatch(N());else e.dispatch(N())}function _C(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:hx(e,t.resolve(n.anchor),t.resolve(n.head))}function ZW(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,o=r,s,a,u;for(let f=0;f<r.length;f++)i=r[f].removeFromSet(i);for(let f=0;f<n.length;f++)o=n[f].removeFromSet(o);if(i.length==1&&o.length==0)a=i[0],s="add",u=f=>f.mark(a.addToSet(f.marks));else if(i.length==0&&o.length==1)a=o[0],s="remove",u=f=>f.mark(a.removeFromSet(f.marks));else return null;let d=[];for(let f=0;f<t.childCount;f++)d.push(u(t.child(f)));if(fe.from(d).eq(e))return{mark:a,type:s}}function JW(e,t,n,r,i){if(n-t<=i.pos-r.pos||kg(r,!0,!1)<i.pos)return!1;let o=e.resolve(t);if(!r.parent.isTextblock){let a=o.nodeAfter;return a!=null&&n==t+a.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=e.resolve(kg(o,!0,!0));return!s.parent.isTextblock||s.pos>n||kg(s,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function kg(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let o=e.node(r).maybeChild(e.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function KW(e,t,n,r,i){let o=e.findDiffStart(t,n);if(o==null)return null;let{a:s,b:a}=e.findDiffEnd(t,n+e.size,n+t.size);if(i=="end"){let u=Math.max(0,o-Math.min(s,a));r-=s+u-o}if(s<o&&e.size<t.size){let u=r<=o&&r>=s?o-r:0;o-=u,o&&o<t.size&&TC(t.textBetween(o-1,o+1))&&(o+=u?1:-1),a=o+(a-s),s=o}else if(a<o){let u=r<=o&&r>=a?o-r:0;o-=u,o&&o<e.size&&TC(e.textBetween(o-1,o+1))&&(o+=u?1:-1),s=o+(s-a),a=o}return{start:o,endA:s,endB:a}}function TC(e){if(e.length!=2)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}class ZT{constructor(t,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new dW,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(DC),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):typeof t=="function"?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=NC(this),MC(this),this.nodeViews=IC(this),this.docView=lC(this.state.doc,AC(this),vg(this),this.dom,this),this.domObserver=new LW(this,(r,i,o,s)=>qW(this,r,i,o,s)),this.domObserver.start(),fW(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let n in t)this._props[n]=t[n];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&B1(this);let n=this._props;this._props=t,t.plugins&&(t.plugins.forEach(DC),this.directPlugins=t.plugins),this.updateStateInner(t.state,n)}setProps(t){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in t)n[r]=t[r];this.update(n)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,n){var r;let i=this.state,o=!1,s=!1;t.storedMarks&&this.composing&&($T(this),s=!0),this.state=t;let a=i.plugins!=t.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let g=IC(this);YW(g,this.nodeViews)&&(this.nodeViews=g,o=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&B1(this),this.editable=NC(this),MC(this);let u=vg(this),d=AC(this),f=i.plugins!=t.plugins&&!i.doc.eq(t.doc)?"reset":t.scrollToSelection>i.scrollToSelection?"to selection":"preserve",h=o||!this.docView.matchesNode(t.doc,d,u);(h||!t.selection.eq(i.selection))&&(s=!0);let m=f=="preserve"&&s&&this.dom.style.overflowAnchor==null&&_H(this);if(s){this.domObserver.stop();let g=h&&(Lr||tr)&&!this.composing&&!i.selection.empty&&!t.selection.empty&&GW(i.selection,t.selection);if(h){let x=tr?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=_W(this)),(o||!this.docView.update(t.doc,d,u,this))&&(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=lC(t.doc,d,u,this.dom,this)),x&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(g=!0)}g||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&GH(this))?Po(this,g):(AT(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(t.doc)&&this.updateDraggedNode(this.dragging,i),f=="reset"?this.dom.scrollTop=0:f=="to selection"?this.scrollToSelection():m&&TH(m)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!(!t||!this.dom.contains(t.nodeType==1?t:t.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof ut){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&nC(this,n.getBoundingClientRect(),t)}else nC(this,this.coordsAtPos(this.state.selection.head,1),t)}}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(!t||t.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,t)}}updateDraggedNode(t,n){let r=t.node,i=-1;if(this.state.doc.nodeAt(r.from)==r.node)i=r.from;else{let o=r.from+(this.state.doc.content.size-n.doc.content.size);(o>0&&this.state.doc.nodeAt(o))==r.node&&(i=o)}this.dragging=new UT(t.slice,t.move,i<0?void 0:ut.create(this.state.doc,i))}someProp(t,n){let r=this._props&&this._props[t],i;if(r!=null&&(i=n?n(r):r))return i;for(let s=0;s<this.directPlugins.length;s++){let a=this.directPlugins[s].props[t];if(a!=null&&(i=n?n(a):a))return i}let o=this.state.plugins;if(o)for(let s=0;s<o.length;s++){let a=o[s].props[t];if(a!=null&&(i=n?n(a):a))return i}}hasFocus(){if(Lr){let t=this.root.activeElement;if(t==this.dom)return!0;if(!t||!this.dom.contains(t))return!1;for(;t&&this.dom!=t&&this.dom.contains(t);){if(t.contentEditable=="false")return!1;t=t.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&AH(this.dom),Po(this),this.domObserver.start()}get root(){let t=this._root;if(t==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return t||document}updateRoot(){this._root=null}posAtCoords(t){return OH(this,t)}coordsAtPos(t,n=1){return vT(this,t,n)}domAtPos(t,n=0){return this.docView.domFromPos(t,n)}nodeDOM(t){let n=this.docView.descAt(t);return n?n.nodeDOM:null}posAtDOM(t,n,r=-1){let i=this.docView.posFromDOM(t,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(t,n){return LH(this,n||this.state,t)}pasteHTML(t,n){return Fc(this,"",t,!1,n||new ClipboardEvent("paste"))}pasteText(t,n){return Fc(this,t,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(t){return px(this,t)}destroy(){this.docView&&(hW(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],vg(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,gH())}get isDestroyed(){return this.docView==null}dispatchEvent(t){return mW(this,t)}domSelectionRange(){let t=this.domSelection();return t?lr&&this.root.nodeType===11&&kH(this.dom.ownerDocument)==this.dom&&$W(this,t)||t:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}ZT.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function AC(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(e.state)),n)for(let r in n)r=="class"?t.class+=" "+n[r]:r=="style"?t.style=(t.style?t.style+";":"")+n[r]:!t[r]&&r!="contenteditable"&&r!="nodeName"&&(t[r]=String(n[r]))}),t.translate||(t.translate="no"),[br.node(0,e.state.doc.content.size,t)]}function MC(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:br.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function NC(e){return!e.someProp("editable",t=>t(e.state)===!1)}function GW(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function IC(e){let t=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(t,i)||(t[i]=r[i])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function YW(e,t){let n=0,r=0;for(let i in e){if(e[i]!=t[i])return!0;n++}for(let i in t)r++;return n!=r}function DC(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var zs={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:"'"},Oh={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},QW=typeof navigator<"u"&&/Mac/.test(navigator.platform),XW=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var er=0;er<10;er++)zs[48+er]=zs[96+er]=String(er);for(var er=1;er<=24;er++)zs[er+111]="F"+er;for(var er=65;er<=90;er++)zs[er]=String.fromCharCode(er+32),Oh[er]=String.fromCharCode(er);for(var wg in zs)Oh.hasOwnProperty(wg)||(Oh[wg]=zs[wg]);function eq(e){var t=QW&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||XW&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?Oh:zs)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const tq=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),nq=typeof navigator<"u"&&/Win/.test(navigator.platform);function rq(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n=="Space"&&(n=" ");let r,i,o,s;for(let a=0;a<t.length-1;a++){let u=t[a];if(/^(cmd|meta|m)$/i.test(u))s=!0;else if(/^a(lt)?$/i.test(u))r=!0;else if(/^(c|ctrl|control)$/i.test(u))i=!0;else if(/^s(hift)?$/i.test(u))o=!0;else if(/^mod$/i.test(u))tq?s=!0:i=!0;else throw new Error("Unrecognized modifier name: "+u)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),s&&(n="Meta-"+n),o&&(n="Shift-"+n),n}function iq(e){let t=Object.create(null);for(let n in e)t[rq(n)]=e[n];return t}function Cg(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function oq(e){return new mn({props:{handleKeyDown:JT(e)}})}function JT(e){let t=iq(e);return function(n,r){let i=eq(r),o,s=t[Cg(i,r)];if(s&&s(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let a=t[Cg(i,r,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(nq&&r.ctrlKey&&r.altKey)&&(o=zs[r.keyCode])&&o!=i){let a=t[Cg(o,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}var sq=Object.defineProperty,vx=(e,t)=>{for(var n in t)sq(e,n,{get:t[n],enumerable:!0})};function zp(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}var Lp=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:t,state:n}=this,{view:r}=t,{tr:i}=n,o=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([s,a])=>[s,(...d)=>{const f=a(...d)(o);return!i.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(i),f}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:n,editor:r,state:i}=this,{view:o}=r,s=[],a=!!e,u=e||i.tr,d=()=>(!a&&t&&!u.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(u),s.every(h=>h===!0)),f={...Object.fromEntries(Object.entries(n).map(([h,m])=>[h,(...x)=>{const b=this.buildProps(u,t),v=m(...x)(b);return s.push(v),f}])),run:d};return f}createCan(e){const{rawCommands:t,state:n}=this,r=!1,i=e||n.tr,o=this.buildProps(i,r);return{...Object.fromEntries(Object.entries(t).map(([a,u])=>[a,(...d)=>u(...d)({...o,dispatch:void 0})])),chain:()=>this.createChain(i,r)}}buildProps(e,t=!0){const{rawCommands:n,editor:r,state:i}=this,{view:o}=r,s={tr:e,editor:r,view:o,state:zp({state:i,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([a,u])=>[a,(...d)=>u(...d)(s)]))}};return s}},KT={};vx(KT,{blur:()=>aq,clearContent:()=>lq,clearNodes:()=>uq,command:()=>cq,createParagraphNear:()=>dq,cut:()=>fq,deleteCurrentNode:()=>hq,deleteNode:()=>pq,deleteRange:()=>mq,deleteSelection:()=>gq,enter:()=>yq,exitCode:()=>xq,extendMarkRange:()=>bq,first:()=>vq,focus:()=>wq,forEach:()=>Cq,insertContent:()=>Sq,insertContentAt:()=>Tq,joinBackward:()=>Nq,joinDown:()=>Mq,joinForward:()=>Iq,joinItemBackward:()=>Dq,joinItemForward:()=>Oq,joinTextblockBackward:()=>Rq,joinTextblockForward:()=>Pq,joinUp:()=>Aq,keyboardShortcut:()=>zq,lift:()=>Lq,liftEmptyBlock:()=>Fq,liftListItem:()=>$q,newlineInCode:()=>Bq,resetAttributes:()=>Uq,scrollIntoView:()=>Vq,selectAll:()=>Hq,selectNodeBackward:()=>Wq,selectNodeForward:()=>qq,selectParentNode:()=>Zq,selectTextblockEnd:()=>Jq,selectTextblockStart:()=>Kq,setContent:()=>Gq,setMark:()=>gZ,setMeta:()=>yZ,setNode:()=>xZ,setNodeSelection:()=>bZ,setTextDirection:()=>vZ,setTextSelection:()=>kZ,sinkListItem:()=>wZ,splitBlock:()=>CZ,splitListItem:()=>SZ,toggleList:()=>EZ,toggleMark:()=>_Z,toggleNode:()=>TZ,toggleWrap:()=>AZ,undoInputRule:()=>MZ,unsetAllMarks:()=>NZ,unsetMark:()=>IZ,unsetTextDirection:()=>DZ,updateAttributes:()=>OZ,wrapIn:()=>RZ,wrapInList:()=>PZ});var aq=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),lq=(e=!0)=>({commands:t})=>t.setContent("",{emitUpdate:e}),uq=()=>({state:e,tr:t,dispatch:n})=>{const{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:s})=>{e.doc.nodesBetween(o.pos,s.pos,(a,u)=>{if(a.type.isText)return;const{doc:d,mapping:f}=t,h=d.resolve(f.map(u)),m=d.resolve(f.map(u+a.nodeSize)),g=h.blockRange(m);if(!g)return;const x=Xl(g);if(a.type.isTextblock){const{defaultType:b}=h.parent.contentMatchAt(h.index());t.setNodeMarkup(g.start,b)}(x||x===0)&&t.lift(g,x)})}),!0},cq=e=>t=>e(t),dq=()=>({state:e,dispatch:t})=>uT(e,t),fq=(e,t)=>({editor:n,tr:r})=>{const{state:i}=n,o=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);const s=r.mapping.map(t);return r.insert(s,o.content),r.setSelection(new yt(r.doc.resolve(Math.max(s-1,0)))),!0},hq=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;const i=e.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(t){const a=i.before(o),u=i.after(o);e.delete(a,u).scrollIntoView()}return!0}return!1};function In(e,t){if(typeof e=="string"){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}var pq=e=>({tr:t,state:n,dispatch:r})=>{const i=In(e,n.schema),o=t.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===i){if(r){const u=o.before(s),d=o.after(s);t.delete(u,d).scrollIntoView()}return!0}return!1},mq=e=>({tr:t,dispatch:n})=>{const{from:r,to:i}=e;return n&&t.delete(r,i),!0},gq=()=>({state:e,dispatch:t})=>sx(e,t),yq=()=>({commands:e})=>e.keyboardShortcut("Enter"),xq=()=>({state:e,dispatch:t})=>tH(e,t);function kx(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function Rh(e,t,n={strict:!0}){const r=Object.keys(t);return r.length?r.every(i=>n.strict?t[i]===e[i]:kx(t[i])?t[i].test(e[i]):t[i]===e[i]):!0}function GT(e,t,n={}){return e.find(r=>r.type===t&&Rh(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}function OC(e,t,n={}){return!!GT(e,t,n)}function wx(e,t,n){var r;if(!e||!t)return;let i=e.parent.childAfter(e.parentOffset);if((!i.node||!i.node.marks.some(f=>f.type===t))&&(i=e.parent.childBefore(e.parentOffset)),!i.node||!i.node.marks.some(f=>f.type===t)||(n=n||((r=i.node.marks[0])==null?void 0:r.attrs),!GT([...i.node.marks],t,n)))return;let s=i.index,a=e.start()+i.offset,u=s+1,d=a+i.node.nodeSize;for(;s>0&&OC([...e.parent.child(s-1).marks],t,n);)s-=1,a-=e.parent.child(s).nodeSize;for(;u<e.parent.childCount&&OC([...e.parent.child(u).marks],t,n);)d+=e.parent.child(u).nodeSize,u+=1;return{from:a,to:d}}function $o(e,t){if(typeof e=="string"){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}var bq=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const o=$o(e,r.schema),{doc:s,selection:a}=n,{$from:u,from:d,to:f}=a;if(i){const h=wx(u,o,t);if(h&&h.from<=d&&h.to>=f){const m=yt.create(s,h.from,h.to);n.setSelection(m)}}return!0},vq=e=>t=>{const n=typeof e=="function"?e(t):e;for(let r=0;r<n.length;r+=1)if(n[r](t))return!0;return!1};function YT(e){return e instanceof yt}function ya(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function QT(e,t=null){if(!t)return null;const n=At.atStart(e),r=At.atEnd(e);if(t==="start"||t===!0)return n;if(t==="end")return r;const i=n.from,o=r.to;return t==="all"?yt.create(e,ya(0,i,o),ya(e.content.size,i,o)):yt.create(e,ya(t,i,o),ya(t,i,o))}function U1(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function Bc(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function kq(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var wq=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:o})=>{t={scrollIntoView:!0,...t};const s=()=>{(Bc()||U1())&&r.dom.focus(),kq()&&!Bc()&&!U1()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t!=null&&t.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&e===null||e===!1)return!0}catch{return!1}if(o&&e===null&&!YT(n.state.selection))return s(),!0;const a=QT(i.doc,e)||n.state.selection,u=n.state.selection.eq(a);return o&&(u||i.setSelection(a),u&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},Cq=(e,t)=>n=>e.every((r,i)=>t(r,{...n,index:i})),Sq=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),XT=e=>{const t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){const r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&XT(r)}return e};function Rf(e){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,"text/html").body;return XT(n)}function Uc(e,t,n){if(e instanceof Ns||e instanceof fe)return e;n={slice:!0,parseOptions:{},...n};const r=typeof e=="object"&&e!==null,i=typeof e=="string";if(r)try{if(Array.isArray(e)&&e.length>0)return fe.fromArray(e.map(a=>t.nodeFromJSON(a)));const s=t.nodeFromJSON(e);return n.errorOnInvalidContent&&s.check(),s}catch(o){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",o),Uc("",t,n)}if(i){if(n.errorOnInvalidContent){let s=!1,a="";const u=new tx({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:d=>(s=!0,a=typeof d=="string"?d:d.outerHTML,null)}]}})});if(n.slice?Oo.fromSchema(u).parseSlice(Rf(e),n.parseOptions):Oo.fromSchema(u).parse(Rf(e),n.parseOptions),n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const o=Oo.fromSchema(t);return n.slice?o.parseSlice(Rf(e),n.parseOptions).content:o.parse(Rf(e),n.parseOptions)}return Uc("",t,n)}function Eq(e,t,n){const r=e.steps.length-1;if(r<t)return;const i=e.steps[r];if(!(i instanceof qn||i instanceof Jn))return;const o=e.mapping.maps[r];let s=0;o.forEach((a,u,d,f)=>{s===0&&(s=f)}),e.setSelection(At.near(e.doc.resolve(s),n))}var _q=e=>!("type"in e),Tq=(e,t,n)=>({tr:r,dispatch:i,editor:o})=>{var s;if(i){n={parseOptions:o.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let a;const u=v=>{o.emit("contentError",{editor:o,error:v,disableCollaboration:()=>{"collaboration"in o.storage&&typeof o.storage.collaboration=="object"&&o.storage.collaboration&&(o.storage.collaboration.isDisabled=!0)}})},d={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!o.options.enableContentCheck&&o.options.emitContentError)try{Uc(t,o.schema,{parseOptions:d,errorOnInvalidContent:!0})}catch(v){u(v)}try{a=Uc(t,o.schema,{parseOptions:d,errorOnInvalidContent:(s=n.errorOnInvalidContent)!=null?s:o.options.enableContentCheck})}catch(v){return u(v),!1}let{from:f,to:h}=typeof e=="number"?{from:e,to:e}:{from:e.from,to:e.to},m=!0,g=!0;if((_q(a)?a:[a]).forEach(v=>{v.check(),m=m?v.isText&&v.marks.length===0:!1,g=g?v.isBlock:!1}),f===h&&g){const{parent:v}=r.doc.resolve(f);v.isTextblock&&!v.type.spec.code&&!v.childCount&&(f-=1,h+=1)}let b;if(m){if(Array.isArray(t))b=t.map(v=>v.text||"").join("");else if(t instanceof fe){let v="";t.forEach(C=>{C.text&&(v+=C.text)}),b=v}else typeof t=="object"&&t&&t.text?b=t.text:b=t;r.insertText(b,f,h)}else{b=a;const v=r.doc.resolve(f),C=v.node(),_=v.parentOffset===0,E=C.isText||C.isTextblock,I=C.content.size>0;_&&E&&I&&(f=Math.max(0,f-1)),r.replaceWith(f,h,b)}n.updateSelection&&Eq(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:f,text:b}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:f,text:b})}return!0},Aq=()=>({state:e,dispatch:t})=>QV(e,t),Mq=()=>({state:e,dispatch:t})=>XV(e,t),Nq=()=>({state:e,dispatch:t})=>nT(e,t),Iq=()=>({state:e,dispatch:t})=>sT(e,t),Dq=()=>({state:e,dispatch:t,tr:n})=>{try{const r=Ip(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},Oq=()=>({state:e,dispatch:t,tr:n})=>{try{const r=Ip(e.doc,e.selection.$from.pos,1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},Rq=()=>({state:e,dispatch:t})=>GV(e,t),Pq=()=>({state:e,dispatch:t})=>YV(e,t);function e6(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function jq(e){const t=e.split(/-(?!$)/);let n=t[t.length-1];n==="Space"&&(n=" ");let r,i,o,s;for(let a=0;a<t.length-1;a+=1){const u=t[a];if(/^(cmd|meta|m)$/i.test(u))s=!0;else if(/^a(lt)?$/i.test(u))r=!0;else if(/^(c|ctrl|control)$/i.test(u))i=!0;else if(/^s(hift)?$/i.test(u))o=!0;else if(/^mod$/i.test(u))Bc()||e6()?s=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${u}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),s&&(n=`Meta-${n}`),o&&(n=`Shift-${n}`),n}var zq=e=>({editor:t,view:n,tr:r,dispatch:i})=>{const o=jq(e).split(/-(?!$)/),s=o.find(d=>!["Alt","Ctrl","Meta","Shift"].includes(d)),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}),u=t.captureTransaction(()=>{n.someProp("handleKeyDown",d=>d(n,a))});return u==null||u.steps.forEach(d=>{const f=d.map(r.mapping);f&&i&&r.maybeStep(f)}),!0};function Ls(e,t,n={}){const{from:r,to:i,empty:o}=e.selection,s=t?In(t,e.schema):null,a=[];e.doc.nodesBetween(r,i,(h,m)=>{if(h.isText)return;const g=Math.max(r,m),x=Math.min(i,m+h.nodeSize);a.push({node:h,from:g,to:x})});const u=i-r,d=a.filter(h=>s?s.name===h.node.type.name:!0).filter(h=>Rh(h.node.attrs,n,{strict:!1}));return o?!!d.length:d.reduce((h,m)=>h+m.to-m.from,0)>=u}var Lq=(e,t={})=>({state:n,dispatch:r})=>{const i=In(e,n.schema);return Ls(n,i,t)?eH(n,r):!1},Fq=()=>({state:e,dispatch:t})=>cT(e,t),$q=e=>({state:t,dispatch:n})=>{const r=In(e,t.schema);return fH(r)(t,n)},Bq=()=>({state:e,dispatch:t})=>lT(e,t);function Fp(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function RC(e,t){const n=typeof t=="string"?[t]:t;return Object.keys(e).reduce((r,i)=>(n.includes(i)||(r[i]=e[i]),r),{})}var Uq=(e,t)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=Fp(typeof e=="string"?e:e.name,r.schema);if(!a)return!1;a==="node"&&(o=In(e,r.schema)),a==="mark"&&(s=$o(e,r.schema));let u=!1;return n.selection.ranges.forEach(d=>{r.doc.nodesBetween(d.$from.pos,d.$to.pos,(f,h)=>{o&&o===f.type&&(u=!0,i&&n.setNodeMarkup(h,void 0,RC(f.attrs,t))),s&&f.marks.length&&f.marks.forEach(m=>{s===m.type&&(u=!0,i&&n.addMark(h,h+f.nodeSize,s.create(RC(m.attrs,t))))})})}),u},Vq=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),Hq=()=>({tr:e,dispatch:t})=>{if(t){const n=new Yr(e.doc);e.setSelection(n)}return!0},Wq=()=>({state:e,dispatch:t})=>iT(e,t),qq=()=>({state:e,dispatch:t})=>aT(e,t),Zq=()=>({state:e,dispatch:t})=>iH(e,t),Jq=()=>({state:e,dispatch:t})=>aH(e,t),Kq=()=>({state:e,dispatch:t})=>sH(e,t);function V1(e,t,n={},r={}){return Uc(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var Gq=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:o,dispatch:s,commands:a})=>{const{doc:u}=o;if(r.preserveWhitespace!=="full"){const d=V1(e,i.schema,r,{errorOnInvalidContent:t??i.options.enableContentCheck});return s&&o.replaceWith(0,u.content.size,d).setMeta("preventUpdate",!n),!0}return s&&o.setMeta("preventUpdate",!n),a.insertContentAt({from:0,to:u.content.size},e,{parseOptions:r,errorOnInvalidContent:t??i.options.enableContentCheck})};function t6(e,t){const n=$o(t,e.schema),{from:r,to:i,empty:o}=e.selection,s=[];o?(e.storedMarks&&s.push(...e.storedMarks),s.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,u=>{s.push(...u.marks)});const a=s.find(u=>u.type.name===n.name);return a?{...a.attrs}:{}}function n6(e,t){const n=new Q4(e);return t.forEach(r=>{r.steps.forEach(i=>{n.step(i)})}),n}function Yq(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function Qq(e,t,n){const r=[];return e.nodesBetween(t.from,t.to,(i,o)=>{n(i)&&r.push({node:i,pos:o})}),r}function Xq(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function $p(e){return t=>Xq(t.$from,e)}function lt(e,t,n){return e.config[t]===void 0&&e.parent?lt(e.parent,t,n):typeof e.config[t]=="function"?e.config[t].bind({...n,parent:e.parent?lt(e.parent,t,n):null}):e.config[t]}function Cx(e){return e.map(t=>{const n={name:t.name,options:t.options,storage:t.storage},r=lt(t,"addExtensions",n);return r?[t,...Cx(r())]:t}).flat(10)}function sd(e,t){const n=Fa.fromSchema(t).serializeFragment(e),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function r6(e){return typeof e=="function"}function Zt(e,t=void 0,...n){return r6(e)?t?e.bind(t)(...n):e(...n):e}function eZ(e={}){return Object.keys(e).length===0&&e.constructor===Object}function Vl(e){const t=e.filter(i=>i.type==="extension"),n=e.filter(i=>i.type==="node"),r=e.filter(i=>i.type==="mark");return{baseExtensions:t,nodeExtensions:n,markExtensions:r}}function i6(e){const t=[],{nodeExtensions:n,markExtensions:r}=Vl(e),i=[...n,...r],o={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},s=n.filter(d=>d.name!=="text").map(d=>d.name),a=r.map(d=>d.name),u=[...s,...a];return e.forEach(d=>{const f={name:d.name,options:d.options,storage:d.storage,extensions:i},h=lt(d,"addGlobalAttributes",f);if(!h)return;h().forEach(g=>{let x;Array.isArray(g.types)?x=g.types:g.types==="*"?x=u:g.types==="nodes"?x=s:g.types==="marks"?x=a:x=[],x.forEach(b=>{Object.entries(g.attributes).forEach(([v,C])=>{t.push({type:b,name:v,attribute:{...o,...C}})})})})}),i.forEach(d=>{const f={name:d.name,options:d.options,storage:d.storage},h=lt(d,"addAttributes",f);if(!h)return;const m=h();Object.entries(m).forEach(([g,x])=>{const b={...o,...x};typeof(b==null?void 0:b.default)=="function"&&(b.default=b.default()),b!=null&&b.isRequired&&(b==null?void 0:b.default)===void 0&&delete b.default,t.push({type:d.name,name:g,attribute:b})})}),t}function Dn(...e){return e.filter(t=>!!t).reduce((t,n)=>{const r={...t};return Object.entries(n).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){const a=o?String(o).split(" "):[],u=r[i]?r[i].split(" "):[],d=a.filter(f=>!u.includes(f));r[i]=[...u,...d].join(" ")}else if(i==="style"){const a=o?o.split(";").map(f=>f.trim()).filter(Boolean):[],u=r[i]?r[i].split(";").map(f=>f.trim()).filter(Boolean):[],d=new Map;u.forEach(f=>{const[h,m]=f.split(":").map(g=>g.trim());d.set(h,m)}),a.forEach(f=>{const[h,m]=f.split(":").map(g=>g.trim());d.set(h,m)}),r[i]=Array.from(d.entries()).map(([f,h])=>`${f}: ${h}`).join("; ")}else r[i]=o}),r},{})}function Hl(e,t){return t.filter(n=>n.type===e.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(e.attrs)||{}:{[n.name]:e.attrs[n.name]}).reduce((n,r)=>Dn(n,r),{})}function tZ(e){return typeof e!="string"?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e==="true"?!0:e==="false"?!1:e}function PC(e,t){return"style"in e?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;const i=t.reduce((o,s)=>{const a=s.attribute.parseHTML?s.attribute.parseHTML(n):tZ(n.getAttribute(s.name));return a==null?o:{...o,[s.name]:a}},{});return{...r,...i}}}}function jC(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>t==="attrs"&&eZ(n)?!1:n!=null))}function zC(e){var t,n;const r={};return!((t=e==null?void 0:e.attribute)!=null&&t.isRequired)&&"default"in((e==null?void 0:e.attribute)||{})&&(r.default=e.attribute.default),((n=e==null?void 0:e.attribute)==null?void 0:n.validate)!==void 0&&(r.validate=e.attribute.validate),[e.name,r]}function nZ(e,t){var n;const r=i6(e),{nodeExtensions:i,markExtensions:o}=Vl(e),s=(n=i.find(d=>lt(d,"topNode")))==null?void 0:n.name,a=Object.fromEntries(i.map(d=>{const f=r.filter(C=>C.type===d.name),h={name:d.name,options:d.options,storage:d.storage,editor:t},m=e.reduce((C,_)=>{const E=lt(_,"extendNodeSchema",h);return{...C,...E?E(d):{}}},{}),g=jC({...m,content:Zt(lt(d,"content",h)),marks:Zt(lt(d,"marks",h)),group:Zt(lt(d,"group",h)),inline:Zt(lt(d,"inline",h)),atom:Zt(lt(d,"atom",h)),selectable:Zt(lt(d,"selectable",h)),draggable:Zt(lt(d,"draggable",h)),code:Zt(lt(d,"code",h)),whitespace:Zt(lt(d,"whitespace",h)),linebreakReplacement:Zt(lt(d,"linebreakReplacement",h)),defining:Zt(lt(d,"defining",h)),isolating:Zt(lt(d,"isolating",h)),attrs:Object.fromEntries(f.map(zC))}),x=Zt(lt(d,"parseHTML",h));x&&(g.parseDOM=x.map(C=>PC(C,f)));const b=lt(d,"renderHTML",h);b&&(g.toDOM=C=>b({node:C,HTMLAttributes:Hl(C,f)}));const v=lt(d,"renderText",h);return v&&(g.toText=v),[d.name,g]})),u=Object.fromEntries(o.map(d=>{const f=r.filter(v=>v.type===d.name),h={name:d.name,options:d.options,storage:d.storage,editor:t},m=e.reduce((v,C)=>{const _=lt(C,"extendMarkSchema",h);return{...v,..._?_(d):{}}},{}),g=jC({...m,inclusive:Zt(lt(d,"inclusive",h)),excludes:Zt(lt(d,"excludes",h)),group:Zt(lt(d,"group",h)),spanning:Zt(lt(d,"spanning",h)),code:Zt(lt(d,"code",h)),attrs:Object.fromEntries(f.map(zC))}),x=Zt(lt(d,"parseHTML",h));x&&(g.parseDOM=x.map(v=>PC(v,f)));const b=lt(d,"renderHTML",h);return b&&(g.toDOM=v=>b({mark:v,HTMLAttributes:Hl(v,f)})),[d.name,g]}));return new tx({topNode:s,nodes:a,marks:u})}function rZ(e){const t=e.filter((n,r)=>e.indexOf(n)!==r);return Array.from(new Set(t))}function pc(e){return e.sort((n,r)=>{const i=lt(n,"priority")||100,o=lt(r,"priority")||100;return i>o?-1:i<o?1:0})}function o6(e){const t=pc(Cx(e)),n=rZ(t.map(r=>r.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),t}function s6(e,t,n){const{from:r,to:i}=t,{blockSeparator:o=`
1222
+
1223
+ `,textSerializers:s={}}=n||{};let a="";return e.nodesBetween(r,i,(u,d,f,h)=>{var m;u.isBlock&&d>r&&(a+=o);const g=s==null?void 0:s[u.type.name];if(g)return f&&(a+=g({node:u,pos:d,parent:f,index:h,range:t})),!1;u.isText&&(a+=(m=u==null?void 0:u.text)==null?void 0:m.slice(Math.max(r,d)-d,i-d))}),a}function iZ(e,t){const n={from:0,to:e.content.size};return s6(e,n,t)}function a6(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}function oZ(e,t){const n=In(t,e.schema),{from:r,to:i}=e.selection,o=[];e.doc.nodesBetween(r,i,a=>{o.push(a)});const s=o.reverse().find(a=>a.type.name===n.name);return s?{...s.attrs}:{}}function l6(e,t){const n=Fp(typeof t=="string"?t:t.name,e.schema);return n==="node"?oZ(e,t):n==="mark"?t6(e,t):{}}function sZ(e,t=JSON.stringify){const n={};return e.filter(r=>{const i=t(r);return Object.prototype.hasOwnProperty.call(n,i)?!1:n[i]=!0})}function aZ(e){const t=sZ(e);return t.length===1?t:t.filter((n,r)=>!t.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 u6(e){const{mapping:t,steps:n}=e,r=[];return t.maps.forEach((i,o)=>{const s=[];if(i.ranges.length)i.forEach((a,u)=>{s.push({from:a,to:u})});else{const{from:a,to:u}=n[o];if(a===void 0||u===void 0)return;s.push({from:a,to:u})}s.forEach(({from:a,to:u})=>{const d=t.slice(o).map(a,-1),f=t.slice(o).map(u),h=t.invert().map(d,-1),m=t.invert().map(f);r.push({oldRange:{from:h,to:m},newRange:{from:d,to:f}})})}),aZ(r)}function Sx(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach(i=>{const o=n.resolve(e),s=wx(o,i.type);s&&r.push({mark:i,...s})}):n.nodesBetween(e,t,(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}var lZ=(e,t,n,r=20)=>{const i=e.doc.resolve(n);let o=r,s=null;for(;o>0&&s===null;){const a=i.node(o);(a==null?void 0:a.type.name)===t?s=a:o-=1}return[s,o]};function Bu(e,t){return t.nodes[e]||t.marks[e]||null}function Qf(e,t,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=e.find(o=>o.type===t&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}var uZ=(e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(i,o,s,a)=>{var u,d;const f=((d=(u=i.type.spec).toText)==null?void 0:d.call(u,{node:i,pos:o,parent:s,index:a}))||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?f:f.slice(0,Math.max(0,r-o))}),n};function H1(e,t,n={}){const{empty:r,ranges:i}=e.selection,o=t?$o(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(h=>o?o.name===h.type.name:!0).find(h=>Rh(h.attrs,n,{strict:!1}));let s=0;const a=[];if(i.forEach(({$from:h,$to:m})=>{const g=h.pos,x=m.pos;e.doc.nodesBetween(g,x,(b,v)=>{if(o&&b.inlineContent&&!b.type.allowsMarkType(o))return!1;if(!b.isText&&!b.marks.length)return;const C=Math.max(g,v),_=Math.min(x,v+b.nodeSize),E=_-C;s+=E,a.push(...b.marks.map(I=>({mark:I,from:C,to:_})))})}),s===0)return!1;const u=a.filter(h=>o?o.name===h.mark.type.name:!0).filter(h=>Rh(h.mark.attrs,n,{strict:!1})).reduce((h,m)=>h+m.to-m.from,0),d=a.filter(h=>o?h.mark.type!==o&&h.mark.type.excludes(o):!0).reduce((h,m)=>h+m.to-m.from,0);return(u>0?u+d:u)>=s}function cZ(e,t,n={}){if(!t)return Ls(e,null,n)||H1(e,null,n);const r=Fp(t,e.schema);return r==="node"?Ls(e,t,n):r==="mark"?H1(e,t,n):!1}var dZ=(e,t)=>{const{$from:n,$to:r,$anchor:i}=e.selection;if(t){const o=$p(a=>a.type.name===t)(e.selection);if(!o)return!1;const s=e.doc.resolve(o.pos+1);return i.pos+1===s.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},fZ=e=>{const{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)};function LC(e,t){return Array.isArray(t)?t.some(n=>(typeof n=="string"?n:n.name)===e.name):t}function FC(e,t){const{nodeExtensions:n}=Vl(t),r=n.find(s=>s.name===e);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=Zt(lt(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function Bp(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(e.type.name==="hardBreak")return!0;if(e.isText)return/^\s*$/m.test((r=e.text)!=null?r:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let i=!0;return e.content.forEach(o=>{i!==!1&&(Bp(o,{ignoreWhitespace:n,checkChildren:t})||(i=!1))}),i}return!1}function c6(e){return e instanceof ut}var d6=class f6{constructor(t){this.position=t}static fromJSON(t){return new f6(t.position)}toJSON(){return{position:this.position}}};function hZ(e,t){const n=t.mapping.mapResult(e.position);return{position:new d6(n.pos),mapResult:n}}function pZ(e){return new d6(e)}function mZ(e,t,n){var r;const{selection:i}=t;let o=null;if(YT(i)&&(o=i.$cursor),o){const a=(r=e.storedMarks)!=null?r:o.marks();return o.parent.type.allowsMarkType(n)&&(!!n.isInSet(a)||!a.some(d=>d.type.excludes(n)))}const{ranges:s}=i;return s.some(({$from:a,$to:u})=>{let d=a.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(a.pos,u.pos,(f,h,m)=>{if(d)return!1;if(f.isInline){const g=!m||m.type.allowsMarkType(n),x=!!n.isInSet(f.marks)||!f.marks.some(b=>b.type.excludes(n));d=g&&x}return!d}),d})}var gZ=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:s,ranges:a}=o,u=$o(e,r.schema);if(i)if(s){const d=t6(r,u);n.addStoredMark(u.create({...d,...t}))}else a.forEach(d=>{const f=d.$from.pos,h=d.$to.pos;r.doc.nodesBetween(f,h,(m,g)=>{const x=Math.max(g,f),b=Math.min(g+m.nodeSize,h);m.marks.find(C=>C.type===u)?m.marks.forEach(C=>{u===C.type&&n.addMark(x,b,u.create({...C.attrs,...t}))}):n.addMark(x,b,u.create(t))})});return mZ(r,n,u)},yZ=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),xZ=(e,t={})=>({state:n,dispatch:r,chain:i})=>{const o=In(e,n.schema);let s;return n.selection.$anchor.sameParent(n.selection.$head)&&(s=n.selection.$anchor.parent.attrs),o.isTextblock?i().command(({commands:a})=>X2(o,{...s,...t})(n)?!0:a.clearNodes()).command(({state:a})=>X2(o,{...s,...t})(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},bZ=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,i=ya(e,0,r.content.size),o=ut.create(r,i);t.setSelection(o)}return!0},vZ=(e,t)=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=r;let s,a;return typeof t=="number"?(s=t,a=t):t&&"from"in t&&"to"in t?(s=t.from,a=t.to):(s=o.from,a=o.to),i&&n.doc.nodesBetween(s,a,(u,d)=>{u.isText||n.setNodeMarkup(d,void 0,{...u.attrs,dir:e})}),!0},kZ=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,{from:i,to:o}=typeof e=="number"?{from:e,to:e}:e,s=yt.atStart(r).from,a=yt.atEnd(r).to,u=ya(i,s,a),d=ya(o,s,a),f=yt.create(r,u,d);t.setSelection(f)}return!0},wZ=e=>({state:t,dispatch:n})=>{const r=In(e,t.schema);return mH(r)(t,n)};function $C(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter(i=>t==null?void 0:t.includes(i.type.name));e.tr.ensureMarks(r)}}var CZ=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{const{selection:o,doc:s}=t,{$from:a,$to:u}=o,d=i.extensionManager.attributes,f=Qf(d,a.node().type.name,a.node().attrs);if(o instanceof ut&&o.node.isBlock)return!a.parentOffset||!Ro(s,a.pos)?!1:(r&&(e&&$C(n,i.extensionManager.splittableMarks),t.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const h=u.parentOffset===u.parent.content.size,m=a.depth===0?void 0:Yq(a.node(-1).contentMatchAt(a.indexAfter(-1)));let g=h&&m?[{type:m,attrs:f}]:void 0,x=Ro(t.doc,t.mapping.map(a.pos),1,g);if(!g&&!x&&Ro(t.doc,t.mapping.map(a.pos),1,m?[{type:m}]:void 0)&&(x=!0,g=m?[{type:m,attrs:f}]:void 0),r){if(x&&(o instanceof yt&&t.deleteSelection(),t.split(t.mapping.map(a.pos),1,g),m&&!h&&!a.parentOffset&&a.parent.type!==m)){const b=t.mapping.map(a.before()),v=t.doc.resolve(b);a.node(-1).canReplaceWith(v.index(),v.index()+1,m)&&t.setNodeMarkup(t.mapping.map(a.before()),m)}e&&$C(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return x},SZ=(e,t={})=>({tr:n,state:r,dispatch:i,editor:o})=>{var s;const a=In(e,r.schema),{$from:u,$to:d}=r.selection,f=r.selection.node;if(f&&f.isBlock||u.depth<2||!u.sameParent(d))return!1;const h=u.node(-1);if(h.type!==a)return!1;const m=o.extensionManager.attributes;if(u.parent.content.size===0&&u.node(-1).childCount===u.indexAfter(-1)){if(u.depth===2||u.node(-3).type!==a||u.index(-2)!==u.node(-2).childCount-1)return!1;if(i){let C=fe.empty;const _=u.index(-1)?1:u.index(-2)?2:3;for(let R=u.depth-_;R>=u.depth-3;R-=1)C=fe.from(u.node(R).copy(C));const E=u.indexAfter(-1)<u.node(-2).childCount?1:u.indexAfter(-2)<u.node(-3).childCount?2:3,I={...Qf(m,u.node().type.name,u.node().attrs),...t},N=((s=a.contentMatch.defaultType)==null?void 0:s.createAndFill(I))||void 0;C=C.append(fe.from(a.createAndFill(null,N)||void 0));const M=u.before(u.depth-(_-1));n.replace(M,u.after(-E),new We(C,4-_,0));let F=-1;n.doc.nodesBetween(M,n.doc.content.size,(R,D)=>{if(F>-1)return!1;R.isTextblock&&R.content.size===0&&(F=D+1)}),F>-1&&n.setSelection(yt.near(n.doc.resolve(F))),n.scrollIntoView()}return!0}const g=d.pos===u.end()?h.contentMatchAt(0).defaultType:null,x={...Qf(m,h.type.name,h.attrs),...t},b={...Qf(m,u.node().type.name,u.node().attrs),...t};n.delete(u.pos,d.pos);const v=g?[{type:a,attrs:x},{type:g,attrs:b}]:[{type:a,attrs:x}];if(!Ro(n.doc,u.pos,2))return!1;if(i){const{selection:C,storedMarks:_}=r,{splittableMarks:E}=o.extensionManager,I=_||C.$to.parentOffset&&C.$from.marks();if(n.split(u.pos,2,v).scrollIntoView(),!I||!i)return!0;const N=I.filter(M=>E.includes(M.type.name));n.ensureMarks(N)}return!0},Sg=(e,t)=>{const n=$p(s=>s.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=e.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&Hs(e.doc,n.pos)&&e.join(n.pos),!0},Eg=(e,t)=>{const n=$p(s=>s.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=e.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&Hs(e.doc,r)&&e.join(r),!0},EZ=(e,t,n,r={})=>({editor:i,tr:o,state:s,dispatch:a,chain:u,commands:d,can:f})=>{const{extensions:h,splittableMarks:m}=i.extensionManager,g=In(e,s.schema),x=In(t,s.schema),{selection:b,storedMarks:v}=s,{$from:C,$to:_}=b,E=C.blockRange(_),I=v||b.$to.parentOffset&&b.$from.marks();if(!E)return!1;const N=$p(M=>FC(M.type.name,h))(b);if(E.depth>=1&&N&&E.depth-N.depth<=1){if(N.node.type===g)return d.liftListItem(x);if(FC(N.node.type.name,h)&&g.validContent(N.node.content)&&a)return u().command(()=>(o.setNodeMarkup(N.pos,g),!0)).command(()=>Sg(o,g)).command(()=>Eg(o,g)).run()}return!n||!I||!a?u().command(()=>f().wrapInList(g,r)?!0:d.clearNodes()).wrapInList(g,r).command(()=>Sg(o,g)).command(()=>Eg(o,g)).run():u().command(()=>{const M=f().wrapInList(g,r),F=I.filter(R=>m.includes(R.type.name));return o.ensureMarks(F),M?!0:d.clearNodes()}).wrapInList(g,r).command(()=>Sg(o,g)).command(()=>Eg(o,g)).run()},_Z=(e,t={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,s=$o(e,r.schema);return H1(r,s,t)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,t)},TZ=(e,t,n={})=>({state:r,commands:i})=>{const o=In(e,r.schema),s=In(t,r.schema),a=Ls(r,o,n);let u;return r.selection.$anchor.sameParent(r.selection.$head)&&(u=r.selection.$anchor.parent.attrs),a?i.setNode(s,u):i.setNode(o,{...u,...n})},AZ=(e,t={})=>({state:n,commands:r})=>{const i=In(e,n.schema);return Ls(n,i,t)?r.lift(i):r.wrapIn(i,t)},MZ=()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let o;if(i.spec.isInputRules&&(o=i.getState(e))){if(t){const s=e.tr,a=o.transform;for(let u=a.steps.length-1;u>=0;u-=1)s.step(a.steps[u].invert(a.docs[u]));if(o.text){const u=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,e.schema.text(o.text,u))}else s.delete(o.from,o.to)}return!0}}return!1},NZ=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach(o=>{e.removeMark(o.$from.pos,o.$to.pos)}),!0},IZ=(e,t={})=>({tr:n,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:s=!1}=t,{selection:a}=n,u=$o(e,r.schema),{$from:d,empty:f,ranges:h}=a;if(!i)return!0;if(f&&s){let{from:m,to:g}=a;const x=(o=d.marks().find(v=>v.type===u))==null?void 0:o.attrs,b=wx(d,u,x);b&&(m=b.from,g=b.to),n.removeMark(m,g,u)}else h.forEach(m=>{n.removeMark(m.$from.pos,m.$to.pos,u)});return n.removeStoredMark(u),!0},DZ=e=>({tr:t,state:n,dispatch:r})=>{const{selection:i}=n;let o,s;return typeof e=="number"?(o=e,s=e):e&&"from"in e&&"to"in e?(o=e.from,s=e.to):(o=i.from,s=i.to),r&&t.doc.nodesBetween(o,s,(a,u)=>{if(a.isText)return;const d={...a.attrs};delete d.dir,t.setNodeMarkup(u,void 0,d)}),!0},OZ=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=Fp(typeof e=="string"?e:e.name,r.schema);if(!a)return!1;a==="node"&&(o=In(e,r.schema)),a==="mark"&&(s=$o(e,r.schema));let u=!1;return n.selection.ranges.forEach(d=>{const f=d.$from.pos,h=d.$to.pos;let m,g,x,b;n.selection.empty?r.doc.nodesBetween(f,h,(v,C)=>{o&&o===v.type&&(u=!0,x=Math.max(C,f),b=Math.min(C+v.nodeSize,h),m=C,g=v)}):r.doc.nodesBetween(f,h,(v,C)=>{C<f&&o&&o===v.type&&(u=!0,x=Math.max(C,f),b=Math.min(C+v.nodeSize,h),m=C,g=v),C>=f&&C<=h&&(o&&o===v.type&&(u=!0,i&&n.setNodeMarkup(C,void 0,{...v.attrs,...t})),s&&v.marks.length&&v.marks.forEach(_=>{if(s===_.type&&(u=!0,i)){const E=Math.max(C,f),I=Math.min(C+v.nodeSize,h);n.addMark(E,I,s.create({..._.attrs,...t}))}}))}),g&&(m!==void 0&&i&&n.setNodeMarkup(m,void 0,{...g.attrs,...t}),s&&g.marks.length&&g.marks.forEach(v=>{s===v.type&&i&&n.addMark(x,b,s.create({...v.attrs,...t}))}))}),u},RZ=(e,t={})=>({state:n,dispatch:r})=>{const i=In(e,n.schema);return lH(i,t)(n,r)},PZ=(e,t={})=>({state:n,dispatch:r})=>{const i=In(e,n.schema);return uH(i,t)(n,r)},jZ=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){const n=this.callbacks[e];return n&&n.forEach(r=>r.apply(this,t)),this}off(e,t){const n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(r=>r!==t):delete this.callbacks[e]),this}once(e,t){const n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}},ad=class{constructor(e){var t;this.find=e.find,this.handler=e.handler,this.undoable=(t=e.undoable)!=null?t:!0}},zZ=(e,t)=>{if(kx(t))return t.exec(e);const n=t(e);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function Pf(e){var t;const{editor:n,from:r,to:i,text:o,rules:s,plugin:a}=e,{view:u}=n;if(u.composing)return!1;const d=u.state.doc.resolve(r);if(d.parent.type.spec.code||(t=d.nodeBefore||d.nodeAfter)!=null&&t.marks.find(m=>m.type.spec.code))return!1;let f=!1;const h=uZ(d)+o;return s.forEach(m=>{if(f)return;const g=zZ(h,m.find);if(!g)return;const x=u.state.tr,b=zp({state:u.state,transaction:x}),v={from:r-(g[0].length-o.length),to:i},{commands:C,chain:_,can:E}=new Lp({editor:n,state:b});m.handler({state:b,range:v,match:g,commands:C,chain:_,can:E})===null||!x.steps.length||(m.undoable&&x.setMeta(a,{transform:x,from:r,to:i,text:o}),u.dispatch(x),f=!0)}),f}function LZ(e){const{editor:t,rules:n}=e,r=new mn({state:{init(){return null},apply(i,o,s){const a=i.getMeta(r);if(a)return a;const u=i.getMeta("applyInputRules");return!!u&&setTimeout(()=>{let{text:f}=u;typeof f=="string"?f=f:f=sd(fe.from(f),s.schema);const{from:h}=u,m=h+f.length;Pf({editor:t,from:h,to:m,text:f,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:o}},props:{handleTextInput(i,o,s,a){return Pf({editor:t,from:o,to:s,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&Pf({editor:t,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?Pf({editor:t,from:s.pos,to:s.pos,text:`
1224
+ `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function FZ(e){return Object.prototype.toString.call(e).slice(8,-1)}function jf(e){return FZ(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function h6(e,t){const n={...e};return jf(e)&&jf(t)&&Object.keys(t).forEach(r=>{jf(t[r])&&jf(e[r])?n[r]=h6(e[r],t[r]):n[r]=t[r]}),n}var Ex=class{constructor(e={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...Zt(lt(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...Zt(lt(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(e={}){const t=this.extend({...this.config,addOptions:()=>h6(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name="name"in e?e.name:t.parent.name,t}},ti=class p6 extends Ex{constructor(){super(...arguments),this.type="mark"}static create(t={}){const n=typeof t=="function"?t():t;return new p6(n)}static handleExit({editor:t,mark:n}){const{tr:r}=t.state,i=t.state.selection.$from;if(i.pos===i.end()){const s=i.marks();if(!!!s.find(d=>(d==null?void 0:d.type.name)===n.name))return!1;const u=s.find(d=>(d==null?void 0:d.type.name)===n.name);return u&&r.removeStoredMark(u),r.insertText(" ",i.pos),t.view.dispatch(r),!0}return!1}configure(t){return super.configure(t)}extend(t){const n=typeof t=="function"?t():t;return super.extend(n)}};function $Z(e){return typeof e=="number"}var BZ=class{constructor(e){this.find=e.find,this.handler=e.handler}},UZ=(e,t,n)=>{if(kx(t))return[...e.matchAll(t)];const r=t(e,n);return r?r.map(i=>{const o=[i.text];return o.index=i.index,o.input=e,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 VZ(e){const{editor:t,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:a}=e,{commands:u,chain:d,can:f}=new Lp({editor:t,state:n}),h=[];return n.doc.nodesBetween(r,i,(g,x)=>{var b,v,C,_,E;if((v=(b=g.type)==null?void 0:b.spec)!=null&&v.code||!(g.isText||g.isTextblock||g.isInline))return;const I=(E=(_=(C=g.content)==null?void 0:C.size)!=null?_:g.nodeSize)!=null?E:0,N=Math.max(r,x),M=Math.min(i,x+I);if(N>=M)return;const F=g.isText?g.text||"":g.textBetween(N-x,M-x,void 0,"");UZ(F,o.find,s).forEach(D=>{if(D.index===void 0)return;const L=N+D.index+1,X=L+D[0].length,ee={from:n.tr.mapping.map(L),to:n.tr.mapping.map(X)},Ie=o.handler({state:n,range:ee,match:D,commands:u,chain:d,can:f,pasteEvent:s,dropEvent:a});h.push(Ie)})}),h.every(g=>g!==null)}var zf=null,HZ=e=>{var t;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(t=n.clipboardData)==null||t.setData("text/html",e),n};function WZ(e){const{editor:t,rules:n}=e;let r=null,i=!1,o=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a;try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}const u=({state:f,from:h,to:m,rule:g,pasteEvt:x})=>{const b=f.tr,v=zp({state:f,transaction:b});if(!(!VZ({editor:t,state:v,from:Math.max(h-1,0),to:m.b-1,rule:g,pasteEvent:x,dropEvent:a})||!b.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}return s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,b}};return n.map(f=>new mn({view(h){const m=x=>{var b;r=(b=h.dom.parentElement)!=null&&b.contains(x.target)?h.dom.parentElement:null,r&&(zf=t)},g=()=>{zf&&(zf=null)};return window.addEventListener("dragstart",m),window.addEventListener("dragend",g),{destroy(){window.removeEventListener("dragstart",m),window.removeEventListener("dragend",g)}}},props:{handleDOMEvents:{drop:(h,m)=>{if(o=r===h.dom.parentElement,a=m,!o){const g=zf;g!=null&&g.isEditable&&setTimeout(()=>{const x=g.state.selection;x&&g.commands.deleteRange({from:x.from,to:x.to})},10)}return!1},paste:(h,m)=>{var g;const x=(g=m.clipboardData)==null?void 0:g.getData("text/html");return s=m,i=!!(x!=null&&x.includes("data-pm-slice")),!1}}},appendTransaction:(h,m,g)=>{const x=h[0],b=x.getMeta("uiEvent")==="paste"&&!i,v=x.getMeta("uiEvent")==="drop"&&!o,C=x.getMeta("applyPasteRules"),_=!!C;if(!b&&!v&&!_)return;if(_){let{text:N}=C;typeof N=="string"?N=N:N=sd(fe.from(N),g.schema);const{from:M}=C,F=M+N.length,R=HZ(N);return u({rule:f,state:g,from:M,to:{b:F},pasteEvt:R})}const E=m.doc.content.findDiffStart(g.doc.content),I=m.doc.content.findDiffEnd(g.doc.content);if(!(!$Z(E)||!I||E===I.b))return u({rule:f,state:g,from:E,to:I,pasteEvt:s})}}))}var Up=class{constructor(e,t){this.splittableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=o6(e),this.schema=nZ(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{const n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:Bu(t.name,this.schema)},r=lt(t,"addCommands",n);return r?{...e,...r()}:e},{})}get plugins(){const{editor:e}=this;return pc([...this.extensions].reverse()).flatMap(r=>{const i={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:e,type:Bu(r.name,this.schema)},o=[],s=lt(r,"addKeyboardShortcuts",i);let a={};if(r.type==="mark"&&lt(r,"exitable",i)&&(a.ArrowRight=()=>ti.handleExit({editor:e,mark:r})),s){const m=Object.fromEntries(Object.entries(s()).map(([g,x])=>[g,()=>x({editor:e})]));a={...a,...m}}const u=oq(a);o.push(u);const d=lt(r,"addInputRules",i);if(LC(r,e.options.enableInputRules)&&d){const m=d();if(m&&m.length){const g=LZ({editor:e,rules:m}),x=Array.isArray(g)?g:[g];o.push(...x)}}const f=lt(r,"addPasteRules",i);if(LC(r,e.options.enablePasteRules)&&f){const m=f();if(m&&m.length){const g=WZ({editor:e,rules:m});o.push(...g)}}const h=lt(r,"addProseMirrorPlugins",i);if(h){const m=h();o.push(...m)}return o})}get attributes(){return i6(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=Vl(this.extensions);return Object.fromEntries(t.filter(n=>!!lt(n,"addNodeView")).map(n=>{const r=this.attributes.filter(u=>u.type===n.name),i={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:e,type:In(n.name,this.schema)},o=lt(n,"addNodeView",i);if(!o)return[];const s=o();if(!s)return[];const a=(u,d,f,h,m)=>{const g=Hl(u,r);return s({node:u,view:d,getPos:f,decorations:h,innerDecorations:m,editor:e,extension:n,HTMLAttributes:g})};return[n.name,a]}))}dispatchTransaction(e){const{editor:t}=this;return pc([...this.extensions].reverse()).reduceRight((r,i)=>{const o={name:i.name,options:i.options,storage:this.editor.extensionStorage[i.name],editor:t,type:Bu(i.name,this.schema)},s=lt(i,"dispatchTransaction",o);return s?a=>{s.call(o,{transaction:a,next:r})}:r},e)}transformPastedHTML(e){const{editor:t}=this;return pc([...this.extensions]).reduce((r,i)=>{const o={name:i.name,options:i.options,storage:this.editor.extensionStorage[i.name],editor:t,type:Bu(i.name,this.schema)},s=lt(i,"transformPastedHTML",o);return s?(a,u)=>{const d=r(a,u);return s.call(o,d)}:r},e||(r=>r))}get markViews(){const{editor:e}=this,{markExtensions:t}=Vl(this.extensions);return Object.fromEntries(t.filter(n=>!!lt(n,"addMarkView")).map(n=>{const r=this.attributes.filter(a=>a.type===n.name),i={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:e,type:$o(n.name,this.schema)},o=lt(n,"addMarkView",i);if(!o)return[];const s=(a,u,d)=>{const f=Hl(a,r);return o()({mark:a,view:u,inline:d,editor:e,extension:n,HTMLAttributes:f,updateAttributes:h=>{iJ(a,e,h)}})};return[n.name,s]}))}setupExtensions(){const e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(t=>[t.name,t.storage])),e.forEach(t=>{var n;const r={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:Bu(t.name,this.schema)};t.type==="mark"&&((n=Zt(lt(t,"keepOnSplit",r)))==null||n)&&this.splittableMarks.push(t.name);const i=lt(t,"onBeforeCreate",r),o=lt(t,"onCreate",r),s=lt(t,"onUpdate",r),a=lt(t,"onSelectionUpdate",r),u=lt(t,"onTransaction",r),d=lt(t,"onFocus",r),f=lt(t,"onBlur",r),h=lt(t,"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),u&&this.editor.on("transaction",u),d&&this.editor.on("focus",d),f&&this.editor.on("blur",f),h&&this.editor.on("destroy",h)})}};Up.resolve=o6;Up.sort=pc;Up.flatten=Cx;var m6={};vx(m6,{ClipboardTextSerializer:()=>y6,Commands:()=>x6,Delete:()=>b6,Drop:()=>v6,Editable:()=>k6,FocusEvents:()=>C6,Keymap:()=>S6,Paste:()=>E6,Tabindex:()=>_6,TextDirection:()=>T6,focusEventsPluginKey:()=>w6});var dn=class g6 extends Ex{constructor(){super(...arguments),this.type="extension"}static create(t={}){const n=typeof t=="function"?t():t;return new g6(n)}configure(t){return super.configure(t)}extend(t){const n=typeof t=="function"?t():t;return super.extend(n)}},y6=dn.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new mn({key:new Rn("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:o}=i,s=Math.min(...o.map(f=>f.$from.pos)),a=Math.max(...o.map(f=>f.$to.pos)),u=a6(n);return s6(r,{from:s,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:u})}}})]}}),x6=dn.create({name:"commands",addCommands(){return{...KT}}}),b6=dn.create({name:"delete",onUpdate({transaction:e,appendedTransactions:t}){var n,r,i;const o=()=>{var s,a,u,d;if((d=(u=(a=(s=this.editor.options.coreExtensionOptions)==null?void 0:s.delete)==null?void 0:a.filterTransaction)==null?void 0:u.call(a,e))!=null?d:e.getMeta("y-sync$"))return;const f=n6(e.before,[e,...t]);u6(f).forEach(g=>{f.mapping.mapResult(g.oldRange.from).deletedAfter&&f.mapping.mapResult(g.oldRange.to).deletedBefore&&f.before.nodesBetween(g.oldRange.from,g.oldRange.to,(x,b)=>{const v=b+x.nodeSize-2,C=g.oldRange.from<=b&&v<=g.oldRange.to;this.editor.emit("delete",{type:"node",node:x,from:b,to:v,newFrom:f.mapping.map(b),newTo:f.mapping.map(v),deletedRange:g.oldRange,newRange:g.newRange,partial:!C,editor:this.editor,transaction:e,combinedTransform:f})})});const m=f.mapping;f.steps.forEach((g,x)=>{var b,v;if(g instanceof zi){const C=m.slice(x).map(g.from,-1),_=m.slice(x).map(g.to),E=m.invert().map(C,-1),I=m.invert().map(_),N=(b=f.doc.nodeAt(C-1))==null?void 0:b.marks.some(F=>F.eq(g.mark)),M=(v=f.doc.nodeAt(_))==null?void 0:v.marks.some(F=>F.eq(g.mark));this.editor.emit("delete",{type:"mark",mark:g.mark,from:g.from,to:g.to,deletedRange:{from:E,to:I},newRange:{from:C,to:_},partial:!!(M||N),editor:this.editor,transaction:e,combinedTransform:f})}})};(i=(r=(n=this.editor.options.coreExtensionOptions)==null?void 0:n.delete)==null?void 0:r.async)==null||i?setTimeout(o,0):o()}}),v6=dn.create({name:"drop",addProseMirrorPlugins(){return[new mn({key:new Rn("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),k6=dn.create({name:"editable",addProseMirrorPlugins(){return[new mn({key:new Rn("editable"),props:{editable:()=>this.editor.options.editable}})]}}),w6=new Rn("focusEvents"),C6=dn.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new mn({key:w6,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),S6=dn.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:a})=>{const{selection:u,doc:d}=a,{empty:f,$anchor:h}=u,{pos:m,parent:g}=h,x=h.parent.isTextblock&&m>0?a.doc.resolve(m-1):h,b=x.parent.type.spec.isolating,v=h.pos-h.parentOffset,C=b&&x.parent.childCount===1?v===h.pos:At.atStart(d).from===m;return!f||!g.type.isTextblock||g.textContent.length||!C||C&&h.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),t=()=>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:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Bc()||e6()?o:i},addProseMirrorPlugins(){return[new mn({key:new Rn("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some(b=>b.getMeta("composition")))return;const r=e.some(b=>b.docChanged)&&!t.doc.eq(n.doc),i=e.some(b=>b.getMeta("preventClearDocument"));if(!r||i)return;const{empty:o,from:s,to:a}=t.selection,u=At.atStart(t.doc).from,d=At.atEnd(t.doc).to;if(o||!(s===u&&a===d)||!Bp(n.doc))return;const m=n.tr,g=zp({state:n,transaction:m}),{commands:x}=new Lp({editor:this.editor,state:g});if(x.clearNodes(),!!m.steps.length)return m}})]}}),E6=dn.create({name:"paste",addProseMirrorPlugins(){return[new mn({key:new Rn("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),_6=dn.create({name:"tabindex",addProseMirrorPlugins(){return[new mn({key:new Rn("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),T6=dn.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:e}=Vl(this.extensions);return[{types:e.filter(t=>t.name!=="text").map(t=>t.name),attributes:{dir:{default:this.options.direction,parseHTML:t=>{const n=t.getAttribute("dir");return n&&(n==="ltr"||n==="rtl"||n==="auto")?n:this.options.direction},renderHTML:t=>t.dir?{dir:t.dir}:{}}}}]},addProseMirrorPlugins(){return[new mn({key:new Rn("textDirection"),props:{attributes:()=>{const e=this.options.direction;return e?{dir:e}:{}}}})]}}),qZ=class ec{constructor(t,n,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=t,this.editor=n,this.currentNode=i}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var t;return(t=this.actualDepth)!=null?t:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(t){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},t)}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 t=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(t);return new ec(n,this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new ec(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new ec(t,this.editor)}get children(){const t=[];return this.node.content.forEach((n,r)=>{const i=n.isBlock&&!n.isTextblock,o=n.isAtom&&!n.isText,s=n.isInline,a=this.pos+r+(o?0:1);if(a<0||a>this.resolvedPos.doc.nodeSize-2)return;const u=this.resolvedPos.doc.resolve(a);if(!i&&!s&&u.depth<=this.depth)return;const d=new ec(u,this.editor,i,i||s?n:null);i&&(d.actualDepth=this.depth+1),t.push(d)}),t}get firstChild(){return this.children[0]||null}get lastChild(){const t=this.children;return t[t.length-1]||null}closest(t,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===t)if(Object.keys(n).length>0){const o=i.node.attrs,s=Object.keys(n);for(let a=0;a<s.length;a+=1){const u=s[a];if(o[u]!==n[u])break}}else r=i;i=i.parent}return r}querySelector(t,n={}){return this.querySelectorAll(t,n,!0)[0]||null}querySelectorAll(t,n={},r=!1){let i=[];if(!this.children||this.children.length===0)return i;const o=Object.keys(n);return this.children.forEach(s=>{r&&i.length>0||(s.node.type.name===t&&o.every(u=>n[u]===s.node.attrs[u])&&i.push(s),!(r&&i.length>0)&&(i=i.concat(s.querySelectorAll(t,n,r))))}),i}setAttribute(t){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...t}),this.editor.view.dispatch(n)}},ZZ=`.ProseMirror {
1225
+ position: relative;
1226
+ }
1227
+
1228
+ .ProseMirror {
1229
+ word-wrap: break-word;
1230
+ white-space: pre-wrap;
1231
+ white-space: break-spaces;
1232
+ -webkit-font-variant-ligatures: none;
1233
+ font-variant-ligatures: none;
1234
+ font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
1235
+ }
1236
+
1237
+ .ProseMirror [contenteditable="false"] {
1238
+ white-space: normal;
1239
+ }
1240
+
1241
+ .ProseMirror [contenteditable="false"] [contenteditable="true"] {
1242
+ white-space: pre-wrap;
1243
+ }
1244
+
1245
+ .ProseMirror pre {
1246
+ white-space: pre-wrap;
1247
+ }
1248
+
1249
+ img.ProseMirror-separator {
1250
+ display: inline !important;
1251
+ border: none !important;
1252
+ margin: 0 !important;
1253
+ width: 0 !important;
1254
+ height: 0 !important;
1255
+ }
1256
+
1257
+ .ProseMirror-gapcursor {
1258
+ display: none;
1259
+ pointer-events: none;
1260
+ position: absolute;
1261
+ margin: 0;
1262
+ }
1263
+
1264
+ .ProseMirror-gapcursor:after {
1265
+ content: "";
1266
+ display: block;
1267
+ position: absolute;
1268
+ top: -2px;
1269
+ width: 20px;
1270
+ border-top: 1px solid black;
1271
+ animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
1272
+ }
1273
+
1274
+ @keyframes ProseMirror-cursor-blink {
1275
+ to {
1276
+ visibility: hidden;
1277
+ }
1278
+ }
1279
+
1280
+ .ProseMirror-hideselection *::selection {
1281
+ background: transparent;
1282
+ }
1283
+
1284
+ .ProseMirror-hideselection *::-moz-selection {
1285
+ background: transparent;
1286
+ }
1287
+
1288
+ .ProseMirror-hideselection * {
1289
+ caret-color: transparent;
1290
+ }
1291
+
1292
+ .ProseMirror-focused .ProseMirror-gapcursor {
1293
+ display: block;
1294
+ }`;function JZ(e,t,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const i=document.createElement("style");return t&&i.setAttribute("nonce",t),i.setAttribute("data-tiptap-style",""),i.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(i),i}var KZ=class extends jZ{constructor(e={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:r})=>{throw r},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:hZ,createMappablePosition:pZ},this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:r,slice:i,moved:o})=>this.options.onDrop(r,i,o)),this.on("paste",({event:r,slice:i})=>this.options.onPaste(r,i)),this.on("delete",this.options.onDelete);const t=this.createDoc(),n=QT(t,this.options.autofocus);this.editorState=_l.create({doc:t,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(e){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(e),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const e=this.editorView.dom;e!=null&&e.editor&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn("Failed to remove CSS element:",e)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=JZ(ZZ,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if(t==="state")return this.editorState;if(t in e)return Reflect.get(e,t);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){const n=r6(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;const t=this.state.plugins;let n=t;if([].concat(e).forEach(i=>{const o=typeof i=="string"?`${i}$`:i.key;n=n.filter(s=>!s.key.startsWith(o))}),t.length===n.length)return;const r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var e,t;const r=[...this.options.enableCoreExtensions?[k6,y6.configure({blockSeparator:(t=(e=this.options.coreExtensionOptions)==null?void 0:e.clipboardTextSerializer)==null?void 0:t.blockSeparator}),x6,C6,S6,_6,v6,E6,b6,T6.configure({direction:this.options.textDirection})].filter(i=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[i.name]!==!1:!0):[],...this.options.extensions].filter(i=>["extension","node","mark"].includes(i==null?void 0:i.type));this.extensionManager=new Up(r,this)}createCommandManager(){this.commandManager=new Lp({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=V1(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(t.message))throw t;this.emit("contentError",{editor:this,error:t,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(n=>n.name!=="collaboration"),this.createExtensionManager()}}),e=V1(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return e}createView(e){const{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),i=n?this.extensionManager.dispatchTransaction(r):r,o=t.transformPastedHTML,s=this.extensionManager.transformPastedHTML(o);this.editorView=new ZT(e,{...t,attributes:{role:"textbox",...t==null?void 0:t.attributes},dispatchTransaction:i,transformPastedHTML:s,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const a=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(a),this.prependClass(),this.injectCSS();const u=this.view.dom;u.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(d=>{var f;return(f=this.capturedTransaction)==null?void 0:f.step(d)});return}const{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),i=n.includes(e),o=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:e,nextState:t}),!i)return;this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const s=n.findLast(d=>d.getMeta("focus")||d.getMeta("blur")),a=s==null?void 0:s.getMeta("focus"),u=s==null?void 0:s.getMeta("blur");a&&this.emit("focus",{editor:this,event:a.event,transaction:s}),u&&this.emit("blur",{editor:this,event:u.event,transaction:s}),!(e.getMeta("preventUpdate")||!n.some(d=>d.docChanged)||o.doc.eq(t.doc))&&this.emit("update",{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return l6(this.state,e)}isActive(e,t){const n=typeof e=="string"?e:null,r=typeof e=="string"?t:e;return cZ(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return sd(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t=`
1295
+
1296
+ `,textSerializers:n={}}=e||{};return iZ(this.state.doc,{blockSeparator:t,textSerializers:{...a6(this.schema),...n}})}get isEmpty(){return Bp(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var e,t;return(t=(e=this.editorView)==null?void 0:e.isDestroyed)!=null?t:!0}$node(e,t){var n;return((n=this.$doc)==null?void 0:n.querySelector(e,t))||null}$nodes(e,t){var n;return((n=this.$doc)==null?void 0:n.querySelectorAll(e,t))||null}$pos(e){const t=this.state.doc.resolve(e);return new qZ(t,this)}get $doc(){return this.$pos(0)}};function Wl(e){return new ad({find:e.find,handler:({state:t,range:n,match:r})=>{const i=Zt(e.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=t,s=r[r.length-1],a=r[0];if(s){const u=a.search(/\S/),d=n.from+a.indexOf(s),f=d+s.length;if(Sx(n.from,n.to,t.doc).filter(g=>g.mark.type.excluded.find(b=>b===e.type&&b!==g.mark.type)).filter(g=>g.to>d).length)return null;f<n.to&&o.delete(f,n.to),d>n.from&&o.delete(n.from+u,d);const m=n.from+u+s.length;o.addMark(n.from+u,m,e.type.create(i||{})),o.removeStoredMark(e.type)}},undoable:e.undoable})}function GZ(e){return new ad({find:e.find,handler:({state:t,range:n,match:r})=>{const i=Zt(e.getAttributes,void 0,r)||{},{tr:o}=t,s=n.from;let a=n.to;const u=e.type.create(i);if(r[1]){const d=r[0].lastIndexOf(r[1]);let f=s+d;f>a?f=a:a=f+r[1].length;const h=r[0][r[0].length-1];o.insertText(h,s+r[0].length-1),o.replaceWith(f,a,u)}else if(r[0]){const d=e.type.isInline?s:s-1;o.insert(d,e.type.create(i)).delete(o.mapping.map(s),o.mapping.map(a))}o.scrollIntoView()},undoable:e.undoable})}function Ph(e){return new ad({find:e.find,handler:({state:t,range:n,match:r})=>{const i=t.doc.resolve(n.from),o=Zt(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,o)},undoable:e.undoable})}function Sn(e){return new ad({find:e.find,handler:({state:t,range:n,match:r})=>{let i=e.replace,o=n.from;const s=n.to;if(r[1]){const a=r[0].lastIndexOf(r[1]);i+=r[0].slice(a+r[1].length),o+=a;const u=o-s;u>0&&(i=r[0].slice(a-u,a)+i,o=s)}t.tr.insertText(i,o,s)},undoable:e.undoable})}function ql(e){return new ad({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{const o=Zt(e.getAttributes,void 0,r)||{},s=t.tr.delete(n.from,n.to),u=s.doc.resolve(n.from).blockRange(),d=u&&ix(u,e.type,o);if(!d)return null;if(s.wrap(u,d),e.keepMarks&&e.editor){const{selection:h,storedMarks:m}=t,{splittableMarks:g}=e.editor.extensionManager,x=m||h.$to.parentOffset&&h.$from.marks();if(x){const b=x.filter(v=>g.includes(v.type.name));s.ensureMarks(b)}}if(e.keepAttributes){const h=e.type.name==="bulletList"||e.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(h,o).run()}const f=s.doc.resolve(n.from-1).nodeBefore;f&&f.type===e.type&&Hs(s.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,f))&&s.join(n.from-1)},undoable:e.undoable})}function YZ(e,t){const{selection:n}=e,{$from:r}=n;if(n instanceof ut){const o=r.index();return r.parent.canReplaceWith(o,o+1,t)}let i=r.depth;for(;i>=0;){const o=r.index(i);if(r.node(i).contentMatchAt(o).matchType(t))return!0;i-=1}return!1}var QZ={};vx(QZ,{createAtomBlockMarkdownSpec:()=>XZ,createBlockMarkdownSpec:()=>eJ,createInlineMarkdownSpec:()=>rJ,parseAttributes:()=>_x,parseIndentedBlocks:()=>W1,renderNestedMarkdownContent:()=>Ax,serializeAttributes:()=>Tx});function _x(e){if(!(e!=null&&e.trim()))return{};const t={},n=[],r=e.replace(/["']([^"']*)["']/g,d=>(n.push(d),`__QUOTED_${n.length-1}__`)),i=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(i){const d=i.map(f=>f.trim().slice(1));t.class=d.join(" ")}const o=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);o&&(t.id=o[1]);const s=/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;Array.from(r.matchAll(s)).forEach(([,d,f])=>{var h;const m=parseInt(((h=f.match(/__QUOTED_(\d+)__/))==null?void 0:h[1])||"0",10),g=n[m];g&&(t[d]=g.slice(1,-1))});const u=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return u&&u.split(/\s+/).filter(Boolean).forEach(f=>{f.match(/^[a-zA-Z][\w-]*$/)&&(t[f]=!0)}),t}function Tx(e){if(!e||Object.keys(e).length===0)return"";const t=[];return e.class&&String(e.class).split(/\s+/).filter(Boolean).forEach(r=>t.push(`.${r}`)),e.id&&t.push(`#${e.id}`),Object.entries(e).forEach(([n,r])=>{n==="class"||n==="id"||(r===!0?t.push(n):r!==!1&&r!=null&&t.push(`${n}="${String(r)}"`))}),t.join(" ")}function XZ(e){const{nodeName:t,name:n,parseAttributes:r=_x,serializeAttributes:i=Tx,defaultAttributes:o={},requiredAttributes:s=[],allowedAttributes:a}=e,u=n||t,d=f=>{if(!a)return f;const h={};return a.forEach(m=>{m in f&&(h[m]=f[m])}),h};return{parseMarkdown:(f,h)=>{const m={...o,...f.attributes};return h.createNode(t,m,[])},markdownTokenizer:{name:t,level:"block",start(f){var h;const m=new RegExp(`^:::${u}(?:\\s|$)`,"m"),g=(h=f.match(m))==null?void 0:h.index;return g!==void 0?g:-1},tokenize(f,h,m){const g=new RegExp(`^:::${u}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),x=f.match(g);if(!x)return;const b=x[1]||"",v=r(b);if(!s.find(_=>!(_ in v)))return{type:t,raw:x[0],attributes:v}}},renderMarkdown:f=>{const h=d(f.attrs||{}),m=i(h),g=m?` {${m}}`:"";return`:::${u}${g} :::`}}}function eJ(e){const{nodeName:t,name:n,getContent:r,parseAttributes:i=_x,serializeAttributes:o=Tx,defaultAttributes:s={},content:a="block",allowedAttributes:u}=e,d=n||t,f=h=>{if(!u)return h;const m={};return u.forEach(g=>{g in h&&(m[g]=h[g])}),m};return{parseMarkdown:(h,m)=>{let g;if(r){const b=r(h);g=typeof b=="string"?[{type:"text",text:b}]:b}else a==="block"?g=m.parseChildren(h.tokens||[]):g=m.parseInline(h.tokens||[]);const x={...s,...h.attributes};return m.createNode(t,x,g)},markdownTokenizer:{name:t,level:"block",start(h){var m;const g=new RegExp(`^:::${d}`,"m"),x=(m=h.match(g))==null?void 0:m.index;return x!==void 0?x:-1},tokenize(h,m,g){var x;const b=new RegExp(`^:::${d}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),v=h.match(b);if(!v)return;const[C,_=""]=v,E=i(_);let I=1;const N=C.length;let M="";const F=/^:::([\w-]*)(\s.*)?/gm,R=h.slice(N);for(F.lastIndex=0;;){const D=F.exec(R);if(D===null)break;const L=D.index,X=D[1];if(!((x=D[2])!=null&&x.endsWith(":::"))){if(X)I+=1;else if(I-=1,I===0){const ee=R.slice(0,L);M=ee.trim();const Ie=h.slice(0,N+L+D[0].length);let he=[];if(M)if(a==="block")for(he=g.blockTokens(ee),he.forEach(Z=>{Z.text&&(!Z.tokens||Z.tokens.length===0)&&(Z.tokens=g.inlineTokens(Z.text))});he.length>0;){const Z=he[he.length-1];if(Z.type==="paragraph"&&(!Z.text||Z.text.trim()===""))he.pop();else break}else he=g.inlineTokens(M);return{type:t,raw:Ie,attributes:E,content:M,tokens:he}}}}}},renderMarkdown:(h,m)=>{const g=f(h.attrs||{}),x=o(g),b=x?` {${x}}`:"",v=m.renderChildren(h.content||[],`
1297
+
1298
+ `);return`:::${d}${b}
1299
+
1300
+ ${v}
1301
+
1302
+ :::`}}}function tJ(e){if(!e.trim())return{};const t={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(e);for(;r!==null;){const[,i,o,s]=r;t[i]=o||s,r=n.exec(e)}return t}function nJ(e){return Object.entries(e).filter(([,t])=>t!=null).map(([t,n])=>`${t}="${n}"`).join(" ")}function rJ(e){const{nodeName:t,name:n,getContent:r,parseAttributes:i=tJ,serializeAttributes:o=nJ,defaultAttributes:s={},selfClosing:a=!1,allowedAttributes:u}=e,d=n||t,f=m=>{if(!u)return m;const g={};return u.forEach(x=>{const b=typeof x=="string"?x:x.name,v=typeof x=="string"?void 0:x.skipIfDefault;if(b in m){const C=m[b];if(v!==void 0&&C===v)return;g[b]=C}}),g},h=d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(m,g)=>{const x={...s,...m.attributes};if(a)return g.createNode(t,x);const b=r?r(m):m.content||"";return b?g.createNode(t,x,[g.createTextNode(b)]):g.createNode(t,x,[])},markdownTokenizer:{name:t,level:"inline",start(m){const g=a?new RegExp(`\\[${h}\\s*[^\\]]*\\]`):new RegExp(`\\[${h}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${h}\\]`),x=m.match(g),b=x==null?void 0:x.index;return b!==void 0?b:-1},tokenize(m,g,x){const b=a?new RegExp(`^\\[${h}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${h}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${h}\\]`),v=m.match(b);if(!v)return;let C="",_="";if(a){const[,I]=v;_=I}else{const[,I,N]=v;_=I,C=N||""}const E=i(_.trim());return{type:t,raw:v[0],content:C.trim(),attributes:E}}},renderMarkdown:m=>{let g="";r?g=r(m):m.content&&m.content.length>0&&(g=m.content.filter(C=>C.type==="text").map(C=>C.text).join(""));const x=f(m.attrs||{}),b=o(x),v=b?` ${b}`:"";return a?`[${d}${v}]`:`[${d}${v}]${g}[/${d}]`}}}function W1(e,t,n){var r,i,o,s;const a=e.split(`
1303
+ `),u=[];let d="",f=0;const h=t.baseIndentSize||2;for(;f<a.length;){const m=a[f],g=m.match(t.itemPattern);if(!g){if(u.length>0)break;if(m.trim()===""){f+=1,d=`${d}${m}
1304
+ `;continue}else return}const x=t.extractItemData(g),{indentLevel:b,mainContent:v}=x;d=`${d}${m}
1305
+ `;const C=[v];for(f+=1;f<a.length;){const N=a[f];if(N.trim()===""){const F=a.slice(f+1).findIndex(L=>L.trim()!=="");if(F===-1)break;if((((i=(r=a[f+1+F].match(/^(\s*)/))==null?void 0:r[1])==null?void 0:i.length)||0)>b){C.push(N),d=`${d}${N}
1306
+ `,f+=1;continue}else break}if((((s=(o=N.match(/^(\s*)/))==null?void 0:o[1])==null?void 0:s.length)||0)>b)C.push(N),d=`${d}${N}
1307
+ `,f+=1;else break}let _;const E=C.slice(1);if(E.length>0){const N=E.map(M=>M.slice(b+h)).join(`
1308
+ `);N.trim()&&(t.customNestedParser?_=t.customNestedParser(N):_=n.blockTokens(N))}const I=t.createToken(x,_);u.push(I)}if(u.length!==0)return{items:u,raw:d}}function Ax(e,t,n,r){if(!e||!Array.isArray(e.content))return"";const i=typeof n=="function"?n(r):n,[o,...s]=e.content,a=t.renderChildren([o]),u=[`${i}${a}`];return s&&s.length>0&&s.forEach(d=>{const f=t.renderChildren([d]);if(f){const h=f.split(`
1309
+ `).map(m=>m?t.indent(m):"").join(`
1310
+ `);u.push(h)}}),u.join(`
1311
+ `)}function iJ(e,t,n={}){const{state:r}=t,{doc:i,tr:o}=r,s=e;i.descendants((a,u)=>{const d=o.mapping.map(u),f=o.mapping.map(u)+a.nodeSize;let h=null;if(a.marks.forEach(g=>{if(g!==s)return!1;h=g}),!h)return;let m=!1;if(Object.keys(n).forEach(g=>{n[g]!==h.attrs[g]&&(m=!0)}),m){const g=e.type.create({...e.attrs,...n});o.removeMark(d,f,e.type),o.addMark(d,f,g)}}),o.docChanged&&t.view.dispatch(o)}var Kt=class A6 extends Ex{constructor(){super(...arguments),this.type="node"}static create(t={}){const n=typeof t=="function"?t():t;return new A6(n)}configure(t){return super.configure(t)}extend(t){const n=typeof t=="function"?t():t;return super.extend(n)}},oJ=class{constructor(e,t,n){this.isDragging=!1,this.component=e,this.editor=t.editor,this.options={stopEvent:null,ignoreMutation:null,...n},this.extension=t.extension,this.node=t.node,this.decorations=t.decorations,this.innerDecorations=t.innerDecorations,this.view=t.view,this.HTMLAttributes=t.HTMLAttributes,this.getPos=t.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var t,n,r,i,o,s,a;const{view:u}=this.editor,d=e.target,f=d.nodeType===3?(t=d.parentElement)==null?void 0:t.closest("[data-drag-handle]"):d.closest("[data-drag-handle]");if(!this.dom||(n=this.contentDOM)!=null&&n.contains(d)||!f)return;let h=0,m=0;if(this.dom!==f){const _=this.dom.getBoundingClientRect(),E=f.getBoundingClientRect(),I=(i=e.offsetX)!=null?i:(r=e.nativeEvent)==null?void 0:r.offsetX,N=(s=e.offsetY)!=null?s:(o=e.nativeEvent)==null?void 0:o.offsetY;h=E.x-_.x+I,m=E.y-_.y+N}const g=this.dom.cloneNode(!0);try{const _=this.dom.getBoundingClientRect();g.style.width=`${Math.round(_.width)}px`,g.style.height=`${Math.round(_.height)}px`,g.style.boxSizing="border-box",g.style.pointerEvents="none"}catch{}let x=null;try{x=document.createElement("div"),x.style.position="absolute",x.style.top="-9999px",x.style.left="-9999px",x.style.pointerEvents="none",x.appendChild(g),document.body.appendChild(x),(a=e.dataTransfer)==null||a.setDragImage(g,h,m)}finally{x&&setTimeout(()=>{try{x==null||x.remove()}catch{}},0)}const b=this.getPos();if(typeof b!="number")return;const v=ut.create(u.state.doc,b),C=u.state.tr.setSelection(v);u.dispatch(C)}stopEvent(e){var t;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:e});const n=e.target;if(!(this.dom.contains(n)&&!((t=this.contentDOM)!=null&&t.contains(n))))return!1;const i=e.type.startsWith("drag"),o=e.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(n.tagName)||n.isContentEditable)&&!o&&!i)return!0;const{isEditable:a}=this.editor,{isDragging:u}=this,d=!!this.node.type.spec.draggable,f=ut.isSelectable(this.node),h=e.type==="copy",m=e.type==="paste",g=e.type==="cut",x=e.type==="mousedown";if(!d&&f&&i&&e.target===this.dom&&e.preventDefault(),d&&i&&!u&&e.target===this.dom)return e.preventDefault(),!1;if(d&&a&&!u&&x){const b=n.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||o||h||m||g||x&&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"&&(Bc()||U1())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(n=>n.isContentEditable)?!1:this.contentDOM===e.target&&e.type==="attributes"?!0:!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command(({tr:t})=>{const n=this.getPos();return typeof n!="number"?!1:(t.setNodeMarkup(n,void 0,{...this.node.attrs,...e}),!0)})}deleteNode(){const e=this.getPos();if(typeof e!="number")return;const t=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:t})}};function Oa(e){return new BZ({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{const o=Zt(e.getAttributes,void 0,r,i);if(o===!1||o===null)return null;const{tr:s}=t,a=r[r.length-1],u=r[0];let d=n.to;if(a){const f=u.search(/\S/),h=n.from+u.indexOf(a),m=h+a.length;if(Sx(n.from,n.to,t.doc).filter(x=>x.mark.type.excluded.find(v=>v===e.type&&v!==x.mark.type)).filter(x=>x.to>h).length)return null;m<n.to&&s.delete(m,n.to),h>n.from&&s.delete(n.from+f,h),d=n.from+f+a.length,s.addMark(n.from+f,d,e.type.create(o||{})),s.removeStoredMark(e.type)}}})}const{getOwnPropertyNames:sJ,getOwnPropertySymbols:aJ}=Object,{hasOwnProperty:lJ}=Object.prototype;function _g(e,t){return function(r,i,o){return e(r,i,o)&&t(r,i,o)}}function Lf(e){return function(n,r,i){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,i);const{cache:o}=i,s=o.get(n),a=o.get(r);if(s&&a)return s===r&&a===n;o.set(n,r),o.set(r,n);const u=e(n,r,i);return o.delete(n),o.delete(r),u}}function uJ(e){return e!=null?e[Symbol.toStringTag]:void 0}function BC(e){return sJ(e).concat(aJ(e))}const cJ=Object.hasOwn||((e,t)=>lJ.call(e,t));function $a(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const dJ="__v",fJ="__o",hJ="_owner",{getOwnPropertyDescriptor:UC,keys:VC}=Object;function pJ(e,t){return e.byteLength===t.byteLength&&jh(new Uint8Array(e),new Uint8Array(t))}function mJ(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function gJ(e,t){return e.byteLength===t.byteLength&&jh(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function yJ(e,t){return $a(e.getTime(),t.getTime())}function xJ(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function bJ(e,t){return e===t}function HC(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const i=new Array(r),o=e.entries();let s,a,u=0;for(;(s=o.next())&&!s.done;){const d=t.entries();let f=!1,h=0;for(;(a=d.next())&&!a.done;){if(i[h]){h++;continue}const m=s.value,g=a.value;if(n.equals(m[0],g[0],u,h,e,t,n)&&n.equals(m[1],g[1],m[0],g[0],e,t,n)){f=i[h]=!0;break}h++}if(!f)return!1;u++}return!0}const vJ=$a;function kJ(e,t,n){const r=VC(e);let i=r.length;if(VC(t).length!==i)return!1;for(;i-- >0;)if(!M6(e,t,n,r[i]))return!1;return!0}function Uu(e,t,n){const r=BC(e);let i=r.length;if(BC(t).length!==i)return!1;let o,s,a;for(;i-- >0;)if(o=r[i],!M6(e,t,n,o)||(s=UC(e,o),a=UC(t,o),(s||a)&&(!s||!a||s.configurable!==a.configurable||s.enumerable!==a.enumerable||s.writable!==a.writable)))return!1;return!0}function wJ(e,t){return $a(e.valueOf(),t.valueOf())}function CJ(e,t){return e.source===t.source&&e.flags===t.flags}function WC(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const i=new Array(r),o=e.values();let s,a;for(;(s=o.next())&&!s.done;){const u=t.values();let d=!1,f=0;for(;(a=u.next())&&!a.done;){if(!i[f]&&n.equals(s.value,a.value,s.value,a.value,e,t,n)){d=i[f]=!0;break}f++}if(!d)return!1}return!0}function jh(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function SJ(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function M6(e,t,n,r){return(r===hJ||r===fJ||r===dJ)&&(e.$$typeof||t.$$typeof)?!0:cJ(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const EJ="[object ArrayBuffer]",_J="[object Arguments]",TJ="[object Boolean]",AJ="[object DataView]",MJ="[object Date]",NJ="[object Error]",IJ="[object Map]",DJ="[object Number]",OJ="[object Object]",RJ="[object RegExp]",PJ="[object Set]",jJ="[object String]",zJ={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},LJ="[object URL]",FJ=Object.prototype.toString;function $J({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:o,areMapsEqual:s,areNumbersEqual:a,areObjectsEqual:u,arePrimitiveWrappersEqual:d,areRegExpsEqual:f,areSetsEqual:h,areTypedArraysEqual:m,areUrlsEqual:g,unknownTagComparators:x}){return function(v,C,_){if(v===C)return!0;if(v==null||C==null)return!1;const E=typeof v;if(E!==typeof C)return!1;if(E!=="object")return E==="number"?a(v,C,_):E==="function"?o(v,C,_):!1;const I=v.constructor;if(I!==C.constructor)return!1;if(I===Object)return u(v,C,_);if(Array.isArray(v))return t(v,C,_);if(I===Date)return r(v,C,_);if(I===RegExp)return f(v,C,_);if(I===Map)return s(v,C,_);if(I===Set)return h(v,C,_);const N=FJ.call(v);if(N===MJ)return r(v,C,_);if(N===RJ)return f(v,C,_);if(N===IJ)return s(v,C,_);if(N===PJ)return h(v,C,_);if(N===OJ)return typeof v.then!="function"&&typeof C.then!="function"&&u(v,C,_);if(N===LJ)return g(v,C,_);if(N===NJ)return i(v,C,_);if(N===_J)return u(v,C,_);if(zJ[N])return m(v,C,_);if(N===EJ)return e(v,C,_);if(N===AJ)return n(v,C,_);if(N===TJ||N===DJ||N===jJ)return d(v,C,_);if(x){let M=x[N];if(!M){const F=uJ(v);F&&(M=x[F])}if(M)return M(v,C,_)}return!1}}function BJ({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:pJ,areArraysEqual:n?Uu:mJ,areDataViewsEqual:gJ,areDatesEqual:yJ,areErrorsEqual:xJ,areFunctionsEqual:bJ,areMapsEqual:n?_g(HC,Uu):HC,areNumbersEqual:vJ,areObjectsEqual:n?Uu:kJ,arePrimitiveWrappersEqual:wJ,areRegExpsEqual:CJ,areSetsEqual:n?_g(WC,Uu):WC,areTypedArraysEqual:n?_g(jh,Uu):jh,areUrlsEqual:SJ,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const i=Lf(r.areArraysEqual),o=Lf(r.areMapsEqual),s=Lf(r.areObjectsEqual),a=Lf(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:i,areMapsEqual:o,areObjectsEqual:s,areSetsEqual:a})}return r}function UJ(e){return function(t,n,r,i,o,s,a){return e(t,n,a)}}function VJ({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(a,u){const{cache:d=e?new WeakMap:void 0,meta:f}=n();return t(a,u,{cache:d,equals:r,meta:f,strict:i})};if(e)return function(a,u){return t(a,u,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};const o={cache:void 0,equals:r,meta:void 0,strict:i};return function(a,u){return t(a,u,o)}}const HJ=qs();qs({strict:!0});qs({circular:!0});qs({circular:!0,strict:!0});qs({createInternalComparator:()=>$a});qs({strict:!0,createInternalComparator:()=>$a});qs({circular:!0,createInternalComparator:()=>$a});qs({circular:!0,createInternalComparator:()=>$a,strict:!0});function qs(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,o=BJ(e),s=$J(o),a=n?n(s):UJ(s);return VJ({circular:t,comparator:s,createState:r,equals:a,strict:i})}var Tg={exports:{}},Ag={};/**
1312
+ * @license React
1313
+ * use-sync-external-store-shim/with-selector.production.js
1314
+ *
1315
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
1316
+ *
1317
+ * This source code is licensed under the MIT license found in the
1318
+ * LICENSE file in the root directory of this source tree.
1319
+ */var qC;function WJ(){if(qC)return Ag;qC=1;var e=Kc(),t=t_();function n(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,s=e.useEffect,a=e.useMemo,u=e.useDebugValue;return Ag.useSyncExternalStoreWithSelector=function(d,f,h,m,g){var x=o(null);if(x.current===null){var b={hasValue:!1,value:null};x.current=b}else b=x.current;x=a(function(){function C(M){if(!_){if(_=!0,E=M,M=m(M),g!==void 0&&b.hasValue){var F=b.value;if(g(F,M))return I=F}return I=M}if(F=I,r(E,M))return F;var R=m(M);return g!==void 0&&g(F,R)?(E=M,F):(E=M,I=R)}var _=!1,E,I,N=h===void 0?null:h;return[function(){return C(f())},N===null?void 0:function(){return C(N())}]},[f,h,m,g]);var v=i(d,x[0],x[1]);return s(function(){b.hasValue=!0,b.value=v},[v]),u(v),v},Ag}var ZC;function qJ(){return ZC||(ZC=1,Tg.exports=WJ()),Tg.exports}var ZJ=qJ(),JJ=(...e)=>t=>{e.forEach(n=>{typeof n=="function"?n(t):n&&(n.current=t)})},KJ=({contentComponent:e})=>{const t=ky.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getServerSnapshot);return w.jsx(w.Fragment,{children:Object.values(t)})};function GJ(){const e=new Set;let t={};return{subscribe(n){return e.add(n),()=>{e.delete(n)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(n,r){t={...t,[n]:O9.createPortal(r.reactElement,r.element,n)},e.forEach(i=>i())},removeRenderer(n){const r={...t};delete r[n],t=r,e.forEach(i=>i())}}}var YJ=class extends jo.Component{constructor(e){var t;super(e),this.editorContentRef=jo.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!((t=e.editor)!=null&&t.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var e;const t=this.props.editor;if(t&&!t.isDestroyed&&((e=t.view.dom)!=null&&e.parentNode)){if(t.contentComponent)return;const n=this.editorContentRef.current;n.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:n}),t.contentComponent=GJ(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=t.contentComponent.subscribe(()=>{this.setState(r=>r.hasContentComponentInitialized?r:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),t.createNodeViews(),this.initialized=!0}}componentWillUnmount(){var e;const t=this.props.editor;if(t){this.initialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),t.contentComponent=null;try{if(!((e=t.view.dom)!=null&&e.parentNode))return;const n=document.createElement("div");n.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:n})}catch{}}}render(){const{editor:e,innerRef:t,...n}=this.props;return w.jsxs(w.Fragment,{children:[w.jsx("div",{ref:JJ(t,this.editorContentRef),...n}),(e==null?void 0:e.contentComponent)&&w.jsx(KJ,{contentComponent:e.contentComponent})]})}},QJ=A.forwardRef((e,t)=>{const n=jo.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return jo.createElement(YJ,{key:n,innerRef:t,...e})}),N6=jo.memo(QJ),XJ=typeof window<"u"?A.useLayoutEffect:A.useEffect,eK=class{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){const t=()=>{this.transactionNumber+=1,this.subscribers.forEach(r=>r())},n=this.editor;return n.on("transaction",t),()=>{n.off("transaction",t)}}}};function tK(e){var t;const[n]=A.useState(()=>new eK(e.editor)),r=ZJ.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,e.selector,(t=e.equalityFn)!=null?t:HJ);return XJ(()=>n.watch(e.editor),[e.editor,n]),A.useDebugValue(r),r}var nK=!1,q1=typeof window>"u",rK=q1||!!(typeof window<"u"&&window.next),iK=class I6{constructor(t){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=t,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(t){this.editor=t,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){return this.options.current.immediatelyRender===void 0?q1||rK?null:this.createEditor():(this.options.current.immediatelyRender,this.options.current.immediatelyRender?this.createEditor():null)}createEditor(){const t={...this.options.current,onBeforeCreate:(...r)=>{var i,o;return(o=(i=this.options.current).onBeforeCreate)==null?void 0:o.call(i,...r)},onBlur:(...r)=>{var i,o;return(o=(i=this.options.current).onBlur)==null?void 0:o.call(i,...r)},onCreate:(...r)=>{var i,o;return(o=(i=this.options.current).onCreate)==null?void 0:o.call(i,...r)},onDestroy:(...r)=>{var i,o;return(o=(i=this.options.current).onDestroy)==null?void 0:o.call(i,...r)},onFocus:(...r)=>{var i,o;return(o=(i=this.options.current).onFocus)==null?void 0:o.call(i,...r)},onSelectionUpdate:(...r)=>{var i,o;return(o=(i=this.options.current).onSelectionUpdate)==null?void 0:o.call(i,...r)},onTransaction:(...r)=>{var i,o;return(o=(i=this.options.current).onTransaction)==null?void 0:o.call(i,...r)},onUpdate:(...r)=>{var i,o;return(o=(i=this.options.current).onUpdate)==null?void 0:o.call(i,...r)},onContentError:(...r)=>{var i,o;return(o=(i=this.options.current).onContentError)==null?void 0:o.call(i,...r)},onDrop:(...r)=>{var i,o;return(o=(i=this.options.current).onDrop)==null?void 0:o.call(i,...r)},onPaste:(...r)=>{var i,o;return(o=(i=this.options.current).onPaste)==null?void 0:o.call(i,...r)},onDelete:(...r)=>{var i,o;return(o=(i=this.options.current).onDelete)==null?void 0:o.call(i,...r)}};return new KZ(t)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(t){return this.subscriptions.add(t),()=>{this.subscriptions.delete(t)}}static compareOptions(t,n){return Object.keys(t).every(r=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(r)?!0:r==="extensions"&&t.extensions&&n.extensions?t.extensions.length!==n.extensions.length?!1:t.extensions.every((i,o)=>{var s;return i===((s=n.extensions)==null?void 0:s[o])}):t[r]===n[r])}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&t.length===0?I6.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(t){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=t;return}if(this.previousDeps.length===t.length&&this.previousDeps.every((r,i)=>r===t[i]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=t}scheduleDestroy(){const t=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===t){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===t&&this.setEditor(null))},1)}};function oK(e={},t=[]){const n=A.useRef(e);n.current=e;const[r]=A.useState(()=>new iK(n)),i=ky.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return A.useDebugValue(i),A.useEffect(r.onRender(t)),tK({editor:i,selector:({transactionNumber:o})=>e.shouldRerenderOnTransaction===!1||e.shouldRerenderOnTransaction===void 0?null:e.immediatelyRender&&o===0?0:o+1}),i}var D6=A.createContext({editor:null});D6.Consumer;var O6=A.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),R6=()=>A.useContext(O6);function sK({as:e="div",...t}){const{nodeViewContentRef:n,nodeViewContentChildren:r}=R6();return w.jsx(e,{...t,ref:n,"data-node-view-content":"",style:{whiteSpace:"pre-wrap",...t.style},children:r})}var aK=jo.forwardRef((e,t)=>{const{onDragStart:n}=R6(),r=e.as||"div";return w.jsx(r,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})});function JC(e){return!!(typeof e=="function"&&e.prototype&&e.prototype.isReactComponent)}function KC(e){return!!(typeof e=="object"&&e.$$typeof&&(e.$$typeof.toString()==="Symbol(react.forward_ref)"||e.$$typeof.description==="react.forward_ref"))}function lK(e){return!!(typeof e=="object"&&e.$$typeof&&(e.$$typeof.toString()==="Symbol(react.memo)"||e.$$typeof.description==="react.memo"))}function uK(e){if(JC(e)||KC(e))return!0;if(lK(e)){const t=e.type;if(t)return JC(t)||KC(t)}return!1}function cK(){try{if(A.version)return parseInt(A.version.split(".")[0],10)>=19}catch{}return!1}var dK=class{constructor(e,{editor:t,props:n={},as:r="div",className:i=""}){this.ref=null,this.destroyed=!1,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=e,this.editor=t,this.props=n,this.element=document.createElement(r),this.element.classList.add("react-renderer"),i&&this.element.classList.add(...i.split(" ")),this.editor.isInitialized?Ey.flushSync(()=>{this.render()}):queueMicrotask(()=>{this.destroyed||this.render()})}render(){var e;if(this.destroyed)return;const t=this.component,n=this.props,r=this.editor,i=cK(),o=uK(t),s={...n};s.ref&&!(i||o)&&delete s.ref,!s.ref&&(i||o)&&(s.ref=a=>{this.ref=a}),this.reactElement=w.jsx(t,{...s}),(e=r==null?void 0:r.contentComponent)==null||e.setRenderer(this.id,this)}updateProps(e={}){this.destroyed||(this.props={...this.props,...e},this.render())}destroy(){var e;this.destroyed=!0;const t=this.editor;(e=t==null?void 0:t.contentComponent)==null||e.removeRenderer(this.id);try{this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}catch{}}updateAttributes(e){Object.keys(e).forEach(t=>{this.element.setAttribute(t,e[t])})}};jo.createContext({markViewContentRef:()=>{}});var fK=class extends oJ{constructor(e,t,n){if(super(e,t,n),this.selectionRafId=null,this.cachedExtensionWithSyncedStorage=null,!this.node.isLeaf){this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement.dataset.nodeViewContentReact="",this.contentDOMElement.dataset.nodeViewWrapper="",this.contentDOMElement.style.whiteSpace="inherit";const r=this.dom.querySelector("[data-node-view-content]");if(!r)return;r.appendChild(this.contentDOMElement)}}get extensionWithSyncedStorage(){if(!this.cachedExtensionWithSyncedStorage){const e=this.editor,t=this.extension;this.cachedExtensionWithSyncedStorage=new Proxy(t,{get(n,r,i){var o;return r==="storage"?(o=e.storage[t.name])!=null?o:{}:Reflect.get(n,r,i)}})}return this.cachedExtensionWithSyncedStorage}mount(){const e={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extensionWithSyncedStorage,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(u={})=>this.updateAttributes(u),deleteNode:()=>this.deleteNode(),ref:A.createRef()};if(!this.component.displayName){const u=d=>d.charAt(0).toUpperCase()+d.substring(1);this.component.displayName=u(this.extension.name)}const r={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:u=>{u&&this.contentDOMElement&&u.firstChild!==this.contentDOMElement&&(u.hasAttribute("data-node-view-wrapper")&&u.removeAttribute("data-node-view-wrapper"),u.appendChild(this.contentDOMElement))}},i=this.component,o=A.memo(u=>w.jsx(O6.Provider,{value:r,children:A.createElement(i,u)}));o.displayName="ReactNodeView";let s=this.node.isInline?"span":"div";this.options.as&&(s=this.options.as);const{className:a=""}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.renderer=new dK(o,{editor:this.editor,props:e,as:s,className:`node-${this.node.type.name} ${a}`.trim()}),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.updateElementAttributes()}get dom(){var e;if(this.renderer.element.firstElementChild&&!((e=this.renderer.element.firstElementChild)!=null&&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(){this.selectionRafId&&(cancelAnimationFrame(this.selectionRafId),this.selectionRafId=null),this.selectionRafId=requestAnimationFrame(()=>{this.selectionRafId=null;const{from:e,to:t}=this.editor.state.selection,n=this.getPos();if(typeof n=="number")if(e<=n&&t>=n+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}})}update(e,t,n){const r=i=>{this.renderer.updateProps(i),typeof this.options.attrs=="function"&&this.updateElementAttributes()};if(e.type!==this.node.type)return!1;if(typeof this.options.update=="function"){const i=this.node,o=this.decorations,s=this.innerDecorations;return this.node=e,this.decorations=t,this.innerDecorations=n,this.options.update({oldNode:i,oldDecorations:o,newNode:e,newDecorations:t,oldInnerDecorations:s,innerDecorations:n,updateProps:()=>r({node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage})})}return e===this.node&&this.decorations===t&&this.innerDecorations===n||(this.node=e,this.decorations=t,this.innerDecorations=n,r({node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage})),!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,this.selectionRafId&&(cancelAnimationFrame(this.selectionRafId),this.selectionRafId=null)}updateElementAttributes(){if(this.options.attrs){let e={};if(typeof this.options.attrs=="function"){const t=this.editor.extensionManager.attributes,n=Hl(this.node,t);e=this.options.attrs({node:this.node,HTMLAttributes:n})}else e=this.options.attrs;this.renderer.updateAttributes(e)}}};function hK(e,t){return n=>n.editor.contentComponent?new fK(e,n,t):{}}var Mx=A.createContext({get editor(){throw new Error("useTiptap must be used within a <Tiptap> provider")}});Mx.displayName="TiptapContext";var pK=()=>A.useContext(Mx);function P6({editor:e,instance:t,children:n}){const r=e??t;if(!r)throw new Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");const i=A.useMemo(()=>({editor:r}),[r]),o=A.useMemo(()=>({editor:r}),[r]);return w.jsx(D6.Provider,{value:o,children:w.jsx(Mx.Provider,{value:i,children:n})})}P6.displayName="Tiptap";function j6({...e}){const{editor:t}=pK();return w.jsx(N6,{editor:t,...e})}j6.displayName="Tiptap.Content";Object.assign(P6,{Content:j6});var zh=(e,t)=>{if(e==="slot")return 0;if(e instanceof Function)return e(t);const{children:n,...r}=t??{};if(e==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[e,r,n]},mK=/^\s*>\s$/,gK=Kt.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:e}){return zh("blockquote",{...Dn(this.options.HTMLAttributes,e),children:zh("slot",{})})},parseMarkdown:(e,t)=>t.createNode("blockquote",void 0,t.parseChildren(e.tokens||[])),renderMarkdown:(e,t)=>{if(!e.content)return"";const n=">",r=[];return e.content.forEach(i=>{const a=t.renderChildren([i]).split(`
1320
+ `).map(u=>u.trim()===""?n:`${n} ${u}`);r.push(a.join(`
1321
+ `))}),r.join(`
1322
+ ${n}
1323
+ `)},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[ql({find:mK,type:this.type})]}}),yK=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,xK=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,bK=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,vK=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,kK=ti.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>e.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:e=>e.type.name===this.name},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return zh("strong",{...Dn(this.options.HTMLAttributes,e),children:zh("slot",{})})},markdownTokenName:"strong",parseMarkdown:(e,t)=>t.applyMark("bold",t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`**${t.renderChildren(e)}**`,addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Wl({find:yK,type:this.type}),Wl({find:bK,type:this.type})]},addPasteRules(){return[Oa({find:xK,type:this.type}),Oa({find:vK,type:this.type})]}}),wK=/(^|[^`])`([^`]+)`(?!`)$/,CK=/(^|[^`])`([^`]+)`(?!`)/g,SK=ti.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:e}){return["code",Dn(this.options.HTMLAttributes,e),0]},markdownTokenName:"codespan",parseMarkdown:(e,t)=>t.applyMark("code",[{type:"text",text:e.text||""}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:"",addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Wl({find:wK,type:this.type})]},addPasteRules(){return[Oa({find:CK,type:this.type})]}}),Mg=4,EK=/^```([a-z]+)?[\s\n]$/,_K=/^~~~([a-z]+)?[\s\n]$/,TK=Kt.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:Mg,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{var t;const{languageClassPrefix:n}=this.options;if(!n)return null;const o=[...((t=e.firstElementChild)==null?void 0:t.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:e,HTMLAttributes:t}){return["pre",Dn(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(e,t)=>{var n;return((n=e.raw)==null?void 0:n.startsWith("```"))===!1&&e.codeBlockStyle!=="indented"?[]:t.createNode("codeBlock",{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[])},renderMarkdown:(e,t)=>{var n;let r="";const i=((n=e.attrs)==null?void 0:n.language)||"";return e.content?r=[`\`\`\`${i}`,t.renderChildren(e.content),"```"].join(`
1324
+ `):r=`\`\`\`${i}
1325
+
1326
+ \`\`\``,r},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;const n=(t=this.options.tabSize)!=null?t:Mg,{state:r}=e,{selection:i}=r,{$from:o,empty:s}=i;if(o.parent.type!==this.type)return!1;const a=" ".repeat(n);return s?e.commands.insertContent(a):e.commands.command(({tr:u})=>{const{from:d,to:f}=i,g=r.doc.textBetween(d,f,`
1327
+ `,`
1328
+ `).split(`
1329
+ `).map(x=>a+x).join(`
1330
+ `);return u.replaceWith(d,f,r.schema.text(g)),!0})},"Shift-Tab":({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;const n=(t=this.options.tabSize)!=null?t:Mg,{state:r}=e,{selection:i}=r,{$from:o,empty:s}=i;return o.parent.type!==this.type?!1:s?e.commands.command(({tr:a})=>{var u;const{pos:d}=o,f=o.start(),h=o.end(),g=r.doc.textBetween(f,h,`
1331
+ `,`
1332
+ `).split(`
1333
+ `);let x=0,b=0;const v=d-f;for(let M=0;M<g.length;M+=1){if(b+g[M].length>=v){x=M;break}b+=g[M].length+1}const _=((u=g[x].match(/^ */))==null?void 0:u[0])||"",E=Math.min(_.length,n);if(E===0)return!0;let I=f;for(let M=0;M<x;M+=1)I+=g[M].length+1;return a.delete(I,I+E),d-I<=E&&a.setSelection(yt.create(a.doc,I)),!0}):e.commands.command(({tr:a})=>{const{from:u,to:d}=i,m=r.doc.textBetween(u,d,`
1334
+ `,`
1335
+ `).split(`
1336
+ `).map(g=>{var x;const b=((x=g.match(/^ */))==null?void 0:x[0])||"",v=Math.min(b.length,n);return g.slice(v)}).join(`
1337
+ `);return a.replaceWith(u,d,r.schema.text(m)),!0})},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=e,{selection:n}=t,{$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(`
1338
+
1339
+ `);return!o||!s?!1:e.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:n,doc:r}=t,{$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?!1:r.nodeAt(a)?e.commands.command(({tr:d})=>(d.setSelection(At.near(r.resolve(a))),!0)):e.commands.exitCode()}}},addInputRules(){return[Ph({find:EK,type:this.type,getAttributes:e=>({language:e[1]})}),Ph({find:_K,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new mn({key:new Rn("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),r=t.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}=e.state,u=a.text(n.replace(/\r\n?/g,`
1340
+ `));return s.replaceSelectionWith(this.type.create({language:o},u)),s.selection.$from.parent.type!==this.type&&s.setSelection(yt.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),e.dispatch(s),!0}}})]}}),AK=Kt.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
1341
+
1342
+ `):""}),MK=Kt.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:e}){return["br",Dn(this.options.HTMLAttributes,e)]},renderText(){return`
1343
+ `},renderMarkdown:()=>`
1344
+ `,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.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,u=o||i.$to.parentOffset&&i.$from.marks();return t().insertContent({type:this.name}).command(({tr:d,dispatch:f})=>{if(f&&u&&s){const h=u.filter(m=>a.includes(m.type.name));d.ensureMarks(h)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),NK=Kt.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(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,Dn(this.options.HTMLAttributes,t),0]},parseMarkdown:(e,t)=>t.createNode("heading",{level:e.depth||1},t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>{var n;const r=(n=e.attrs)!=null&&n.level?parseInt(e.attrs.level,10):1,i="#".repeat(r);return e.content?`${i} ${t.renderChildren(e.content)}`:""},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,"paragraph",e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>Ph({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),IK=Kt.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:e}){return["hr",Dn(this.options.HTMLAttributes,e)]},markdownTokenName:"hr",parseMarkdown:(e,t)=>t.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!YZ(t,t.schema.nodes[this.name]))return!1;const{selection:n}=t,{$to:r}=n,i=e();return c6(n)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:o,tr:s,dispatch:a})=>{if(a){const{$to:u}=s.selection,d=u.end();if(u.nodeAfter)u.nodeAfter.isTextblock?s.setSelection(yt.create(s.doc,u.pos+1)):u.nodeAfter.isBlock?s.setSelection(ut.create(s.doc,u.pos)):s.setSelection(yt.create(s.doc,u.pos));else{const f=o.schema.nodes[this.options.nextNodeType]||u.parent.type.contentMatch.defaultType,h=f==null?void 0:f.create();h&&(s.insert(d,h),s.setSelection(yt.create(s.doc,d+1)))}s.scrollIntoView()}return!0}).run()}}},addInputRules(){return[GZ({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),DK=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,OK=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,RK=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,PK=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,jK=ti.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>e.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:e=>e.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",Dn(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(e,t)=>t.applyMark("italic",t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Wl({find:DK,type:this.type}),Wl({find:RK,type:this.type})]},addPasteRules(){return[Oa({find:OK,type:this.type}),Oa({find:PK,type:this.type})]}});const zK="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",LK="ελ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",Z1="numeric",J1="ascii",K1="alpha",mc="asciinumeric",tc="alphanumeric",G1="domain",z6="emoji",FK="scheme",$K="slashscheme",Ng="whitespace";function BK(e,t){return e in t||(t[e]=[]),t[e]}function xa(e,t,n){t[Z1]&&(t[mc]=!0,t[tc]=!0),t[J1]&&(t[mc]=!0,t[K1]=!0),t[mc]&&(t[tc]=!0),t[K1]&&(t[tc]=!0),t[tc]&&(t[G1]=!0),t[z6]&&(t[G1]=!0);for(const r in t){const i=BK(r,n);i.indexOf(e)<0&&i.push(e)}}function UK(e,t){const n={};for(const r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function zr(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}zr.groups={};zr.prototype={accepts(){return!!this.t},go(e){const t=this,n=t.j[e];if(n)return n;for(let r=0;r<t.jr.length;r++){const i=t.jr[r][0],o=t.jr[r][1];if(o&&i.test(e))return o}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let i=0;i<e.length;i++)this.tt(e[i],t,n,r)},tr(e,t,n,r){r=r||zr.groups;let i;return t&&t.j?i=t:(i=new zr(t),n&&r&&xa(t,n,r)),this.jr.push([e,i]),i},ts(e,t,n,r){let i=this;const o=e.length;if(!o)return i;for(let s=0;s<o-1;s++)i=i.tt(e[s]);return i.tt(e[o-1],t,n,r)},tt(e,t,n,r){r=r||zr.groups;const i=this;if(t&&t.j)return i.j[e]=t,t;const o=t;let s,a=i.go(e);if(a?(s=new zr,Object.assign(s.j,a.j),s.jr.push.apply(s.jr,a.jr),s.jd=a.jd,s.t=a.t):s=new zr,o){if(r)if(s.t&&typeof s.t=="string"){const u=Object.assign(UK(s.t,r),n);xa(o,u,r)}else n&&xa(o,n,r);s.t=o}return i.j[e]=s,s}};const Tt=(e,t,n,r,i)=>e.ta(t,n,r,i),wn=(e,t,n,r,i)=>e.tr(t,n,r,i),GC=(e,t,n,r,i)=>e.ts(t,n,r,i),ve=(e,t,n,r,i)=>e.tt(t,n,r,i),Mo="WORD",Y1="UWORD",L6="ASCIINUMERICAL",F6="ALPHANUMERICAL",Vc="LOCALHOST",Q1="TLD",X1="UTLD",Xf="SCHEME",El="SLASH_SCHEME",Nx="NUM",ey="WS",Ix="NL",gc="OPENBRACE",yc="CLOSEBRACE",Lh="OPENBRACKET",Fh="CLOSEBRACKET",$h="OPENPAREN",Bh="CLOSEPAREN",Uh="OPENANGLEBRACKET",Vh="CLOSEANGLEBRACKET",Hh="FULLWIDTHLEFTPAREN",Wh="FULLWIDTHRIGHTPAREN",qh="LEFTCORNERBRACKET",Zh="RIGHTCORNERBRACKET",Jh="LEFTWHITECORNERBRACKET",Kh="RIGHTWHITECORNERBRACKET",Gh="FULLWIDTHLESSTHAN",Yh="FULLWIDTHGREATERTHAN",Qh="AMPERSAND",Xh="APOSTROPHE",ep="ASTERISK",gs="AT",tp="BACKSLASH",np="BACKTICK",rp="CARET",ks="COLON",Dx="COMMA",ip="DOLLAR",Zi="DOT",op="EQUALS",Ox="EXCLAMATION",hi="HYPHEN",xc="PERCENT",sp="PIPE",ap="PLUS",lp="POUND",bc="QUERY",Rx="QUOTE",$6="FULLWIDTHMIDDLEDOT",Px="SEMI",Ji="SLASH",vc="TILDE",up="UNDERSCORE",B6="EMOJI",cp="SYM";var U6=Object.freeze({__proto__:null,ALPHANUMERICAL:F6,AMPERSAND:Qh,APOSTROPHE:Xh,ASCIINUMERICAL:L6,ASTERISK:ep,AT:gs,BACKSLASH:tp,BACKTICK:np,CARET:rp,CLOSEANGLEBRACKET:Vh,CLOSEBRACE:yc,CLOSEBRACKET:Fh,CLOSEPAREN:Bh,COLON:ks,COMMA:Dx,DOLLAR:ip,DOT:Zi,EMOJI:B6,EQUALS:op,EXCLAMATION:Ox,FULLWIDTHGREATERTHAN:Yh,FULLWIDTHLEFTPAREN:Hh,FULLWIDTHLESSTHAN:Gh,FULLWIDTHMIDDLEDOT:$6,FULLWIDTHRIGHTPAREN:Wh,HYPHEN:hi,LEFTCORNERBRACKET:qh,LEFTWHITECORNERBRACKET:Jh,LOCALHOST:Vc,NL:Ix,NUM:Nx,OPENANGLEBRACKET:Uh,OPENBRACE:gc,OPENBRACKET:Lh,OPENPAREN:$h,PERCENT:xc,PIPE:sp,PLUS:ap,POUND:lp,QUERY:bc,QUOTE:Rx,RIGHTCORNERBRACKET:Zh,RIGHTWHITECORNERBRACKET:Kh,SCHEME:Xf,SEMI:Px,SLASH:Ji,SLASH_SCHEME:El,SYM:cp,TILDE:vc,TLD:Q1,UNDERSCORE:up,UTLD:X1,UWORD:Y1,WORD:Mo,WS:ey});const To=/[a-z]/,Vu=new RegExp("\\p{L}","u"),Ig=new RegExp("\\p{Emoji}","u"),Ao=/\d/,Dg=/\s/,YC="\r",Og=`
1345
+ `,VK="️",HK="‍",Rg="";let Ff=null,$f=null;function WK(e=[]){const t={};zr.groups=t;const n=new zr;Ff==null&&(Ff=QC(zK)),$f==null&&($f=QC(LK)),ve(n,"'",Xh),ve(n,"{",gc),ve(n,"}",yc),ve(n,"[",Lh),ve(n,"]",Fh),ve(n,"(",$h),ve(n,")",Bh),ve(n,"<",Uh),ve(n,">",Vh),ve(n,"(",Hh),ve(n,")",Wh),ve(n,"「",qh),ve(n,"」",Zh),ve(n,"『",Jh),ve(n,"』",Kh),ve(n,"<",Gh),ve(n,">",Yh),ve(n,"&",Qh),ve(n,"*",ep),ve(n,"@",gs),ve(n,"`",np),ve(n,"^",rp),ve(n,":",ks),ve(n,",",Dx),ve(n,"$",ip),ve(n,".",Zi),ve(n,"=",op),ve(n,"!",Ox),ve(n,"-",hi),ve(n,"%",xc),ve(n,"|",sp),ve(n,"+",ap),ve(n,"#",lp),ve(n,"?",bc),ve(n,'"',Rx),ve(n,"/",Ji),ve(n,";",Px),ve(n,"~",vc),ve(n,"_",up),ve(n,"\\",tp),ve(n,"・",$6);const r=wn(n,Ao,Nx,{[Z1]:!0});wn(r,Ao,r);const i=wn(r,To,L6,{[mc]:!0}),o=wn(r,Vu,F6,{[tc]:!0}),s=wn(n,To,Mo,{[J1]:!0});wn(s,Ao,i),wn(s,To,s),wn(i,Ao,i),wn(i,To,i);const a=wn(n,Vu,Y1,{[K1]:!0});wn(a,To),wn(a,Ao,o),wn(a,Vu,a),wn(o,Ao,o),wn(o,To),wn(o,Vu,o);const u=ve(n,Og,Ix,{[Ng]:!0}),d=ve(n,YC,ey,{[Ng]:!0}),f=wn(n,Dg,ey,{[Ng]:!0});ve(n,Rg,f),ve(d,Og,u),ve(d,Rg,f),wn(d,Dg,f),ve(f,YC),ve(f,Og),wn(f,Dg,f),ve(f,Rg,f);const h=wn(n,Ig,B6,{[z6]:!0});ve(h,"#"),wn(h,Ig,h),ve(h,VK,h);const m=ve(h,HK);ve(m,"#"),wn(m,Ig,h);const g=[[To,s],[Ao,i]],x=[[To,null],[Vu,a],[Ao,o]];for(let b=0;b<Ff.length;b++)cs(n,Ff[b],Q1,Mo,g);for(let b=0;b<$f.length;b++)cs(n,$f[b],X1,Y1,x);xa(Q1,{tld:!0,ascii:!0},t),xa(X1,{utld:!0,alpha:!0},t),cs(n,"file",Xf,Mo,g),cs(n,"mailto",Xf,Mo,g),cs(n,"http",El,Mo,g),cs(n,"https",El,Mo,g),cs(n,"ftp",El,Mo,g),cs(n,"ftps",El,Mo,g),xa(Xf,{scheme:!0,ascii:!0},t),xa(El,{slashscheme:!0,ascii:!0},t),e=e.sort((b,v)=>b[0]>v[0]?1:-1);for(let b=0;b<e.length;b++){const v=e[b][0],_=e[b][1]?{[FK]:!0}:{[$K]:!0};v.indexOf("-")>=0?_[G1]=!0:To.test(v)?Ao.test(v)?_[mc]=!0:_[J1]=!0:_[Z1]=!0,GC(n,v,v,_)}return GC(n,"localhost",Vc,{ascii:!0}),n.jd=new zr(cp),{start:n,tokens:Object.assign({groups:t},U6)}}function V6(e,t){const n=qK(t.replace(/[A-Z]/g,a=>a.toLowerCase())),r=n.length,i=[];let o=0,s=0;for(;s<r;){let a=e,u=null,d=0,f=null,h=-1,m=-1;for(;s<r&&(u=a.go(n[s]));)a=u,a.accepts()?(h=0,m=0,f=a):h>=0&&(h+=n[s].length,m++),d+=n[s].length,o+=n[s].length,s++;o-=h,s-=m,d-=h,i.push({t:f.t,v:t.slice(o-d,o),s:o-d,e:o})}return i}function qK(e){const t=[],n=e.length;let r=0;for(;r<n;){let i=e.charCodeAt(r),o,s=i<55296||i>56319||r+1===n||(o=e.charCodeAt(r+1))<56320||o>57343?e[r]:e.slice(r,r+2);t.push(s),r+=s.length}return t}function cs(e,t,n,r,i){let o;const s=t.length;for(let a=0;a<s-1;a++){const u=t[a];e.j[u]?o=e.j[u]:(o=new zr(r),o.jr=i.slice(),e.j[u]=o),e=o}return o=new zr(n),o.jr=i.slice(),e.j[t[s-1]]=o,o}function QC(e){const t=[],n=[];let r=0,i="0123456789";for(;r<e.length;){let o=0;for(;i.indexOf(e[r+o])>=0;)o++;if(o>0){t.push(n.join(""));for(let s=parseInt(e.substring(r,r+o),10);s>0;s--)n.pop();r+=o}else n.push(e[r]),r++}return t}const Hc={defaultProtocol:"http",events:null,format:XC,formatHref:XC,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function jx(e,t=null){let n=Object.assign({},Hc);e&&(n=Object.assign(n,e instanceof jx?e.o:e));const r=n.ignoreTags,i=[];for(let o=0;o<r.length;o++)i.push(r[o].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=i}jx.prototype={o:Hc,ignoreTags:[],defaultRender(e){return e},check(e){return this.get("validate",e.toString(),e)},get(e,t,n){const r=t!=null;let i=this.o[e];return i&&(typeof i=="object"?(i=n.t in i?i[n.t]:Hc[e],typeof i=="function"&&r&&(i=i(t,n))):typeof i=="function"&&r&&(i=i(t,n.t,n)),i)},getObj(e,t,n){let r=this.o[e];return typeof r=="function"&&t!=null&&(r=r(t,n.t,n)),r},render(e){const t=e.render(this);return(this.get("render",null,e)||this.defaultRender)(t,e.t,e)}};function XC(e){return e}function H6(e,t){this.t="token",this.v=e,this.tk=t}H6.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){const t=this.toString(),n=e.get("truncate",t,this),r=e.get("format",t,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=Hc.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get("validate",this.toString(),this)},render(e){const t=this,n=this.toHref(e.get("defaultProtocol")),r=e.get("formatHref",n,this),i=e.get("tagName",n,t),o=this.toFormattedString(e),s={},a=e.get("className",n,t),u=e.get("target",n,t),d=e.get("rel",n,t),f=e.getObj("attributes",n,t),h=e.getObj("events",n,t);return s.href=r,a&&(s.class=a),u&&(s.target=u),d&&(s.rel=d),f&&Object.assign(s,f),{tagName:i,attributes:s,content:o,eventListeners:h}}};function Vp(e,t){class n extends H6{constructor(i,o){super(i,o),this.t=e}}for(const r in t)n.prototype[r]=t[r];return n.t=e,n}const eS=Vp("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),tS=Vp("text"),ZK=Vp("nl"),Bf=Vp("url",{isLink:!0,toHref(e=Hc.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){const e=this.tk;return e.length>=2&&e[0].t!==Vc&&e[1].t===ks}}),di=e=>new zr(e);function JK({groups:e}){const t=e.domain.concat([Qh,ep,gs,tp,np,rp,ip,op,hi,Nx,xc,sp,ap,lp,Ji,cp,vc,up]),n=[Xh,ks,Dx,Zi,Ox,xc,bc,Rx,Px,Uh,Vh,gc,yc,Fh,Lh,$h,Bh,Hh,Wh,qh,Zh,Jh,Kh,Gh,Yh],r=[Qh,Xh,ep,tp,np,rp,ip,op,hi,gc,yc,xc,sp,ap,lp,bc,Ji,cp,vc,up],i=di(),o=ve(i,vc);Tt(o,r,o),Tt(o,e.domain,o);const s=di(),a=di(),u=di();Tt(i,e.domain,s),Tt(i,e.scheme,a),Tt(i,e.slashscheme,u),Tt(s,r,o),Tt(s,e.domain,s);const d=ve(s,gs);ve(o,gs,d),ve(a,gs,d),ve(u,gs,d);const f=ve(o,Zi);Tt(f,r,o),Tt(f,e.domain,o);const h=di();Tt(d,e.domain,h),Tt(h,e.domain,h);const m=ve(h,Zi);Tt(m,e.domain,h);const g=di(eS);Tt(m,e.tld,g),Tt(m,e.utld,g),ve(d,Vc,g);const x=ve(h,hi);ve(x,hi,x),Tt(x,e.domain,h),Tt(g,e.domain,h),ve(g,Zi,m),ve(g,hi,x);const b=ve(g,ks);Tt(b,e.numeric,eS);const v=ve(s,hi),C=ve(s,Zi);ve(v,hi,v),Tt(v,e.domain,s),Tt(C,r,o),Tt(C,e.domain,s);const _=di(Bf);Tt(C,e.tld,_),Tt(C,e.utld,_),Tt(_,e.domain,s),Tt(_,r,o),ve(_,Zi,C),ve(_,hi,v),ve(_,gs,d);const E=ve(_,ks),I=di(Bf);Tt(E,e.numeric,I);const N=di(Bf),M=di();Tt(N,t,N),Tt(N,n,M),Tt(M,t,N),Tt(M,n,M),ve(_,Ji,N),ve(I,Ji,N);const F=ve(a,ks),R=ve(u,ks),D=ve(R,Ji),L=ve(D,Ji);Tt(a,e.domain,s),ve(a,Zi,C),ve(a,hi,v),Tt(u,e.domain,s),ve(u,Zi,C),ve(u,hi,v),Tt(F,e.domain,N),ve(F,Ji,N),ve(F,bc,N),Tt(L,e.domain,N),Tt(L,t,N),ve(L,Ji,N);const X=[[gc,yc],[Lh,Fh],[$h,Bh],[Uh,Vh],[Hh,Wh],[qh,Zh],[Jh,Kh],[Gh,Yh]];for(let ee=0;ee<X.length;ee++){const[Ie,he]=X[ee],Z=ve(N,Ie);ve(M,Ie,Z),ve(Z,he,N);const ge=di(Bf);Tt(Z,t,ge);const Oe=di();Tt(Z,n),Tt(ge,t,ge),Tt(ge,n,Oe),Tt(Oe,t,ge),Tt(Oe,n,Oe),ve(ge,he,N),ve(Oe,he,N)}return ve(i,Vc,_),ve(i,Ix,ZK),{start:i,tokens:U6}}function KK(e,t,n){let r=n.length,i=0,o=[],s=[];for(;i<r;){let a=e,u=null,d=null,f=0,h=null,m=-1;for(;i<r&&!(u=a.go(n[i].t));)s.push(n[i++]);for(;i<r&&(d=u||a.go(n[i].t));)u=null,a=d,a.accepts()?(m=0,h=a):m>=0&&m++,i++,f++;if(m<0)i-=f,i<r&&(s.push(n[i]),i++);else{s.length>0&&(o.push(Pg(tS,t,s)),s=[]),i-=m,f-=m;const g=h.t,x=n.slice(i-f,i);o.push(Pg(g,t,x))}}return s.length>0&&o.push(Pg(tS,t,s)),o}function Pg(e,t,n){const r=n[0].s,i=n[n.length-1].e,o=t.slice(r,i);return new e(o,n)}const GK=typeof console<"u"&&console&&console.warn||(()=>{}),YK="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",cn={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function QK(){return zr.groups={},cn.scanner=null,cn.parser=null,cn.tokenQueue=[],cn.pluginQueue=[],cn.customSchemes=[],cn.initialized=!1,cn}function nS(e,t=!1){if(cn.initialized&&GK(`linkifyjs: already initialized - will not register custom scheme "${e}" ${YK}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw new Error(`linkifyjs: incorrect scheme format.
1346
+ 1. Must only contain digits, lowercase ASCII letters or "-"
1347
+ 2. Cannot start or end with "-"
1348
+ 3. "-" cannot repeat`);cn.customSchemes.push([e,t])}function XK(){cn.scanner=WK(cn.customSchemes);for(let e=0;e<cn.tokenQueue.length;e++)cn.tokenQueue[e][1]({scanner:cn.scanner});cn.parser=JK(cn.scanner.tokens);for(let e=0;e<cn.pluginQueue.length;e++)cn.pluginQueue[e][1]({scanner:cn.scanner,parser:cn.parser});return cn.initialized=!0,cn}function zx(e){return cn.initialized||XK(),KK(cn.parser.start,e,V6(cn.scanner.start,e))}zx.scan=V6;function W6(e,t=null,n=null){if(t&&typeof t=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}const r=new jx(n),i=zx(e),o=[];for(let s=0;s<i.length;s++){const a=i[s];a.isLink&&(!t||a.t===t)&&r.check(a)&&o.push(a.toFormattedObject(r))}return o}var Lx="[\0-   ᠎ -\u2029  ]",eG=new RegExp(Lx),tG=new RegExp(`${Lx}$`),nG=new RegExp(Lx,"g");function rG(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?["()","[]"].includes(e[0].value+e[2].value):!1}function iG(e){return new mn({key:new Rn("autolink"),appendTransaction:(t,n,r)=>{const i=t.some(d=>d.docChanged)&&!n.doc.eq(r.doc),o=t.some(d=>d.getMeta("preventAutolink"));if(!i||o)return;const{tr:s}=r,a=n6(n.doc,[...t]);if(u6(a).forEach(({newRange:d})=>{const f=Qq(r.doc,d,g=>g.isTextblock);let h,m;if(f.length>1)h=f[0],m=r.doc.textBetween(h.pos,h.pos+h.node.nodeSize,void 0," ");else if(f.length){const g=r.doc.textBetween(d.from,d.to," "," ");if(!tG.test(g))return;h=f[0],m=r.doc.textBetween(h.pos,d.to,void 0," ")}if(h&&m){const g=m.split(eG).filter(Boolean);if(g.length<=0)return!1;const x=g[g.length-1],b=h.pos+m.lastIndexOf(x);if(!x)return!1;const v=zx(x).map(C=>C.toObject(e.defaultProtocol));if(!rG(v))return!1;v.filter(C=>C.isLink).map(C=>({...C,from:b+C.start+1,to:b+C.end+1})).filter(C=>r.schema.marks.code?!r.doc.rangeHasMark(C.from,C.to,r.schema.marks.code):!0).filter(C=>e.validate(C.value)).filter(C=>e.shouldAutoLink(C.value)).forEach(C=>{Sx(C.from,C.to,r.doc).some(_=>_.mark.type===e.type)||s.addMark(C.from,C.to,e.type.create({href:C.href}))})}}),!!s.steps.length)return s}})}function oG(e){return new mn({key:new Rn("handleClickLink"),props:{handleClick:(t,n,r)=>{var i,o;if(r.button!==0||!t.editable)return!1;let s=null;if(r.target instanceof HTMLAnchorElement)s=r.target;else{const u=r.target;if(!u)return!1;const d=e.editor.view.dom;s=u.closest("a"),s&&!d.contains(s)&&(s=null)}if(!s)return!1;let a=!1;if(e.enableClickSelection&&(a=e.editor.commands.extendMarkRange(e.type.name)),e.openOnClick){const u=l6(t.state,e.type.name),d=(i=s.href)!=null?i:u.href,f=(o=s.target)!=null?o:u.target;d&&(window.open(d,f),a=!0)}return a}}})}function sG(e){return new mn({key:new Rn("handlePasteLink"),props:{handlePaste:(t,n,r)=>{const{shouldAutoLink:i}=e,{state:o}=t,{selection:s}=o,{empty:a}=s;if(a)return!1;let u="";r.content.forEach(f=>{u+=f.textContent});const d=W6(u,{defaultProtocol:e.defaultProtocol}).find(f=>f.isLink&&f.value===u);return!u||!d||i!==void 0&&!i(d.value)?!1:e.editor.commands.setMark(e.type,{href:d.href})}}})}function da(e,t){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return t&&t.forEach(r=>{const i=typeof r=="string"?r:r.scheme;i&&n.push(i)}),!e||e.replace(nG,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var aG=ti.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{if(typeof e=="string"){nS(e);return}nS(e.scheme,e.optionalSlashes)})},onDestroy(){QK()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(e,t)=>!!da(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{const t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes("@"))return!0;const i=(e.includes("@")?e.split("@").pop():e).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(i)||!/\./.test(i))}}},addAttributes(){return{href:{default:null,parseHTML(e){return e.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:e=>{const t=e.getAttribute("href");return!t||!this.options.isAllowedUri(t,{defaultValidate:n=>!!da(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:t=>!!da(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Dn(this.options.HTMLAttributes,e),0]:["a",Dn(this.options.HTMLAttributes,{...e,href:""}),0]},markdownTokenName:"link",parseMarkdown:(e,t)=>t.applyMark("link",t.parseInline(e.tokens||[]),{href:e.href,title:e.title||null}),renderMarkdown:(e,t)=>{var n,r,i,o;const s=(r=(n=e.attrs)==null?void 0:n.href)!=null?r:"",a=(o=(i=e.attrs)==null?void 0:i.title)!=null?o:"",u=t.renderChildren(e);return a?`[${u}](${s} "${a}")`:`[${u}](${s})`},addCommands(){return{setLink:e=>({chain:t})=>{const{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:r=>!!da(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,e).setMeta("preventAutolink",!0).run():!1},toggleLink:e=>({chain:t})=>{const{href:n}=e||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:r=>!!da(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[Oa({find:e=>{const t=[];if(e){const{protocols:n,defaultProtocol:r}=this.options,i=W6(e).filter(o=>o.isLink&&this.options.isAllowedUri(o.value,{defaultValidate:s=>!!da(s,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(o=>{this.options.shouldAutoLink(o.value)&&t.push({text:o.value,data:{href:o.href},index:o.start})})}return t},type:this.type,getAttributes:e=>{var t;return{href:(t=e.data)==null?void 0:t.href}}})]},addProseMirrorPlugins(){const e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(iG({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:i=>!!da(i,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),e.push(oG({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(sG({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}}),lG=Object.defineProperty,uG=(e,t)=>{for(var n in t)lG(e,n,{get:t[n],enumerable:!0})},cG="listItem",rS="textStyle",iS=/^\s*([-+*])\s$/,q6=Kt.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:e}){return["ul",Dn(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(e,t)=>e.type!=="list"||e.ordered?[]:{type:"bulletList",content:e.items?t.parseChildren(e.items):[]},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
1349
+ `):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(cG,this.editor.getAttributes(rS)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=ql({find:iS,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=ql({find:iS,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(rS),editor:this.editor})),[e]}}),Z6=Kt.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",Dn(this.options.HTMLAttributes,e),0]},markdownTokenName:"list_item",parseMarkdown:(e,t)=>{if(e.type!=="list_item")return[];let n=[];if(e.tokens&&e.tokens.length>0)if(e.tokens.some(i=>i.type==="paragraph"))n=t.parseChildren(e.tokens);else{const i=e.tokens[0];if(i&&i.type==="text"&&i.tokens&&i.tokens.length>0){if(n=[{type:"paragraph",content:t.parseInline(i.tokens)}],e.tokens.length>1){const s=e.tokens.slice(1),a=t.parseChildren(s);n.push(...a)}}else n=t.parseChildren(e.tokens)}return n.length===0&&(n=[{type:"paragraph",content:[]}]),{type:"listItem",content:n}},renderMarkdown:(e,t,n)=>Ax(e,t,r=>{var i,o;return r.parentType==="bulletList"?"- ":r.parentType==="orderedList"?`${(((o=(i=r.meta)==null?void 0:i.parentAttrs)==null?void 0:o.start)||1)+r.index}. `:"- "},n),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),dG={};uG(dG,{findListItemPos:()=>ld,getNextListDepth:()=>Fx,handleBackspace:()=>ty,handleDelete:()=>ny,hasListBefore:()=>J6,hasListItemAfter:()=>fG,hasListItemBefore:()=>K6,listItemHasSubList:()=>G6,nextListIsDeeper:()=>Y6,nextListIsHigher:()=>Q6});var ld=(e,t)=>{const{$from:n}=t.selection,r=In(e,t.schema);let i=null,o=n.depth,s=n.pos,a=null;for(;o>0&&a===null;)i=n.node(o),i.type===r?a=o:(o-=1,s-=1);return a===null?null:{$pos:t.doc.resolve(s),depth:a}},Fx=(e,t)=>{const n=ld(e,t);if(!n)return!1;const[,r]=lZ(t,e,n.$pos.pos+4);return r},J6=(e,t,n)=>{const{$anchor:r}=e.selection,i=Math.max(0,r.pos-2),o=e.doc.resolve(i).node();return!(!o||!n.includes(o.type.name))},K6=(e,t)=>{var n;const{$anchor:r}=t.selection,i=t.doc.resolve(r.pos-2);return!(i.index()===0||((n=i.nodeBefore)==null?void 0:n.type.name)!==e)},G6=(e,t,n)=>{if(!n)return!1;const r=In(e,t.schema);let i=!1;return n.descendants(o=>{o.type===r&&(i=!0)}),i},ty=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!Ls(e.state,t)&&J6(e.state,t,n)){const{$anchor:a}=e.state.selection,u=e.state.doc.resolve(a.before()-1),d=[];u.node().descendants((m,g)=>{m.type.name===t&&d.push({node:m,pos:g})});const f=d.at(-1);if(!f)return!1;const h=e.state.doc.resolve(u.start()+f.pos+1);return e.chain().cut({from:a.start()-1,to:a.end()+1},h.end()).joinForward().run()}if(!Ls(e.state,t)||!fZ(e.state))return!1;const r=ld(t,e.state);if(!r)return!1;const o=e.state.doc.resolve(r.$pos.pos-2).node(r.depth),s=G6(t,e.state,o);return K6(t,e.state)&&!s?e.commands.joinItemBackward():e.chain().liftListItem(t).run()},Y6=(e,t)=>{const n=Fx(e,t),r=ld(e,t);return!r||!n?!1:n>r.depth},Q6=(e,t)=>{const n=Fx(e,t),r=ld(e,t);return!r||!n?!1:n<r.depth},ny=(e,t)=>{if(!Ls(e.state,t)||!dZ(e.state,t))return!1;const{selection:n}=e.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:Y6(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():Q6(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward()},fG=(e,t)=>{var n;const{$anchor:r}=t.selection,i=t.doc.resolve(r.pos-r.parentOffset-2);return!(i.index()===i.parent.childCount-1||((n=i.nodeAfter)==null?void 0:n.type.name)!==e)},X6=dn.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&ny(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&ny(e,n)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&ty(e,n,r)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&ty(e,n,r)&&(t=!0)}),t}}}}),oS=/^(\s*)(\d+)\.\s+(.*)$/,hG=/^\s/;function pG(e){const t=[];let n=0,r=0;for(;n<e.length;){const i=e[n],o=i.match(oS);if(!o)break;const[,s,a,u]=o,d=s.length;let f=u,h=n+1;const m=[i];for(;h<e.length;){const g=e[h];if(g.match(oS))break;if(g.trim()==="")m.push(g),f+=`
1350
+ `,h+=1;else if(g.match(hG))m.push(g),f+=`
1351
+ ${g.slice(d+2)}`,h+=1;else break}t.push({indent:d,number:parseInt(a,10),content:f.trim(),raw:m.join(`
1352
+ `)}),r=h,n=h}return[t,r]}function eA(e,t,n){var r;const i=[];let o=0;for(;o<e.length;){const s=e[o];if(s.indent===t){const a=s.content.split(`
1353
+ `),u=((r=a[0])==null?void 0:r.trim())||"",d=[];u&&d.push({type:"paragraph",raw:u,tokens:n.inlineTokens(u)});const f=a.slice(1).join(`
1354
+ `).trim();if(f){const g=n.blockTokens(f);d.push(...g)}let h=o+1;const m=[];for(;h<e.length&&e[h].indent>t;)m.push(e[h]),h+=1;if(m.length>0){const g=Math.min(...m.map(b=>b.indent)),x=eA(m,g,n);d.push({type:"list",ordered:!0,start:m[0].number,items:x,raw:m.map(b=>b.raw).join(`
1355
+ `)})}i.push({type:"list_item",raw:s.raw,tokens:d}),o=h}else o+=1}return i}function mG(e,t){return e.map(n=>{if(n.type!=="list_item")return t.parseChildren([n])[0];const r=[];return n.tokens&&n.tokens.length>0&&n.tokens.forEach(i=>{if(i.type==="paragraph"||i.type==="list"||i.type==="blockquote"||i.type==="code")r.push(...t.parseChildren([i]));else if(i.type==="text"&&i.tokens){const o=t.parseChildren([i]);r.push({type:"paragraph",content:o})}else{const o=t.parseChildren([i]);o.length>0&&r.push(...o)}}),{type:"listItem",content:r}})}var gG="listItem",sS="textStyle",aS=/^(\d+)\.\s$/,tA=Kt.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:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1},type:{default:null,parseHTML:e=>e.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return t===1?["ol",Dn(this.options.HTMLAttributes,n),0]:["ol",Dn(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(e,t)=>{if(e.type!=="list"||!e.ordered)return[];const n=e.start||1,r=e.items?mG(e.items,t):[];return n!==1?{type:"orderedList",attrs:{start:n},content:r}:{type:"orderedList",content:r}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
1356
+ `):"",markdownTokenizer:{name:"orderedList",level:"block",start:e=>{const t=e.match(/^(\s*)(\d+)\.\s+/),n=t==null?void 0:t.index;return n!==void 0?n:-1},tokenize:(e,t,n)=>{var r;const i=e.split(`
1357
+ `),[o,s]=pG(i);if(o.length===0)return;const a=eA(o,0,n);return a.length===0?void 0:{type:"list",ordered:!0,start:((r=o[0])==null?void 0:r.number)||1,items:a,raw:i.slice(0,s).join(`
1358
+ `)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(gG,this.editor.getAttributes(sS)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=ql({find:aS,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=ql({find:aS,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(sS)}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1],editor:this.editor})),[e]}}),yG=/^\s*(\[([( |x])?\])\s$/,xG=Kt.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{const t=e.getAttribute("data-checked");return t===""||t==="true"},renderHTML:e=>({"data-checked":e.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:e,HTMLAttributes:t}){return["li",Dn(this.options.HTMLAttributes,t,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:e.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(e,t)=>{const n=[];if(e.tokens&&e.tokens.length>0?n.push(t.createNode("paragraph",{},t.parseInline(e.tokens))):e.text?n.push(t.createNode("paragraph",{},[t.createNode("text",{text:e.text})])):n.push(t.createNode("paragraph",{},[])),e.nestedTokens&&e.nestedTokens.length>0){const r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode("taskItem",{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>{var n;const i=`- [${(n=e.attrs)!=null&&n.checked?"x":" "}] `;return Ax(e,t,i)},addKeyboardShortcuts(){const e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{const i=document.createElement("li"),o=document.createElement("label"),s=document.createElement("span"),a=document.createElement("input"),u=document.createElement("div"),d=h=>{var m,g;a.ariaLabel=((g=(m=this.options.a11y)==null?void 0:m.checkboxLabel)==null?void 0:g.call(m,h,a.checked))||`Task item checkbox for ${h.textContent||"empty task item"}`};d(e),o.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",h=>h.preventDefault()),a.addEventListener("change",h=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}const{checked:m}=h.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:g})=>{const x=n();if(typeof x!="number")return!1;const b=g.doc.nodeAt(x);return g.setNodeMarkup(x,void 0,{...b==null?void 0:b.attrs,checked:m}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,m)||(a.checked=!a.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([h,m])=>{i.setAttribute(h,m)}),i.dataset.checked=e.attrs.checked,a.checked=e.attrs.checked,o.append(a,s),i.append(o,u),Object.entries(t).forEach(([h,m])=>{i.setAttribute(h,m)});let f=new Set(Object.keys(t));return{dom:i,contentDOM:u,update:h=>{if(h.type!==this.type)return!1;i.dataset.checked=h.attrs.checked,a.checked=h.attrs.checked,d(h);const m=r.extensionManager.attributes,g=Hl(h,m),x=new Set(Object.keys(g)),b=this.options.HTMLAttributes;return f.forEach(v=>{x.has(v)||(v in b?i.setAttribute(v,b[v]):i.removeAttribute(v))}),Object.entries(g).forEach(([v,C])=>{C==null?v in b?i.setAttribute(v,b[v]):i.removeAttribute(v):i.setAttribute(v,C)}),f=x,!0}}}},addInputRules(){return[ql({find:yG,type:this.type,getAttributes:e=>({checked:e[e.length-1]==="x"})})]}}),bG=Kt.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return["ul",Dn(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:(e,t)=>t.createNode("taskList",{},t.parseChildren(e.items||[])),renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
1359
+ `):"",markdownTokenizer:{name:"taskList",level:"block",start(e){var t;const n=(t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:t.index;return n!==void 0?n:-1},tokenize(e,t,n){const r=o=>{const s=W1(o,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:a=>({indentLevel:a[1].length,mainContent:a[4],checked:a[3].toLowerCase()==="x"}),createToken:(a,u)=>({type:"taskItem",raw:"",mainContent:a.mainContent,indentLevel:a.indentLevel,checked:a.checked,text:a.mainContent,tokens:n.inlineTokens(a.mainContent),nestedTokens:u}),customNestedParser:r},n);return s?[{type:"taskList",raw:s.raw,items:s.items}]:n.blockTokens(o)},i=W1(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:o=>({indentLevel:o[1].length,mainContent:o[4],checked:o[3].toLowerCase()==="x"}),createToken:(o,s)=>({type:"taskItem",raw:"",mainContent:o.mainContent,indentLevel:o.indentLevel,checked:o.checked,text:o.mainContent,tokens:n.inlineTokens(o.mainContent),nestedTokens:s}),customNestedParser:r},n);if(i)return{type:"taskList",raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});dn.create({name:"listKit",addExtensions(){const e=[];return this.options.bulletList!==!1&&e.push(q6.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(Z6.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(X6.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(tA.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(xG.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(bG.configure(this.options.taskList)),e}});var lS="&nbsp;",vG=" ",kG=Kt.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",Dn(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{const n=e.tokens||[];if(n.length===1&&n[0].type==="image")return t.parseChildren([n[0]]);const r=t.parseInline(n);return r.length===1&&r[0].type==="text"&&(r[0].text===lS||r[0].text===vG)?t.createNode("paragraph",void 0,[]):t.createNode("paragraph",void 0,r)},renderMarkdown:(e,t)=>{if(!e)return"";const n=Array.isArray(e.content)?e.content:[];return n.length===0?lS:t.renderChildren(n)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),wG=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,CG=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,SG=ti.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["s",Dn(this.options.HTMLAttributes,e),0]},markdownTokenName:"del",parseMarkdown:(e,t)=>t.applyMark("strike",t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Wl({find:wG,type:this.type})]},addPasteRules(){return[Oa({find:CG,type:this.type})]}}),EG=Kt.create({name:"text",group:"inline",parseMarkdown:e=>({type:"text",text:e.text||""}),renderMarkdown:e=>e.text||""}),_G=ti.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["u",Dn(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||"underline",t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`++${t.renderChildren(e)}++`},markdownTokenizer:{name:"underline",level:"inline",start(e){return e.indexOf("++")},tokenize(e,t,n){const i=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!i)return;const o=i[2].trim();return{type:"underline",raw:i[0],text:o,tokens:n.inlineTokens(o)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function TG(e={}){return new mn({view(t){return new AG(t,e)}})}class AG{constructor(t,n){var r;this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let o=s=>{this[i](s)};return t.dom.addEventListener(i,o),{name:i,handler:o}})}destroy(){this.handlers.forEach(({name:t,handler:n})=>this.editorView.dom.removeEventListener(t,n))}update(t,n){this.cursorPos!=null&&n.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(t){t!=this.cursorPos&&(this.cursorPos=t,t==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let t=this.editorView.state.doc.resolve(this.cursorPos),n=!t.parent.inlineContent,r,i=this.editorView.dom,o=i.getBoundingClientRect(),s=o.width/i.offsetWidth,a=o.height/i.offsetHeight;if(n){let h=t.nodeBefore,m=t.nodeAfter;if(h||m){let g=this.editorView.nodeDOM(this.cursorPos-(h?h.nodeSize:0));if(g){let x=g.getBoundingClientRect(),b=h?x.bottom:x.top;h&&m&&(b=(b+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let v=this.width/2*a;r={left:x.left,right:x.right,top:b-v,bottom:b+v}}}}if(!r){let h=this.editorView.coordsAtPos(this.cursorPos),m=this.width/2*s;r={left:h.left-m,right:h.left+m,top:h.top,bottom:h.bottom}}let u=this.editorView.dom.offsetParent;this.element||(this.element=u.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 d,f;if(!u||u==document.body&&getComputedStyle(u).position=="static")d=-pageXOffset,f=-pageYOffset;else{let h=u.getBoundingClientRect(),m=h.width/u.offsetWidth,g=h.height/u.offsetHeight;d=h.left-u.scrollLeft*m,f=h.top-u.scrollTop*g}this.element.style.left=(r.left-d)/s+"px",this.element.style.top=(r.top-f)/a+"px",this.element.style.width=(r.right-r.left)/s+"px",this.element.style.height=(r.bottom-r.top)/a+"px"}scheduleRemoval(t){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),t)}dragover(t){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,o=typeof i=="function"?i(this.editorView,n,t):i;if(n&&!o){let s=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=Z4(this.editorView.state.doc,s,this.editorView.dragging.slice);a!=null&&(s=a)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(t){this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)}}class Cn extends At{constructor(t){super(t,t)}map(t,n){let r=t.resolve(n.map(this.head));return Cn.valid(r)?new Cn(r):At.near(r)}content(){return We.empty}eq(t){return t instanceof Cn&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Cn(t.resolve(n.pos))}getBookmark(){return new $x(this.anchor)}static valid(t){let n=t.parent;if(n.isTextblock||!MG(t)||!NG(t))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(t.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(t,n,r=!1){e:for(;;){if(!r&&Cn.valid(t))return t;let i=t.pos,o=null;for(let s=t.depth;;s--){let a=t.node(s);if(n>0?t.indexAfter(s)<a.childCount:t.index(s)>0){o=a.child(n>0?t.indexAfter(s):t.index(s)-1);break}else if(s==0)return null;i+=n;let u=t.doc.resolve(i);if(Cn.valid(u))return u}for(;;){let s=n>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!ut.isSelectable(o)){t=t.doc.resolve(i+o.nodeSize*n),r=!1;continue e}break}o=s,i+=n;let a=t.doc.resolve(i);if(Cn.valid(a))return a}return null}}}Cn.prototype.visible=!1;Cn.findFrom=Cn.findGapCursorFrom;At.jsonID("gapcursor",Cn);class $x{constructor(t){this.pos=t}map(t){return new $x(t.map(this.pos))}resolve(t){let n=t.resolve(this.pos);return Cn.valid(n)?new Cn(n):At.near(n)}}function nA(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function MG(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||nA(i.type))return!0;if(i.inlineContent)return!1}}return!0}function NG(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||nA(i.type))return!0;if(i.inlineContent)return!1}}return!0}function IG(){return new mn({props:{decorations:PG,createSelectionBetween(e,t,n){return t.pos==n.pos&&Cn.valid(n)?new Cn(n):null},handleClick:OG,handleKeyDown:DG,handleDOMEvents:{beforeinput:RG}}})}const DG=JT({ArrowLeft:Uf("horiz",-1),ArrowRight:Uf("horiz",1),ArrowUp:Uf("vert",-1),ArrowDown:Uf("vert",1)});function Uf(e,t){const n=e=="vert"?t>0?"down":"up":t>0?"right":"left";return function(r,i,o){let s=r.selection,a=t>0?s.$to:s.$from,u=s.empty;if(s instanceof yt){if(!o.endOfTextblock(n)||a.depth==0)return!1;u=!1,a=r.doc.resolve(t>0?a.after():a.before())}let d=Cn.findGapCursorFrom(a,t,u);return d?(i&&i(r.tr.setSelection(new Cn(d))),!0):!1}}function OG(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!Cn.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&ut.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new Cn(r))),!0)}function RG(e,t){if(t.inputType!="insertCompositionText"||!(e.state.selection instanceof Cn))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=fe.empty;for(let s=r.length-1;s>=0;s--)i=fe.from(r[s].createAndFill(null,i));let o=e.state.tr.replace(n.pos,n.pos,new We(i,0,0));return o.setSelection(yt.near(o.doc.resolve(n.pos+1))),e.dispatch(o),!1}function PG(e){if(!(e.selection instanceof Cn))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",bn.create(e.doc,[br.widget(e.selection.head,t,{key:"gapcursor"})])}var dp=200,Kn=function(){};Kn.prototype.append=function(t){return t.length?(t=Kn.from(t),!this.length&&t||t.length<dp&&this.leafAppend(t)||this.length<dp&&t.leafPrepend(this)||this.appendInner(t)):this};Kn.prototype.prepend=function(t){return t.length?Kn.from(t).append(this):this};Kn.prototype.appendInner=function(t){return new jG(this,t)};Kn.prototype.slice=function(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.length),t>=n?Kn.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))};Kn.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};Kn.prototype.forEach=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(t,n,r,0):this.forEachInvertedInner(t,n,r,0)};Kn.prototype.map=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(t(o,s))},n,r),i};Kn.from=function(t){return t instanceof Kn?t:t&&t.length?new rA(t):Kn.empty};var rA=(function(e){function t(r){e.call(this),this.values=r}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new t(this.values.slice(i,o))},t.prototype.getInner=function(i){return this.values[i]},t.prototype.forEachInner=function(i,o,s,a){for(var u=o;u<s;u++)if(i(this.values[u],a+u)===!1)return!1},t.prototype.forEachInvertedInner=function(i,o,s,a){for(var u=o-1;u>=s;u--)if(i(this.values[u],a+u)===!1)return!1},t.prototype.leafAppend=function(i){if(this.length+i.length<=dp)return new t(this.values.concat(i.flatten()))},t.prototype.leafPrepend=function(i){if(this.length+i.length<=dp)return new t(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t})(Kn);Kn.empty=new rA([]);var jG=(function(e){function t(n,r){e.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},t.prototype.forEachInner=function(r,i,o,s){var a=this.left.length;if(i<a&&this.left.forEachInner(r,i,Math.min(o,a),s)===!1||o>a&&this.right.forEachInner(r,Math.max(i-a,0),Math.min(this.length,o)-a,s+a)===!1)return!1},t.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<a&&this.left.forEachInvertedInner(r,Math.min(i,a),o,s)===!1)return!1},t.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(r,i):r>=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},t.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new t(this.left,i)},t.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new t(i,this.right)},t.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new t(this.left,new t(this.right,r)):new t(this,r)},t})(Kn);const zG=500;class ji{constructor(t,n){this.items=t,this.eventCount=n}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=t.tr,a,u,d=[],f=[];return this.items.forEach((h,m)=>{if(!h.step){i||(i=this.remapping(r,m+1),o=i.maps.length),o--,f.push(h);return}if(i){f.push(new Ki(h.map));let g=h.step.map(i.slice(o)),x;g&&s.maybeStep(g).doc&&(x=s.mapping.maps[s.mapping.maps.length-1],d.push(new Ki(x,void 0,void 0,d.length+f.length))),o--,x&&i.appendMap(x,o)}else s.maybeStep(h.step);if(h.selection)return a=i?h.selection.map(i.slice(o)):h.selection,u=new ji(this.items.slice(0,r).append(f.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:u,transform:s,selection:a}}addTransform(t,n,r,i){let o=[],s=this.eventCount,a=this.items,u=!i&&a.length?a.get(a.length-1):null;for(let f=0;f<t.steps.length;f++){let h=t.steps[f].invert(t.docs[f]),m=new Ki(t.mapping.maps[f],h,n),g;(g=u&&u.merge(m))&&(m=g,f?o.pop():a=a.slice(0,a.length-1)),o.push(m),n&&(s++,n=void 0),i||(u=m)}let d=s-r.depth;return d>FG&&(a=LG(a,d),s-=d),new ji(a.append(o),s)}remapping(t,n){let r=new jc;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=t?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},t,n),r}addMaps(t){return this.eventCount==0?this:new ji(this.items.append(t.map(n=>new Ki(n))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=t.mapping,s=t.steps.length,a=this.eventCount;this.items.forEach(m=>{m.selection&&a--},i);let u=n;this.items.forEach(m=>{let g=o.getMirror(--u);if(g==null)return;s=Math.min(s,g);let x=o.maps[g];if(m.step){let b=t.steps[g].invert(t.docs[g]),v=m.selection&&m.selection.map(o.slice(u+1,g));v&&a++,r.push(new Ki(x,b,v))}else r.push(new Ki(x))},i);let d=[];for(let m=n;m<s;m++)d.push(new Ki(o.maps[m]));let f=this.items.slice(0,i).append(d).append(r),h=new ji(f,a);return h.emptyItemCount()>zG&&(h=h.compress(this.items.length-r.length)),h}emptyItemCount(){let t=0;return this.items.forEach(n=>{n.step||t++}),t}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],o=0;return this.items.forEach((s,a)=>{if(a>=t)i.push(s),s.selection&&o++;else if(s.step){let u=s.step.map(n.slice(r)),d=u&&u.getMap();if(r--,d&&n.appendMap(d,r),u){let f=s.selection&&s.selection.map(n.slice(r));f&&o++;let h=new Ki(d.invert(),u,f),m,g=i.length-1;(m=i.length&&i[g].merge(h))?i[g]=m:i.push(h)}}else s.map&&r--},this.items.length,0),new ji(Kn.from(i.reverse()),o)}}ji.empty=new ji(Kn.empty,0);function LG(e,t){let n;return e.forEach((r,i)=>{if(r.selection&&t--==0)return n=i,!1}),e.slice(n)}class Ki{constructor(t,n,r,i){this.map=t,this.step=n,this.selection=r,this.mirrorOffset=i}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new Ki(n.getMap().invert(),n,this.selection)}}}class ys{constructor(t,n,r,i,o){this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const FG=20;function $G(e,t,n,r){let i=n.getMeta(Ca),o;if(i)return i.historyState;n.getMeta(VG)&&(e=new ys(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return e;if(s&&s.getMeta(Ca))return s.getMeta(Ca).redo?new ys(e.done.addTransform(n,void 0,r,eh(t)),e.undone,uS(n.mapping.maps),e.prevTime,e.prevComposition):new ys(e.done,e.undone.addTransform(n,void 0,r,eh(t)),null,e.prevTime,e.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),u=e.prevTime==0||!s&&e.prevComposition!=a&&(e.prevTime<(n.time||0)-r.newGroupDelay||!BG(n,e.prevRanges)),d=s?jg(e.prevRanges,n.mapping):uS(n.mapping.maps);return new ys(e.done.addTransform(n,u?t.selection.getBookmark():void 0,r,eh(t)),ji.empty,d,n.time,a??e.prevComposition)}else return(o=n.getMeta("rebased"))?new ys(e.done.rebased(n,o),e.undone.rebased(n,o),jg(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new ys(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),jg(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function BG(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((r,i)=>{for(let o=0;o<t.length;o+=2)r<=t[o+1]&&i>=t[o]&&(n=!0)}),n}function uS(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((r,i,o,s)=>t.push(o,s));return t}function jg(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),o=t.map(e[r+1],-1);i<=o&&n.push(i,o)}return n}function UG(e,t,n){let r=eh(t),i=Ca.get(t).spec.config,o=(n?e.undone:e.done).popEvent(t,r);if(!o)return null;let s=o.selection.resolve(o.transform.doc),a=(n?e.done:e.undone).addTransform(o.transform,t.selection.getBookmark(),i,r),u=new ys(n?a:o.remaining,n?o.remaining:a,null,0,-1);return o.transform.setSelection(s).setMeta(Ca,{redo:n,historyState:u})}let zg=!1,cS=null;function eh(e){let t=e.plugins;if(cS!=t){zg=!1,cS=t;for(let n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){zg=!0;break}}return zg}const Ca=new Rn("history"),VG=new Rn("closeHistory");function HG(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new mn({key:Ca,state:{init(){return new ys(ji.empty,ji.empty,null,0,-1)},apply(t,n,r){return $G(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(t,n){let r=n.inputType,i=r=="historyUndo"?oA:r=="historyRedo"?sA:null;return!i||!t.editable?!1:(n.preventDefault(),i(t.state,t.dispatch))}}}})}function iA(e,t){return(n,r)=>{let i=Ca.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let o=UG(i,n,e);o&&r(t?o.scrollIntoView():o)}return!0}}const oA=iA(!1,!0),sA=iA(!0,!0);dn.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:e=>e.length,wordCounter:e=>e.split(" ").filter(t=>t!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{const t=(e==null?void 0:e.node)||this.editor.state.doc;if(((e==null?void 0:e.mode)||this.options.mode)==="textSize"){const r=t.textBetween(0,t.content.size,void 0," ");return this.options.textCounter(r)}return t.nodeSize},this.storage.words=e=>{const t=(e==null?void 0:e.node)||this.editor.state.doc,n=t.textBetween(0,t.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new mn({key:new Rn("characterCount"),appendTransaction:(t,n,r)=>{if(e)return;const i=this.options.limit;if(i==null||i===0){e=!0;return}const o=this.storage.characters({node:r.doc});if(o>i){const s=o-i,a=0,u=s;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);const d=r.tr.deleteRange(a,u);return e=!0,d}e=!0},filterTransaction:(t,n)=>{const r=this.options.limit;if(!t.docChanged||r===0||r===null||r===void 0)return!0;const i=this.storage.characters({node:n.doc}),o=this.storage.characters({node:t.doc});if(o<=r||i>r&&o>r&&o<=i)return!0;if(i>r&&o>r&&o>i||!t.getMeta("paste"))return!1;const a=t.selection.$head.pos,u=o-r,d=a-u,f=a;return t.deleteRange(d,f),!(this.storage.characters({node:t.doc})>r)}})]}});var WG=dn.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[TG(this.options)]}});dn.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new mn({key:new Rn("focus"),props:{decorations:({doc:e,selection:t})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,o=[];if(!n||!r)return bn.create(e,[]);let s=0;this.options.mode==="deepest"&&e.descendants((u,d)=>{if(u.isText)return;if(!(i>=d&&i<=d+u.nodeSize-1))return!1;s+=1});let a=0;return e.descendants((u,d)=>{if(u.isText||!(i>=d&&i<=d+u.nodeSize-1))return!1;if(a+=1,this.options.mode==="deepest"&&s-a>0||this.options.mode==="shallowest"&&a>1)return this.options.mode==="deepest";o.push(br.node(d,d+u.nodeSize,{class:this.options.className}))}),bn.create(e,o)}}})]}});var qG=dn.create({name:"gapCursor",addProseMirrorPlugins(){return[IG()]},extendNodeSchema(e){var t;const n={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:(t=Zt(lt(e,"allowGapCursor",n)))!=null?t:null}}}),dS="placeholder";function ZG(e){return e.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}var JG=dn.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:dS,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){const e=this.options.dataAttribute?`data-${ZG(this.options.dataAttribute)}`:`data-${dS}`;return[new mn({key:new Rn("placeholder"),props:{decorations:({doc:t,selection:n})=>{const r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=n,o=[];if(!r)return null;const s=this.editor.isEmpty;return t.descendants((a,u)=>{const d=i>=u&&i<=u+a.nodeSize,f=!a.isLeaf&&Bp(a);if((d||!this.options.showOnlyCurrent)&&f){const h=[this.options.emptyNodeClass];s&&h.push(this.options.emptyEditorClass);const m=br.node(u,u+a.nodeSize,{class:h.join(" "),[e]:typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:a,pos:u,hasAnchor:d}):this.options.placeholder});o.push(m)}return this.options.includeChildren}),bn.create(t,o)}}})]}});dn.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:e,options:t}=this;return[new mn({key:new Rn("selection"),props:{decorations(n){return n.selection.empty||e.isFocused||!e.isEditable||c6(n.selection)||e.view.dragging?null:bn.create(n.doc,[br.inline(n.selection.from,n.selection.to,{class:t.className})])}}})]}});function fS({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||(t==null?void 0:t.type)===e}var KG=dn.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var e;const t=new Rn(this.name),n=this.options.node||((e=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:e.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,i])=>i).filter(i=>(this.options.notAfter||[]).concat(n).includes(i.name));return[new mn({key:t,appendTransaction:(i,o,s)=>{const{doc:a,tr:u,schema:d}=s,f=t.getState(s),h=a.content.size,m=d.nodes[n];if(f)return u.insert(h,m.create())},state:{init:(i,o)=>{const s=o.tr.doc.lastChild;return!fS({node:s,types:r})},apply:(i,o)=>{if(!i.docChanged||i.getMeta("__uniqueIDTransaction"))return o;const s=i.doc.lastChild;return!fS({node:s,types:r})}}})]}}),GG=dn.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>oA(e,t),redo:()=>({state:e,dispatch:t})=>sA(e,t)}},addProseMirrorPlugins(){return[HG(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()}}}),YG=dn.create({name:"starterKit",addExtensions(){var e,t,n,r;const i=[];return this.options.bold!==!1&&i.push(kK.configure(this.options.bold)),this.options.blockquote!==!1&&i.push(gK.configure(this.options.blockquote)),this.options.bulletList!==!1&&i.push(q6.configure(this.options.bulletList)),this.options.code!==!1&&i.push(SK.configure(this.options.code)),this.options.codeBlock!==!1&&i.push(TK.configure(this.options.codeBlock)),this.options.document!==!1&&i.push(AK.configure(this.options.document)),this.options.dropcursor!==!1&&i.push(WG.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&i.push(qG.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&i.push(MK.configure(this.options.hardBreak)),this.options.heading!==!1&&i.push(NK.configure(this.options.heading)),this.options.undoRedo!==!1&&i.push(GG.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&i.push(IK.configure(this.options.horizontalRule)),this.options.italic!==!1&&i.push(jK.configure(this.options.italic)),this.options.listItem!==!1&&i.push(Z6.configure(this.options.listItem)),this.options.listKeymap!==!1&&i.push(X6.configure((e=this.options)==null?void 0:e.listKeymap)),this.options.link!==!1&&i.push(aG.configure((t=this.options)==null?void 0:t.link)),this.options.orderedList!==!1&&i.push(tA.configure(this.options.orderedList)),this.options.paragraph!==!1&&i.push(kG.configure(this.options.paragraph)),this.options.strike!==!1&&i.push(SG.configure(this.options.strike)),this.options.text!==!1&&i.push(EG.configure(this.options.text)),this.options.underline!==!1&&i.push(_G.configure((n=this.options)==null?void 0:n.underline)),this.options.trailingNode!==!1&&i.push(KG.configure((r=this.options)==null?void 0:r.trailingNode)),i}}),QG=YG,XG=JG,eY=e=>Sn({find:/--$/,replace:e??"—"}),tY=e=>Sn({find:/\.\.\.$/,replace:e??"…"}),nY=e=>Sn({find:/(?:^|[\s{[(<'"\u2018\u201C])(")$/,replace:e??"“"}),rY=e=>Sn({find:/"$/,replace:e??"”"}),iY=e=>Sn({find:/(?:^|[\s{[(<'"\u2018\u201C])(')$/,replace:e??"‘"}),oY=e=>Sn({find:/'$/,replace:e??"’"}),sY=e=>Sn({find:/<-$/,replace:e??"←"}),aY=e=>Sn({find:/->$/,replace:e??"→"}),lY=e=>Sn({find:/\(c\)$/,replace:e??"©"}),uY=e=>Sn({find:/\(tm\)$/,replace:e??"™"}),cY=e=>Sn({find:/\(sm\)$/,replace:e??"℠"}),dY=e=>Sn({find:/\(r\)$/,replace:e??"®"}),fY=e=>Sn({find:/(?:^|\s)(1\/2)\s$/,replace:e??"½"}),hY=e=>Sn({find:/\+\/-$/,replace:e??"±"}),pY=e=>Sn({find:/!=$/,replace:e??"≠"}),mY=e=>Sn({find:/<<$/,replace:e??"«"}),gY=e=>Sn({find:/>>$/,replace:e??"»"}),yY=e=>Sn({find:/\d+\s?([*x])\s?\d+$/,replace:e??"×"}),xY=e=>Sn({find:/\^2$/,replace:e??"²"}),bY=e=>Sn({find:/\^3$/,replace:e??"³"}),vY=e=>Sn({find:/(?:^|\s)(1\/4)\s$/,replace:e??"¼"}),kY=e=>Sn({find:/(?:^|\s)(3\/4)\s$/,replace:e??"¾"}),wY=dn.create({name:"typography",addOptions(){return{closeDoubleQuote:"”",closeSingleQuote:"’",copyright:"©",ellipsis:"…",emDash:"—",laquo:"«",leftArrow:"←",multiplication:"×",notEqual:"≠",oneHalf:"½",oneQuarter:"¼",openDoubleQuote:"“",openSingleQuote:"‘",plusMinus:"±",raquo:"»",registeredTrademark:"®",rightArrow:"→",servicemark:"℠",superscriptThree:"³",superscriptTwo:"²",threeQuarters:"¾",trademark:"™"}},addInputRules(){const e=[];return this.options.emDash!==!1&&e.push(eY(this.options.emDash)),this.options.ellipsis!==!1&&e.push(tY(this.options.ellipsis)),this.options.openDoubleQuote!==!1&&e.push(nY(this.options.openDoubleQuote)),this.options.closeDoubleQuote!==!1&&e.push(rY(this.options.closeDoubleQuote)),this.options.openSingleQuote!==!1&&e.push(iY(this.options.openSingleQuote)),this.options.closeSingleQuote!==!1&&e.push(oY(this.options.closeSingleQuote)),this.options.leftArrow!==!1&&e.push(sY(this.options.leftArrow)),this.options.rightArrow!==!1&&e.push(aY(this.options.rightArrow)),this.options.copyright!==!1&&e.push(lY(this.options.copyright)),this.options.trademark!==!1&&e.push(uY(this.options.trademark)),this.options.servicemark!==!1&&e.push(cY(this.options.servicemark)),this.options.registeredTrademark!==!1&&e.push(dY(this.options.registeredTrademark)),this.options.oneHalf!==!1&&e.push(fY(this.options.oneHalf)),this.options.plusMinus!==!1&&e.push(hY(this.options.plusMinus)),this.options.notEqual!==!1&&e.push(pY(this.options.notEqual)),this.options.laquo!==!1&&e.push(mY(this.options.laquo)),this.options.raquo!==!1&&e.push(gY(this.options.raquo)),this.options.multiplication!==!1&&e.push(yY(this.options.multiplication)),this.options.superscriptTwo!==!1&&e.push(xY(this.options.superscriptTwo)),this.options.superscriptThree!==!1&&e.push(bY(this.options.superscriptThree)),this.options.oneQuarter!==!1&&e.push(vY(this.options.oneQuarter)),this.options.threeQuarters!==!1&&e.push(kY(this.options.threeQuarters)),e}}),CY=wY;const hS={};function SY(e){let t=hS[e];if(t)return t;t=hS[e]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);t.push(r)}for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);t[r]="%"+("0"+r.toString(16).toUpperCase()).slice(-2)}return t}function Zl(e,t){typeof t!="string"&&(t=Zl.defaultChars);const n=SY(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(r){let i="";for(let o=0,s=r.length;o<s;o+=3){const a=parseInt(r.slice(o+1,o+3),16);if(a<128){i+=n[a];continue}if((a&224)===192&&o+3<s){const u=parseInt(r.slice(o+4,o+6),16);if((u&192)===128){const d=a<<6&1984|u&63;d<128?i+="��":i+=String.fromCharCode(d),o+=3;continue}}if((a&240)===224&&o+6<s){const u=parseInt(r.slice(o+4,o+6),16),d=parseInt(r.slice(o+7,o+9),16);if((u&192)===128&&(d&192)===128){const f=a<<12&61440|u<<6&4032|d&63;f<2048||f>=55296&&f<=57343?i+="���":i+=String.fromCharCode(f),o+=6;continue}}if((a&248)===240&&o+9<s){const u=parseInt(r.slice(o+4,o+6),16),d=parseInt(r.slice(o+7,o+9),16),f=parseInt(r.slice(o+10,o+12),16);if((u&192)===128&&(d&192)===128&&(f&192)===128){let h=a<<18&1835008|u<<12&258048|d<<6&4032|f&63;h<65536||h>1114111?i+="����":(h-=65536,i+=String.fromCharCode(55296+(h>>10),56320+(h&1023))),o+=9;continue}}i+="�"}return i})}Zl.defaultChars=";/?:@&=+$,#";Zl.componentChars="";const pS={};function EY(e){let t=pS[e];if(t)return t;t=pS[e]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);/^[0-9a-z]$/i.test(r)?t.push(r):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function ud(e,t,n){typeof t!="string"&&(n=t,t=ud.defaultChars),typeof n>"u"&&(n=!0);const r=EY(t);let i="";for(let o=0,s=e.length;o<s;o++){const a=e.charCodeAt(o);if(n&&a===37&&o+2<s&&/^[0-9a-f]{2}$/i.test(e.slice(o+1,o+3))){i+=e.slice(o,o+3),o+=2;continue}if(a<128){i+=r[a];continue}if(a>=55296&&a<=57343){if(a>=55296&&a<=56319&&o+1<s){const u=e.charCodeAt(o+1);if(u>=56320&&u<=57343){i+=encodeURIComponent(e[o]+e[o+1]),o++;continue}}i+="%EF%BF%BD";continue}i+=encodeURIComponent(e[o])}return i}ud.defaultChars=";/?:@&=+$,-_.!~*'()#";ud.componentChars="-_.!~*'()";function Bx(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function fp(){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 _Y=/^([a-z0-9.+-]+:)/i,TY=/:[0-9]*$/,AY=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,MY=["<",">",'"',"`"," ","\r",`
1360
+ `," "],NY=["{","}","|","\\","^","`"].concat(MY),IY=["'"].concat(NY),mS=["%","/","?",";","#"].concat(IY),gS=["/","?","#"],DY=255,yS=/^[+a-z0-9A-Z_-]{0,63}$/,OY=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,xS={javascript:!0,"javascript:":!0},bS={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Ux(e,t){if(e&&e instanceof fp)return e;const n=new fp;return n.parse(e,t),n}fp.prototype.parse=function(e,t){let n,r,i,o=e;if(o=o.trim(),!t&&e.split("#").length===1){const d=AY.exec(o);if(d)return this.pathname=d[1],d[2]&&(this.search=d[2]),this}let s=_Y.exec(o);if(s&&(s=s[0],n=s.toLowerCase(),this.protocol=s,o=o.substr(s.length)),(t||s||o.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i=o.substr(0,2)==="//",i&&!(s&&xS[s])&&(o=o.substr(2),this.slashes=!0)),!xS[s]&&(i||s&&!bS[s])){let d=-1;for(let x=0;x<gS.length;x++)r=o.indexOf(gS[x]),r!==-1&&(d===-1||r<d)&&(d=r);let f,h;d===-1?h=o.lastIndexOf("@"):h=o.lastIndexOf("@",d),h!==-1&&(f=o.slice(0,h),o=o.slice(h+1),this.auth=f),d=-1;for(let x=0;x<mS.length;x++)r=o.indexOf(mS[x]),r!==-1&&(d===-1||r<d)&&(d=r);d===-1&&(d=o.length),o[d-1]===":"&&d--;const m=o.slice(0,d);o=o.slice(d),this.parseHost(m),this.hostname=this.hostname||"";const g=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!g){const x=this.hostname.split(/\./);for(let b=0,v=x.length;b<v;b++){const C=x[b];if(C&&!C.match(yS)){let _="";for(let E=0,I=C.length;E<I;E++)C.charCodeAt(E)>127?_+="x":_+=C[E];if(!_.match(yS)){const E=x.slice(0,b),I=x.slice(b+1),N=C.match(OY);N&&(E.push(N[1]),I.unshift(N[2])),I.length&&(o=I.join(".")+o),this.hostname=E.join(".");break}}}}this.hostname.length>DY&&(this.hostname=""),g&&(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 u=o.indexOf("?");return u!==-1&&(this.search=o.substr(u),o=o.slice(0,u)),o&&(this.pathname=o),bS[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};fp.prototype.parseHost=function(e){let t=TY.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};const RY=Object.freeze(Object.defineProperty({__proto__:null,decode:Zl,encode:ud,format:Bx,parse:Ux},Symbol.toStringTag,{value:"Module"})),aA=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,lA=/[\0-\x1F\x7F-\x9F]/,PY=/[\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]/,Vx=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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]/,uA=/[\$\+<->\^`\|~\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]/,cA=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,jY=Object.freeze(Object.defineProperty({__proto__:null,Any:aA,Cc:lA,Cf:PY,P:Vx,S:uA,Z:cA},Symbol.toStringTag,{value:"Module"})),zY=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(e=>e.charCodeAt(0))),LY=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0)));var Lg;const FY=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]]),$Y=(Lg=String.fromCodePoint)!==null&&Lg!==void 0?Lg:function(e){let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function BY(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=FY.get(e))!==null&&t!==void 0?t:e}var Zn;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(Zn||(Zn={}));const UY=32;var _s;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(_s||(_s={}));function ry(e){return e>=Zn.ZERO&&e<=Zn.NINE}function VY(e){return e>=Zn.UPPER_A&&e<=Zn.UPPER_F||e>=Zn.LOWER_A&&e<=Zn.LOWER_F}function HY(e){return e>=Zn.UPPER_A&&e<=Zn.UPPER_Z||e>=Zn.LOWER_A&&e<=Zn.LOWER_Z||ry(e)}function WY(e){return e===Zn.EQUALS||HY(e)}var Wn;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(Wn||(Wn={}));var ws;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(ws||(ws={}));class qY{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=Wn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=ws.Strict}startEntity(t){this.decodeMode=t,this.state=Wn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case Wn.EntityStart:return t.charCodeAt(n)===Zn.NUM?(this.state=Wn.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=Wn.NamedEntity,this.stateNamedEntity(t,n));case Wn.NumericStart:return this.stateNumericStart(t,n);case Wn.NumericDecimal:return this.stateNumericDecimal(t,n);case Wn.NumericHex:return this.stateNumericHex(t,n);case Wn.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|UY)===Zn.LOWER_X?(this.state=Wn.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=Wn.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,i){if(n!==r){const o=r-n;this.result=this.result*Math.pow(i,o)+parseInt(t.substr(n,o),i),this.consumed+=o}}stateNumericHex(t,n){const r=n;for(;n<t.length;){const i=t.charCodeAt(n);if(ry(i)||VY(i))n+=1;else return this.addToNumericResult(t,r,n,16),this.emitNumericEntity(i,3)}return this.addToNumericResult(t,r,n,16),-1}stateNumericDecimal(t,n){const r=n;for(;n<t.length;){const i=t.charCodeAt(n);if(ry(i))n+=1;else return this.addToNumericResult(t,r,n,10),this.emitNumericEntity(i,2)}return this.addToNumericResult(t,r,n,10),-1}emitNumericEntity(t,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===Zn.SEMI)this.consumed+=1;else if(this.decodeMode===ws.Strict)return 0;return this.emitCodePoint(BY(this.result),this.consumed),this.errors&&(t!==Zn.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let i=r[this.treeIndex],o=(i&_s.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const s=t.charCodeAt(n);if(this.treeIndex=ZY(r,i,this.treeIndex+Math.max(1,o),s),this.treeIndex<0)return this.result===0||this.decodeMode===ws.Attribute&&(o===0||WY(s))?0:this.emitNotTerminatedNamedEntity();if(i=r[this.treeIndex],o=(i&_s.VALUE_LENGTH)>>14,o!==0){if(s===Zn.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==ws.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,i=(r[n]&_s.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[t]&~_s.VALUE_LENGTH:i[t+1],r),n===3&&this.emitCodePoint(i[t+2],r),r}end(){var t;switch(this.state){case Wn.NamedEntity:return this.result!==0&&(this.decodeMode!==ws.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Wn.NumericDecimal:return this.emitNumericEntity(0,2);case Wn.NumericHex:return this.emitNumericEntity(0,3);case Wn.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Wn.EntityStart:return 0}}}function dA(e){let t="";const n=new qY(e,r=>t+=$Y(r));return function(i,o){let s=0,a=0;for(;(a=i.indexOf("&",a))>=0;){t+=i.slice(s,a),n.startEntity(o);const d=n.write(i,a+1);if(d<0){s=a+n.end();break}s=a+d,a=d===0?s+1:s}const u=t+i.slice(s);return t="",u}}function ZY(e,t,n,r){const i=(t&_s.BRANCH_LENGTH)>>7,o=t&_s.JUMP_TABLE;if(i===0)return o!==0&&r===o?n:-1;if(o){const u=r-o;return u<0||u>=i?-1:e[n+u]-1}let s=n,a=s+i-1;for(;s<=a;){const u=s+a>>>1,d=e[u];if(d<r)s=u+1;else if(d>r)a=u-1;else return e[u+i]}return-1}const JY=dA(zY);dA(LY);function fA(e,t=ws.Legacy){return JY(e,t)}function KY(e){return Object.prototype.toString.call(e)}function Hx(e){return KY(e)==="[object String]"}const GY=Object.prototype.hasOwnProperty;function YY(e,t){return GY.call(e,t)}function Hp(e){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){e[r]=n[r]})}}),e}function hA(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function Wx(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function hp(e){if(e>65535){e-=65536;const t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}const pA=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,QY=/&([a-z#][a-z0-9]{1,31});/gi,XY=new RegExp(pA.source+"|"+QY.source,"gi"),eQ=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function tQ(e,t){if(t.charCodeAt(0)===35&&eQ.test(t)){const r=t[1].toLowerCase()==="x"?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return Wx(r)?hp(r):e}const n=fA(e);return n!==e?n:e}function nQ(e){return e.indexOf("\\")<0?e:e.replace(pA,"$1")}function Jl(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(XY,function(t,n,r){return n||tQ(t,r)})}const rQ=/[&<>"]/,iQ=/[&<>"]/g,oQ={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function sQ(e){return oQ[e]}function Fs(e){return rQ.test(e)?e.replace(iQ,sQ):e}const aQ=/[.?*+^$[\]\\(){}|-]/g;function lQ(e){return e.replace(aQ,"\\$&")}function nn(e){switch(e){case 9:case 32:return!0}return!1}function Wc(e){if(e>=8192&&e<=8202)return!0;switch(e){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 qc(e){return Vx.test(e)||uA.test(e)}function Zc(e){switch(e){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 Wp(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}const uQ={mdurl:RY,ucmicro:jY},cQ=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:hA,assign:Hp,escapeHtml:Fs,escapeRE:lQ,fromCodePoint:hp,has:YY,isMdAsciiPunct:Zc,isPunctChar:qc,isSpace:nn,isString:Hx,isValidEntityCode:Wx,isWhiteSpace:Wc,lib:uQ,normalizeReference:Wp,unescapeAll:Jl,unescapeMd:nQ},Symbol.toStringTag,{value:"Module"}));function dQ(e,t,n){let r,i,o,s;const a=e.posMax,u=e.pos;for(e.pos=t+1,r=1;e.pos<a;){if(o=e.src.charCodeAt(e.pos),o===93&&(r--,r===0)){i=!0;break}if(s=e.pos,e.md.inline.skipToken(e),o===91){if(s===e.pos-1)r++;else if(n)return e.pos=u,-1}}let d=-1;return i&&(d=e.pos),e.pos=u,d}function fQ(e,t,n){let r,i=t;const o={ok:!1,pos:0,str:""};if(e.charCodeAt(i)===60){for(i++;i<n;){if(r=e.charCodeAt(i),r===10||r===60)return o;if(r===62)return o.pos=i+1,o.str=Jl(e.slice(t+1,i)),o.ok=!0,o;if(r===92&&i+1<n){i+=2;continue}i++}return o}let s=0;for(;i<n&&(r=e.charCodeAt(i),!(r===32||r<32||r===127));){if(r===92&&i+1<n){if(e.charCodeAt(i+1)===32)break;i+=2;continue}if(r===40&&(s++,s>32))return o;if(r===41){if(s===0)break;s--}i++}return t===i||s!==0||(o.str=Jl(e.slice(t,i)),o.pos=i,o.ok=!0),o}function hQ(e,t,n,r){let i,o=t;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=e.charCodeAt(o);if(a!==34&&a!==39&&a!==40)return s;t++,o++,a===40&&(a=41),s.marker=a}for(;o<n;){if(i=e.charCodeAt(o),i===s.marker)return s.pos=o+1,s.str+=Jl(e.slice(t,o)),s.ok=!0,s;if(i===40&&s.marker===41)return s;i===92&&o+1<n&&o++,o++}return s.can_continue=!0,s.str+=Jl(e.slice(t,o)),s}const pQ=Object.freeze(Object.defineProperty({__proto__:null,parseLinkDestination:fQ,parseLinkLabel:dQ,parseLinkTitle:hQ},Symbol.toStringTag,{value:"Module"})),so={};so.code_inline=function(e,t,n,r,i){const o=e[t];return"<code"+i.renderAttrs(o)+">"+Fs(o.content)+"</code>"};so.code_block=function(e,t,n,r,i){const o=e[t];return"<pre"+i.renderAttrs(o)+"><code>"+Fs(e[t].content)+`</code></pre>
1361
+ `};so.fence=function(e,t,n,r,i){const o=e[t],s=o.info?Jl(o.info).trim():"";let a="",u="";if(s){const f=s.split(/(\s+)/g);a=f[0],u=f.slice(2).join("")}let d;if(n.highlight?d=n.highlight(o.content,a,u)||Fs(o.content):d=Fs(o.content),d.indexOf("<pre")===0)return d+`
1362
+ `;if(s){const f=o.attrIndex("class"),h=o.attrs?o.attrs.slice():[];f<0?h.push(["class",n.langPrefix+a]):(h[f]=h[f].slice(),h[f][1]+=" "+n.langPrefix+a);const m={attrs:h};return`<pre><code${i.renderAttrs(m)}>${d}</code></pre>
1363
+ `}return`<pre><code${i.renderAttrs(o)}>${d}</code></pre>
1364
+ `};so.image=function(e,t,n,r,i){const o=e[t];return o.attrs[o.attrIndex("alt")][1]=i.renderInlineAsText(o.children,n,r),i.renderToken(e,t,n)};so.hardbreak=function(e,t,n){return n.xhtmlOut?`<br />
1365
+ `:`<br>
1366
+ `};so.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?`<br />
1367
+ `:`<br>
1368
+ `:`
1369
+ `};so.text=function(e,t){return Fs(e[t].content)};so.html_block=function(e,t){return e[t].content};so.html_inline=function(e,t){return e[t].content};function eu(){this.rules=Hp({},so)}eu.prototype.renderAttrs=function(t){let n,r,i;if(!t.attrs)return"";for(i="",n=0,r=t.attrs.length;n<r;n++)i+=" "+Fs(t.attrs[n][0])+'="'+Fs(t.attrs[n][1])+'"';return i};eu.prototype.renderToken=function(t,n,r){const i=t[n];let o="";if(i.hidden)return"";i.block&&i.nesting!==-1&&n&&t[n-1].hidden&&(o+=`
1370
+ `),o+=(i.nesting===-1?"</":"<")+i.tag,o+=this.renderAttrs(i),i.nesting===0&&r.xhtmlOut&&(o+=" /");let s=!1;if(i.block&&(s=!0,i.nesting===1&&n+1<t.length)){const a=t[n+1];(a.type==="inline"||a.hidden||a.nesting===-1&&a.tag===i.tag)&&(s=!1)}return o+=s?`>
1371
+ `:">",o};eu.prototype.renderInline=function(e,t,n){let r="";const i=this.rules;for(let o=0,s=e.length;o<s;o++){const a=e[o].type;typeof i[a]<"u"?r+=i[a](e,o,t,n,this):r+=this.renderToken(e,o,t)}return r};eu.prototype.renderInlineAsText=function(e,t,n){let r="";for(let i=0,o=e.length;i<o;i++)switch(e[i].type){case"text":r+=e[i].content;break;case"image":r+=this.renderInlineAsText(e[i].children,t,n);break;case"html_inline":case"html_block":r+=e[i].content;break;case"softbreak":case"hardbreak":r+=`
1372
+ `;break}return r};eu.prototype.render=function(e,t,n){let r="";const i=this.rules;for(let o=0,s=e.length;o<s;o++){const a=e[o].type;a==="inline"?r+=this.renderInline(e[o].children,t,n):typeof i[a]<"u"?r+=i[a](e,o,t,n,this):r+=this.renderToken(e,o,t,n)}return r};function Fr(){this.__rules__=[],this.__cache__=null}Fr.prototype.__find__=function(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1};Fr.prototype.__compile__=function(){const e=this,t=[""];e.__rules__.forEach(function(n){n.enabled&&n.alt.forEach(function(r){t.indexOf(r)<0&&t.push(r)})}),e.__cache__={},t.forEach(function(n){e.__cache__[n]=[],e.__rules__.forEach(function(r){r.enabled&&(n&&r.alt.indexOf(n)<0||e.__cache__[n].push(r.fn))})})};Fr.prototype.at=function(e,t,n){const r=this.__find__(e),i=n||{};if(r===-1)throw new Error("Parser rule not found: "+e);this.__rules__[r].fn=t,this.__rules__[r].alt=i.alt||[],this.__cache__=null};Fr.prototype.before=function(e,t,n,r){const i=this.__find__(e),o=r||{};if(i===-1)throw new Error("Parser rule not found: "+e);this.__rules__.splice(i,0,{name:t,enabled:!0,fn:n,alt:o.alt||[]}),this.__cache__=null};Fr.prototype.after=function(e,t,n,r){const i=this.__find__(e),o=r||{};if(i===-1)throw new Error("Parser rule not found: "+e);this.__rules__.splice(i+1,0,{name:t,enabled:!0,fn:n,alt:o.alt||[]}),this.__cache__=null};Fr.prototype.push=function(e,t,n){const r=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:r.alt||[]}),this.__cache__=null};Fr.prototype.enable=function(e,t){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(function(r){const i=this.__find__(r);if(i<0){if(t)return;throw new Error("Rules manager: invalid rule name "+r)}this.__rules__[i].enabled=!0,n.push(r)},this),this.__cache__=null,n};Fr.prototype.enableOnly=function(e,t){Array.isArray(e)||(e=[e]),this.__rules__.forEach(function(n){n.enabled=!1}),this.enable(e,t)};Fr.prototype.disable=function(e,t){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(function(r){const i=this.__find__(r);if(i<0){if(t)return;throw new Error("Rules manager: invalid rule name "+r)}this.__rules__[i].enabled=!1,n.push(r)},this),this.__cache__=null,n};Fr.prototype.getRules=function(e){return this.__cache__===null&&this.__compile__(),this.__cache__[e]||[]};function Fi(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}Fi.prototype.attrIndex=function(t){if(!this.attrs)return-1;const n=this.attrs;for(let r=0,i=n.length;r<i;r++)if(n[r][0]===t)return r;return-1};Fi.prototype.attrPush=function(t){this.attrs?this.attrs.push(t):this.attrs=[t]};Fi.prototype.attrSet=function(t,n){const r=this.attrIndex(t),i=[t,n];r<0?this.attrPush(i):this.attrs[r]=i};Fi.prototype.attrGet=function(t){const n=this.attrIndex(t);let r=null;return n>=0&&(r=this.attrs[n][1]),r};Fi.prototype.attrJoin=function(t,n){const r=this.attrIndex(t);r<0?this.attrPush([t,n]):this.attrs[r][1]=this.attrs[r][1]+" "+n};function mA(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}mA.prototype.Token=Fi;const mQ=/\r\n?|\n/g,gQ=/\0/g;function yQ(e){let t;t=e.src.replace(mQ,`
1373
+ `),t=t.replace(gQ,"�"),e.src=t}function xQ(e){let t;e.inlineMode?(t=new e.Token("inline","",0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}function bQ(e){const t=e.tokens;for(let n=0,r=t.length;n<r;n++){const i=t[n];i.type==="inline"&&e.md.inline.parse(i.content,e.md,e.env,i.children)}}function vQ(e){return/^<a[>\s]/i.test(e)}function kQ(e){return/^<\/a\s*>/i.test(e)}function wQ(e){const t=e.tokens;if(e.md.options.linkify)for(let n=0,r=t.length;n<r;n++){if(t[n].type!=="inline"||!e.md.linkify.pretest(t[n].content))continue;let i=t[n].children,o=0;for(let s=i.length-1;s>=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"&&(vQ(a.content)&&o>0&&o--,kQ(a.content)&&o++),!(o>0)&&a.type==="text"&&e.md.linkify.test(a.content)){const u=a.content;let d=e.md.linkify.match(u);const f=[];let h=a.level,m=0;d.length>0&&d[0].index===0&&s>0&&i[s-1].type==="text_special"&&(d=d.slice(1));for(let g=0;g<d.length;g++){const x=d[g].url,b=e.md.normalizeLink(x);if(!e.md.validateLink(b))continue;let v=d[g].text;d[g].schema?d[g].schema==="mailto:"&&!/^mailto:/i.test(v)?v=e.md.normalizeLinkText("mailto:"+v).replace(/^mailto:/,""):v=e.md.normalizeLinkText(v):v=e.md.normalizeLinkText("http://"+v).replace(/^http:\/\//,"");const C=d[g].index;if(C>m){const N=new e.Token("text","",0);N.content=u.slice(m,C),N.level=h,f.push(N)}const _=new e.Token("link_open","a",1);_.attrs=[["href",b]],_.level=h++,_.markup="linkify",_.info="auto",f.push(_);const E=new e.Token("text","",0);E.content=v,E.level=h,f.push(E);const I=new e.Token("link_close","a",-1);I.level=--h,I.markup="linkify",I.info="auto",f.push(I),m=d[g].lastIndex}if(m<u.length){const g=new e.Token("text","",0);g.content=u.slice(m),g.level=h,f.push(g)}t[n].children=i=hA(i,s,f)}}}}const gA=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,CQ=/\((c|tm|r)\)/i,SQ=/\((c|tm|r)\)/ig,EQ={c:"©",r:"®",tm:"™"};function _Q(e,t){return EQ[t.toLowerCase()]}function TQ(e){let t=0;for(let n=e.length-1;n>=0;n--){const r=e[n];r.type==="text"&&!t&&(r.content=r.content.replace(SQ,_Q)),r.type==="link_open"&&r.info==="auto"&&t--,r.type==="link_close"&&r.info==="auto"&&t++}}function AQ(e){let t=0;for(let n=e.length-1;n>=0;n--){const r=e[n];r.type==="text"&&!t&&gA.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"&&t--,r.type==="link_close"&&r.info==="auto"&&t++}}function MQ(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type==="inline"&&(CQ.test(e.tokens[t].content)&&TQ(e.tokens[t].children),gA.test(e.tokens[t].content)&&AQ(e.tokens[t].children))}const NQ=/['"]/,vS=/['"]/g,kS="’";function Vf(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function IQ(e,t){let n;const r=[];for(let i=0;i<e.length;i++){const o=e[i],s=e[i].level;for(n=r.length-1;n>=0&&!(r[n].level<=s);n--);if(r.length=n+1,o.type!=="text")continue;let a=o.content,u=0,d=a.length;e:for(;u<d;){vS.lastIndex=u;const f=vS.exec(a);if(!f)break;let h=!0,m=!0;u=f.index+1;const g=f[0]==="'";let x=32;if(f.index-1>=0)x=a.charCodeAt(f.index-1);else for(n=i-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){x=e[n].content.charCodeAt(e[n].content.length-1);break}let b=32;if(u<d)b=a.charCodeAt(u);else for(n=i+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){b=e[n].content.charCodeAt(0);break}const v=Zc(x)||qc(String.fromCharCode(x)),C=Zc(b)||qc(String.fromCharCode(b)),_=Wc(x),E=Wc(b);if(E?h=!1:C&&(_||v||(h=!1)),_?m=!1:v&&(E||C||(m=!1)),b===34&&f[0]==='"'&&x>=48&&x<=57&&(m=h=!1),h&&m&&(h=v,m=C),!h&&!m){g&&(o.content=Vf(o.content,f.index,kS));continue}if(m)for(n=r.length-1;n>=0;n--){let I=r[n];if(r[n].level<s)break;if(I.single===g&&r[n].level===s){I=r[n];let N,M;g?(N=t.md.options.quotes[2],M=t.md.options.quotes[3]):(N=t.md.options.quotes[0],M=t.md.options.quotes[1]),o.content=Vf(o.content,f.index,M),e[I.token].content=Vf(e[I.token].content,I.pos,N),u+=M.length-1,I.token===i&&(u+=N.length-1),a=o.content,d=a.length,r.length=n;continue e}}h?r.push({token:i,pos:f.index,single:g,level:s}):m&&g&&(o.content=Vf(o.content,f.index,kS))}}}function DQ(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)e.tokens[t].type!=="inline"||!NQ.test(e.tokens[t].content)||IQ(e.tokens[t].children,e)}function OQ(e){let t,n;const r=e.tokens,i=r.length;for(let o=0;o<i;o++){if(r[o].type!=="inline")continue;const s=r[o].children,a=s.length;for(t=0;t<a;t++)s[t].type==="text_special"&&(s[t].type="text");for(t=n=0;t<a;t++)s[t].type==="text"&&t+1<a&&s[t+1].type==="text"?s[t+1].content=s[t].content+s[t+1].content:(t!==n&&(s[n]=s[t]),n++);t!==n&&(s.length=n)}}const Fg=[["normalize",yQ],["block",xQ],["inline",bQ],["linkify",wQ],["replacements",MQ],["smartquotes",DQ],["text_join",OQ]];function qx(){this.ruler=new Fr;for(let e=0;e<Fg.length;e++)this.ruler.push(Fg[e][0],Fg[e][1])}qx.prototype.process=function(e){const t=this.ruler.getRules("");for(let n=0,r=t.length;n<r;n++)t[n](e)};qx.prototype.State=mA;function ao(e,t,n,r){this.src=e,this.md=t,this.env=n,this.tokens=r,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0;const i=this.src;for(let o=0,s=0,a=0,u=0,d=i.length,f=!1;s<d;s++){const h=i.charCodeAt(s);if(!f)if(nn(h)){a++,h===9?u+=4-u%4:u++;continue}else f=!0;(h===10||s===d-1)&&(h!==10&&s++,this.bMarks.push(o),this.eMarks.push(s),this.tShift.push(a),this.sCount.push(u),this.bsCount.push(0),f=!1,a=0,u=0,o=s+1)}this.bMarks.push(i.length),this.eMarks.push(i.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}ao.prototype.push=function(e,t,n){const r=new Fi(e,t,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r};ao.prototype.isEmpty=function(t){return this.bMarks[t]+this.tShift[t]>=this.eMarks[t]};ao.prototype.skipEmptyLines=function(t){for(let n=this.lineMax;t<n&&!(this.bMarks[t]+this.tShift[t]<this.eMarks[t]);t++);return t};ao.prototype.skipSpaces=function(t){for(let n=this.src.length;t<n;t++){const r=this.src.charCodeAt(t);if(!nn(r))break}return t};ao.prototype.skipSpacesBack=function(t,n){if(t<=n)return t;for(;t>n;)if(!nn(this.src.charCodeAt(--t)))return t+1;return t};ao.prototype.skipChars=function(t,n){for(let r=this.src.length;t<r&&this.src.charCodeAt(t)===n;t++);return t};ao.prototype.skipCharsBack=function(t,n,r){if(t<=r)return t;for(;t>r;)if(n!==this.src.charCodeAt(--t))return t+1;return t};ao.prototype.getLines=function(t,n,r,i){if(t>=n)return"";const o=new Array(n-t);for(let s=0,a=t;a<n;a++,s++){let u=0;const d=this.bMarks[a];let f=d,h;for(a+1<n||i?h=this.eMarks[a]+1:h=this.eMarks[a];f<h&&u<r;){const m=this.src.charCodeAt(f);if(nn(m))m===9?u+=4-(u+this.bsCount[a])%4:u++;else if(f-d<this.tShift[a])u++;else break;f++}u>r?o[s]=new Array(u-r+1).join(" ")+this.src.slice(f,h):o[s]=this.src.slice(f,h)}return o.join("")};ao.prototype.Token=Fi;const RQ=65536;function $g(e,t){const n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.slice(n,r)}function wS(e){const t=[],n=e.length;let r=0,i=e.charCodeAt(r),o=!1,s=0,a="";for(;r<n;)i===124&&(o?(a+=e.substring(s,r-1),s=r):(t.push(a+e.substring(s,r)),a="",s=r+1)),o=i===92,r++,i=e.charCodeAt(r);return t.push(a+e.substring(s)),t}function PQ(e,t,n,r){if(t+2>n)return!1;let i=t+1;if(e.sCount[i]<e.blkIndent||e.sCount[i]-e.blkIndent>=4)return!1;let o=e.bMarks[i]+e.tShift[i];if(o>=e.eMarks[i])return!1;const s=e.src.charCodeAt(o++);if(s!==124&&s!==45&&s!==58||o>=e.eMarks[i])return!1;const a=e.src.charCodeAt(o++);if(a!==124&&a!==45&&a!==58&&!nn(a)||s===45&&nn(a))return!1;for(;o<e.eMarks[i];){const I=e.src.charCodeAt(o);if(I!==124&&I!==45&&I!==58&&!nn(I))return!1;o++}let u=$g(e,t+1),d=u.split("|");const f=[];for(let I=0;I<d.length;I++){const N=d[I].trim();if(!N){if(I===0||I===d.length-1)continue;return!1}if(!/^:?-+:?$/.test(N))return!1;N.charCodeAt(N.length-1)===58?f.push(N.charCodeAt(0)===58?"center":"right"):N.charCodeAt(0)===58?f.push("left"):f.push("")}if(u=$g(e,t).trim(),u.indexOf("|")===-1||e.sCount[t]-e.blkIndent>=4)return!1;d=wS(u),d.length&&d[0]===""&&d.shift(),d.length&&d[d.length-1]===""&&d.pop();const h=d.length;if(h===0||h!==f.length)return!1;if(r)return!0;const m=e.parentType;e.parentType="table";const g=e.md.block.ruler.getRules("blockquote"),x=e.push("table_open","table",1),b=[t,0];x.map=b;const v=e.push("thead_open","thead",1);v.map=[t,t+1];const C=e.push("tr_open","tr",1);C.map=[t,t+1];for(let I=0;I<d.length;I++){const N=e.push("th_open","th",1);f[I]&&(N.attrs=[["style","text-align:"+f[I]]]);const M=e.push("inline","",0);M.content=d[I].trim(),M.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let _,E=0;for(i=t+2;i<n&&!(e.sCount[i]<e.blkIndent);i++){let I=!1;for(let M=0,F=g.length;M<F;M++)if(g[M](e,i,n,!0)){I=!0;break}if(I||(u=$g(e,i).trim(),!u)||e.sCount[i]-e.blkIndent>=4||(d=wS(u),d.length&&d[0]===""&&d.shift(),d.length&&d[d.length-1]===""&&d.pop(),E+=h-d.length,E>RQ))break;if(i===t+2){const M=e.push("tbody_open","tbody",1);M.map=_=[t+2,0]}const N=e.push("tr_open","tr",1);N.map=[i,i+1];for(let M=0;M<h;M++){const F=e.push("td_open","td",1);f[M]&&(F.attrs=[["style","text-align:"+f[M]]]);const R=e.push("inline","",0);R.content=d[M]?d[M].trim():"",R.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return _&&(e.push("tbody_close","tbody",-1),_[1]=i),e.push("table_close","table",-1),b[1]=i,e.parentType=m,e.line=i,!0}function jQ(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let r=t+1,i=r;for(;r<n;){if(e.isEmpty(r)){r++;continue}if(e.sCount[r]-e.blkIndent>=4){r++,i=r;continue}break}e.line=i;const o=e.push("code_block","code",0);return o.content=e.getLines(t,i,4+e.blkIndent,!1)+`
1374
+ `,o.map=[t,e.line],!0}function zQ(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||i+3>o)return!1;const s=e.src.charCodeAt(i);if(s!==126&&s!==96)return!1;let a=i;i=e.skipChars(i,s);let u=i-a;if(u<3)return!1;const d=e.src.slice(a,i),f=e.src.slice(i,o);if(s===96&&f.indexOf(String.fromCharCode(s))>=0)return!1;if(r)return!0;let h=t,m=!1;for(;h++,!(h>=n||(i=a=e.bMarks[h]+e.tShift[h],o=e.eMarks[h],i<o&&e.sCount[h]<e.blkIndent));)if(e.src.charCodeAt(i)===s&&!(e.sCount[h]-e.blkIndent>=4)&&(i=e.skipChars(i,s),!(i-a<u)&&(i=e.skipSpaces(i),!(i<o)))){m=!0;break}u=e.sCount[t],e.line=h+(m?1:0);const g=e.push("fence","code",0);return g.info=f,g.content=e.getLines(t+1,h,u,!0),g.markup=d,g.map=[t,e.line],!0}function LQ(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];const s=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(i)!==62)return!1;if(r)return!0;const a=[],u=[],d=[],f=[],h=e.md.block.ruler.getRules("blockquote"),m=e.parentType;e.parentType="blockquote";let g=!1,x;for(x=t;x<n;x++){const E=e.sCount[x]<e.blkIndent;if(i=e.bMarks[x]+e.tShift[x],o=e.eMarks[x],i>=o)break;if(e.src.charCodeAt(i++)===62&&!E){let N=e.sCount[x]+1,M,F;e.src.charCodeAt(i)===32?(i++,N++,F=!1,M=!0):e.src.charCodeAt(i)===9?(M=!0,(e.bsCount[x]+N)%4===3?(i++,N++,F=!1):F=!0):M=!1;let R=N;for(a.push(e.bMarks[x]),e.bMarks[x]=i;i<o;){const D=e.src.charCodeAt(i);if(nn(D))D===9?R+=4-(R+e.bsCount[x]+(F?1:0))%4:R++;else break;i++}g=i>=o,u.push(e.bsCount[x]),e.bsCount[x]=e.sCount[x]+1+(M?1:0),d.push(e.sCount[x]),e.sCount[x]=R-N,f.push(e.tShift[x]),e.tShift[x]=i-e.bMarks[x];continue}if(g)break;let I=!1;for(let N=0,M=h.length;N<M;N++)if(h[N](e,x,n,!0)){I=!0;break}if(I){e.lineMax=x,e.blkIndent!==0&&(a.push(e.bMarks[x]),u.push(e.bsCount[x]),f.push(e.tShift[x]),d.push(e.sCount[x]),e.sCount[x]-=e.blkIndent);break}a.push(e.bMarks[x]),u.push(e.bsCount[x]),f.push(e.tShift[x]),d.push(e.sCount[x]),e.sCount[x]=-1}const b=e.blkIndent;e.blkIndent=0;const v=e.push("blockquote_open","blockquote",1);v.markup=">";const C=[t,0];v.map=C,e.md.block.tokenize(e,t,x);const _=e.push("blockquote_close","blockquote",-1);_.markup=">",e.lineMax=s,e.parentType=m,C[1]=e.line;for(let E=0;E<f.length;E++)e.bMarks[E+t]=a[E],e.tShift[E+t]=f[E],e.sCount[E+t]=d[E],e.bsCount[E+t]=u[E];return e.blkIndent=b,!0}function FQ(e,t,n,r){const i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let o=e.bMarks[t]+e.tShift[t];const s=e.src.charCodeAt(o++);if(s!==42&&s!==45&&s!==95)return!1;let a=1;for(;o<i;){const d=e.src.charCodeAt(o++);if(d!==s&&!nn(d))return!1;d===s&&a++}if(a<3)return!1;if(r)return!0;e.line=t+1;const u=e.push("hr","hr",0);return u.map=[t,e.line],u.markup=Array(a+1).join(String.fromCharCode(s)),!0}function CS(e,t){const n=e.eMarks[t];let r=e.bMarks[t]+e.tShift[t];const i=e.src.charCodeAt(r++);if(i!==42&&i!==45&&i!==43)return-1;if(r<n){const o=e.src.charCodeAt(r);if(!nn(o))return-1}return r}function SS(e,t){const n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];let i=n;if(i+1>=r)return-1;let o=e.src.charCodeAt(i++);if(o<48||o>57)return-1;for(;;){if(i>=r)return-1;if(o=e.src.charCodeAt(i++),o>=48&&o<=57){if(i-n>=10)return-1;continue}if(o===41||o===46)break;return-1}return i<r&&(o=e.src.charCodeAt(i),!nn(o))?-1:i}function $Q(e,t){const n=e.level+2;for(let r=t+2,i=e.tokens.length-2;r<i;r++)e.tokens[r].level===n&&e.tokens[r].type==="paragraph_open"&&(e.tokens[r+2].hidden=!0,e.tokens[r].hidden=!0,r+=2)}function BQ(e,t,n,r){let i,o,s,a,u=t,d=!0;if(e.sCount[u]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[u]-e.listIndent>=4&&e.sCount[u]<e.blkIndent)return!1;let f=!1;r&&e.parentType==="paragraph"&&e.sCount[u]>=e.blkIndent&&(f=!0);let h,m,g;if((g=SS(e,u))>=0){if(h=!0,s=e.bMarks[u]+e.tShift[u],m=Number(e.src.slice(s,g-1)),f&&m!==1)return!1}else if((g=CS(e,u))>=0)h=!1;else return!1;if(f&&e.skipSpaces(g)>=e.eMarks[u])return!1;if(r)return!0;const x=e.src.charCodeAt(g-1),b=e.tokens.length;h?(a=e.push("ordered_list_open","ol",1),m!==1&&(a.attrs=[["start",m]])):a=e.push("bullet_list_open","ul",1);const v=[u,0];a.map=v,a.markup=String.fromCharCode(x);let C=!1;const _=e.md.block.ruler.getRules("list"),E=e.parentType;for(e.parentType="list";u<n;){o=g,i=e.eMarks[u];const I=e.sCount[u]+g-(e.bMarks[u]+e.tShift[u]);let N=I;for(;o<i;){const Z=e.src.charCodeAt(o);if(Z===9)N+=4-(N+e.bsCount[u])%4;else if(Z===32)N++;else break;o++}const M=o;let F;M>=i?F=1:F=N-I,F>4&&(F=1);const R=I+F;a=e.push("list_item_open","li",1),a.markup=String.fromCharCode(x);const D=[u,0];a.map=D,h&&(a.info=e.src.slice(s,g-1));const L=e.tight,X=e.tShift[u],ee=e.sCount[u],Ie=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=R,e.tight=!0,e.tShift[u]=M-e.bMarks[u],e.sCount[u]=N,M>=i&&e.isEmpty(u+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,u,n,!0),(!e.tight||C)&&(d=!1),C=e.line-u>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=Ie,e.tShift[u]=X,e.sCount[u]=ee,e.tight=L,a=e.push("list_item_close","li",-1),a.markup=String.fromCharCode(x),u=e.line,D[1]=u,u>=n||e.sCount[u]<e.blkIndent||e.sCount[u]-e.blkIndent>=4)break;let he=!1;for(let Z=0,ge=_.length;Z<ge;Z++)if(_[Z](e,u,n,!0)){he=!0;break}if(he)break;if(h){if(g=SS(e,u),g<0)break;s=e.bMarks[u]+e.tShift[u]}else if(g=CS(e,u),g<0)break;if(x!==e.src.charCodeAt(g-1))break}return h?a=e.push("ordered_list_close","ol",-1):a=e.push("bullet_list_close","ul",-1),a.markup=String.fromCharCode(x),v[1]=u,e.line=u,e.parentType=E,d&&$Q(e,b),!0}function UQ(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t],s=t+1;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(i)!==91)return!1;function a(_){const E=e.lineMax;if(_>=E||e.isEmpty(_))return null;let I=!1;if(e.sCount[_]-e.blkIndent>3&&(I=!0),e.sCount[_]<0&&(I=!0),!I){const F=e.md.block.ruler.getRules("reference"),R=e.parentType;e.parentType="reference";let D=!1;for(let L=0,X=F.length;L<X;L++)if(F[L](e,_,E,!0)){D=!0;break}if(e.parentType=R,D)return null}const N=e.bMarks[_]+e.tShift[_],M=e.eMarks[_];return e.src.slice(N,M+1)}let u=e.src.slice(i,o+1);o=u.length;let d=-1;for(i=1;i<o;i++){const _=u.charCodeAt(i);if(_===91)return!1;if(_===93){d=i;break}else if(_===10){const E=a(s);E!==null&&(u+=E,o=u.length,s++)}else if(_===92&&(i++,i<o&&u.charCodeAt(i)===10)){const E=a(s);E!==null&&(u+=E,o=u.length,s++)}}if(d<0||u.charCodeAt(d+1)!==58)return!1;for(i=d+2;i<o;i++){const _=u.charCodeAt(i);if(_===10){const E=a(s);E!==null&&(u+=E,o=u.length,s++)}else if(!nn(_))break}const f=e.md.helpers.parseLinkDestination(u,i,o);if(!f.ok)return!1;const h=e.md.normalizeLink(f.str);if(!e.md.validateLink(h))return!1;i=f.pos;const m=i,g=s,x=i;for(;i<o;i++){const _=u.charCodeAt(i);if(_===10){const E=a(s);E!==null&&(u+=E,o=u.length,s++)}else if(!nn(_))break}let b=e.md.helpers.parseLinkTitle(u,i,o);for(;b.can_continue;){const _=a(s);if(_===null)break;u+=_,i=o,o=u.length,s++,b=e.md.helpers.parseLinkTitle(u,i,o,b)}let v;for(i<o&&x!==i&&b.ok?(v=b.str,i=b.pos):(v="",i=m,s=g);i<o;){const _=u.charCodeAt(i);if(!nn(_))break;i++}if(i<o&&u.charCodeAt(i)!==10&&v)for(v="",i=m,s=g;i<o;){const _=u.charCodeAt(i);if(!nn(_))break;i++}if(i<o&&u.charCodeAt(i)!==10)return!1;const C=Wp(u.slice(1,d));return C?(r||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[C]>"u"&&(e.env.references[C]={title:v,href:h}),e.line=s),!0):!1}const VQ=["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"],HQ="[a-zA-Z_:][a-zA-Z0-9:._-]*",WQ="[^\"'=<>`\\x00-\\x20]+",qQ="'[^']*'",ZQ='"[^"]*"',JQ="(?:"+WQ+"|"+qQ+"|"+ZQ+")",KQ="(?:\\s+"+HQ+"(?:\\s*=\\s*"+JQ+")?)",yA="<[A-Za-z][A-Za-z0-9\\-]*"+KQ+"*\\s*\\/?>",xA="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",GQ="<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->",YQ="<[?][\\s\\S]*?[?]>",QQ="<![A-Za-z][^>]*>",XQ="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",eX=new RegExp("^(?:"+yA+"|"+xA+"|"+GQ+"|"+YQ+"|"+QQ+"|"+XQ+")"),tX=new RegExp("^(?:"+yA+"|"+xA+")"),gl=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+VQ.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(tX.source+"\\s*$"),/^$/,!1]];function nX(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(i)!==60)return!1;let s=e.src.slice(i,o),a=0;for(;a<gl.length&&!gl[a][0].test(s);a++);if(a===gl.length)return!1;if(r)return gl[a][2];let u=t+1;if(!gl[a][1].test(s)){for(;u<n&&!(e.sCount[u]<e.blkIndent);u++)if(i=e.bMarks[u]+e.tShift[u],o=e.eMarks[u],s=e.src.slice(i,o),gl[a][1].test(s)){s.length!==0&&u++;break}}e.line=u;const d=e.push("html_block","",0);return d.map=[t,u],d.content=e.getLines(t,u,e.blkIndent,!0),!0}function rX(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let s=e.src.charCodeAt(i);if(s!==35||i>=o)return!1;let a=1;for(s=e.src.charCodeAt(++i);s===35&&i<o&&a<=6;)a++,s=e.src.charCodeAt(++i);if(a>6||i<o&&!nn(s))return!1;if(r)return!0;o=e.skipSpacesBack(o,i);const u=e.skipCharsBack(o,35,i);u>i&&nn(e.src.charCodeAt(u-1))&&(o=u),e.line=t+1;const d=e.push("heading_open","h"+String(a),1);d.markup="########".slice(0,a),d.map=[t,e.line];const f=e.push("inline","",0);f.content=e.src.slice(i,o).trim(),f.map=[t,e.line],f.children=[];const h=e.push("heading_close","h"+String(a),-1);return h.markup="########".slice(0,a),!0}function iX(e,t,n){const r=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;const i=e.parentType;e.parentType="paragraph";let o=0,s,a=t+1;for(;a<n&&!e.isEmpty(a);a++){if(e.sCount[a]-e.blkIndent>3)continue;if(e.sCount[a]>=e.blkIndent){let g=e.bMarks[a]+e.tShift[a];const x=e.eMarks[a];if(g<x&&(s=e.src.charCodeAt(g),(s===45||s===61)&&(g=e.skipChars(g,s),g=e.skipSpaces(g),g>=x))){o=s===61?1:2;break}}if(e.sCount[a]<0)continue;let m=!1;for(let g=0,x=r.length;g<x;g++)if(r[g](e,a,n,!0)){m=!0;break}if(m)break}if(!o)return!1;const u=e.getLines(t,a,e.blkIndent,!1).trim();e.line=a+1;const d=e.push("heading_open","h"+String(o),1);d.markup=String.fromCharCode(s),d.map=[t,e.line];const f=e.push("inline","",0);f.content=u,f.map=[t,e.line-1],f.children=[];const h=e.push("heading_close","h"+String(o),-1);return h.markup=String.fromCharCode(s),e.parentType=i,!0}function oX(e,t,n){const r=e.md.block.ruler.getRules("paragraph"),i=e.parentType;let o=t+1;for(e.parentType="paragraph";o<n&&!e.isEmpty(o);o++){if(e.sCount[o]-e.blkIndent>3||e.sCount[o]<0)continue;let d=!1;for(let f=0,h=r.length;f<h;f++)if(r[f](e,o,n,!0)){d=!0;break}if(d)break}const s=e.getLines(t,o,e.blkIndent,!1).trim();e.line=o;const a=e.push("paragraph_open","p",1);a.map=[t,e.line];const u=e.push("inline","",0);return u.content=s,u.map=[t,e.line],u.children=[],e.push("paragraph_close","p",-1),e.parentType=i,!0}const Hf=[["table",PQ,["paragraph","reference"]],["code",jQ],["fence",zQ,["paragraph","reference","blockquote","list"]],["blockquote",LQ,["paragraph","reference","blockquote","list"]],["hr",FQ,["paragraph","reference","blockquote","list"]],["list",BQ,["paragraph","reference","blockquote"]],["reference",UQ],["html_block",nX,["paragraph","reference","blockquote"]],["heading",rX,["paragraph","reference","blockquote"]],["lheading",iX],["paragraph",oX]];function qp(){this.ruler=new Fr;for(let e=0;e<Hf.length;e++)this.ruler.push(Hf[e][0],Hf[e][1],{alt:(Hf[e][2]||[]).slice()})}qp.prototype.tokenize=function(e,t,n){const r=this.ruler.getRules(""),i=r.length,o=e.md.options.maxNesting;let s=t,a=!1;for(;s<n&&(e.line=s=e.skipEmptyLines(s),!(s>=n||e.sCount[s]<e.blkIndent));){if(e.level>=o){e.line=n;break}const u=e.line;let d=!1;for(let f=0;f<i;f++)if(d=r[f](e,s,n,!1),d){if(u>=e.line)throw new Error("block rule didn't increment state.line");break}if(!d)throw new Error("none of the block rules matched");e.tight=!a,e.isEmpty(e.line-1)&&(a=!0),s=e.line,s<n&&e.isEmpty(s)&&(a=!0,s++,e.line=s)}};qp.prototype.parse=function(e,t,n,r){if(!e)return;const i=new this.State(e,t,n,r);this.tokenize(i,i.line,i.lineMax)};qp.prototype.State=ao;function cd(e,t,n,r){this.src=e,this.env=n,this.md=t,this.tokens=r,this.tokens_meta=Array(r.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}cd.prototype.pushPending=function(){const e=new Fi("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e};cd.prototype.push=function(e,t,n){this.pending&&this.pushPending();const r=new Fi(e,t,n);let i=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),r.level=this.level,n>0&&(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};cd.prototype.scanDelims=function(e,t){const n=this.posMax,r=this.src.charCodeAt(e),i=e>0?this.src.charCodeAt(e-1):32;let o=e;for(;o<n&&this.src.charCodeAt(o)===r;)o++;const s=o-e,a=o<n?this.src.charCodeAt(o):32,u=Zc(i)||qc(String.fromCharCode(i)),d=Zc(a)||qc(String.fromCharCode(a)),f=Wc(i),h=Wc(a),m=!h&&(!d||f||u),g=!f&&(!u||h||d);return{can_open:m&&(t||!g||u),can_close:g&&(t||!m||d),length:s}};cd.prototype.Token=Fi;function sX(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function aX(e,t){let n=e.pos;for(;n<e.posMax&&!sX(e.src.charCodeAt(n));)n++;return n===e.pos?!1:(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}const lX=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function uX(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const n=e.pos,r=e.posMax;if(n+3>r||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const i=e.pending.match(lX);if(!i)return!1;const o=i[1],s=e.md.linkify.matchAtStart(e.src.slice(n-o.length));if(!s)return!1;let a=s.url;if(a.length<=o.length)return!1;let u=a.length;for(;u>0&&a.charCodeAt(u-1)===42;)u--;u!==a.length&&(a=a.slice(0,u));const d=e.md.normalizeLink(a);if(!e.md.validateLink(d))return!1;if(!t){e.pending=e.pending.slice(0,-o.length);const f=e.push("link_open","a",1);f.attrs=[["href",d]],f.markup="linkify",f.info="auto";const h=e.push("text","",0);h.content=e.md.normalizeLinkText(a);const m=e.push("link_close","a",-1);m.markup="linkify",m.info="auto"}return e.pos+=a.length-o.length,!0}function cX(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const r=e.pending.length-1,i=e.posMax;if(!t)if(r>=0&&e.pending.charCodeAt(r)===32)if(r>=1&&e.pending.charCodeAt(r-1)===32){let o=r-1;for(;o>=1&&e.pending.charCodeAt(o-1)===32;)o--;e.pending=e.pending.slice(0,o),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(n++;n<i&&nn(e.src.charCodeAt(n));)n++;return e.pos=n,!0}const Zx=[];for(let e=0;e<256;e++)Zx.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){Zx[e.charCodeAt(0)]=1});function dX(e,t){let n=e.pos;const r=e.posMax;if(e.src.charCodeAt(n)!==92||(n++,n>=r))return!1;let i=e.src.charCodeAt(n);if(i===10){for(t||e.push("hardbreak","br",0),n++;n<r&&(i=e.src.charCodeAt(n),!!nn(i));)n++;return e.pos=n,!0}let o=e.src[n];if(i>=55296&&i<=56319&&n+1<r){const a=e.src.charCodeAt(n+1);a>=56320&&a<=57343&&(o+=e.src[n+1],n++)}const s="\\"+o;if(!t){const a=e.push("text_special","",0);i<256&&Zx[i]!==0?a.content=o:a.content=s,a.markup=s,a.info="escape"}return e.pos=n+1,!0}function fX(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==96)return!1;const i=n;n++;const o=e.posMax;for(;n<o&&e.src.charCodeAt(n)===96;)n++;const s=e.src.slice(i,n),a=s.length;if(e.backticksScanned&&(e.backticks[a]||0)<=i)return t||(e.pending+=s),e.pos+=a,!0;let u=n,d;for(;(d=e.src.indexOf("`",u))!==-1;){for(u=d+1;u<o&&e.src.charCodeAt(u)===96;)u++;const f=u-d;if(f===a){if(!t){const h=e.push("code_inline","code",0);h.markup=s,h.content=e.src.slice(n,d).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return e.pos=u,!0}e.backticks[f]=d}return e.backticksScanned=!0,t||(e.pending+=s),e.pos+=a,!0}function hX(e,t){const n=e.pos,r=e.src.charCodeAt(n);if(t||r!==126)return!1;const i=e.scanDelims(e.pos,!0);let o=i.length;const s=String.fromCharCode(r);if(o<2)return!1;let a;o%2&&(a=e.push("text","",0),a.content=s,o--);for(let u=0;u<o;u+=2)a=e.push("text","",0),a.content=s+s,e.delimiters.push({marker:r,length:0,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close});return e.pos+=i.length,!0}function ES(e,t){let n;const r=[],i=t.length;for(let o=0;o<i;o++){const s=t[o];if(s.marker!==126||s.end===-1)continue;const a=t[s.end];n=e.tokens[s.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=e.tokens[a.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",e.tokens[a.token-1].type==="text"&&e.tokens[a.token-1].content==="~"&&r.push(a.token-1)}for(;r.length;){const o=r.pop();let s=o+1;for(;s<e.tokens.length&&e.tokens[s].type==="s_close";)s++;s--,o!==s&&(n=e.tokens[s],e.tokens[s]=e.tokens[o],e.tokens[o]=n)}}function pX(e){const t=e.tokens_meta,n=e.tokens_meta.length;ES(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&ES(e,t[r].delimiters)}const bA={tokenize:hX,postProcess:pX};function mX(e,t){const n=e.pos,r=e.src.charCodeAt(n);if(t||r!==95&&r!==42)return!1;const i=e.scanDelims(e.pos,r===42);for(let o=0;o<i.length;o++){const s=e.push("text","",0);s.content=String.fromCharCode(r),e.delimiters.push({marker:r,length:i.length,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close})}return e.pos+=i.length,!0}function _S(e,t){const n=t.length;for(let r=n-1;r>=0;r--){const i=t[r];if(i.marker!==95&&i.marker!==42||i.end===-1)continue;const o=t[i.end],s=r>0&&t[r-1].end===i.end+1&&t[r-1].marker===i.marker&&t[r-1].token===i.token-1&&t[i.end+1].token===o.token+1,a=String.fromCharCode(i.marker),u=e.tokens[i.token];u.type=s?"strong_open":"em_open",u.tag=s?"strong":"em",u.nesting=1,u.markup=s?a+a:a,u.content="";const d=e.tokens[o.token];d.type=s?"strong_close":"em_close",d.tag=s?"strong":"em",d.nesting=-1,d.markup=s?a+a:a,d.content="",s&&(e.tokens[t[r-1].token].content="",e.tokens[t[i.end+1].token].content="",r--)}}function gX(e){const t=e.tokens_meta,n=e.tokens_meta.length;_S(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&_S(e,t[r].delimiters)}const vA={tokenize:mX,postProcess:gX};function yX(e,t){let n,r,i,o,s="",a="",u=e.pos,d=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const f=e.pos,h=e.posMax,m=e.pos+1,g=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(g<0)return!1;let x=g+1;if(x<h&&e.src.charCodeAt(x)===40){for(d=!1,x++;x<h&&(n=e.src.charCodeAt(x),!(!nn(n)&&n!==10));x++);if(x>=h)return!1;if(u=x,i=e.md.helpers.parseLinkDestination(e.src,x,e.posMax),i.ok){for(s=e.md.normalizeLink(i.str),e.md.validateLink(s)?x=i.pos:s="",u=x;x<h&&(n=e.src.charCodeAt(x),!(!nn(n)&&n!==10));x++);if(i=e.md.helpers.parseLinkTitle(e.src,x,e.posMax),x<h&&u!==x&&i.ok)for(a=i.str,x=i.pos;x<h&&(n=e.src.charCodeAt(x),!(!nn(n)&&n!==10));x++);}(x>=h||e.src.charCodeAt(x)!==41)&&(d=!0),x++}if(d){if(typeof e.env.references>"u")return!1;if(x<h&&e.src.charCodeAt(x)===91?(u=x+1,x=e.md.helpers.parseLinkLabel(e,x),x>=0?r=e.src.slice(u,x++):x=g+1):x=g+1,r||(r=e.src.slice(m,g)),o=e.env.references[Wp(r)],!o)return e.pos=f,!1;s=o.href,a=o.title}if(!t){e.pos=m,e.posMax=g;const b=e.push("link_open","a",1),v=[["href",s]];b.attrs=v,a&&v.push(["title",a]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=x,e.posMax=h,!0}function xX(e,t){let n,r,i,o,s,a,u,d,f="";const h=e.pos,m=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const g=e.pos+2,x=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(x<0)return!1;if(o=x+1,o<m&&e.src.charCodeAt(o)===40){for(o++;o<m&&(n=e.src.charCodeAt(o),!(!nn(n)&&n!==10));o++);if(o>=m)return!1;for(d=o,a=e.md.helpers.parseLinkDestination(e.src,o,e.posMax),a.ok&&(f=e.md.normalizeLink(a.str),e.md.validateLink(f)?o=a.pos:f=""),d=o;o<m&&(n=e.src.charCodeAt(o),!(!nn(n)&&n!==10));o++);if(a=e.md.helpers.parseLinkTitle(e.src,o,e.posMax),o<m&&d!==o&&a.ok)for(u=a.str,o=a.pos;o<m&&(n=e.src.charCodeAt(o),!(!nn(n)&&n!==10));o++);else u="";if(o>=m||e.src.charCodeAt(o)!==41)return e.pos=h,!1;o++}else{if(typeof e.env.references>"u")return!1;if(o<m&&e.src.charCodeAt(o)===91?(d=o+1,o=e.md.helpers.parseLinkLabel(e,o),o>=0?i=e.src.slice(d,o++):o=x+1):o=x+1,i||(i=e.src.slice(g,x)),s=e.env.references[Wp(i)],!s)return e.pos=h,!1;f=s.href,u=s.title}if(!t){r=e.src.slice(g,x);const b=[];e.md.inline.parse(r,e.md,e.env,b);const v=e.push("image","img",0),C=[["src",f],["alt",""]];v.attrs=C,v.children=b,v.content=r,u&&C.push(["title",u])}return e.pos=o,e.posMax=m,!0}const bX=/^([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])?)*)$/,vX=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function kX(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;const r=e.pos,i=e.posMax;for(;;){if(++n>=i)return!1;const s=e.src.charCodeAt(n);if(s===60)return!1;if(s===62)break}const o=e.src.slice(r+1,n);if(vX.test(o)){const s=e.md.normalizeLink(o);if(!e.md.validateLink(s))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",s]],a.markup="autolink",a.info="auto";const u=e.push("text","",0);u.content=e.md.normalizeLinkText(o);const d=e.push("link_close","a",-1);d.markup="autolink",d.info="auto"}return e.pos+=o.length+2,!0}if(bX.test(o)){const s=e.md.normalizeLink("mailto:"+o);if(!e.md.validateLink(s))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",s]],a.markup="autolink",a.info="auto";const u=e.push("text","",0);u.content=e.md.normalizeLinkText(o);const d=e.push("link_close","a",-1);d.markup="autolink",d.info="auto"}return e.pos+=o.length+2,!0}return!1}function wX(e){return/^<a[>\s]/i.test(e)}function CX(e){return/^<\/a\s*>/i.test(e)}function SX(e){const t=e|32;return t>=97&&t<=122}function EX(e,t){if(!e.md.options.html)return!1;const n=e.posMax,r=e.pos;if(e.src.charCodeAt(r)!==60||r+2>=n)return!1;const i=e.src.charCodeAt(r+1);if(i!==33&&i!==63&&i!==47&&!SX(i))return!1;const o=e.src.slice(r).match(eX);if(!o)return!1;if(!t){const s=e.push("html_inline","",0);s.content=o[0],wX(s.content)&&e.linkLevel++,CX(s.content)&&e.linkLevel--}return e.pos+=o[0].length,!0}const _X=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,TX=/^&([a-z][a-z0-9]{1,31});/i;function AX(e,t){const n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=r)return!1;if(e.src.charCodeAt(n+1)===35){const o=e.src.slice(n).match(_X);if(o){if(!t){const s=o[1][0].toLowerCase()==="x"?parseInt(o[1].slice(1),16):parseInt(o[1],10),a=e.push("text_special","",0);a.content=Wx(s)?hp(s):hp(65533),a.markup=o[0],a.info="entity"}return e.pos+=o[0].length,!0}}else{const o=e.src.slice(n).match(TX);if(o){const s=fA(o[0]);if(s!==o[0]){if(!t){const a=e.push("text_special","",0);a.content=s,a.markup=o[0],a.info="entity"}return e.pos+=o[0].length,!0}}}return!1}function TS(e){const t={},n=e.length;if(!n)return;let r=0,i=-2;const o=[];for(let s=0;s<n;s++){const a=e[s];if(o.push(0),(e[r].marker!==a.marker||i!==a.token-1)&&(r=s),i=a.token,a.length=a.length||0,!a.close)continue;t.hasOwnProperty(a.marker)||(t[a.marker]=[-1,-1,-1,-1,-1,-1]);const u=t[a.marker][(a.open?3:0)+a.length%3];let d=r-o[r]-1,f=d;for(;d>u;d-=o[d]+1){const h=e[d];if(h.marker===a.marker&&h.open&&h.end<0){let m=!1;if((h.close||a.open)&&(h.length+a.length)%3===0&&(h.length%3!==0||a.length%3!==0)&&(m=!0),!m){const g=d>0&&!e[d-1].open?o[d-1]+1:0;o[s]=s-d+g,o[d]=g,a.open=!1,h.end=s,h.close=!1,f=-1,i=-2;break}}}f!==-1&&(t[a.marker][(a.open?3:0)+(a.length||0)%3]=f)}}function MX(e){const t=e.tokens_meta,n=e.tokens_meta.length;TS(e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&TS(t[r].delimiters)}function NX(e){let t,n,r=0;const i=e.tokens,o=e.tokens.length;for(t=n=0;t<o;t++)i[t].nesting<0&&r--,i[t].level=r,i[t].nesting>0&&r++,i[t].type==="text"&&t+1<o&&i[t+1].type==="text"?i[t+1].content=i[t].content+i[t+1].content:(t!==n&&(i[n]=i[t]),n++);t!==n&&(i.length=n)}const Bg=[["text",aX],["linkify",uX],["newline",cX],["escape",dX],["backticks",fX],["strikethrough",bA.tokenize],["emphasis",vA.tokenize],["link",yX],["image",xX],["autolink",kX],["html_inline",EX],["entity",AX]],Ug=[["balance_pairs",MX],["strikethrough",bA.postProcess],["emphasis",vA.postProcess],["fragments_join",NX]];function dd(){this.ruler=new Fr;for(let e=0;e<Bg.length;e++)this.ruler.push(Bg[e][0],Bg[e][1]);this.ruler2=new Fr;for(let e=0;e<Ug.length;e++)this.ruler2.push(Ug[e][0],Ug[e][1])}dd.prototype.skipToken=function(e){const t=e.pos,n=this.ruler.getRules(""),r=n.length,i=e.md.options.maxNesting,o=e.cache;if(typeof o[t]<"u"){e.pos=o[t];return}let s=!1;if(e.level<i){for(let a=0;a<r;a++)if(e.level++,s=n[a](e,!0),e.level--,s){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;s||e.pos++,o[t]=e.pos};dd.prototype.tokenize=function(e){const t=this.ruler.getRules(""),n=t.length,r=e.posMax,i=e.md.options.maxNesting;for(;e.pos<r;){const o=e.pos;let s=!1;if(e.level<i){for(let a=0;a<n;a++)if(s=t[a](e,!1),s){if(o>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(s){if(e.pos>=r)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()};dd.prototype.parse=function(e,t,n,r){const i=new this.State(e,t,n,r);this.tokenize(i);const o=this.ruler2.getRules(""),s=o.length;for(let a=0;a<s;a++)o[a](i)};dd.prototype.State=cd;function IX(e){const t={};e=e||{},t.src_Any=aA.source,t.src_Cc=lA.source,t.src_Z=cA.source,t.src_P=Vx.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");const n="[><|]";return t.src_pseudo_letter="(?:(?!"+n+"|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|"+n+"|"+t.src_ZPCc+")(?!"+(e["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+"|"+n+`|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]|$)|"+(e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+t.src_ZCc+"|$)|;(?!"+t.src_ZCc+"|$)|\\!+(?!"+t.src_ZCc+"|[!]|$)|\\?(?!"+t.src_ZCc+"|[?]|$))+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy="(^|"+n+'|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}function iy(e){return Array.prototype.slice.call(arguments,1).forEach(function(n){n&&Object.keys(n).forEach(function(r){e[r]=n[r]})}),e}function Zp(e){return Object.prototype.toString.call(e)}function DX(e){return Zp(e)==="[object String]"}function OX(e){return Zp(e)==="[object Object]"}function RX(e){return Zp(e)==="[object RegExp]"}function AS(e){return Zp(e)==="[object Function]"}function PX(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const kA={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function jX(e){return Object.keys(e||{}).reduce(function(t,n){return t||kA.hasOwnProperty(n)},!1)}const zX={"http:":{validate:function(e,t,n){const r=e.slice(t);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(e,t,n){const r=e.slice(t);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)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){const r=e.slice(t);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}}},LX="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]",FX="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function $X(e){e.__index__=-1,e.__text_cache__=""}function BX(e){return function(t,n){const r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}function MS(){return function(e,t){t.normalize(e)}}function pp(e){const t=e.re=IX(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(LX),n.push(t.src_xn),t.src_tlds=n.join("|");function r(a){return a.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(r(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(r(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(r(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(r(t.tpl_host_fuzzy_test),"i");const i=[];e.__compiled__={};function o(a,u){throw new Error('(LinkifyIt) Invalid schema "'+a+'": '+u)}Object.keys(e.__schemas__).forEach(function(a){const u=e.__schemas__[a];if(u===null)return;const d={validate:null,link:null};if(e.__compiled__[a]=d,OX(u)){RX(u.validate)?d.validate=BX(u.validate):AS(u.validate)?d.validate=u.validate:o(a,u),AS(u.normalize)?d.normalize=u.normalize:u.normalize?o(a,u):d.normalize=MS();return}if(DX(u)){i.push(a);return}o(a,u)}),i.forEach(function(a){e.__compiled__[e.__schemas__[a]]&&(e.__compiled__[a].validate=e.__compiled__[e.__schemas__[a]].validate,e.__compiled__[a].normalize=e.__compiled__[e.__schemas__[a]].normalize)}),e.__compiled__[""]={validate:null,normalize:MS()};const s=Object.keys(e.__compiled__).filter(function(a){return a.length>0&&e.__compiled__[a]}).map(PX).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+s+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+s+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i"),$X(e)}function UX(e,t){const n=e.__index__,r=e.__last_index__,i=e.__text_cache__.slice(n,r);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=r+t,this.raw=i,this.text=i,this.url=i}function oy(e,t){const n=new UX(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function Xr(e,t){if(!(this instanceof Xr))return new Xr(e,t);t||jX(e)&&(t=e,e={}),this.__opts__=iy({},kA,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=iy({},zX,e),this.__compiled__={},this.__tlds__=FX,this.__tlds_replaced__=!1,this.re={},pp(this)}Xr.prototype.add=function(t,n){return this.__schemas__[t]=n,pp(this),this};Xr.prototype.set=function(t){return this.__opts__=iy(this.__opts__,t),this};Xr.prototype.test=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return!1;let n,r,i,o,s,a,u,d,f;if(this.re.schema_test.test(t)){for(u=this.re.schema_search,u.lastIndex=0;(n=u.exec(t))!==null;)if(o=this.testSchemaAt(t,n[2],u.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:"]&&(d=t.search(this.re.host_fuzzy_test),d>=0&&(this.__index__<0||d<this.__index__)&&(r=t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(s=r.index+r[1].length,(this.__index__<0||s<this.__index__)&&(this.__schema__="",this.__index__=s,this.__last_index__=r.index+r[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(f=t.indexOf("@"),f>=0&&(i=t.match(this.re.email_fuzzy))!==null&&(s=i.index+i[1].length,a=i.index+i[0].length,(this.__index__<0||s<this.__index__||s===this.__index__&&a>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=s,this.__last_index__=a))),this.__index__>=0};Xr.prototype.pretest=function(t){return this.re.pretest.test(t)};Xr.prototype.testSchemaAt=function(t,n,r){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,r,this):0};Xr.prototype.match=function(t){const n=[];let r=0;this.__index__>=0&&this.__text_cache__===t&&(n.push(oy(this,r)),r=this.__last_index__);let i=r?t.slice(r):t;for(;this.test(i);)n.push(oy(this,r)),i=i.slice(this.__last_index__),r+=this.__last_index__;return n.length?n:null};Xr.prototype.matchAtStart=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return null;const n=this.re.schema_at_start.exec(t);if(!n)return null;const r=this.testSchemaAt(t,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,oy(this,0)):null};Xr.prototype.tlds=function(t,n){return t=Array.isArray(t)?t:[t],n?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(r,i,o){return r!==o[i-1]}).reverse(),pp(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,pp(this),this)};Xr.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};Xr.prototype.onCompile=function(){};const Nl=2147483647,Yi=36,Jx=1,Jc=26,VX=38,HX=700,wA=72,CA=128,SA="-",WX=/^xn--/,qX=/[^\0-\x7F]/,ZX=/[\x2E\u3002\uFF0E\uFF61]/g,JX={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Vg=Yi-Jx,Qi=Math.floor,Hg=String.fromCharCode;function xs(e){throw new RangeError(JX[e])}function KX(e,t){const n=[];let r=e.length;for(;r--;)n[r]=t(e[r]);return n}function EA(e,t){const n=e.split("@");let r="";n.length>1&&(r=n[0]+"@",e=n[1]),e=e.replace(ZX,".");const i=e.split("."),o=KX(i,t).join(".");return r+o}function _A(e){const t=[];let n=0;const r=e.length;for(;n<r;){const i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){const o=e.charCodeAt(n++);(o&64512)==56320?t.push(((i&1023)<<10)+(o&1023)+65536):(t.push(i),n--)}else t.push(i)}return t}const GX=e=>String.fromCodePoint(...e),YX=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:Yi},NS=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},TA=function(e,t,n){let r=0;for(e=n?Qi(e/HX):e>>1,e+=Qi(e/t);e>Vg*Jc>>1;r+=Yi)e=Qi(e/Vg);return Qi(r+(Vg+1)*e/(e+VX))},AA=function(e){const t=[],n=e.length;let r=0,i=CA,o=wA,s=e.lastIndexOf(SA);s<0&&(s=0);for(let a=0;a<s;++a)e.charCodeAt(a)>=128&&xs("not-basic"),t.push(e.charCodeAt(a));for(let a=s>0?s+1:0;a<n;){const u=r;for(let f=1,h=Yi;;h+=Yi){a>=n&&xs("invalid-input");const m=YX(e.charCodeAt(a++));m>=Yi&&xs("invalid-input"),m>Qi((Nl-r)/f)&&xs("overflow"),r+=m*f;const g=h<=o?Jx:h>=o+Jc?Jc:h-o;if(m<g)break;const x=Yi-g;f>Qi(Nl/x)&&xs("overflow"),f*=x}const d=t.length+1;o=TA(r-u,d,u==0),Qi(r/d)>Nl-i&&xs("overflow"),i+=Qi(r/d),r%=d,t.splice(r++,0,i)}return String.fromCodePoint(...t)},MA=function(e){const t=[];e=_A(e);const n=e.length;let r=CA,i=0,o=wA;for(const u of e)u<128&&t.push(Hg(u));const s=t.length;let a=s;for(s&&t.push(SA);a<n;){let u=Nl;for(const f of e)f>=r&&f<u&&(u=f);const d=a+1;u-r>Qi((Nl-i)/d)&&xs("overflow"),i+=(u-r)*d,r=u;for(const f of e)if(f<r&&++i>Nl&&xs("overflow"),f===r){let h=i;for(let m=Yi;;m+=Yi){const g=m<=o?Jx:m>=o+Jc?Jc:m-o;if(h<g)break;const x=h-g,b=Yi-g;t.push(Hg(NS(g+x%b,0))),h=Qi(x/b)}t.push(Hg(NS(h,0))),o=TA(i,d,a===s),i=0,++a}++i,++r}return t.join("")},QX=function(e){return EA(e,function(t){return WX.test(t)?AA(t.slice(4).toLowerCase()):t})},XX=function(e){return EA(e,function(t){return qX.test(t)?"xn--"+MA(t):t})},NA={version:"2.3.1",ucs2:{decode:_A,encode:GX},decode:AA,encode:MA,toASCII:XX,toUnicode:QX},eee={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},tee={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},nee={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}},ree={default:eee,zero:tee,commonmark:nee},iee=/^(vbscript|javascript|file|data):/,oee=/^data:image\/(gif|png|jpeg|webp);/;function see(e){const t=e.trim().toLowerCase();return iee.test(t)?oee.test(t):!0}const IA=["http:","https:","mailto:"];function aee(e){const t=Ux(e,!0);if(t.hostname&&(!t.protocol||IA.indexOf(t.protocol)>=0))try{t.hostname=NA.toASCII(t.hostname)}catch{}return ud(Bx(t))}function lee(e){const t=Ux(e,!0);if(t.hostname&&(!t.protocol||IA.indexOf(t.protocol)>=0))try{t.hostname=NA.toUnicode(t.hostname)}catch{}return Zl(Bx(t),Zl.defaultChars+"%")}function $r(e,t){if(!(this instanceof $r))return new $r(e,t);t||Hx(e)||(t=e||{},e="default"),this.inline=new dd,this.block=new qp,this.core=new qx,this.renderer=new eu,this.linkify=new Xr,this.validateLink=see,this.normalizeLink=aee,this.normalizeLinkText=lee,this.utils=cQ,this.helpers=Hp({},pQ),this.options={},this.configure(e),t&&this.set(t)}$r.prototype.set=function(e){return Hp(this.options,e),this};$r.prototype.configure=function(e){const t=this;if(Hx(e)){const n=e;if(e=ree[n],!e)throw new Error('Wrong `markdown-it` preset "'+n+'", check name')}if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(n){e.components[n].rules&&t[n].ruler.enableOnly(e.components[n].rules),e.components[n].rules2&&t[n].ruler2.enableOnly(e.components[n].rules2)}),this};$r.prototype.enable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(i){n=n.concat(this[i].ruler.enable(e,!0))},this),n=n.concat(this.inline.ruler2.enable(e,!0));const r=e.filter(function(i){return n.indexOf(i)<0});if(r.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this};$r.prototype.disable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(i){n=n.concat(this[i].ruler.disable(e,!0))},this),n=n.concat(this.inline.ruler2.disable(e,!0));const r=e.filter(function(i){return n.indexOf(i)<0});if(r.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this};$r.prototype.use=function(e){const t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this};$r.prototype.parse=function(e,t){if(typeof e!="string")throw new Error("Input data should be a String");const n=new this.core.State(e,this,t);return this.core.process(n),n.tokens};$r.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)};$r.prototype.parseInline=function(e,t){const n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens};$r.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)};const uee=new tx({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(e){return["h"+e.attrs.level,0]}},code_block:{content:"text*",group:"block",code:!0,defining:!0,marks:"",attrs:{params:{default:""}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:e=>({params:e.getAttribute("data-params")||""})}],toDOM(e){return["pre",e.attrs.params?{"data-params":e.attrs.params}:{},["code",0]]}},ordered_list:{content:"list_item+",group:"block",attrs:{order:{default:1},tight:{default:!1}},parseDOM:[{tag:"ol",getAttrs(e){return{order:e.hasAttribute("start")?+e.getAttribute("start"):1,tight:e.hasAttribute("data-tight")}}}],toDOM(e){return["ol",{start:e.attrs.order==1?null:e.attrs.order,"data-tight":e.attrs.tight?"true":null},0]}},bullet_list:{content:"list_item+",group:"block",attrs:{tight:{default:!1}},parseDOM:[{tag:"ul",getAttrs:e=>({tight:e.hasAttribute("data-tight")})}],toDOM(e){return["ul",{"data-tight":e.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(e){return{src:e.getAttribute("src"),title:e.getAttribute("title"),alt:e.getAttribute("alt")}}}],toDOM(e){return["img",e.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:e=>e.type.name=="em"}],toDOM(){return["em"]}},strong:{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:e=>e.style.fontWeight!="normal"&&null},{style:"font-weight=400",clearMark:e=>e.type.name=="strong"},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],toDOM(){return["strong"]}},link:{attrs:{href:{},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs(e){return{href:e.getAttribute("href"),title:e.getAttribute("title")}}}],toDOM(e){return["a",e.attrs]}},code:{code:!0,parseDOM:[{tag:"code"}],toDOM(){return["code"]}}}});function cee(e,t){if(e.isText&&t.isText&&Wt.sameSet(e.marks,t.marks))return e.withText(e.text+t.text)}class dee{constructor(t,n){this.schema=t,this.tokenHandlers=n,this.stack=[{type:t.topNodeType,attrs:null,content:[],marks:Wt.none}]}top(){return this.stack[this.stack.length-1]}push(t){this.stack.length&&this.top().content.push(t)}addText(t){if(!t)return;let n=this.top(),r=n.content,i=r[r.length-1],o=this.schema.text(t,n.marks),s;i&&(s=cee(i,o))?r[r.length-1]=s:r.push(o)}openMark(t){let n=this.top();n.marks=t.addToSet(n.marks)}closeMark(t){let n=this.top();n.marks=t.removeFromSet(n.marks)}parseTokens(t){for(let n=0;n<t.length;n++){let r=t[n],i=this.tokenHandlers[r.type];if(!i)throw new Error("Token type `"+r.type+"` not supported by Markdown parser");i(this,r,t,n)}}addNode(t,n,r){let i=this.top(),o=t.createAndFill(n,r,i?i.marks:[]);return o?(this.push(o),o):null}openNode(t,n){this.stack.push({type:t,attrs:n,content:[],marks:Wt.none})}closeNode(){let t=this.stack.pop();return this.addNode(t.type,t.attrs,t.content)}}function Hu(e,t,n,r){return e.getAttrs?e.getAttrs(t,n,r):e.attrs instanceof Function?e.attrs(t):e.attrs}function Wg(e,t){return e.noCloseToken||t=="code_inline"||t=="code_block"||t=="fence"}function IS(e){return e[e.length-1]==`
1375
+ `?e.slice(0,e.length-1):e}function qg(){}function fee(e,t){let n=Object.create(null);for(let r in t){let i=t[r];if(i.block){let o=e.nodeType(i.block);Wg(i,r)?n[r]=(s,a,u,d)=>{s.openNode(o,Hu(i,a,u,d)),s.addText(IS(a.content)),s.closeNode()}:(n[r+"_open"]=(s,a,u,d)=>s.openNode(o,Hu(i,a,u,d)),n[r+"_close"]=s=>s.closeNode())}else if(i.node){let o=e.nodeType(i.node);n[r]=(s,a,u,d)=>s.addNode(o,Hu(i,a,u,d))}else if(i.mark){let o=e.marks[i.mark];Wg(i,r)?n[r]=(s,a,u,d)=>{s.openMark(o.create(Hu(i,a,u,d))),s.addText(IS(a.content)),s.closeMark(o)}:(n[r+"_open"]=(s,a,u,d)=>s.openMark(o.create(Hu(i,a,u,d))),n[r+"_close"]=s=>s.closeMark(o))}else if(i.ignore)Wg(i,r)?n[r]=qg:(n[r+"_open"]=qg,n[r+"_close"]=qg);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 hee=class{constructor(t,n,r){this.schema=t,this.tokenizer=n,this.tokens=r,this.tokenHandlers=fee(t,r)}parse(t,n={}){let r=new dee(this.schema,this.tokenHandlers),i;r.parseTokens(this.tokenizer.parse(t,n));do i=r.closeNode();while(r.stack.length);return i||this.schema.topNodeType.createAndFill()}};function DS(e,t){for(;++t<e.length;)if(e[t].type!="list_item_open")return e[t].hidden;return!1}new hee(uee,$r("commonmark",{html:!1}),{blockquote:{block:"blockquote"},paragraph:{block:"paragraph"},list_item:{block:"list_item"},bullet_list:{block:"bullet_list",getAttrs:(e,t,n)=>({tight:DS(t,n)})},ordered_list:{block:"ordered_list",getAttrs:(e,t,n)=>({order:+e.attrGet("start")||1,tight:DS(t,n)})},heading:{block:"heading",getAttrs:e=>({level:+e.tag.slice(1)})},code_block:{block:"code_block",noCloseToken:!0},fence:{block:"code_block",getAttrs:e=>({params:e.info||""}),noCloseToken:!0},hr:{node:"horizontal_rule"},image:{node:"image",getAttrs:e=>({src:e.attrGet("src"),title:e.attrGet("title")||null,alt:e.children[0]&&e.children[0].content||null})},hardbreak:{node:"hard_break"},em:{mark:"em"},strong:{mark:"strong"},link:{mark:"link",getAttrs:e=>({href:e.attrGet("href"),title:e.attrGet("title")||null})},code_inline:{mark:"code",noCloseToken:!0}});const pee={open:"",close:"",mixable:!0};let mee=class{constructor(t,n,r={}){this.nodes=t,this.marks=n,this.options=r}serialize(t,n={}){n=Object.assign({},this.options,n);let r=new DA(this.nodes,this.marks,n);return r.renderContent(t),r.out}};const lo=new mee({blockquote(e,t){e.wrapBlock("> ",null,t,()=>e.renderContent(t))},code_block(e,t){const n=t.textContent.match(/`{3,}/gm),r=n?n.sort().slice(-1)[0]+"`":"```";e.write(r+(t.attrs.params||"")+`
1376
+ `),e.text(t.textContent,!1),e.write(`
1377
+ `),e.write(r),e.closeBlock(t)},heading(e,t){e.write(e.repeat("#",t.attrs.level)+" "),e.renderInline(t,!1),e.closeBlock(t)},horizontal_rule(e,t){e.write(t.attrs.markup||"---"),e.closeBlock(t)},bullet_list(e,t){e.renderList(t," ",()=>(t.attrs.bullet||"*")+" ")},ordered_list(e,t){let n=t.attrs.order||1,r=String(n+t.childCount-1).length,i=e.repeat(" ",r+2);e.renderList(t,i,o=>{let s=String(n+o);return e.repeat(" ",r-s.length)+s+". "})},list_item(e,t){e.renderContent(t)},paragraph(e,t){e.renderInline(t),e.closeBlock(t)},image(e,t){e.write("!["+e.esc(t.attrs.alt||"")+"]("+t.attrs.src.replace(/[\(\)]/g,"\\$&")+(t.attrs.title?' "'+t.attrs.title.replace(/"/g,'\\"')+'"':"")+")")},hard_break(e,t,n,r){for(let i=r+1;i<n.childCount;i++)if(n.child(i).type!=t.type){e.write(`\\
1378
+ `);return}},text(e,t){e.text(t.text,!e.inAutolink)}},{em:{open:"*",close:"*",mixable:!0,expelEnclosingWhitespace:!0},strong:{open:"**",close:"**",mixable:!0,expelEnclosingWhitespace:!0},link:{open(e,t,n,r){return e.inAutolink=gee(t,n,r),e.inAutolink?"<":"["},close(e,t,n,r){let{inAutolink:i}=e;return e.inAutolink=void 0,i?">":"]("+t.attrs.href.replace(/[\(\)"]/g,"\\$&")+(t.attrs.title?` "${t.attrs.title.replace(/"/g,'\\"')}"`:"")+")"},mixable:!0},code:{open(e,t,n,r){return OS(n.child(r),-1)},close(e,t,n,r){return OS(n.child(r-1),1)},escape:!1}});function OS(e,t){let n=/`+/g,r,i=0;if(e.isText)for(;r=n.exec(e.text);)i=Math.max(i,r[0].length);let o=i>0&&t>0?" `":"`";for(let s=0;s<i;s++)o+="`";return i>0&&t<0&&(o+=" "),o}function gee(e,t,n){if(e.attrs.title||!/^\w+:/.test(e.attrs.href))return!1;let r=t.child(n);return!r.isText||r.text!=e.attrs.href||r.marks[r.marks.length-1]!=e?!1:n==t.childCount-1||!e.isInSet(t.child(n+1).marks)}let DA=class{constructor(t,n,r){this.nodes=t,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(t=2){if(this.closed){if(this.atBlank()||(this.out+=`
1379
+ `),t>1){let n=this.delim,r=/\s+$/.exec(n);r&&(n=n.slice(0,n.length-r[0].length));for(let i=1;i<t;i++)this.out+=n+`
1380
+ `}this.closed=null}}getMark(t){let n=this.marks[t];if(!n){if(this.options.strict!==!1)throw new Error(`Mark type \`${t}\` not supported by Markdown renderer`);n=pee}return n}wrapBlock(t,n,r,i){let o=this.delim;this.write(n??t),this.delim+=t,i(),this.delim=o,this.closeBlock(r)}atBlank(){return/(^|\n)$/.test(this.out)}ensureNewLine(){this.atBlank()||(this.out+=`
1381
+ `)}write(t){this.flushClose(),this.delim&&this.atBlank()&&(this.out+=this.delim),t&&(this.out+=t)}closeBlock(t){this.closed=t}text(t,n=!0){let r=t.split(`
1382
+ `);for(let i=0;i<r.length;i++)this.write(),!n&&r[i][0]=="["&&/(^|[^\\])\!$/.test(this.out)&&(this.out=this.out.slice(0,this.out.length-1)+"\\!"),this.out+=n?this.esc(r[i],this.atBlockStart):r[i],i!=r.length-1&&(this.out+=`
1383
+ `)}render(t,n,r){if(this.nodes[t.type.name])this.nodes[t.type.name](this,t,n,r);else{if(this.options.strict!==!1)throw new Error("Token type `"+t.type.name+"` not supported by Markdown renderer");t.type.isLeaf||(t.type.inlineContent?this.renderInline(t):this.renderContent(t),t.isBlock&&this.closeBlock(t))}}renderContent(t){t.forEach((n,r,i)=>this.render(n,t,i))}renderInline(t,n=!0){this.atBlockStart=n;let r=[],i="",o=(s,a,u)=>{let d=s?s.marks:[];s&&s.type.name===this.options.hardBreakNodeName&&(d=d.filter(b=>{if(u+1==t.childCount)return!1;let v=t.child(u+1);return b.isInSet(v.marks)&&(!v.isText||/\S/.test(v.text))}));let f=i;if(i="",s&&s.isText&&d.some(b=>{let v=this.getMark(b.type.name);return v&&v.expelEnclosingWhitespace&&!b.isInSet(r)})){let[b,v,C]=/^(\s*)(.*)$/m.exec(s.text);v&&(f+=v,s=C?s.withText(C):null,s||(d=r))}if(s&&s.isText&&d.some(b=>{let v=this.getMark(b.type.name);return v&&v.expelEnclosingWhitespace&&!this.isMarkAhead(t,u+1,b)})){let[b,v,C]=/^(.*?)(\s*)$/m.exec(s.text);C&&(i=C,s=v?s.withText(v):null,s||(d=r))}let h=d.length?d[d.length-1]:null,m=h&&this.getMark(h.type.name).escape===!1,g=d.length-(m?1:0);e:for(let b=0;b<g;b++){let v=d[b];if(!this.getMark(v.type.name).mixable)break;for(let C=0;C<r.length;C++){let _=r[C];if(!this.getMark(_.type.name).mixable)break;if(v.eq(_)){b>C?d=d.slice(0,C).concat(v).concat(d.slice(C,b)).concat(d.slice(b+1,g)):C>b&&(d=d.slice(0,b).concat(d.slice(b+1,C)).concat(v).concat(d.slice(C,g)));continue e}}}let x=0;for(;x<Math.min(r.length,g)&&d[x].eq(r[x]);)++x;for(;x<r.length;)this.text(this.markString(r.pop(),!1,t,u),!1);if(f&&this.text(f),s){for(;r.length<g;){let b=d[r.length];r.push(b),this.text(this.markString(b,!0,t,u),!1),this.atBlockStart=!1}m&&s.isText?this.text(this.markString(h,!0,t,u)+s.text+this.markString(h,!1,t,u+1),!1):this.render(s,t,u),this.atBlockStart=!1}s!=null&&s.isText&&s.nodeSize>0&&(this.atBlockStart=!1)};t.forEach(o),o(null,0,t.childCount),this.atBlockStart=!1}renderList(t,n,r){this.closed&&this.closed.type==t.type?this.flushClose(3):this.inTightList&&this.flushClose(1);let i=typeof t.attrs.tight<"u"?t.attrs.tight:this.options.tightLists,o=this.inTightList;this.inTightList=i,t.forEach((s,a,u)=>{u&&i&&this.flushClose(1),this.wrapBlock(n,r(u),t,()=>this.render(s,t,u))}),this.inTightList=o}esc(t,n=!1){return t=t.replace(/[`*\\~\[\]_]/g,(r,i)=>r=="_"&&i>0&&i+1<t.length&&t[i-1].match(/\w/)&&t[i+1].match(/\w/)?r:"\\"+r),n&&(t=t.replace(/^(\+[ ]|[\-*>])/,"\\$&").replace(/^(\s*)(#{1,6})(\s|$)/,"$1\\$2$3").replace(/^(\s*\d+)\.\s/,"$1\\. ")),this.options.escapeExtraCharacters&&(t=t.replace(this.options.escapeExtraCharacters,"\\$&")),t}quote(t){let n=t.indexOf('"')==-1?'""':t.indexOf("'")==-1?"''":"()";return n[0]+t+n[1]}repeat(t,n){let r="";for(let i=0;i<n;i++)r+=t;return r}markString(t,n,r,i){let o=this.getMark(t.type.name),s=n?o.open:o.close;return typeof s=="string"?s:s(this,t,r,i)}getEnclosingWhitespace(t){return{leading:(t.match(/^(\s+)/)||[void 0])[0],trailing:(t.match(/(\s+)$/)||[void 0])[0]}}isMarkAhead(t,n,r){for(;;n++){if(n>=t.childCount)return!1;let i=t.child(n);if(i.type.name!=this.options.hardBreakNodeName)return r.isInSet(i.marks);n++}}};var Zg,RS;function yee(){if(RS)return Zg;RS=1;var e=!0,t=!1,n=!1;Zg=function(b,v){v&&(e=!v.enabled,t=!!v.label,n=!!v.labelAfter),b.core.ruler.after("inline","github-task-lists",function(C){for(var _=C.tokens,E=2;E<_.length;E++)o(_,E)&&(s(_[E],C.Token),r(_[E-2],"class","task-list-item"+(e?"":" enabled")),r(_[i(_,E-2)],"class","contains-task-list"))})};function r(b,v,C){var _=b.attrIndex(v),E=[v,C];_<0?b.attrPush(E):b.attrs[_]=E}function i(b,v){for(var C=b[v].level-1,_=v-1;_>=0;_--)if(b[_].level===C)return _;return-1}function o(b,v){return h(b[v])&&m(b[v-1])&&g(b[v-2])&&x(b[v])}function s(b,v){if(b.children.unshift(a(b,v)),b.children[1].content=b.children[1].content.slice(3),b.content=b.content.slice(3),t)if(n){b.children.pop();var C="task-item-"+Math.ceil(Math.random()*(1e4*1e3)-1e3);b.children[0].content=b.children[0].content.slice(0,-1)+' id="'+C+'">',b.children.push(f(b.content,C,v))}else b.children.unshift(u(v)),b.children.push(d(v))}function a(b,v){var C=new v("html_inline","",0),_=e?' disabled="" ':"";return b.content.indexOf("[ ] ")===0?C.content='<input class="task-list-item-checkbox"'+_+'type="checkbox">':(b.content.indexOf("[x] ")===0||b.content.indexOf("[X] ")===0)&&(C.content='<input class="task-list-item-checkbox" checked=""'+_+'type="checkbox">'),C}function u(b){var v=new b("html_inline","",0);return v.content="<label>",v}function d(b){var v=new b("html_inline","",0);return v.content="</label>",v}function f(b,v,C){var _=new C("html_inline","",0);return _.content='<label class="task-list-item-label" for="'+v+'">'+b+"</label>",_.attrs=[{for:v}],_}function h(b){return b.type==="inline"}function m(b){return b.type==="paragraph_open"}function g(b){return b.type==="list_item_open"}function x(b){return b.content.indexOf("[ ] ")===0||b.content.indexOf("[x] ")===0||b.content.indexOf("[X] ")===0}return Zg}var xee=yee();const bee=Ra(xee);var vee=Object.defineProperty,kee=(e,t,n)=>t in e?vee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mp=(e,t,n)=>(kee(e,typeof t!="symbol"?t+"":t,n),n);const wee=dn.create({name:"markdownTightLists",addOptions:()=>({tight:!0,tightClass:"tight",listTypes:["bulletList","orderedList"]}),addGlobalAttributes(){return[{types:this.options.listTypes,attributes:{tight:{default:this.options.tight,parseHTML:e=>e.getAttribute("data-tight")==="true"||!e.querySelector("p"),renderHTML:e=>({class:e.tight?this.options.tightClass:null,"data-tight":e.tight?"true":null})}}}]},addCommands(){var e=this;return{toggleTight:function(){let t=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:t??!(a!=null&&a.tight)})}return e.options.listTypes.some(s=>o(s))}}}}}),PS=$r();function OA(e,t){return PS.inline.State.prototype.scanDelims.call({src:e,posMax:e.length}),new PS.inline.State(e,null,null,[]).scanDelims(t,!0)}function RA(e,t,n,r){let i=e.substring(0,n)+e.substring(n+t.length);return i=i.substring(0,n+r)+t+i.substring(n+r),i}function Cee(e,t,n,r){let i=n,o=e;for(;i<r&&!OA(o,i).can_open;)o=RA(o,t,i,1),i++;return{text:o,from:i,to:r}}function See(e,t,n,r){let i=r,o=e;for(;i>n&&!OA(o,i).can_close;)o=RA(o,t,i,-1),i--;return{text:o,from:n,to:i}}function Eee(e,t,n,r){let i={text:e,from:n,to:r};return i=Cee(i.text,t,i.from,i.to),i=See(i.text,t,i.from,i.to),i.to-i.from<t.length+1&&(i.text=i.text.substring(0,i.from)+i.text.substring(i.to+t.length)),i.text}class _ee extends DA{constructor(t,n,r){super(t,n,r??{}),mp(this,"inTable",!1),this.inlines=[]}render(t,n,r){super.render(t,n,r);const i=this.inlines[this.inlines.length-1];if(i!=null&&i.start&&i!==null&&i!==void 0&&i.end){const{delimiter:o,start:s,end:a}=this.normalizeInline(i);this.out=Eee(this.out,o,s,a),this.inlines.pop()}}markString(t,n,r,i){const o=this.marks[t.type.name];if(o.expelEnclosingWhitespace)if(n)this.inlines.push({start:this.out.length,delimiter:o.open});else{const s=this.inlines.pop();this.inlines.push({...s,end:this.out.length})}return super.markString(t,n,r,i)}normalizeInline(t){let{start:n,end:r}=t;for(;this.out.charAt(n).match(/\s/);)n++;return{...t,start:n}}}const PA=ti.create({name:"markdownHTMLMark",addStorage(){return{markdown:{serialize:{open(e,t){var n,r;return this.editor.storage.markdown.options.html?(n=(r=jS(t))===null||r===void 0?void 0:r[0])!==null&&n!==void 0?n:"":(console.warn(`Tiptap Markdown: "${t.type.name}" mark is only available in html mode`),"")},close(e,t){var n,r;return this.editor.storage.markdown.options.html&&(n=(r=jS(t))===null||r===void 0?void 0:r[1])!==null&&n!==void 0?n:""}},parse:{}}}}});function jS(e){const t=e.type.schema,n=t.text(" ",[e]),i=sd(fe.from(n),t).match(/^(<.*?>) (<\/.*?>)$/);return i?[i[1],i[2]]:null}function Kx(e){const t=`<body>${e}</body>`;return new window.DOMParser().parseFromString(t,"text/html").body}function Tee(e){return e==null?void 0:e.replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Aee(e){const t=e.parentElement,n=t.cloneNode();for(;t.firstChild&&t.firstChild!==e;)n.appendChild(t.firstChild);n.childNodes.length>0&&t.parentElement.insertBefore(n,t),t.parentElement.insertBefore(e,t),t.childNodes.length===0&&t.remove()}function Mee(e){const t=e.parentNode;for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}const Jp=Kt.create({name:"markdownHTMLNode",addStorage(){return{markdown:{serialize(e,t,n){this.editor.storage.markdown.options.html?e.write(Nee(t,n)):(console.warn(`Tiptap Markdown: "${t.type.name}" node is only available in html mode`),e.write(`[${t.type.name}]`)),t.isBlock&&e.closeBlock(t)},parse:{}}}}});function Nee(e,t){const n=e.type.schema,r=sd(fe.from(e),n);return e.isBlock&&(t instanceof fe||t.type.name===n.topNodeType.name)?Iee(r):r}function Iee(e){const n=Kx(e).firstElementChild;return n.innerHTML=n.innerHTML.trim()?`
1384
+ ${n.innerHTML}
1385
+ `:`
1386
+ `,n.outerHTML}const Dee=Kt.create({name:"blockquote"}),Oee=Dee.extend({addStorage(){return{markdown:{serialize:lo.nodes.blockquote,parse:{}}}}}),Ree=Kt.create({name:"bulletList"}),jA=Ree.extend({addStorage(){return{markdown:{serialize(e,t){return e.renderList(t," ",()=>(this.editor.storage.markdown.options.bulletListMarker||"-")+" ")},parse:{}}}}}),Pee=Kt.create({name:"codeBlock"}),jee=Pee.extend({addStorage(){return{markdown:{serialize(e,t){e.write("```"+(t.attrs.language||"")+`
1387
+ `),e.text(t.textContent,!1),e.ensureNewLine(),e.write("```"),e.closeBlock(t)},parse:{setup(e){var t;e.set({langPrefix:(t=this.options.languageClassPrefix)!==null&&t!==void 0?t:"language-"})},updateDOM(e){e.innerHTML=e.innerHTML.replace(/\n<\/code><\/pre>/g,"</code></pre>")}}}}}}),zee=Kt.create({name:"hardBreak"}),zA=zee.extend({addStorage(){return{markdown:{serialize(e,t,n,r){for(let i=r+1;i<n.childCount;i++)if(n.child(i).type!=t.type){e.write(e.inTable?Jp.storage.markdown.serialize.call(this,e,t,n):`\\
1388
+ `);return}},parse:{}}}}}),Lee=Kt.create({name:"heading"}),Fee=Lee.extend({addStorage(){return{markdown:{serialize:lo.nodes.heading,parse:{}}}}}),$ee=Kt.create({name:"horizontalRule"}),Bee=$ee.extend({addStorage(){return{markdown:{serialize:lo.nodes.horizontal_rule,parse:{}}}}}),Uee=Kt.create({name:"image"}),Vee=Uee.extend({addStorage(){return{markdown:{serialize:lo.nodes.image,parse:{}}}}}),Hee=Kt.create({name:"listItem"}),Wee=Hee.extend({addStorage(){return{markdown:{serialize:lo.nodes.list_item,parse:{}}}}}),qee=Kt.create({name:"orderedList"});function Zee(e,t,n){let r=0;for(;n-r>0&&t.child(n-r-1).type.name===e.type.name;r++);return r}const Jee=qee.extend({addStorage(){return{markdown:{serialize(e,t,n,r){const i=t.attrs.start||1,o=String(i+t.childCount-1).length,s=e.repeat(" ",o+2),u=Zee(t,n,r)%2?") ":". ";e.renderList(t,s,d=>{const f=String(i+d);return e.repeat(" ",o-f.length)+f+u})},parse:{}}}}}),Kee=Kt.create({name:"paragraph"}),Gee=Kee.extend({addStorage(){return{markdown:{serialize:lo.nodes.paragraph,parse:{}}}}});function Jg(e){var t,n;return(t=e==null||(n=e.content)===null||n===void 0?void 0:n.content)!==null&&t!==void 0?t:[]}const Yee=Kt.create({name:"table"}),Qee=Yee.extend({addStorage(){return{markdown:{serialize(e,t,n){if(!Xee(t)){Jp.storage.markdown.serialize.call(this,e,t,n);return}e.inTable=!0,t.forEach((r,i,o)=>{if(e.write("| "),r.forEach((s,a,u)=>{u&&e.write(" | ");const d=s.firstChild;d.textContent.trim()&&e.renderInline(d)}),e.write(" |"),e.ensureNewLine(),!o){const s=Array.from({length:r.childCount}).map(()=>"---").join(" | ");e.write(`| ${s} |`),e.ensureNewLine()}}),e.closeBlock(t),e.inTable=!1},parse:{}}}}});function zS(e){return e.attrs.colspan>1||e.attrs.rowspan>1}function Xee(e){const t=Jg(e),n=t[0],r=t.slice(1);return!(Jg(n).some(i=>i.type.name!=="tableHeader"||zS(i)||i.childCount>1)||r.some(i=>Jg(i).some(o=>o.type.name==="tableHeader"||zS(o)||o.childCount>1)))}const ete=Kt.create({name:"taskItem"}),tte=ete.extend({addStorage(){return{markdown:{serialize(e,t){const n=t.attrs.checked?"[x]":"[ ]";e.write(`${n} `),e.renderContent(t)},parse:{updateDOM(e){[...e.querySelectorAll(".task-list-item")].forEach(t=>{const n=t.querySelector("input");t.setAttribute("data-type","taskItem"),n&&(t.setAttribute("data-checked",n.checked),n.remove())})}}}}}}),nte=Kt.create({name:"taskList"}),rte=nte.extend({addStorage(){return{markdown:{serialize:jA.storage.markdown.serialize,parse:{setup(e){e.use(bee)},updateDOM(e){[...e.querySelectorAll(".contains-task-list")].forEach(t=>{t.setAttribute("data-type","taskList")})}}}}}}),ite=Kt.create({name:"text"}),ote=ite.extend({addStorage(){return{markdown:{serialize(e,t){e.text(Tee(t.text))},parse:{}}}}}),ste=ti.create({name:"bold"}),ate=ste.extend({addStorage(){return{markdown:{serialize:lo.marks.strong,parse:{}}}}}),lte=ti.create({name:"code"}),ute=lte.extend({addStorage(){return{markdown:{serialize:lo.marks.code,parse:{}}}}}),cte=ti.create({name:"italic"}),dte=cte.extend({addStorage(){return{markdown:{serialize:lo.marks.em,parse:{}}}}}),fte=ti.create({name:"link"}),hte=fte.extend({addStorage(){return{markdown:{serialize:lo.marks.link,parse:{}}}}}),pte=ti.create({name:"strike"}),mte=pte.extend({addStorage(){return{markdown:{serialize:{open:"~~",close:"~~",expelEnclosingWhitespace:!0},parse:{}}}}}),gte=[Oee,jA,jee,zA,Fee,Bee,Jp,Vee,Wee,Jee,Gee,Qee,tte,rte,ote,ate,ute,PA,dte,hte,mte];function gp(e){var t,n;const r=(t=e.storage)===null||t===void 0?void 0:t.markdown,i=(n=gte.find(o=>o.name===e.name))===null||n===void 0?void 0:n.storage.markdown;return r||i?{...i,...r}:null}class yte{constructor(t){mp(this,"editor",null),this.editor=t}serialize(t){const n=new _ee(this.nodes,this.marks,{hardBreakNodeName:zA.name});return n.renderContent(t),n.out}get nodes(){var t;return{...Object.fromEntries(Object.keys(this.editor.schema.nodes).map(n=>[n,this.serializeNode(Jp)])),...Object.fromEntries((t=this.editor.extensionManager.extensions.filter(n=>n.type==="node"&&this.serializeNode(n)).map(n=>[n.name,this.serializeNode(n)]))!==null&&t!==void 0?t:[])}}get marks(){var t;return{...Object.fromEntries(Object.keys(this.editor.schema.marks).map(n=>[n,this.serializeMark(PA)])),...Object.fromEntries((t=this.editor.extensionManager.extensions.filter(n=>n.type==="mark"&&this.serializeMark(n)).map(n=>[n.name,this.serializeMark(n)]))!==null&&t!==void 0?t:[])}}serializeNode(t){var n;return(n=gp(t))===null||n===void 0||(n=n.serialize)===null||n===void 0?void 0:n.bind({editor:this.editor,options:t.options})}serializeMark(t){var n;const r=(n=gp(t))===null||n===void 0?void 0:n.serialize;return r?{...r,open:typeof r.open=="function"?r.open.bind({editor:this.editor,options:t.options}):r.open,close:typeof r.close=="function"?r.close.bind({editor:this.editor,options:t.options}):r.close}:null}}class xte{constructor(t,n){mp(this,"editor",null),mp(this,"md",null);let{html:r,linkify:i,breaks:o}=n;this.editor=t,this.md=this.withPatchedRenderer($r({html:r,linkify:i,breaks:o}))}parse(t){let{inline:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(typeof t=="string"){this.editor.extensionManager.extensions.forEach(o=>{var s;return(s=gp(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(t),i=Kx(r);return this.editor.extensionManager.extensions.forEach(o=>{var s;return(s=gp(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:t}),i.innerHTML}return t}normalizeDOM(t,n){let{inline:r,content:i}=n;return this.normalizeBlocks(t),t.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(t,i),t}normalizeBlocks(t){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&&[...t.querySelectorAll(r)].forEach(i=>{i.parentElement.matches("p")&&Aee(i)})}normalizeInline(t,n){var r;if((r=t.firstElementChild)!==null&&r!==void 0&&r.matches("p")){var i,o,s,a;const u=t.firstElementChild,{nextElementSibling:d}=u,f=(i=(o=n.match(/^\s+/))===null||o===void 0?void 0:o[0])!==null&&i!==void 0?i:"",h=d?"":(s=(a=n.match(/\s+$/))===null||a===void 0?void 0:a[0])!==null&&s!==void 0?s:"";if(n.match(/^\n\n/)){u.innerHTML=`${u.innerHTML}${h}`;return}Mee(u),t.innerHTML=`${f}${t.innerHTML}${h}`}}withPatchedRenderer(t){const n=r=>function(){const i=r(...arguments);return i===`
1389
+ `?i:i[i.length-1]===`
1390
+ `?i.slice(0,-1):i};return t.renderer.rules.hardbreak=n(t.renderer.rules.hardbreak),t.renderer.rules.softbreak=n(t.renderer.rules.softbreak),t.renderer.rules.fence=n(t.renderer.rules.fence),t.renderer.rules.code_block=n(t.renderer.rules.code_block),t.renderer.renderToken=n(t.renderer.renderToken.bind(t.renderer)),t}}const bte=dn.create({name:"markdownClipboard",addOptions(){return{transformPastedText:!1,transformCopiedText:!1}},addProseMirrorPlugins(){return[new mn({key:new Rn("markdownClipboard"),props:{clipboardTextParser:(e,t,n)=>{if(n||!this.options.transformPastedText)return null;const r=this.editor.storage.markdown.parser.parse(e,{inline:!0});return Oo.fromSchema(this.editor.schema).parseSlice(Kx(r),{preserveWhitespace:!0,context:t})},clipboardTextSerializer:e=>this.options.transformCopiedText?this.editor.storage.markdown.serializer.serialize(e.content):null}})]}}),vte=dn.create({name:"markdown",priority:50,addOptions(){return{html:!0,tightLists:!0,tightListClass:"tight",bulletListMarker:"-",linkify:!1,breaks:!1,transformPastedText:!1,transformCopiedText:!1}},addCommands(){const e=m6.Commands.config.addCommands();return{setContent:(t,n)=>r=>e.setContent(r.editor.storage.markdown.parser.parse(t),n)(r),insertContentAt:(t,n,r)=>i=>e.insertContentAt(t,i.editor.storage.markdown.parser.parse(n,{inline:!0}),r)(i)}},onBeforeCreate(){this.editor.storage.markdown={options:{...this.options},parser:new xte(this.editor,this.options),serializer:new yte(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[wee.configure({tight:this.options.tightLists,tightClass:this.options.tightListClass}),bte.configure({transformPastedText:this.options.transformPastedText,transformCopiedText:this.options.transformCopiedText})]}});function kte(){return Math.random().toString(36).substring(2,15)}function nc(e){const t=[];let n=e;for(;n&&n!==document.body;){let r=n.tagName.toLowerCase();if(n.id){r=`#${n.id}`,t.unshift(r);break}const i=n.parentElement;if(i){const o=Array.from(i.children).filter(s=>s.tagName===n.tagName);if(o.length>1){const s=o.indexOf(n)+1;r+=`:nth-of-type(${s})`}}t.unshift(r),n=n.parentElement}return t.join(" > ")}function sy(e){var r;const t=[];let n=e;for(;n&&n!==document.body&&n!==document.documentElement;){let i=n.tagName.toLowerCase();if(n.id){t.unshift(`//*[@id="${n.id}"]`);break}const o=n.parentElement;if(o){const s=Array.from(o.children).filter(a=>a.tagName===n.tagName);if(s.length>1){const a=s.indexOf(n)+1;i+=`[${a}]`}}t.unshift(i),n=n.parentElement}return(r=t[0])!=null&&r.startsWith("//*[@id")||t.unshift(""),t.join("/")||"//"+e.tagName.toLowerCase()}function wte(e){const{container:t,exclude:n=[],enabled:r=!0}=e,[i,o]=A.useState(null),[s,a]=A.useState(null),u=A.useRef(null),d=A.useCallback(b=>b.closest("[data-bobbin]")?!0:n.some(v=>b.matches(v)||b.closest(v)),[n]),f=A.useCallback(b=>({element:b,rect:b.getBoundingClientRect(),path:nc(b),xpath:sy(b),tagName:b.tagName.toLowerCase(),id:b.id||void 0,classList:Array.from(b.classList)}),[]),h=A.useCallback(b=>{if(!r)return;const v=document.elementFromPoint(b.clientX,b.clientY);if(!v||d(v)){o(null);return}if(t&&!t.contains(v)){o(null);return}o(f(v))},[r,t,d,f]),m=A.useCallback(b=>{!r||b.target.closest("[data-bobbin]")||i&&(b.preventDefault(),b.stopPropagation(),a(i),u.current=i.rect)},[r,i]),g=A.useCallback(()=>{a(null),o(null)},[]),x=A.useCallback(b=>{if(!b){g();return}a(f(b))},[f,g]);return A.useEffect(()=>{if(r)return document.addEventListener("mousemove",h,{passive:!0}),document.addEventListener("click",m,{capture:!0}),()=>{document.removeEventListener("mousemove",h),document.removeEventListener("click",m,{capture:!0})}},[r,h,m]),A.useEffect(()=>{if(!s)return;const b=()=>{const v=s.element.getBoundingClientRect();a(C=>C?{...C,rect:v}:null)};return window.addEventListener("scroll",b,{passive:!0}),window.addEventListener("resize",b,{passive:!0}),()=>{window.removeEventListener("scroll",b),window.removeEventListener("resize",b)}},[s==null?void 0:s.element]),{hoveredElement:i,selectedElement:s,selectElement:x,clearSelection:g,lastRect:u.current}}function Cte(){const[e,t]=A.useState([]),n=A.useRef([]),r=A.useRef(new Map),i=A.useCallback((x,b,v)=>{r.current.has(x)||r.current.set(x,new Map);const C=r.current.get(x);C.has(b)||C.set(b,v)},[]),o=A.useCallback(x=>{const b={...x,id:kte(),timestamp:Date.now()};return t(v=>[...v,b]),n.current.push(b),b},[]),s=A.useCallback((x,b,v,C,_,E)=>(i(x,C,E),o({type:"style",target:{path:x,xpath:b,tagName:v},before:{property:C,value:E},after:{property:C,value:_}})),[o,i]),a=A.useCallback((x,b,v,C,_)=>o({type:"text",target:{path:x,xpath:b,tagName:v},before:C,after:_}),[o]),u=A.useCallback((x,b,v,C,_,E,I)=>o({type:"move",target:{path:x,xpath:b,tagName:v},before:{parent:C,index:_},after:{parent:E,index:I}}),[o]),d=A.useCallback((x,b,v,C,_,E,I)=>o({type:x,target:{path:b,xpath:v,tagName:C},before:_,after:E,metadata:I}),[o]),f=A.useCallback(()=>{if(e.length===0)return null;const x=e[e.length-1];return t(b=>b.slice(0,-1)),x},[e]),h=A.useCallback(()=>{t([]),r.current.clear()},[]),m=A.useCallback(()=>[...e],[e]),g=A.useMemo(()=>{var b;const x=new Map;for(const v of e){let C;if(v.type==="style"){const _=v;C=`${v.target.path}:style:${_.after.property}`}else C=`${v.target.path}:${v.type}:${v.id}`;if(v.type==="style"){const _=v;if(((b=r.current.get(v.target.path))==null?void 0:b.get(_.after.property))===_.after.value){x.delete(C);continue}}x.set(C,v)}return Array.from(x.values())},[e]);return{changes:e,deduplicatedChanges:g,changeCount:g.length,recordStyleChange:s,recordTextChange:a,recordMoveChange:u,recordChange:d,undo:f,clearChanges:h,getChanges:m,originalStates:r.current}}function Ste(){const[e,t]=A.useState(null),n=A.useCallback(i=>{t(i)},[]),r=A.useCallback(()=>{t(null)},[]);return{copied:e,copy:n,clear:r,hasCopied:e!==null}}function LA(e,t=[]){const n={version:"1.0",timestamp:new Date().toISOString(),changeCount:e.length+t.length,changes:e.map(r=>{const i={type:r.type,target:r.target.path,xpath:r.target.xpath};switch(r.type){case"style":return{...i,property:r.before.property,before:r.before.value,after:r.after.value};case"text":return{...i,before:r.before,after:r.after};case"move":return{...i,before:`${r.before.parent}[${r.before.index}]`,after:`${r.after.parent}[${r.after.index}]`};default:return{...i,before:JSON.stringify(r.before),after:JSON.stringify(r.after)}}}),annotations:t.map(r=>({type:"annotation",target:r.elementPath,xpath:r.elementXpath,note:r.content}))};return ay(n)}function ay(e,t=0){const n=" ".repeat(t);if(e==null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="number")return String(e);if(typeof e=="string")return/[\n:{}[\],&*#?|\-<>=!%@`]/.test(e)||e.trim()!==e?`"${e.replace(/"/g,'\\"').replace(/\n/g,"\\n")}"`:e||'""';if(Array.isArray(e))return e.length===0?"[]":e.map(r=>{const i=ay(r,t+1);return typeof r=="object"&&r!==null?`${n}- ${i.trimStart()}`:`${n}- ${i}`}).join(`
1391
+ `);if(typeof e=="object"){const r=Object.entries(e);return r.length===0?"{}":r.map(([i,o])=>{const s=ay(o,t+1);return typeof o=="object"&&o!==null&&!Array.isArray(o)?`${n}${i}:
1392
+ ${s}`:Array.isArray(o)&&o.length>0?`${n}${i}:
1393
+ ${s}`:`${n}${i}: ${s}`}).join(`
1394
+ `)}return String(e)}var Ete={slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},white:{DEFAULT:"#ffffff"},black:{DEFAULT:"#000000"},transparent:{DEFAULT:"transparent"},current:{DEFAULT:"currentColor"}},_te={px:"1px",0:"0px","0.5":"0.125rem",1:"0.25rem","1.5":"0.375rem",2:"0.5rem","2.5":"0.625rem",3:"0.75rem","3.5":"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",11:"2.75rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},Tte={xs:"0.75rem",sm:"0.875rem",base:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"3.75rem","7xl":"4.5rem","8xl":"6rem","9xl":"8rem"},Ate={thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},Mte={sans:'ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"',serif:'ui-serif, Georgia, Cambria, "Times New Roman", Times, serif',mono:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace'},Nte={none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2"},Ite={tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},Dte={none:"0px",sm:"0.125rem",DEFAULT:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},Ote={0:"0px",DEFAULT:"1px",2:"2px",4:"4px",8:"8px"},Rte={sm:"0 1px 2px 0 rgb(0 0 0 / 0.05)",DEFAULT:"0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",md:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",lg:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",xl:"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)","2xl":"0 25px 50px -12px rgb(0 0 0 / 0.25)",inner:"inset 0 2px 4px 0 rgb(0 0 0 / 0.05)",none:"none"},Pte={colors:Ete,spacing:_te,fontSize:Tte,fontWeight:Ate,fontFamily:Mte,borderRadius:Dte,borderWidth:Ote,boxShadow:Rte,lineHeight:Nte,letterSpacing:Ite};function LS(e,t,n){e.style.setProperty(t,n)}function FS(e,t){t?(e.contentEditable="true",e.querySelectorAll("p, span, h1, h2, h3, h4, h5, h6, a, li, td, th, label, div").forEach(r=>{var i;if(r instanceof HTMLElement&&r.childNodes.length>0){for(const o of r.childNodes)if(o.nodeType===Node.TEXT_NODE&&((i=o.textContent)!=null&&i.trim())){r.contentEditable="true";break}}})):(e.contentEditable="false",e.querySelectorAll('[contenteditable="true"]').forEach(r=>{r instanceof HTMLElement&&(r.contentEditable="false")}))}function jte(e={}){const{tokens:t,container:n,defaultActive:r=!1,onChanges:i,onSelect:o,exclude:s=[]}=e,[a,u]=A.useState(r),[d,f]=A.useState(!1),[h,m]=A.useState([]),[g,x]=A.useState(!1),[b,v]=A.useState("style"),[C,_]=A.useState("system"),E=A.useMemo(()=>({...Pte,...t}),[t]),{hoveredElement:I,selectedElement:N,selectElement:M,clearSelection:F}=wte({container:n,exclude:[...s,"[data-bobbin]"],enabled:a}),R=Cte(),D=Ste();A.useEffect(()=>{if(N)return FS(N.element,!0),()=>FS(N.element,!1)},[N]),A.useEffect(()=>{i==null||i(R.changes)},[R.changes,i]),A.useEffect(()=>{o==null||o(N)},[N,o]),A.useEffect(()=>{const pe=document.documentElement;if(C==="dark")pe.classList.add("dark"),pe.style.colorScheme="dark";else if(C==="light")pe.classList.remove("dark"),pe.style.colorScheme="light";else{const Pe=window.matchMedia("(prefers-color-scheme: dark)").matches;pe.classList.toggle("dark",Pe),pe.style.colorScheme=Pe?"dark":"light"}},[C]);const L=A.useCallback(()=>u(!0),[]),X=A.useCallback(()=>{u(!1),F()},[F]),ee=A.useCallback((pe,Pe)=>{if(!N)return;const je=N.element,$e=getComputedStyle(je).getPropertyValue(pe);LS(je,pe,Pe),R.recordStyleChange(N.path,N.xpath,N.tagName,pe,Pe,$e)},[N,R]),Ie=A.useCallback(()=>{if(!N)return;const pe=N.element;pe.parentElement&&(R.recordChange("delete",N.path,N.xpath,N.tagName,pe.outerHTML,null),pe.remove(),F())},[N,R,F]),he=A.useCallback((pe,Pe)=>{if(!N)return;const je=N.element,$e=je.parentElement;if(!$e)return;const qt=Array.from($e.children).indexOf(je),Pn=nc($e),ni=nc(pe);if(Pe>=pe.children.length)pe.appendChild(je);else{const uo=pe.children[Pe]??null;pe.insertBefore(je,uo)}R.recordMoveChange(N.path,N.xpath,N.tagName,Pn,qt,ni,Pe)},[N,R]),Z=A.useCallback(()=>{if(!N)return;const pe=N.element,Pe=pe.cloneNode(!0),je=pe.parentElement;je&&je.insertBefore(Pe,pe.nextSibling),R.recordChange("duplicate",N.path,N.xpath,N.tagName,null,Pe.outerHTML),M(Pe)},[N,R,M]),ge=A.useCallback((pe,Pe="")=>{var qt,Pn;if(!N)return;const je=N.element,$e=document.createElement("span");$e.textContent=Pe||"​",$e.contentEditable="true",pe==="child"?je.appendChild($e):pe==="before"?(qt=je.parentElement)==null||qt.insertBefore($e,je):(Pn=je.parentElement)==null||Pn.insertBefore($e,je.nextSibling),R.recordChange("insert",nc($e),sy($e),"span",null,$e.outerHTML,{direction:pe}),M($e)},[N,R,M]),Oe=A.useCallback(()=>{N&&D.copy(N)},[N,D]),Y=A.useCallback(pe=>{var $e,qt;if(!N||!D.copied)return;const Pe=N.element,je=D.copied.element.cloneNode(!0);pe==="child"?Pe.appendChild(je):pe==="before"?($e=Pe.parentElement)==null||$e.insertBefore(je,Pe):(qt=Pe.parentElement)==null||qt.insertBefore(je,Pe.nextSibling),R.recordChange("insert",nc(je),sy(je),je.tagName.toLowerCase(),null,je.outerHTML,{source:"paste",direction:pe}),M(je)},[N,D,R,M]),qe=A.useCallback(pe=>{N&&m(Pe=>{const je=Pe.findIndex($e=>$e.elementPath===N.path);if(je>=0){const $e=Pe[je];if(!$e)return Pe;if(!pe.trim())return Pe.filter((Pn,ni)=>ni!==je);const qt=[...Pe];return qt[je]={id:$e.id,elementPath:$e.elementPath,elementXpath:$e.elementXpath,content:pe,createdAt:Date.now()},qt}else if(pe.trim()){const $e={id:crypto.randomUUID(),elementPath:N.path,elementXpath:N.xpath,content:pe,createdAt:Date.now()};return[...Pe,$e]}return Pe})},[N]),O=A.useCallback(()=>{x(pe=>!pe)},[]),W=A.useCallback(()=>{_(pe=>pe==="light"?"dark":pe==="dark"?"system":"light")},[]),ie=A.useCallback(()=>{const pe=R.undo();pe&&console.log("Undoing:",pe)},[R]),P=A.useCallback(()=>{const pe=R.originalStates;for(const[Pe,je]of pe.entries()){const $e=document.querySelector(Pe);if($e)for(const[qt,Pn]of je.entries())LS($e,qt,Pn)}R.clearChanges()},[R]),Ze=A.useCallback(()=>LA(R.deduplicatedChanges,h),[R.deduplicatedChanges,h]),V={isActive:a,isPillExpanded:d,hoveredElement:I,selectedElement:N,changes:R.deduplicatedChanges,annotations:h,clipboard:D.copied,showMarginPadding:g,activePanel:b,theme:C},Re={activate:L,deactivate:X,selectElement:M,clearSelection:F,applyStyle:ee,deleteElement:Ie,moveElement:he,duplicateElement:Z,insertElement:ge,copyElement:Oe,pasteElement:Y,annotate:qe,toggleMarginPadding:O,toggleTheme:W,undo:ie,exportChanges:Ze,getChanges:R.getChanges,resetChanges:P};return{...V,...Re,tokens:E,setActivePanel:v,setIsPillExpanded:f}}var zte=()=>w.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[w.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"}),w.jsx("path",{d:"M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"})]}),Lte=()=>w.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[w.jsx("path",{d:"M12 20h9"}),w.jsx("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"})]});function Fte({state:e,actions:t,position:n,container:r,zIndex:i=9999}){const[o,s]=A.useState(!1),[a,u]=A.useState(!1),[d,f]=A.useState(null),h=n??{bottom:16,right:16};A.useLayoutEffect(()=>{if(!r){f(null);return}const b=()=>{const C=r.getBoundingClientRect();f({bottom:window.innerHeight-C.bottom+h.bottom,right:window.innerWidth-C.right+h.right})};b();const v=new ResizeObserver(b);return v.observe(r),window.addEventListener("scroll",b,!0),()=>{v.disconnect(),window.removeEventListener("scroll",b,!0)}},[r,h.bottom,h.right]);const m=d??h,g=()=>{e.isActive?t.deactivate():t.activate()},x=b=>{b.stopPropagation();const v=t.exportChanges();navigator.clipboard.writeText(v),u(!0),setTimeout(()=>u(!1),1500)};return w.jsxs("div",{"data-bobbin":"pill",className:"bobbin-pill",style:{position:"fixed",bottom:m.bottom,right:m.right,zIndex:i,display:"flex",alignItems:"center",gap:"6px",padding:"6px 10px",borderRadius:"9999px",backgroundColor:e.isActive?"#18181b":"#fafafa",color:e.isActive?"#fafafa":"#18181b",border:"1px solid #e4e4e7",cursor:"pointer",boxShadow:"0 1px 2px 0 rgb(0 0 0 / 0.05)",transition:"all 0.15s ease",userSelect:"none",fontSize:"13px",fontFamily:"system-ui, -apple-system, sans-serif"},onClick:g,children:[w.jsx(Lte,{}),(e.changes.length>0||e.annotations.length>0)&&w.jsxs("button",{onClick:x,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),style:{display:"flex",alignItems:"center",gap:"4px",padding:"2px 6px",borderRadius:"9999px",backgroundColor:e.isActive?"#fafafa":"#18181b",color:e.isActive?"#18181b":"#fafafa",fontSize:"11px",fontWeight:500,border:"none",cursor:"pointer",transition:"all 0.1s ease"},title:"Copy changes as YAML",children:[w.jsx("span",{children:e.changes.length+e.annotations.length}),o&&w.jsx(zte,{}),a&&w.jsx("span",{style:{fontSize:"10px"},children:"✓"})]}),e.clipboard&&w.jsx("div",{style:{width:"6px",height:"6px",borderRadius:"50%",backgroundColor:e.isActive?"#fafafa":"#18181b",border:"1px solid #a1a1aa"},title:"Element copied"})]})}function $te({hoveredElement:e,selectedElement:t,offset:n=4,zIndex:r=9998}){const[i,o]=A.useState(null),[s,a]=A.useState(null);A.useLayoutEffect(()=>{if(!e||e===t){o(null);return}o(e.rect)},[e,t]),A.useLayoutEffect(()=>{if(!t){a(null);return}a(t.rect)},[t]);const u=(d,f)=>d?{position:"fixed",top:d.top-n,left:d.left-n,width:d.width+n*2,height:d.height+n*2,border:f?"1.5px solid #18181b":"1.5px dashed #71717a",borderRadius:"3px",pointerEvents:"none",zIndex:r,transition:"all 0.12s cubic-bezier(0.4, 0, 0.2, 1)",opacity:1,boxShadow:f?"0 0 0 1px rgba(24, 24, 27, 0.1)":"none"}:{opacity:0,pointerEvents:"none"};return w.jsxs(w.Fragment,{children:[w.jsx("div",{"data-bobbin":"hover-overlay",style:u(i,!1)}),w.jsx("div",{"data-bobbin":"select-overlay",style:u(s,!0)})]})}function Bte(e){const t=e.parentElement;if(!t)return"unknown";const n=getComputedStyle(t),r=n.display,i=n.flexDirection;return r.includes("flex")?i==="column"||i==="column-reverse"?"vertical":"horizontal":r.includes("grid")?"horizontal":"vertical"}var Ute=60,$S=70,yl=18,Wf=28;function Vte({selectedElement:e,actions:t,clipboard:n,zIndex:r=9999}){const[i,o]=A.useState(null),[s,a]=A.useState(null),[u,d]=A.useState(!1),[f,h]=A.useState(null),[m,g]=A.useState(!1);A.useRef(null);const{rect:x}=e,b=A.useMemo(()=>Bte(e.element),[e.element]);x.width<Ute,x.height<$S,x.width<$S,A.useEffect(()=>{g(!1),a(null),o(null)},[e.path]);const v=()=>w.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:w.jsx("path",{d:"M3 6h18M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"})}),C=()=>w.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[w.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"}),w.jsx("path",{d:"M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"})]}),_=()=>w.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[w.jsx("polyline",{points:"5 9 2 12 5 15"}),w.jsx("polyline",{points:"9 5 12 2 15 5"}),w.jsx("polyline",{points:"15 19 12 22 9 19"}),w.jsx("polyline",{points:"19 9 22 12 19 15"}),w.jsx("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),w.jsx("line",{x1:"12",y1:"2",x2:"12",y2:"22"})]}),E=()=>w.jsx("svg",{width:"9",height:"9",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:w.jsx("path",{d:"M12 5v14M5 12h14"})}),I=()=>w.jsxs("svg",{width:"9",height:"9",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[w.jsx("rect",{x:"8",y:"8",width:"12",height:"12",rx:"2"}),w.jsx("rect",{x:"4",y:"4",width:"12",height:"12",rx:"2"})]}),N=()=>w.jsxs("svg",{width:"9",height:"9",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[w.jsx("path",{d:"M16 4h2a2 2 0 012 2v14a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2h2"}),w.jsx("rect",{x:"8",y:"2",width:"8",height:"4",rx:"1"})]});A.useEffect(()=>{if(!m&&!s)return;const Z=Oe=>{Oe.target.closest('[data-bobbin="control-handles"]')||(g(!1),a(null))},ge=setTimeout(()=>{document.addEventListener("mousedown",Z)},0);return()=>{clearTimeout(ge),document.removeEventListener("mousedown",Z)}},[m,s]);const M=A.useCallback(Z=>{if(!u)return;const Oe=document.elementsFromPoint(Z.clientX,Z.clientY).find(Y=>!Y.hasAttribute("data-bobbin")&&Y!==e.element&&!e.element.contains(Y)&&Y instanceof HTMLElement&&Y.tagName!=="HTML"&&Y.tagName!=="BODY");Oe!==f&&(f&&(f.style.outline="",f.style.outlineOffset=""),Oe&&(Oe.style.outline="2px dashed #3b82f6",Oe.style.outlineOffset="2px"),h(Oe||null))},[u,f,e.element]),F=A.useCallback(()=>{if(u&&f){const Z=f.parentElement;if(Z){const ge=Array.from(Z.children).indexOf(f)+1;t.moveElement(Z,ge)}f.style.outline="",f.style.outlineOffset=""}d(!1),h(null)},[u,f,t]);A.useEffect(()=>(u&&(document.addEventListener("mousemove",M),document.addEventListener("mouseup",F),document.body.style.cursor="grabbing"),()=>{document.removeEventListener("mousemove",M),document.removeEventListener("mouseup",F),document.body.style.cursor="",f&&(f.style.outline="",f.style.outlineOffset="")}),[u,M,F,f]);const R=Z=>{const ge=Z==="top"||Z==="bottom",Oe={position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",gap:"3px",zIndex:r,transition:"opacity 0.1s ease",pointerEvents:"auto"};return ge?{...Oe,left:x.left,width:x.width,height:Wf,top:Z==="top"?x.top-Wf:x.bottom,flexDirection:"row"}:{...Oe,top:x.top,height:x.height,width:Wf,left:Z==="left"?x.left-Wf:x.right,flexDirection:"column"}},D=({icon:Z,onClick:ge,title:Oe,visible:Y})=>{const[qe,O]=A.useState(!1);return Y?w.jsx("button",{style:{width:yl,height:yl,borderRadius:"3px",backgroundColor:qe?"#27272a":"#18181b",color:"#fafafa",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.1s ease",boxShadow:"0 1px 3px 0 rgb(0 0 0 / 0.2)",pointerEvents:"auto",flexShrink:0},onClick:W=>{W.stopPropagation(),W.preventDefault(),ge()},onMouseEnter:()=>O(!0),onMouseLeave:()=>O(!1),title:Oe,children:Z}):null},L=()=>{const[Z,ge]=A.useState(!1);return w.jsx("button",{style:{width:yl,height:yl,borderRadius:"3px",backgroundColor:Z?"#27272a":"#18181b",color:"#fafafa",border:"none",cursor:u?"grabbing":"grab",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.1s ease",boxShadow:"0 1px 3px 0 rgb(0 0 0 / 0.2)",pointerEvents:"auto",flexShrink:0},onMouseDown:Oe=>{Oe.stopPropagation(),Oe.preventDefault(),d(!0)},onMouseEnter:()=>ge(!0),onMouseLeave:()=>ge(!1),title:"Move element (drag to new location)",children:w.jsx(_,{})})},X=({position:Z})=>{const ge=ee(Z),Y=Z==="top"||Z==="bottom"?w.jsx("div",{style:{width:"1px",height:yl,backgroundColor:"#3f3f46",margin:"0 2px"}}):w.jsx("div",{style:{height:"1px",width:yl,backgroundColor:"#3f3f46",margin:"2px 0"}});return w.jsxs(w.Fragment,{children:[Z==="top"&&w.jsxs(w.Fragment,{children:[w.jsx(D,{icon:w.jsx(v,{}),onClick:()=>t.deleteElement(),title:"Delete element",visible:!0}),w.jsx(D,{icon:w.jsx(C,{}),onClick:()=>t.copyElement(),title:"Copy element",visible:!0}),Y]}),w.jsx(D,{icon:w.jsx(E,{}),onClick:()=>t.insertElement(ge),title:`Add text ${ge}`,visible:!0}),w.jsx(D,{icon:w.jsx(N,{}),onClick:()=>t.pasteElement(ge),title:`Paste ${ge}`,visible:!!n}),w.jsx(D,{icon:w.jsx(I,{}),onClick:t.duplicateElement,title:"Duplicate element",visible:!0}),Z==="top"&&w.jsxs(w.Fragment,{children:[Y,w.jsx(L,{})]})]})},ee=Z=>b==="horizontal"?Z==="left"?"before":"after":Z==="top"?"before":"after",[Ie,he]=A.useState(null);return w.jsx("div",{"data-bobbin":"control-handles",style:{pointerEvents:"none"},children:["top","bottom","left","right"].map(Z=>{const ge=i===Z;return w.jsx("div",{style:R(Z),onMouseEnter:()=>o(Z),onMouseLeave:()=>o(null),children:ge&&w.jsx(X,{position:Z})},Z)})})}function Hte({selectedElement:e,zIndex:t=9997}){const{element:n,rect:r}=e,i=window.getComputedStyle(n),o={top:parseFloat(i.marginTop)||0,right:parseFloat(i.marginRight)||0,bottom:parseFloat(i.marginBottom)||0,left:parseFloat(i.marginLeft)||0},s={top:parseFloat(i.paddingTop)||0,right:parseFloat(i.paddingRight)||0,bottom:parseFloat(i.paddingBottom)||0,left:parseFloat(i.paddingLeft)||0},a=parseFloat(i.gap)||0,u=parseFloat(i.rowGap)||a,d=parseFloat(i.columnGap)||a,f=i.display,h=i.flexDirection,m=f.includes("flex")||f.includes("grid"),g=h==="column"||h==="column-reverse",x="rgba(251, 146, 60, 0.3)",b="rgba(74, 222, 128, 0.3)",v="rgba(168, 85, 247, 0.35)",_=(()=>{if(!m||u===0&&d===0)return[];const E=Array.from(n.children).filter(N=>N instanceof HTMLElement&&getComputedStyle(N).display!=="none"&&getComputedStyle(N).visibility!=="hidden");if(E.length<2)return[];const I=[];for(let N=0;N<E.length-1;N++){const M=E[N],F=E[N+1];if(!M||!F)continue;const R=M.getBoundingClientRect(),D=F.getBoundingClientRect();if((g||f.includes("grid"))&&u>0&&D.top>R.bottom){const L=R.bottom,X=Math.min(u,D.top-R.bottom);X>0&&I.push({top:L,left:r.left+s.left,width:r.width-s.left-s.right,height:X})}if((!g||f.includes("grid"))&&d>0&&D.left>R.right){const L=R.right,X=Math.min(d,D.left-R.right);X>0&&I.push({top:r.top+s.top,left:L,width:X,height:r.height-s.top-s.bottom})}}return I})();return w.jsxs("div",{"data-bobbin":"margin-padding-overlay",style:{position:"fixed",top:0,left:0,zIndex:t,pointerEvents:"none"},children:[o.top>0&&w.jsx("div",{style:{position:"fixed",top:r.top-o.top,left:r.left,width:r.width,height:o.top,backgroundColor:x}}),o.bottom>0&&w.jsx("div",{style:{position:"fixed",top:r.bottom,left:r.left,width:r.width,height:o.bottom,backgroundColor:x}}),o.left>0&&w.jsx("div",{style:{position:"fixed",top:r.top,left:r.left-o.left,width:o.left,height:r.height,backgroundColor:x}}),o.right>0&&w.jsx("div",{style:{position:"fixed",top:r.top,left:r.right,width:o.right,height:r.height,backgroundColor:x}}),s.top>0&&w.jsx("div",{style:{position:"fixed",top:r.top,left:r.left,width:r.width,height:s.top,backgroundColor:b}}),s.bottom>0&&w.jsx("div",{style:{position:"fixed",top:r.bottom-s.bottom,left:r.left,width:r.width,height:s.bottom,backgroundColor:b}}),s.left>0&&w.jsx("div",{style:{position:"fixed",top:r.top+s.top,left:r.left,width:s.left,height:r.height-s.top-s.bottom,backgroundColor:b}}),s.right>0&&w.jsx("div",{style:{position:"fixed",top:r.top+s.top,left:r.right-s.right,width:s.right,height:r.height-s.top-s.bottom,backgroundColor:b}}),_.map((E,I)=>w.jsx("div",{style:{position:"fixed",top:E.top,left:E.left,width:E.width,height:E.height,backgroundColor:v}},`gap-${I}`))]})}function Ba({title:e,expanded:t,onToggle:n,children:r,hasChanges:i=!1}){return w.jsxs("div",{style:{borderBottom:"1px solid #f4f4f5"},children:[w.jsxs("button",{onClick:n,style:{width:"100%",padding:"8px 12px",display:"flex",alignItems:"center",justifyContent:"space-between",backgroundColor:i?"#eff6ff":"transparent",border:"none",cursor:"pointer",color:"#18181b",fontSize:"11px",fontWeight:500,textTransform:"uppercase",letterSpacing:"0.05em"},children:[w.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[e,i&&w.jsx("span",{style:{width:"6px",height:"6px",borderRadius:"50%",backgroundColor:"#3b82f6"},title:"Has unsaved changes"})]}),w.jsx("span",{style:{fontSize:"10px",color:"#a1a1aa"},children:t?"▲":"▼"})]}),t&&w.jsx("div",{style:{padding:"0 12px 12px"},children:r})]})}function rc({value:e,options:t,onChange:n}){return w.jsx("div",{style:{display:"flex",gap:"2px"},children:t.map(r=>w.jsx("button",{onClick:()=>n(r.value),style:{flex:1,padding:"4px 6px",borderRadius:"4px",border:"1px solid #e4e4e7",backgroundColor:e===r.value?"#18181b":"#ffffff",color:e===r.value?"#fafafa":"#71717a",cursor:"pointer",fontSize:"10px",fontWeight:500,transition:"all 0.1s ease",display:"flex",alignItems:"center",justifyContent:"center"},children:r.label},r.value))})}function yp({value:e,tokens:t,onChange:n,placeholder:r="Select..."}){return w.jsxs("select",{value:e,onChange:i=>n(i.target.value),style:{width:"100%",padding:"4px 8px",borderRadius:"4px",border:"1px solid #e4e4e7",backgroundColor:"#ffffff",color:"#18181b",fontSize:"11px",cursor:"pointer",outline:"none"},children:[w.jsx("option",{value:"",children:r}),Object.entries(t).map(([i,o])=>w.jsxs("option",{value:o,children:[i,": ",o]},i))]})}var Wte=()=>w.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[w.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),w.jsx("polyline",{points:"12 5 19 12 12 19"})]}),qte=()=>w.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[w.jsx("line",{x1:"19",y1:"12",x2:"5",y2:"12"}),w.jsx("polyline",{points:"12 19 5 12 12 5"})]}),Zte=()=>w.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[w.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),w.jsx("polyline",{points:"19 12 12 19 5 12"})]}),Jte=()=>w.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[w.jsx("line",{x1:"12",y1:"19",x2:"12",y2:"5"}),w.jsx("polyline",{points:"5 12 12 5 19 12"})]}),Kte=()=>w.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[w.jsx("line",{x1:"3",y1:"4",x2:"3",y2:"20"}),w.jsx("rect",{x:"7",y:"8",width:"4",height:"8",rx:"1"}),w.jsx("rect",{x:"13",y:"8",width:"4",height:"8",rx:"1"})]}),Gte=()=>w.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[w.jsx("rect",{x:"6",y:"8",width:"4",height:"8",rx:"1"}),w.jsx("rect",{x:"14",y:"8",width:"4",height:"8",rx:"1"})]}),Yte=()=>w.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[w.jsx("line",{x1:"21",y1:"4",x2:"21",y2:"20"}),w.jsx("rect",{x:"7",y:"8",width:"4",height:"8",rx:"1"}),w.jsx("rect",{x:"13",y:"8",width:"4",height:"8",rx:"1"})]}),Qte=()=>w.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[w.jsx("line",{x1:"3",y1:"4",x2:"3",y2:"20"}),w.jsx("line",{x1:"21",y1:"4",x2:"21",y2:"20"}),w.jsx("rect",{x:"6",y:"8",width:"4",height:"8",rx:"1"}),w.jsx("rect",{x:"14",y:"8",width:"4",height:"8",rx:"1"})]}),Xte=()=>w.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[w.jsx("rect",{x:"4",y:"8",width:"4",height:"8",rx:"1"}),w.jsx("rect",{x:"10",y:"8",width:"4",height:"8",rx:"1"}),w.jsx("rect",{x:"16",y:"8",width:"4",height:"8",rx:"1"})]}),ene=()=>w.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[w.jsx("line",{x1:"4",y1:"3",x2:"20",y2:"3"}),w.jsx("rect",{x:"6",y:"6",width:"4",height:"10",rx:"1"}),w.jsx("rect",{x:"14",y:"6",width:"4",height:"6",rx:"1"})]}),tne=()=>w.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[w.jsx("rect",{x:"6",y:"5",width:"4",height:"14",rx:"1"}),w.jsx("rect",{x:"14",y:"7",width:"4",height:"10",rx:"1"})]}),nne=()=>w.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[w.jsx("line",{x1:"4",y1:"21",x2:"20",y2:"21"}),w.jsx("rect",{x:"6",y:"8",width:"4",height:"10",rx:"1"}),w.jsx("rect",{x:"14",y:"12",width:"4",height:"6",rx:"1"})]}),rne=()=>w.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[w.jsx("line",{x1:"4",y1:"3",x2:"20",y2:"3"}),w.jsx("line",{x1:"4",y1:"21",x2:"20",y2:"21"}),w.jsx("rect",{x:"6",y:"6",width:"4",height:"12",rx:"1"}),w.jsx("rect",{x:"14",y:"6",width:"4",height:"12",rx:"1"})]});function ine({expanded:e,onToggle:t,computedStyle:n,onApplyStyle:r,tokens:i,hasChanges:o=!1}){const s=n.display,a=n.flexDirection,u=n.justifyContent,d=n.alignItems,f=n.gap,h=s==="flex"||s==="inline-flex",m=s==="grid"||s==="inline-grid";return w.jsxs(Ba,{title:"Layout",expanded:e,onToggle:t,hasChanges:o,children:[w.jsxs("div",{style:{marginBottom:"12px"},children:[w.jsx("label",{style:{fontSize:"10px",color:"#71717a",marginBottom:"4px",display:"block"},children:"Display"}),w.jsx(rc,{value:s,options:[{value:"block",label:"Block"},{value:"flex",label:"Flex"},{value:"grid",label:"Grid"},{value:"inline",label:"Inline"},{value:"none",label:"None"}],onChange:g=>r("display",g)})]}),h&&w.jsxs(w.Fragment,{children:[w.jsxs("div",{style:{marginBottom:"12px"},children:[w.jsx("label",{style:{fontSize:"10px",color:"#71717a",marginBottom:"4px",display:"block"},children:"Direction"}),w.jsx(rc,{value:a,options:[{value:"row",label:w.jsx(Wte,{})},{value:"row-reverse",label:w.jsx(qte,{})},{value:"column",label:w.jsx(Zte,{})},{value:"column-reverse",label:w.jsx(Jte,{})}],onChange:g=>r("flex-direction",g)})]}),w.jsxs("div",{style:{marginBottom:"12px"},children:[w.jsx("label",{style:{fontSize:"10px",color:"#71717a",marginBottom:"4px",display:"block"},children:"Justify"}),w.jsx(rc,{value:u,options:[{value:"flex-start",label:w.jsx(Kte,{})},{value:"center",label:w.jsx(Gte,{})},{value:"flex-end",label:w.jsx(Yte,{})},{value:"space-between",label:w.jsx(Qte,{})},{value:"space-around",label:w.jsx(Xte,{})}],onChange:g=>r("justify-content",g)})]}),w.jsxs("div",{style:{marginBottom:"12px"},children:[w.jsx("label",{style:{fontSize:"10px",color:"#71717a",marginBottom:"4px",display:"block"},children:"Align"}),w.jsx(rc,{value:d,options:[{value:"flex-start",label:w.jsx(ene,{})},{value:"center",label:w.jsx(tne,{})},{value:"flex-end",label:w.jsx(nne,{})},{value:"stretch",label:w.jsx(rne,{})}],onChange:g=>r("align-items",g)})]})]}),(h||m)&&w.jsxs("div",{style:{marginBottom:"12px"},children:[w.jsx("label",{style:{fontSize:"10px",color:"#71717a",marginBottom:"4px",display:"block"},children:"Gap"}),w.jsx(yp,{value:f,tokens:i.spacing,onChange:g=>r("gap",g)})]})]})}var BS=({linked:e})=>w.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{opacity:e?1:.4},children:e?w.jsxs(w.Fragment,{children:[w.jsx("path",{d:"M9 17H7A5 5 0 0 1 7 7h2"}),w.jsx("path",{d:"M15 7h2a5 5 0 1 1 0 10h-2"}),w.jsx("line",{x1:"8",y1:"12",x2:"16",y2:"12"})]}):w.jsxs(w.Fragment,{children:[w.jsx("path",{d:"M9 17H7A5 5 0 0 1 7 7h2"}),w.jsx("path",{d:"M15 7h2a5 5 0 1 1 0 10h-2"}),w.jsx("line",{x1:"8",y1:"12",x2:"10",y2:"12"}),w.jsx("line",{x1:"14",y1:"12",x2:"16",y2:"12"})]})});function one(e){return!e||e.trim()===""?!0:[/^-?\d+(\.\d+)?(px|em|rem|%|vh|vw|pt|cm|mm|in|pc)?$/i,/^auto$/i,/^inherit$/i,/^initial$/i,/^unset$/i,/^0$/].some(n=>n.test(e.trim()))}function US({values:e,onChange:t,label:n,hasChanges:r={}}){const[i,o]=A.useState(null),[s,a]=A.useState(""),[u,d]=A.useState(!1),[f,h]=A.useState(!1),[m,g]=A.useState(null),x=A.useRef(null);A.useEffect(()=>{i&&x.current&&(x.current.focus(),x.current.select())},[i]);const b=A.useCallback((D,L)=>{t(D,L),u&&(D==="top"||D==="bottom")&&t(D==="top"?"bottom":"top",L),f&&(D==="left"||D==="right")&&t(D==="left"?"right":"left",L)},[t,u,f]),v=(D,L)=>{L.stopPropagation(),o(D),a(e[D]),u&&(D==="top"||D==="bottom")?g("vertical"):f&&(D==="left"||D==="right")&&g("horizontal")},C=D=>{a(D),i&&b(i,D)},_=()=>{o(null),g(null)},E=D=>{(D.key==="Enter"||D.key==="Escape")&&(o(null),g(null))},I=D=>{const L=D.match(/^([\d.]+)/);return L?L[1]:D||"0"},N=D=>m?m==="vertical"&&(D==="top"||D==="bottom")||m==="horizontal"&&(D==="left"||D==="right"):!1,M=D=>{const L=i===D,X=N(D),ee=L?one(s):!0,Ie=r[D];return{padding:L?"0":"2px 4px",borderRadius:"3px",border:`1px solid ${ee?Ie?"#3b82f6":X?"#8b5cf6":L?"#18181b":"#e4e4e7":"#ef4444"}`,backgroundColor:ee?Ie?"#eff6ff":X?"#f5f3ff":"#ffffff":"#fef2f2",color:"#18181b",fontSize:"9px",textAlign:"center",cursor:"text",minWidth:"28px",transition:"all 0.1s ease",outline:"none"}},F=D=>({padding:"2px 4px",borderRadius:"3px",border:`1px solid ${D?"#8b5cf6":"#e4e4e7"}`,backgroundColor:D?"#f5f3ff":"#ffffff",color:D?"#8b5cf6":"#71717a",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.1s ease"}),R=(D,L)=>{const X=i===D;return w.jsx("div",{style:{position:"absolute",...L},children:X?w.jsx("input",{ref:x,type:"text",value:s,onChange:ee=>C(ee.target.value),onBlur:_,onKeyDown:E,style:{...M(D),width:"36px",fontFamily:"inherit"}}):w.jsx("div",{onClick:ee=>v(D,ee),style:M(D),title:`${D}: ${e[D]}`,children:I(e[D])})})};return w.jsxs("div",{children:[w.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"6px"},children:[w.jsx("label",{style:{fontSize:"10px",color:"#71717a"},children:n}),w.jsxs("div",{style:{display:"flex",gap:"2px"},children:[w.jsx("button",{style:F(u),onClick:()=>d(!u),title:u?"Unlink top/bottom":"Link top/bottom",children:w.jsx("span",{style:{transform:"rotate(90deg)",display:"flex"},children:w.jsx(BS,{linked:u})})}),w.jsx("button",{style:F(f),onClick:()=>h(!f),title:f?"Unlink left/right":"Link left/right",children:w.jsx(BS,{linked:f})})]})]}),w.jsxs("div",{style:{position:"relative",width:"100px",height:"40px",margin:"0 auto"},children:[w.jsxs("svg",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none"},viewBox:"0 0 100 70",children:[w.jsx("rect",{x:"10",y:"10",width:"80",height:"50",fill:"none",stroke:"lightgray",strokeWidth:"1",strokeDasharray:"3,2",rx:"2"}),w.jsx("line",{x1:"50",y1:"10",x2:"50",y2:"2",stroke:"lightgray",strokeWidth:"1"}),w.jsx("line",{x1:"50",y1:"60",x2:"50",y2:"68",stroke:"lightgray",strokeWidth:"1"}),w.jsx("line",{x1:"10",y1:"35",x2:"2",y2:"35",stroke:"lightgray",strokeWidth:"1"}),w.jsx("line",{x1:"90",y1:"35",x2:"98",y2:"35",stroke:"lightgray",strokeWidth:"1"})]}),R("top",{top:"-8px",left:"50%",transform:"translateX(-50%)"}),R("bottom",{bottom:"-8px",left:"50%",transform:"translateX(-50%)"}),R("left",{left:"-12px",top:"50%",transform:"translateY(-50%)"}),R("right",{right:"-12px",top:"50%",transform:"translateY(-50%)"})]})]})}function sne({expanded:e,onToggle:t,computedStyle:n,onApplyStyle:r,hasChanges:i=!1,changedProps:o={}}){const s={top:n.marginTop,right:n.marginRight,bottom:n.marginBottom,left:n.marginLeft},a={top:n.paddingTop,right:n.paddingRight,bottom:n.paddingBottom,left:n.paddingLeft},u={top:o["margin-top"],right:o["margin-right"],bottom:o["margin-bottom"],left:o["margin-left"]},d={top:o["padding-top"],right:o["padding-right"],bottom:o["padding-bottom"],left:o["padding-left"]};return w.jsxs(Ba,{title:"Spacing",expanded:e,onToggle:t,hasChanges:i,children:[w.jsx("div",{style:{marginBottom:"16px"},children:w.jsx(US,{label:"Margin",values:s,onChange:(f,h)=>r(`margin-${f}`,h),hasChanges:u})}),w.jsx(US,{label:"Padding",values:a,onChange:(f,h)=>r(`padding-${f}`,h),hasChanges:d})]})}function FA({value:e,min:t=0,max:n=100,step:r=1,unit:i="px",onChange:o,label:s}){const[a,u]=A.useState(!1),[d,f]=A.useState(e),h=A.useCallback(g=>{g.preventDefault(),u(!0);const x=g.clientX,b=d,v=_=>{const E=_.clientX-x,I=_.shiftKey?.1:1,N=Math.min(n,Math.max(t,b+E*I)),M=Math.round(N/r)*r;f(M),o(M)},C=()=>{u(!1),document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",C)};document.addEventListener("mousemove",v),document.addEventListener("mouseup",C)},[d,t,n,r,o]),m=g=>{const x=parseFloat(g.target.value)||0;f(x),o(x)};return w.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[s&&w.jsx("span",{style:{fontSize:"10px",color:"#71717a",width:"18px"},children:s}),w.jsxs("div",{style:{flex:1,display:"flex",alignItems:"center",backgroundColor:"#ffffff",border:"1px solid #e4e4e7",borderRadius:"4px",padding:"3px 6px",cursor:"ew-resize"},onMouseDown:h,children:[w.jsx("input",{type:"number",value:d,onChange:m,style:{width:"100%",backgroundColor:"transparent",border:"none",color:"#18181b",fontSize:"11px",fontFamily:"ui-monospace, monospace",outline:"none",cursor:a?"ew-resize":"text"},onClick:g=>g.stopPropagation()}),w.jsx("span",{style:{fontSize:"10px",color:"#a1a1aa",marginLeft:"4px"},children:i})]})]})}var ane={auto:"auto",full:"100%",fit:"fit-content",min:"min-content",max:"max-content",screen:"100vh"};function xl({label:e,value:t,property:n,onApplyStyle:r}){const[i,o]=A.useState(!1),s=parseFloat(t)||0,a=u=>t.toLowerCase()===u.toLowerCase();return w.jsxs("div",{style:{marginBottom:"10px"},children:[w.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"4px"},children:[w.jsx("label",{style:{fontSize:"10px",color:"#71717a"},children:e}),w.jsx("button",{onClick:()=>o(!i),style:{padding:"1px 4px",borderRadius:"2px",border:"1px solid #e4e4e7",backgroundColor:i?"#18181b":"#ffffff",color:i?"#fafafa":"#71717a",fontSize:"8px",cursor:"pointer"},title:"Toggle custom size slider",children:"px"})]}),w.jsx("div",{style:{display:"flex",gap:"2px",flexWrap:"wrap",marginBottom:i?"6px":0},children:Object.entries(ane).slice(0,5).map(([u,d])=>w.jsx("button",{onClick:()=>r(n,d),style:{padding:"2px 5px",borderRadius:"3px",border:"1px solid",borderColor:a(d)?"#18181b":"#e4e4e7",backgroundColor:a(d)?"#18181b":"#ffffff",color:a(d)?"#fafafa":"#18181b",fontSize:"9px",fontFamily:"ui-monospace, monospace",cursor:"pointer",transition:"all 0.1s ease"},title:d,children:u},u))}),i&&w.jsx(FA,{value:s,min:0,max:1e3,onChange:u=>r(n,`${u}px`)})]})}function lne({expanded:e,onToggle:t,computedStyle:n,onApplyStyle:r,hasChanges:i=!1}){const o=n.width,s=n.height,a=n.minWidth,u=n.maxWidth,d=n.minHeight,f=n.maxHeight;return w.jsxs(Ba,{title:"Size",expanded:e,onToggle:t,hasChanges:i,children:[w.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"12px"},children:[w.jsx(xl,{label:"Width",value:o,property:"width",onApplyStyle:r}),w.jsx(xl,{label:"Height",value:s,property:"height",onApplyStyle:r})]}),w.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"12px"},children:[w.jsx(xl,{label:"Min W",value:a,property:"min-width",onApplyStyle:r}),w.jsx(xl,{label:"Max W",value:u,property:"max-width",onApplyStyle:r})]}),w.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"12px"},children:[w.jsx(xl,{label:"Min H",value:d,property:"min-height",onApplyStyle:r}),w.jsx(xl,{label:"Max H",value:f,property:"max-height",onApplyStyle:r})]})]})}function Il({value:e,tokens:t,quickKeys:n,onChange:r,placeholder:i="More..."}){const[o,s]=A.useState(!1),{quickItems:a,dropdownItems:u}=A.useMemo(()=>{const f=[],h=[];for(const[m,g]of Object.entries(t))n.includes(m)?f.push({key:m,value:g}):h.push({key:m,value:g});return f.sort((m,g)=>n.indexOf(m.key)-n.indexOf(g.key)),{quickItems:f,dropdownItems:h}},[t,n]),d=f=>{const h=m=>m.replace(/\s+/g,"").toLowerCase();return h(e)===h(f)};return w.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"3px",flexWrap:"wrap"},children:[a.map(({key:f,value:h})=>w.jsx("button",{onClick:()=>r(h),style:{padding:"3px 6px",borderRadius:"3px",border:"1px solid",borderColor:d(h)?"#18181b":"#e4e4e7",backgroundColor:d(h)?"#18181b":"#ffffff",color:d(h)?"#fafafa":"#18181b",fontSize:"10px",fontFamily:"ui-monospace, monospace",cursor:"pointer",transition:"all 0.1s ease",minWidth:"28px",textAlign:"center"},title:`${f}: ${h}`,children:f},f)),u.length>0&&w.jsxs("div",{style:{position:"relative"},children:[w.jsx("button",{onClick:()=>s(!o),onBlur:()=>setTimeout(()=>s(!1),150),style:{padding:"3px 6px",borderRadius:"3px",border:"1px solid #e4e4e7",backgroundColor:"#ffffff",color:"#71717a",fontSize:"10px",cursor:"pointer",display:"flex",alignItems:"center",gap:"2px"},children:w.jsx("span",{children:"..."})}),o&&w.jsx("div",{style:{position:"absolute",top:"100%",left:0,marginTop:"2px",backgroundColor:"#ffffff",border:"1px solid #e4e4e7",borderRadius:"4px",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1)",zIndex:10,maxHeight:"150px",overflow:"auto",minWidth:"100px"},children:u.map(({key:f,value:h})=>w.jsxs("button",{onClick:()=>{r(h),s(!1)},style:{display:"block",width:"100%",padding:"4px 8px",border:"none",backgroundColor:d(h)?"#f4f4f5":"transparent",color:"#18181b",fontSize:"10px",fontFamily:"ui-monospace, monospace",cursor:"pointer",textAlign:"left"},children:[w.jsx("span",{style:{fontWeight:500},children:f}),w.jsx("span",{style:{color:"#71717a",marginLeft:"4px"},children:h})]},f))})]})]})}function ly({value:e,colors:t,onChange:n}){const[r,i]=A.useState(!1),o=A.useMemo(()=>{const u=[];for(const[d,f]of Object.entries(t))if(typeof f=="object")for(const[h,m]of Object.entries(f))u.push({name:d,shade:h,value:m});return u},[t]),s=["500","600","700"],a=A.useMemo(()=>o.filter(u=>s.includes(u.shade)),[o]);return w.jsxs("div",{children:[w.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",marginBottom:"6px"},children:[w.jsx("div",{style:{width:"22px",height:"22px",borderRadius:"4px",backgroundColor:e,border:"1px solid #e4e4e7",boxShadow:"inset 0 0 0 1px rgba(0,0,0,0.06)"}}),w.jsx("input",{type:"text",value:e,onChange:u=>n(u.target.value),style:{flex:1,backgroundColor:"#ffffff",border:"1px solid #e4e4e7",borderRadius:"4px",padding:"4px 8px",color:"#18181b",fontSize:"11px",fontFamily:"ui-monospace, monospace"}}),w.jsx("button",{onClick:()=>i(!r),style:{padding:"4px 6px",borderRadius:"4px",border:"1px solid #e4e4e7",backgroundColor:"#ffffff",color:"#71717a",fontSize:"10px",cursor:"pointer"},children:r?"▲":"▼"})]}),r&&w.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(11, 1fr)",gap:"2px",padding:"6px",backgroundColor:"#fafafa",border:"1px solid #e4e4e7",borderRadius:"8px",maxHeight:"200px",overflow:"auto"},children:o.map((u,d)=>w.jsx("button",{onClick:()=>n(u.value),style:{width:"18px",height:"18px",borderRadius:"3px",backgroundColor:u.value,border:e===u.value?"2px solid #18181b":"1px solid #e4e4e7",cursor:"pointer"},title:`${u.name}-${u.shade}`},d))}),!r&&w.jsx("div",{style:{display:"flex",gap:"3px",flexWrap:"wrap"},children:a.map((u,d)=>w.jsx("button",{onClick:()=>n(u.value),style:{width:"14px",height:"14px",borderRadius:"3px",backgroundColor:u.value,border:e===u.value?"2px solid #18181b":"1px solid #e4e4e7",cursor:"pointer"},title:`${u.name}-${u.shade}`},d))})]})}var une=()=>w.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[w.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),w.jsx("line",{x1:"3",y1:"12",x2:"15",y2:"12"}),w.jsx("line",{x1:"3",y1:"18",x2:"18",y2:"18"})]}),cne=()=>w.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[w.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),w.jsx("line",{x1:"6",y1:"12",x2:"18",y2:"12"}),w.jsx("line",{x1:"4",y1:"18",x2:"20",y2:"18"})]}),dne=()=>w.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[w.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),w.jsx("line",{x1:"9",y1:"12",x2:"21",y2:"12"}),w.jsx("line",{x1:"6",y1:"18",x2:"21",y2:"18"})]}),fne=()=>w.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[w.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),w.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),w.jsx("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]});function hne({expanded:e,onToggle:t,computedStyle:n,onApplyStyle:r,tokens:i,hasChanges:o=!1}){const s=n.color,a=n.fontSize,u=n.fontWeight,d=n.fontFamily,f=n.textAlign,h=n.lineHeight;return w.jsxs(Ba,{title:"Typography",expanded:e,onToggle:t,hasChanges:o,children:[w.jsxs("div",{style:{marginBottom:"12px"},children:[w.jsx("label",{style:{fontSize:"10px",color:"#71717a",marginBottom:"4px",display:"block"},children:"Color"}),w.jsx(ly,{value:s,colors:i.colors,onChange:m=>r("color",m)})]}),w.jsxs("div",{style:{marginBottom:"12px"},children:[w.jsx("label",{style:{fontSize:"10px",color:"#71717a",marginBottom:"4px",display:"block"},children:"Font Size"}),w.jsx(Il,{value:a,tokens:i.fontSize,quickKeys:["xs","sm","base","lg","xl","2xl"],onChange:m=>r("font-size",m)})]}),w.jsxs("div",{style:{marginBottom:"12px"},children:[w.jsx("label",{style:{fontSize:"10px",color:"#71717a",marginBottom:"4px",display:"block"},children:"Font Weight"}),w.jsx(Il,{value:u,tokens:i.fontWeight,quickKeys:["light","normal","medium","semibold","bold"],onChange:m=>r("font-weight",m)})]}),w.jsxs("div",{style:{marginBottom:"12px"},children:[w.jsx("label",{style:{fontSize:"10px",color:"#71717a",marginBottom:"4px",display:"block"},children:"Font Family"}),w.jsx(yp,{value:d,tokens:i.fontFamily,onChange:m=>r("font-family",m)})]}),w.jsxs("div",{style:{marginBottom:"12px"},children:[w.jsx("label",{style:{fontSize:"10px",color:"#71717a",marginBottom:"4px",display:"block"},children:"Text Align"}),w.jsx(rc,{value:f,options:[{value:"left",label:w.jsx(une,{})},{value:"center",label:w.jsx(cne,{})},{value:"right",label:w.jsx(dne,{})},{value:"justify",label:w.jsx(fne,{})}],onChange:m=>r("text-align",m)})]}),w.jsxs("div",{children:[w.jsx("label",{style:{fontSize:"10px",color:"#71717a",marginBottom:"4px",display:"block"},children:"Line Height"}),w.jsx(Il,{value:h,tokens:i.lineHeight,quickKeys:["tight","snug","normal","relaxed"],onChange:m=>r("line-height",m)})]})]})}function pne({expanded:e,onToggle:t,computedStyle:n,onApplyStyle:r,tokens:i,hasChanges:o=!1}){const s=n.backgroundColor,a=n.borderColor,u=n.borderWidth,d=n.borderRadius;return w.jsxs(Ba,{title:"Background & Border",expanded:e,onToggle:t,hasChanges:o,children:[w.jsxs("div",{style:{marginBottom:"12px"},children:[w.jsx("label",{style:{fontSize:"10px",color:"#71717a",marginBottom:"4px",display:"block"},children:"Background"}),w.jsx(ly,{value:s,colors:i.colors,onChange:f=>r("background-color",f)})]}),w.jsxs("div",{style:{marginBottom:"12px"},children:[w.jsx("label",{style:{fontSize:"10px",color:"#71717a",marginBottom:"4px",display:"block"},children:"Border Color"}),w.jsx(ly,{value:a,colors:i.colors,onChange:f=>r("border-color",f)})]}),w.jsxs("div",{style:{marginBottom:"12px"},children:[w.jsx("label",{style:{fontSize:"10px",color:"#71717a",marginBottom:"4px",display:"block"},children:"Border Width"}),w.jsx(yp,{value:u,tokens:i.borderWidth,onChange:f=>r("border-width",f)})]}),w.jsxs("div",{children:[w.jsx("label",{style:{fontSize:"10px",color:"#71717a",marginBottom:"4px",display:"block"},children:"Border Radius"}),w.jsx(yp,{value:d,tokens:i.borderRadius,onChange:f=>r("border-radius",f)})]})]})}function mne({expanded:e,onToggle:t,computedStyle:n,onApplyStyle:r,tokens:i,hasChanges:o=!1}){const s=n.boxShadow,a=n.borderRadius,u=n.borderWidth,d=parseFloat(n.opacity)*100;return w.jsxs(Ba,{title:"Effects",expanded:e,onToggle:t,hasChanges:o,children:[w.jsxs("div",{style:{marginBottom:"12px"},children:[w.jsx("label",{style:{fontSize:"10px",color:"#71717a",marginBottom:"4px",display:"block"},children:"Border Radius"}),w.jsx(Il,{value:a,tokens:i.borderRadius,quickKeys:["none","sm","md","lg","full"],onChange:f=>r("border-radius",f)})]}),w.jsxs("div",{style:{marginBottom:"12px"},children:[w.jsx("label",{style:{fontSize:"10px",color:"#71717a",marginBottom:"4px",display:"block"},children:"Border Width"}),w.jsx(Il,{value:u,tokens:i.borderWidth,quickKeys:["0","DEFAULT","2","4"],onChange:f=>r("border-width",f)})]}),w.jsxs("div",{style:{marginBottom:"12px"},children:[w.jsx("label",{style:{fontSize:"10px",color:"#71717a",marginBottom:"4px",display:"block"},children:"Shadow"}),w.jsx(Il,{value:s,tokens:i.boxShadow,quickKeys:["none","sm","md","lg"],onChange:f=>r("box-shadow",f)})]}),w.jsxs("div",{children:[w.jsx("label",{style:{fontSize:"10px",color:"#71717a",marginBottom:"4px",display:"block"},children:"Opacity"}),w.jsx(FA,{value:d,min:0,max:100,step:1,unit:"%",onChange:f=>r("opacity",String(f/100))})]})]})}function gne({expanded:e,onToggle:t,onAnnotate:n,existingAnnotation:r="",hasChanges:i=!1}){const[o,s]=A.useState(r),[a,u]=A.useState(!!r),d=A.useRef(null),f=A.useRef(null);A.useEffect(()=>{s(r),u(!!r)},[r]);const h=A.useCallback(x=>{s(x),u(!1),d.current&&clearTimeout(d.current),x.trim()&&(d.current=setTimeout(()=>{n(x.trim()),u(!0)},500))},[n]);A.useEffect(()=>()=>{d.current&&clearTimeout(d.current)},[]);const m=()=>{d.current&&clearTimeout(d.current),o.trim()&&!a&&(n(o.trim()),u(!0))},g=!!(o.trim()&&a);return w.jsx(Ba,{title:"Annotation",expanded:e,onToggle:t,hasChanges:i||g,children:w.jsxs("div",{style:{position:"relative",borderRadius:"4px",border:`1px solid ${g?"#3b82f6":"#e4e4e7"}`,backgroundColor:g?"#eff6ff":"#ffffff",transition:"all 0.15s ease"},children:[w.jsx("textarea",{ref:f,value:o,onChange:x=>h(x.target.value),onBlur:m,placeholder:"Add a note about this element...",style:{width:"100%",minHeight:"60px",padding:"8px",borderRadius:"4px",border:"none",backgroundColor:"transparent",color:"#18181b",fontSize:"11px",resize:"vertical",fontFamily:"system-ui, -apple-system, sans-serif",outline:"none"}}),o.trim()&&w.jsx("div",{style:{position:"absolute",bottom:"4px",right:"4px",fontSize:"9px",color:a?"#3b82f6":"#a1a1aa",display:"flex",alignItems:"center",gap:"2px"},children:a?w.jsxs(w.Fragment,{children:[w.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:w.jsx("polyline",{points:"20 6 9 17 4 12"})}),"Saved"]}):"Saving..."})]})})}var yne=()=>w.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("circle",{cx:"12",cy:"12",r:"5"}),w.jsx("line",{x1:"12",y1:"1",x2:"12",y2:"3"}),w.jsx("line",{x1:"12",y1:"21",x2:"12",y2:"23"}),w.jsx("line",{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"}),w.jsx("line",{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"}),w.jsx("line",{x1:"1",y1:"12",x2:"3",y2:"12"}),w.jsx("line",{x1:"21",y1:"12",x2:"23",y2:"12"}),w.jsx("line",{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"}),w.jsx("line",{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"})]}),xne=()=>w.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:w.jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}),bne=()=>w.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",ry:"2"}),w.jsx("line",{x1:"8",y1:"21",x2:"16",y2:"21"}),w.jsx("line",{x1:"12",y1:"17",x2:"12",y2:"21"})]}),vne=()=>w.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[w.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),w.jsx("rect",{x:"7",y:"7",width:"10",height:"10",rx:"1"})]}),kne=()=>w.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[w.jsx("path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}),w.jsx("path",{d:"M3 3v5h5"})]}),wne={display:"layout","flex-direction":"layout","justify-content":"layout","align-items":"layout","flex-wrap":"layout",gap:"layout","margin-top":"spacing","margin-right":"spacing","margin-bottom":"spacing","margin-left":"spacing","padding-top":"spacing","padding-right":"spacing","padding-bottom":"spacing","padding-left":"spacing",width:"size",height:"size","min-width":"size","min-height":"size","max-width":"size","max-height":"size","font-size":"typography","font-weight":"typography","font-family":"typography","line-height":"typography","letter-spacing":"typography","text-align":"typography",color:"typography","background-color":"background",background:"background","border-radius":"effects","box-shadow":"effects",border:"effects","border-width":"effects",opacity:"effects"};function Cne({selectedElement:e,actions:t,tokens:n,onClose:r,showMarginPadding:i,zIndex:o=9999,theme:s,onThemeToggle:a,changes:u,annotations:d,onReset:f}){var E;const[h,m]=A.useState(new Set(["annotation","layout","spacing","typography"])),g=A.useMemo(()=>{const I=new Set,N=u.filter(M=>M.target.path===e.path&&M.type==="style");for(const M of N){const F=M.after.property,R=wne[F];R&&I.add(R)}return I},[u,e.path]),x=A.useMemo(()=>{const I={},N=u.filter(M=>M.target.path===e.path&&M.type==="style");for(const M of N){const F=M.after.property;(F.startsWith("margin-")||F.startsWith("padding-"))&&(I[F]=!0)}return I},[u,e.path]),b=I=>{m(N=>{const M=new Set(N);return M.has(I)?M.delete(I):M.add(I),M})},v=window.getComputedStyle(e.element),C={light:w.jsx(yne,{}),dark:w.jsx(xne,{}),system:w.jsx(bne,{})},_=u.some(I=>I.target.path===e.path);return w.jsxs("div",{"data-bobbin":"edit-panel",style:{position:"fixed",top:"16px",right:"16px",width:"280px",maxHeight:"calc(100vh - 32px)",backgroundColor:"#fafafa",borderRadius:"8px",border:"1px solid #e4e4e7",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",zIndex:o,overflow:"hidden",display:"flex",flexDirection:"column",color:"#18181b",fontFamily:"system-ui, -apple-system, sans-serif",fontSize:"13px"},children:[w.jsxs("div",{style:{padding:"10px 12px",borderBottom:"1px solid #e4e4e7",display:"flex",alignItems:"center",justifyContent:"space-between",backgroundColor:"#ffffff"},children:[w.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[w.jsx("span",{style:{fontWeight:500,fontSize:"12px"},children:e.tagName}),e.id&&w.jsxs("span",{style:{color:"#71717a",fontSize:"11px"},children:["#",e.id]}),e.classList.length>0&&w.jsxs("span",{style:{color:"#a1a1aa",fontSize:"10px"},children:[".",e.classList.slice(0,2).join("."),e.classList.length>2&&"..."]})]}),w.jsxs("div",{style:{display:"flex",gap:"4px"},children:[w.jsx("button",{onClick:a,style:{padding:"4px 6px",borderRadius:"4px",border:"1px solid #e4e4e7",backgroundColor:"#ffffff",cursor:"pointer",fontSize:"12px"},title:`Theme: ${s}`,children:C[s]}),w.jsx("button",{onClick:t.toggleMarginPadding,style:{padding:"4px 6px",borderRadius:"4px",border:"1px solid #e4e4e7",backgroundColor:i?"#18181b":"#ffffff",color:i?"#fafafa":"#71717a",cursor:"pointer",fontSize:"10px",display:"flex",alignItems:"center",justifyContent:"center"},title:"Toggle spacing visualization",children:w.jsx(vne,{})}),_&&w.jsx("button",{onClick:f,style:{padding:"4px 6px",borderRadius:"4px",border:"1px solid #e4e4e7",backgroundColor:"#ffffff",color:"#71717a",cursor:"pointer",fontSize:"10px",display:"flex",alignItems:"center",justifyContent:"center"},title:"Reset all changes",children:w.jsx(kne,{})}),w.jsx("button",{onClick:r,style:{width:"22px",height:"22px",borderRadius:"4px",border:"1px solid #e4e4e7",backgroundColor:"#ffffff",color:"#71717a",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"12px"},children:"×"})]})]}),w.jsxs("div",{style:{flex:1,overflow:"auto",padding:"8px 0"},children:[w.jsx(gne,{expanded:h.has("annotation"),onToggle:()=>b("annotation"),onAnnotate:t.annotate,existingAnnotation:(E=d.find(I=>I.elementPath===e.path))==null?void 0:E.content,hasChanges:d.some(I=>I.elementPath===e.path)}),w.jsx(ine,{expanded:h.has("layout"),onToggle:()=>b("layout"),computedStyle:v,onApplyStyle:t.applyStyle,tokens:n,hasChanges:g.has("layout")}),w.jsx(sne,{expanded:h.has("spacing"),onToggle:()=>b("spacing"),computedStyle:v,onApplyStyle:t.applyStyle,tokens:n,hasChanges:g.has("spacing"),changedProps:x}),w.jsx(lne,{expanded:h.has("size"),onToggle:()=>b("size"),computedStyle:v,onApplyStyle:t.applyStyle,tokens:n,hasChanges:g.has("size")}),w.jsx(hne,{expanded:h.has("typography"),onToggle:()=>b("typography"),computedStyle:v,onApplyStyle:t.applyStyle,tokens:n,hasChanges:g.has("typography")}),w.jsx(pne,{expanded:h.has("background"),onToggle:()=>b("background"),computedStyle:v,onApplyStyle:t.applyStyle,tokens:n,hasChanges:g.has("background")}),w.jsx(mne,{expanded:h.has("effects"),onToggle:()=>b("effects"),computedStyle:v,onApplyStyle:t.applyStyle,tokens:n,hasChanges:g.has("effects")})]})]})}function Sne({selectedElement:e,onSelectElement:t,zIndex:n=9999}){const[r,i]=A.useState("attributes"),[o,s]=A.useState(!1),a=A.useMemo(()=>{const f=window.getComputedStyle(e.element),h={},m=["display","position","width","height","margin","padding","border","background","color","font-family","font-size","font-weight","line-height","text-align","flex","grid"];for(const g of m)h[g]=f.getPropertyValue(g);return h},[e.element]),u=A.useMemo(()=>{const f={},h=e.element;for(const m of h.attributes)m.name.toLowerCase()!=="contenteditable"&&(f[m.name]=m.value);return f},[e.element]),d=A.useMemo(()=>{const f=[];let h=e.element;for(;h&&h!==document.body;)f.unshift(h),h=h.parentElement;return f},[e.element]);return w.jsx("div",{"data-bobbin":"inspector",style:{position:"fixed",bottom:"16px",left:"16px",width:o?"auto":"320px",maxHeight:o?"auto":"260px",backgroundColor:"#fafafa",borderRadius:"8px",border:"1px solid #e4e4e7",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1)",zIndex:n,overflow:"hidden",display:"flex",flexDirection:"column",color:"#18181b",fontFamily:"ui-monospace, SFMono-Regular, monospace",fontSize:"11px"},children:o?w.jsx("div",{style:{padding:"6px 10px",display:"flex",alignItems:"center",gap:"8px",cursor:"pointer",backgroundColor:"#ffffff"},onClick:()=>s(!1),children:w.jsx("span",{style:{fontSize:"10px",color:"#71717a"},children:"Inspector"})}):w.jsxs(w.Fragment,{children:[w.jsxs("div",{style:{display:"flex",borderBottom:"1px solid #e4e4e7",backgroundColor:"#ffffff"},children:[["styles","attributes"].map(f=>w.jsx("button",{onClick:()=>i(f),style:{flex:1,padding:"6px 8px",border:"none",borderBottom:r===f?"2px solid #18181b":"2px solid transparent",backgroundColor:"transparent",color:r===f?"#18181b":"#71717a",cursor:"pointer",textTransform:"capitalize",fontSize:"11px",fontWeight:r===f?500:400},children:f},f)),w.jsx("div",{style:{display:"flex",alignItems:"center",gap:"2px",padding:"0 4px"},children:w.jsx("button",{onClick:()=>s(!0),style:{width:"18px",height:"18px",borderRadius:"3px",border:"none",backgroundColor:"transparent",color:"#71717a",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"14px"},title:"Minimize",children:"−"})})]}),w.jsxs("div",{style:{flex:1,overflow:"auto",padding:"6px"},children:[r==="tree"&&w.jsx("div",{children:d.map((f,h)=>w.jsxs("div",{onClick:()=>t(f),style:{padding:"3px 6px",paddingLeft:`${h*10+6}px`,cursor:"pointer",backgroundColor:f===e.element?"#18181b":"transparent",color:f===e.element?"#fafafa":"#18181b",borderRadius:"3px",marginBottom:"1px"},children:[w.jsx("span",{style:{color:f===e.element?"#a1a1aa":"#52525b"},children:f.tagName.toLowerCase()}),f.id&&w.jsxs("span",{style:{color:f===e.element?"#d4d4d8":"#71717a"},children:["#",f.id]}),f.classList.length>0&&w.jsxs("span",{style:{color:(f===e.element,"#a1a1aa")},children:[".",Array.from(f.classList).slice(0,2).join(".")]})]},h))}),r==="styles"&&w.jsx("div",{children:Object.entries(a).map(([f,h])=>w.jsxs("div",{style:{display:"flex",padding:"2px 0",borderBottom:"1px solid #f4f4f5"},children:[w.jsxs("span",{style:{color:"#52525b",width:"100px"},children:[f,":"]}),w.jsx("span",{style:{color:"#18181b",flex:1},children:h})]},f))}),r==="attributes"&&w.jsx("div",{children:Object.entries(u).map(([f,h])=>w.jsxs("div",{style:{display:"flex",padding:"2px 0",borderBottom:"1px solid #f4f4f5"},children:[w.jsx("span",{style:{color:"#71717a",width:"80px"},children:f}),w.jsxs("span",{style:{color:"#18181b"},children:['"',h,'"']})]},f))})]})]})})}function Ene(e){const{showInspector:t=!1,...n}=e,r=jte(n),{zIndex:i=9999,pillContainer:o}=n;return Ey.createPortal(w.jsxs("div",{"data-bobbin":"root",children:[w.jsx(Fte,{state:r,actions:r,position:n.position,container:o??n.container,zIndex:i}),r.isActive&&w.jsx($te,{hoveredElement:r.hoveredElement,selectedElement:r.selectedElement,zIndex:i-10}),r.selectedElement&&w.jsx(Vte,{selectedElement:r.selectedElement,actions:r,clipboard:r.clipboard,zIndex:i}),r.selectedElement&&r.showMarginPadding&&w.jsx(Hte,{selectedElement:r.selectedElement,zIndex:i-5}),r.selectedElement&&r.activePanel==="style"&&w.jsx(Cne,{selectedElement:r.selectedElement,actions:r,tokens:r.tokens,onClose:r.clearSelection,showMarginPadding:r.showMarginPadding,zIndex:i,theme:r.theme,onThemeToggle:r.toggleTheme,changes:r.changes,annotations:r.annotations,onReset:r.resetChanges}),r.selectedElement&&(t||r.activePanel==="inspector")&&w.jsx(Sne,{selectedElement:r.selectedElement,onSelectElement:s=>r.selectElement(s),onClose:()=>r.setActivePanel(null),zIndex:i})]}),document.body)}var _ne=/^```([a-z]*)?$/;function Tne({node:e,updateAttributes:t,editor:n,getPos:r}){var h;const i=A.useRef(null),o=A.useCallback(()=>{requestAnimationFrame(()=>{var m;return(m=i.current)==null?void 0:m.focus()})},[]),s=A.useCallback(()=>{const m=typeof r=="function"?r():void 0;m!==void 0&&n.chain().focus().setTextSelection(m+1).run()},[n,r]),a=A.useCallback(()=>{const m=typeof r=="function"?r():void 0;m!==void 0&&m>1&&(n.state.doc.resolve(m).nodeBefore?n.chain().focus().setTextSelection(m-1).run():n.chain().focus().setTextSelection(1).run())},[n,r]),u=A.useCallback(m=>{t({language:m.target.value})},[t]),d=A.useCallback(m=>{switch(m.stopPropagation(),m.key){case"Enter":case"ArrowDown":m.preventDefault(),s();break;case"ArrowUp":m.preventDefault(),a();break;case"Escape":m.preventDefault(),s();break}},[s,a]),f=A.useCallback(m=>{m.stopPropagation(),m.preventDefault(),o()},[o]);return w.jsxs(aK,{className:"code-block-wrapper my-2","data-type":"codeBlock",children:[w.jsxs("div",{className:"language-input-wrapper flex items-center gap-1 mb-1",contentEditable:!1,children:[w.jsx("span",{className:"text-xs text-muted-foreground select-none",children:"```"}),w.jsx("input",{ref:i,type:"text",value:e.attrs.language||"",onChange:u,onKeyDown:d,onKeyUp:m=>m.stopPropagation(),onMouseDown:f,onClick:m=>{m.stopPropagation(),o()},onFocus:m=>m.stopPropagation(),onBlur:m=>m.stopPropagation(),placeholder:"language",className:"language-input bg-transparent text-xs text-muted-foreground outline-none border-none min-w-[60px] max-w-[120px] focus:ring-1 focus:ring-ring rounded px-1",style:{width:`${Math.max(60,(((h=e.attrs.language)==null?void 0:h.length)||8)*7)}px`},spellCheck:!1,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off"})]}),w.jsx("pre",{className:"bg-muted rounded-md px-3 py-2 font-mono text-sm overflow-x-auto !mt-0",children:w.jsx(sK,{as:"code"})})]})}var Ane=Kt.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:e=>{var i;const{languageClassPrefix:t}=this.options;return[...((i=e.firstElementChild)==null?void 0:i.classList)||[]].filter(o=>o.startsWith(t)).map(o=>o.replace(t,""))[0]||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:e,HTMLAttributes:t}){return["pre",t,["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},addNodeView(){return hK(Tne,{stopEvent:({event:e})=>{const t=e.target;return t.classList.contains("language-input")||!!t.closest(".language-input-wrapper")}})},addInputRules(){return[Ph({find:_ne,type:this.type,getAttributes:e=>({language:e[1]||""})})]},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1}}}});function Mne(e){var t;return((t=e.project.files.get(e.activeFile))==null?void 0:t.content)??""}function Nne(e){return Array.from(e.files.values())}var Ine=/<<<<<<< SEARCH\n([\s\S]*?)\n=======\n([\s\S]*?)\n>>>>>>> REPLACE/g,Dne=[/^<<<<<<< SEARCH\s*$/m,/^=======\s*$/m,/^>>>>>>> REPLACE\s*$/m],One=/^```(\w*)\s*((?:[a-zA-Z_][\w-]*="[^"]*"\s*)*)\s*$/,Rne=/([a-zA-Z_][\w-]*)="([^"]*)"/g;function Pne(e){const t={};if(!e)return t;const n=new RegExp(Rne.source,"g");let r;for(;(r=n.exec(e))!==null;){const i=r[1],o=r[2];i&&o!==void 0&&(t[i]=o)}return t}function jne(e){const t=[],n=e.split(`
1395
+ `);let r=0;for(;r<n.length;){const i=n[r];if(!i){r++;continue}const o=i.match(One);if(o){const s=o[1]||"",a=Pne(o[2]??""),u=[];for(r++;r<n.length;){const d=n[r];if(d!==void 0&&d.match(/^```\s*$/))break;u.push(d??""),r++}t.push({language:s,attributes:a,content:u.join(`
1396
+ `)})}r++}return t}function zne(e){for(const t of Dne){const n=e.match(t);if(n)return n[0].trim()}return null}function Lne(e){let t=e;return t=t.replace(/^<<<<<<< SEARCH\s*\n?/gm,""),t=t.replace(/^=======\s*\n?/gm,""),t=t.replace(/^>>>>>>> REPLACE\s*\n?/gm,""),t=t.replace(/\n{3,}/g,`
1397
+
1398
+ `),t}function Fne(e){const t=[],n=[],r=jne(e);for(const o of r){o.attributes.note&&t.push(o.attributes.note);const s=o.content.match(/<<<<<<< SEARCH\n([\s\S]*?)\n=======\n([\s\S]*?)\n>>>>>>> REPLACE/);s&&s[1]!==void 0&&s[2]!==void 0&&n.push({note:o.attributes.note,path:o.attributes.path,search:s[1],replace:s[2]})}const i=Vne(e);return{progressNotes:t,diffs:n,summary:i}}function $ne(e,t,n={}){let r=e,i=0;const o=[];for(const u of t)if(r.includes(u.search))r=r.replace(u.search,u.replace),i++;else{const f=u.search.split(`
1399
+ `).slice(0,3).join(`
1400
+ `).slice(0,100),h=u.search.length>f.length?"...":"";o.push(f+h)}const s=zne(r);let a;return s&&(n.sanitize?(r=Lne(r),a=`Removed stray diff marker "${s}" from output`):a=`Output contains diff marker "${s}" - the LLM may have generated a malformed response`),{code:r,applied:i,failed:o,warning:a}}function Bne(e){return Ine.test(e)}var Une=/```\w*(?:\s+[a-zA-Z_][\w-]*="[^"]*")*\s*\n[\s\S]*?\n```/g;function Vne(e){let t=e.replace(Une,"");return t=t.replace(/^<<<<<<< SEARCH\s*$/gm,""),t=t.replace(/^=======\s*$/gm,""),t=t.replace(/^>>>>>>> REPLACE\s*$/gm,""),t=t.replace(/^```[\w]*(?:\s+[a-zA-Z_][\w-]*="[^"]*")*\s*$/gm,""),t=t.replace(/\n{3,}/g,`
1401
+
1402
+ `).trim(),t}async function Hne(e,t={}){const{endpoint:n="/api/edit",onProgress:r,sanitize:i=!0}=t,o=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!o.ok)throw new Error("Edit request failed");const s=await Wne(o,r);if(!Bne(s))throw new Error("No valid diffs in response");const a=Fne(s),u=$ne(e.code,a.diffs,{sanitize:i});if(u.applied===0){const f=u.failed.map((h,m)=>`[${m+1}] "${h}"`).join(`
1403
+ `);throw new Error(`Failed to apply ${a.diffs.length} diff(s). None of the SEARCH blocks matched the code.
1404
+
1405
+ Failed searches:
1406
+ ${f}
1407
+
1408
+ This usually means the code has changed or the SEARCH text doesn't match exactly.`)}let d=a.summary||`Applied ${u.applied} change(s)`;return u.warning&&(d=`⚠️ ${u.warning}
1409
+
1410
+ ${d}`),{newCode:u.code,summary:d,progressNotes:a.progressNotes}}async function Wne(e,t){var a;const n=(a=e.body)==null?void 0:a.getReader();if(!n)return e.text();const r=new TextDecoder;let i="";const o=new Set;let s=!1;for(;!s;){const u=await n.read();if(s=u.done,u.value&&(i+=r.decode(u.value,{stream:!0}),t)){const d=/```\w*\s+note="([^"]+)"/g;let f;for(;(f=d.exec(i))!==null;){const h=f[1];if(h){const m=h.trim();o.has(m)||(o.add(m),t(m))}}}}return i}function VS(e){return{...e,files:new Map(e.files)}}function qne(e){const{originalCode:t,compile:n,apiEndpoint:r}=e,i=A.useMemo(()=>wh(t),[t]),[o,s]=A.useState(i),[a,u]=A.useState(i.entry),[d,f]=A.useState([]),[h,m]=A.useState(!1),[g,x]=A.useState(null),[b,v]=A.useState([]),[C,_]=A.useState(null),E=A.useCallback(async(D,L,X=!1)=>{const ee=[],Ie=await Hne({code:D,prompt:L},{endpoint:r,onProgress:he=>v(Z=>[...Z,he])});if(ee.push({prompt:X?`Fix: ${L}`:L,summary:Ie.summary,isRetry:X}),n){const he=await n(Ie.newCode);if(!he.success&&he.error){v([]);const Z=`Compilation error: ${he.error}
1411
+
1412
+ Please fix this error.`,ge=await E(Ie.newCode,Z,!0);return{newCode:ge.newCode,entries:[...ee,...ge.entries]}}}return{newCode:Ie.newCode,entries:ee}},[n,r]),I=A.useMemo(()=>{var D;return((D=o.files.get(a))==null?void 0:D.content)??""},[o,a]),N=A.useCallback(async D=>{if(!(!D.trim()||h)){m(!0),x(null),v([]),_(D);try{const L=await E(I,D);s(X=>{const ee=VS(X),Ie=ee.files.get(a);return Ie&&ee.files.set(a,{...Ie,content:L.newCode}),ee}),f(X=>[...X,...L.entries])}catch(L){x(L instanceof Error?L.message:"Edit failed")}finally{m(!1),v([]),_(null)}}},[I,a,h,E]),M=A.useCallback(()=>{s(i),u(i.entry),f([]),x(null),v([])},[i]),F=A.useCallback(D=>{s(L=>{const X=VS(L),ee=X.files.get(a);return ee&&X.files.set(a,{...ee,content:D}),X})},[a]),R=A.useCallback(()=>{x(null)},[]);return{project:o,originalProject:i,activeFile:a,history:d,isApplying:h,error:g,streamingNotes:b,pendingPrompt:C,submitEdit:N,revert:M,updateActiveFile:F,setActiveFile:u,clearError:R}}function Zne({text:e,isLatest:t}){return w.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground/60",children:[t&&w.jsx(yi,{className:"h-3 w-3 animate-spin"}),w.jsx("p",{className:"text-xs italic",children:e})]})}function Jne({entries:e,streamingNotes:t,isStreaming:n,pendingPrompt:r,className:i=""}){const o=A.useRef(null);return A.useEffect(()=>{o.current&&(o.current.scrollTop=o.current.scrollHeight)},[e,t,r]),w.jsxs("div",{ref:o,className:`overflow-y-auto p-4 space-y-4 bg-background ${i}`,children:[e.map((s,a)=>w.jsxs("div",{className:"space-y-3",children:[w.jsx("div",{className:"flex justify-end",children:w.jsx("div",{className:"bg-primary text-primary-foreground rounded-lg px-4 py-2 max-w-[85%]",children:w.jsx("div",{className:"prose prose-sm prose-invert max-w-none prose-p:my-1 prose-headings:my-2 prose-ul:my-1 prose-ol:my-1 prose-li:my-0",children:w.jsx(lc,{remarkPlugins:[uc],children:s.prompt})})})}),w.jsx("div",{className:"flex justify-start",children:w.jsx("div",{className:"bg-primary/10 rounded-lg px-4 py-2 max-w-[85%]",children:w.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none prose-p:my-1 prose-headings:my-2 prose-ul:my-1 prose-ol:my-1 prose-li:my-0",children:w.jsx(lc,{remarkPlugins:[uc],children:s.summary})})})})]},a)),r&&w.jsxs("div",{className:"space-y-3",children:[w.jsx("div",{className:"flex justify-end",children:w.jsx("div",{className:"bg-primary text-primary-foreground rounded-lg px-4 py-2 max-w-[85%]",children:w.jsx("div",{className:"prose prose-sm prose-invert max-w-none prose-p:my-1 prose-headings:my-2 prose-ul:my-1 prose-ol:my-1 prose-li:my-0",children:w.jsx(lc,{remarkPlugins:[uc],children:r})})})}),n&&t.length>0&&w.jsx("div",{className:"space-y-1 py-2 px-3",children:t.map((s,a)=>w.jsx(Zne,{text:s,isLatest:a===t.length-1},a))})]})]})}function $A({value:e,onChange:t,onSubmit:n,placeholder:r="Type a message...",disabled:i=!1,className:o=""}){const s=A.useRef(null),a=oK({extensions:[QG.configure({heading:{levels:[1,2,3]},bulletList:{keepMarks:!0,keepAttributes:!1},orderedList:{keepMarks:!0,keepAttributes:!1},codeBlock:!1,code:{HTMLAttributes:{class:"bg-muted rounded px-1 py-0.5 font-mono text-sm"}},blockquote:{HTMLAttributes:{class:"border-l-4 border-muted-foreground/30 pl-4 italic"}},horizontalRule:!1,hardBreak:{keepMarks:!1}}),Ane,XG.configure({placeholder:r,emptyEditorClass:"is-editor-empty"}),CY,vte.configure({html:!1,transformPastedText:!0,transformCopiedText:!0})],content:e,editable:!i,editorProps:{attributes:{class:`outline-none min-h-[40px] max-h-[200px] overflow-y-auto px-3 py-2 ${o}`},handleKeyDown:(d,f)=>{var E;const{state:h}=d,{selection:m}=h,{$from:g,$to:x,empty:b}=m,v=g.parent.type.name,C=v==="listItem",_=v==="codeBlock";if((f.metaKey||f.ctrlKey)&&f.key==="a"&&_){f.preventDefault();const{tr:I}=h;return I.setSelection(yt.create(I.doc,g.start(),g.end())),d.dispatch(I),!0}if(f.key==="ArrowUp"&&_&&!g.parent.textContent.slice(0,g.parentOffset).includes(`
1413
+ `)){const M=(E=d.domAtPos(g.start()).node.parentElement)==null?void 0:E.closest(".code-block-wrapper"),F=M==null?void 0:M.querySelector(".language-input");if(F)return f.preventDefault(),F.focus(),F.select(),!0}if(f.key==="Tab"&&_){f.preventDefault();const{tr:I}=h;if(b)if(f.shiftKey){const N=g.parent.textContent.slice(0,g.parentOffset);N.endsWith(" ")?I.delete(g.pos-2,g.pos):N.endsWith(" ")&&I.delete(g.pos-1,g.pos)}else I.insertText(" ");else{const N=g.parent.textContent,M=N.lastIndexOf(`
1414
+ `,g.parentOffset-1)+1,F=N.indexOf(`
1415
+ `,x.parentOffset),R=F===-1?N.length:F,L=N.slice(M,R).split(`
1416
+ `),X=f.shiftKey?L.map(Ie=>Ie.replace(/^ ?/,"")).join(`
1417
+ `):L.map(Ie=>" "+Ie).join(`
1418
+ `),ee=g.start();I.replaceWith(ee+M,ee+R,h.schema.text(X))}return d.dispatch(I),!0}if(f.key==="Enter"){if(_){if(f.shiftKey){f.preventDefault();const{tr:I}=h;return I.insertText(`
1419
+ `),d.dispatch(I),!0}return f.preventDefault(),n(),!0}if(f.shiftKey){f.preventDefault();const{tr:I}=h;return d.dispatch(I.split(g.pos)),!0}if(!C)return f.preventDefault(),n(),!0}return!1}},onUpdate:({editor:d})=>{const f=d.storage.markdown;f!=null&&f.getMarkdown?t(f.getMarkdown()):t(d.getText())}});A.useEffect(()=>{if(!a)return;const d=h=>{var v,C,_;const m=(v=h.clipboardData)==null?void 0:v.getData("text/plain"),g=(C=h.clipboardData)==null?void 0:C.getData("text/html");if(!m)return;const{$from:x}=a.state.selection;if(x.parent.type.name==="codeBlock"){h.preventDefault(),h.stopPropagation();const{tr:E}=a.state;E.insertText(m),a.view.dispatch(E);return}if(g){h.preventDefault(),h.stopPropagation();const E=a.storage.markdown;if(E!=null&&E.parser)try{const I=E.parser.parse(m);if(((_=I==null?void 0:I.content)==null?void 0:_.size)>0){const N=[];I.content.forEach(M=>N.push(M.toJSON())),a.chain().focus().insertContent(N).run();return}}catch(I){console.warn("Markdown parse failed, falling back to plain text",I)}a.chain().focus().insertContent(m).run()}},f=s.current;return f==null||f.addEventListener("paste",d,{capture:!0}),()=>f==null?void 0:f.removeEventListener("paste",d,{capture:!0})},[a]),A.useEffect(()=>{a&&e===""&&a.getText()!==""&&a.commands.clearContent()},[a,e]),A.useEffect(()=>{a==null||a.setEditable(!i)},[a,i]);const u=A.useCallback(()=>{a==null||a.commands.focus()},[a]);return A.useEffect(()=>{a&&(a.focusInput=u)},[a,u]),w.jsx("div",{ref:s,className:`
1420
+ flex-1 rounded-md border border-input bg-background text-sm
1421
+ ring-offset-background
1422
+ focus-within:outline-none focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2
1423
+ ${i?"cursor-not-allowed opacity-50":""}
1424
+ `,onClick:()=>a==null?void 0:a.commands.focus(),children:w.jsx(N6,{editor:a,className:"markdown-editor"})})}function Kne(e){const t={name:"",path:"",isDir:!0,children:[]};for(const n of e){const r=n.path.split("/");let i=t;for(let o=0;o<r.length;o++){const s=r[o],a=o===r.length-1,u=r.slice(0,o+1).join("/");let d=i.children.find(f=>f.name===s);d||(d={name:s,path:u,isDir:!a,children:[]},i.children.push(d)),i=d}}return t.children.sort((n,r)=>n.isDir!==r.isDir?n.isDir?-1:1:n.name.localeCompare(r.name)),t}function uy({node:e,activeFile:t,onSelect:n,depth:r=0}){const[i,o]=A.useState(!0);if(!e.name)return w.jsx(w.Fragment,{children:e.children.map(a=>w.jsx(uy,{node:a,activeFile:t,onSelect:n,depth:r},a.path))});const s=e.path===t;return e.isDir?w.jsxs("div",{children:[w.jsxs("button",{onClick:()=>o(!i),className:"flex items-center gap-1 w-full px-2 py-1 text-left text-sm hover:bg-muted/50 rounded",style:{paddingLeft:`${r*12+8}px`},children:[i?w.jsx(Ic,{className:"h-3 w-3 shrink-0"}):w.jsx(uP,{className:"h-3 w-3 shrink-0"}),w.jsx(wP,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),w.jsx("span",{className:"truncate",children:e.name})]}),i&&w.jsx("div",{children:e.children.map(a=>w.jsx(uy,{node:a,activeFile:t,onSelect:n,depth:r+1},a.path))})]}):w.jsxs("button",{onClick:()=>n(e.path),className:`flex items-center gap-1 w-full px-2 py-1 text-left text-sm hover:bg-muted/50 rounded ${s?"bg-primary/10 text-primary":""}`,style:{paddingLeft:`${r*12+20}px`},children:[w.jsx(xP,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),w.jsx("span",{className:"truncate",children:e.name})]})}function Gne({files:e,activeFile:t,onSelectFile:n}){const r=A.useMemo(()=>Kne(e),[e]);return w.jsxs("div",{className:"w-48 border-r bg-muted/30 overflow-auto text-foreground",children:[w.jsx("div",{className:"p-2 border-b text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Files"}),w.jsx("div",{className:"p-1",children:w.jsx(uy,{node:r,activeFile:t,onSelect:n})})]})}function Yne(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return t}function Qne({isOpen:e,onClose:t,renderPreview:n,renderLoading:r,renderError:i,previewError:o,previewLoading:s,...a}){var D;const[u,d]=A.useState(!0),[f,h]=A.useState(!1),[m,g]=A.useState(""),[x,b]=A.useState([]),[v,C]=A.useState(null),_=qne(a),E=Mne(_),I=A.useMemo(()=>Nne(_.project),[_.project]),N=E!==(((D=_.originalProject.files.get(_.activeFile))==null?void 0:D.content)??""),M=A.useCallback(L=>{b(L)},[]),F=()=>{if(!m.trim()&&x.length===0||_.isApplying)return;let L=m;if(x.length>0){const X=LA(x,[]);L=`${m}
1425
+
1426
+ ---
1427
+ Visual Changes (apply these styles/modifications):
1428
+ \`\`\`yaml
1429
+ ${X}
1430
+ \`\`\``}_.submitEdit(L),g(""),b([])},R=()=>{const L=_.history.length,X=E;g(""),_.clearError(),t(X,L)};return e?w.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-8",children:w.jsxs("div",{className:"flex flex-col bg-background rounded-lg shadow-xl w-full h-full max-w-6xl max-h-[90vh] overflow-hidden",children:[w.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 bg-background border-b-2",children:[w.jsx(o_,{className:"h-4 w-4 text-primary"}),_.isApplying&&w.jsxs("span",{className:"text-xs font-medium text-primary flex items-center gap-1 ml-2",children:[w.jsx(yi,{className:"h-3 w-3 animate-spin"}),"Applying edits..."]}),w.jsxs("div",{className:"ml-auto flex gap-2",children:[N&&w.jsx("button",{onClick:_.revert,className:"px-2 py-1 text-xs rounded flex items-center gap-1 hover:bg-primary/20 text-primary",title:"Revert to original",children:w.jsx(s_,{className:"h-3 w-3"})}),w.jsx("button",{onClick:()=>h(!f),className:`px-2 py-1 text-xs rounded flex items-center gap-1 ${f?"bg-primary text-primary-foreground":"hover:bg-primary/20 text-primary"}`,title:f?"Single file":"File tree",children:f?w.jsx(gP,{className:"h-3 w-3"}):w.jsx(vP,{className:"h-3 w-3"})}),w.jsxs("button",{onClick:()=>d(!u),className:`px-2 py-1 text-xs rounded flex items-center gap-1 ${u?"bg-primary text-primary-foreground":"hover:bg-primary/20 text-primary"}`,children:[u?w.jsx(i_,{className:"h-3 w-3"}):w.jsx(f1,{className:"h-3 w-3"}),u?"Preview":"Code"]}),w.jsxs("button",{onClick:R,className:"px-2 py-1 text-xs rounded flex items-center gap-1 bg-primary text-primary-foreground hover:bg-primary/90",title:"Exit edit mode",children:[w.jsx(DP,{className:"h-3 w-3"}),"Done"]})]})]}),w.jsxs("div",{className:"flex-1 min-h-0 border-b-2 overflow-hidden flex",children:[f&&w.jsx(Gne,{files:I,activeFile:_.activeFile,onSelectFile:_.setActiveFile}),w.jsx("div",{className:"flex-1 overflow-auto",children:u?w.jsxs("div",{className:"bg-white h-full relative",ref:C,children:[o&&i?i(o):o?w.jsxs("div",{className:"p-4 text-sm text-destructive flex items-center gap-2",children:[w.jsx(Ta,{className:"h-4 w-4 shrink-0"}),w.jsx("span",{children:o})]}):s&&r?r():s?w.jsxs("div",{className:"p-4 flex items-center gap-2 text-muted-foreground",children:[w.jsx(yi,{className:"h-4 w-4 animate-spin"}),w.jsx("span",{className:"text-sm",children:"Rendering preview..."})]}):w.jsx("div",{className:"p-4",children:n(E)},Yne(E)),!r&&!i&&!s&&w.jsx(Ene,{container:v,pillContainer:v,defaultActive:!1,showInspector:!0,onChanges:M,exclude:[".bobbin-pill","[data-bobbin]"]})]}):w.jsx("div",{className:"p-4 bg-muted/10 h-full overflow-auto",children:w.jsx("pre",{className:"text-xs whitespace-pre-wrap break-words m-0",children:w.jsx("code",{children:E})})})})]}),w.jsx(Jne,{entries:_.history,streamingNotes:_.streamingNotes,isStreaming:_.isApplying,pendingPrompt:_.pendingPrompt,className:"h-48"}),_.error&&w.jsxs("div",{className:"px-4 py-2 bg-destructive/10 text-destructive text-sm flex items-center gap-2 border-t-2 border-destructive",children:[w.jsx(Ta,{className:"h-4 w-4 shrink-0"}),_.error]}),x.length>0&&w.jsxs("div",{className:"px-4 py-2 bg-blue-50 text-blue-700 text-sm flex items-center gap-2 border-t",children:[w.jsxs("span",{children:[x.length," visual change",x.length!==1?"s":""]}),w.jsx("button",{onClick:()=>b([]),className:"text-xs underline hover:no-underline",children:"Clear"})]}),w.jsxs("div",{className:"p-4 border-t-2 bg-primary/5 flex gap-2 items-end",children:[w.jsx("div",{className:"flex-1",children:w.jsx($A,{value:m,onChange:g,onSubmit:F,placeholder:"Describe changes...",disabled:_.isApplying})}),w.jsx("button",{onClick:F,disabled:!m.trim()&&x.length===0||_.isApplying,className:"px-3 py-2 bg-primary text-primary-foreground rounded-md hover:bg-primary/90 disabled:opacity-50 flex items-center gap-1 shrink-0",children:_.isApplying?w.jsx(yi,{className:"h-4 w-4 animate-spin"}):w.jsx(a_,{className:"h-4 w-4"})})]})]})}):null}var BA="/vfs",qf=null;async function Xne(){if(qf)return qf;try{const e=await fetch(`${BA}/config`);if(e.ok)return qf=await e.json(),qf}catch{}return{usePaths:!1}}var Kg=null;function ere(){if(!Kg){const e=new eV({baseUrl:BA});Kg=new XU(e)}return Kg}async function HS(e){await ere().saveProject(e)}function UA(e){return{name:"preview",version:"1.0.0",platform:"browser",image:"@aprovan/patchwork-image-shadcn",services:e}}function VA(e,t,n,r){const[i,o]=A.useState(!1),[s,a]=A.useState(null),u=A.useRef(null),d=A.useRef(null);return A.useEffect(()=>{if(!n||!e||!u.current)return;let f=!1;async function h(){if(!(!u.current||!e)){o(!0),a(null);try{d.current&&(e.unmount(d.current),d.current=null);const m=await e.compile(t,UA(r),{typescript:!0});if(f)return;const g=await e.mount(m,{target:u.current,mode:"embedded"});d.current=g}catch(m){f||a(m instanceof Error?m.message:"Failed to render JSX")}finally{f||o(!1)}}}return h(),()=>{f=!0,d.current&&e&&(e.unmount(d.current),d.current=null)}},[t,e,n,r]),{containerRef:u,loading:i,error:s}}function tre({code:e,compiler:t,services:n,filePath:r}){const[i,o]=A.useState(!1),[s,a]=A.useState(!0),[u,d]=A.useState(e),[f,h]=A.useState(0),[m,g]=A.useState("unsaved"),x=A.useMemo(()=>crypto.randomUUID(),[]),b=A.useCallback(async()=>{if(r&&(await Xne()).usePaths){const D=r.split("/");return D.length>1?D.slice(0,-1).join("/"):r.replace(/\.[^.]+$/,"")}return x},[r,x]),v=A.useCallback(()=>{if(r){const R=r.split("/");return R[R.length-1]||"main.tsx"}return"main.tsx"},[r]),C=A.useCallback(async()=>{g("saving");try{const R=await b(),D=v(),L=wh(u,D,R);await HS(L),g("saved")}catch(R){console.warn("[VFS] Failed to save project:",R),g("error")}},[u,b,v]),{containerRef:_,loading:E,error:I}=VA(t,u,s&&!i,n),N=A.useCallback(async R=>{if(!t)return{success:!0};const D=[],L=console.error;console.error=(...X)=>{D.push(X.map(ee=>typeof ee=="object"?JSON.stringify(ee):String(ee)).join(" ")),L.apply(console,X)};try{return await t.compile(R,UA(n),{typescript:!0}),{success:!0}}catch(X){const ee=X instanceof Error?X.message:"Compilation failed",Ie=D.length>0?`
1431
+
1432
+ Console errors:
1433
+ ${D.join(`
1434
+ `)}`:"";return{success:!1,error:ee+Ie}}finally{console.error=L}},[t,n]),M=()=>{d(e),h(0)},F=u!==e;return w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"my-3 border rounded-lg",children:[w.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-muted/50 border-b rounded-t-lg",children:[w.jsx(f1,{className:"h-4 w-4 text-muted-foreground"}),f>0&&w.jsxs("span",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[w.jsx(EP,{className:"h-3 w-3"}),f," edit",f!==1?"s":""]}),w.jsx("button",{onClick:C,disabled:m==="saving",className:`px-2 py-1 text-xs rounded flex items-center gap-1 ${m==="saved"?"text-green-600":m==="error"?"text-destructive hover:bg-muted":"text-muted-foreground hover:bg-muted"}`,title:m==="saved"?"Saved to disk":m==="saving"?"Saving...":m==="error"?"Save failed - click to retry":"Click to save",children:m==="saving"?w.jsx(yi,{className:"h-3 w-3 animate-spin"}):w.jsxs("span",{className:"relative",children:[w.jsx(fP,{className:"h-3 w-3"}),m==="saved"&&w.jsx(sP,{className:"h-2 w-2 absolute -bottom-0.5 -right-0.5 stroke-[3]"})]})}),w.jsxs("div",{className:"ml-auto flex gap-1",children:[F&&w.jsx("button",{onClick:M,className:"px-2 py-1 text-xs rounded flex items-center gap-1 hover:bg-muted text-muted-foreground",title:"Revert to original",children:w.jsx(s_,{className:"h-3 w-3"})}),w.jsx("button",{onClick:()=>o(!0),className:"px-2 py-1 text-xs rounded flex items-center gap-1 hover:bg-muted",title:"Edit component",children:w.jsx(o_,{className:"h-3 w-3"})}),w.jsxs("button",{onClick:()=>a(!s),className:`px-2 py-1 text-xs rounded flex items-center gap-1 ${s?"bg-primary text-primary-foreground":"hover:bg-primary/20 text-primary"}`,children:[s?w.jsx(i_,{className:"h-3 w-3"}):w.jsx(f1,{className:"h-3 w-3"}),s?"Preview":"Code"]})]})]}),s?w.jsxs("div",{className:"bg-white",children:[I?w.jsxs("div",{className:"p-3 text-sm text-destructive flex items-center gap-2",children:[w.jsx(Ta,{className:"h-4 w-4 shrink-0"}),w.jsx("span",{children:I})]}):E?w.jsxs("div",{className:"p-3 flex items-center gap-2 text-muted-foreground",children:[w.jsx(yi,{className:"h-4 w-4 animate-spin"}),w.jsx("span",{className:"text-sm",children:"Rendering preview..."})]}):t?null:w.jsx("div",{className:"p-3 text-sm text-muted-foreground",children:"Compiler not initialized"}),w.jsx("div",{ref:_})]}):w.jsx("div",{className:"p-3 bg-muted/30 overflow-auto max-h-96",children:w.jsx("pre",{className:"text-xs whitespace-pre-wrap break-words m-0",children:w.jsx("code",{children:u})})})]}),w.jsx(Qne,{isOpen:i,onClose:(R,D)=>{d(R),h(L=>L+D),o(!1),D>0&&(g("saving"),(async()=>{try{const L=await b(),X=v(),ee=wh(R,X,L);await HS(ee),g("saved")}catch(L){console.warn("[VFS] Failed to save project:",L),g("error")}})())},originalCode:u,compile:N,renderPreview:R=>w.jsx(nre,{code:R,compiler:t,services:n})})]})}function nre({code:e,compiler:t,services:n}){const{containerRef:r,loading:i,error:o}=VA(t,e,!0,n);return w.jsxs(w.Fragment,{children:[o&&w.jsxs("div",{className:"text-sm text-destructive flex items-center gap-2",children:[w.jsx(Ta,{className:"h-4 w-4 shrink-0"}),w.jsx("span",{children:o})]}),i&&w.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[w.jsx(yi,{className:"h-4 w-4 animate-spin"}),w.jsx("span",{className:"text-sm",children:"Rendering preview..."})]}),!t&&!i&&!o&&w.jsx("div",{className:"text-sm text-muted-foreground",children:"Compiler not initialized"}),w.jsx("div",{ref:r})]})}function rre({children:e,className:t=""}){return w.jsx("span",{className:`inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 ${t}`,children:e})}function ire({children:e,open:t,onOpenChange:n}){return t?w.jsx("div",{className:"fixed inset-0 z-50 bg-black/50",onClick:()=>n==null?void 0:n(!1),children:w.jsx("div",{className:"fixed left-1/2 top-1/2 z-50 w-full max-w-lg -translate-x-1/2 -translate-y-1/2 bg-background p-6 shadow-lg rounded-lg",onClick:r=>r.stopPropagation(),children:e})}):null}function ore({namespaces:e,services:t=[],BadgeComponent:n=rre,DialogComponent:r=ire}){const[i,o]=A.useState(!1);if(e.length===0)return null;const s=t.reduce((a,u)=>{var d;return(a[d=u.namespace]??(a[d]=[])).push(u),a},{});return w.jsxs(w.Fragment,{children:[w.jsxs("button",{onClick:()=>o(!0),className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[w.jsx(NP,{className:"h-4 w-4 text-muted-foreground"}),w.jsxs(n,{className:"text-xs",children:[e.length," service",e.length!==1?"s":""]})]}),w.jsxs(r,{open:i,onOpenChange:o,children:[w.jsxs("div",{className:"flex justify-between items-center mb-4",children:[w.jsx("h2",{className:"text-lg font-semibold",children:"Available Services"}),w.jsx("button",{onClick:()=>o(!1),className:"text-muted-foreground hover:text-foreground",children:"×"})]}),w.jsx("div",{className:"space-y-3 max-h-96 overflow-auto",children:e.map(a=>{var u;return w.jsxs("details",{open:e.length===1,children:[w.jsxs("summary",{className:"flex items-center gap-2 w-full p-2 rounded bg-muted/50 hover:bg-muted transition-colors cursor-pointer",children:[w.jsx(Ic,{className:"h-4 w-4 text-muted-foreground"}),w.jsx("span",{className:"font-medium text-sm",children:a}),s[a]&&w.jsxs(n,{className:"ml-auto text-xs",children:[s[a].length," tool",s[a].length!==1?"s":""]})]}),w.jsx("div",{className:"ml-6 mt-2 space-y-2",children:((u=s[a])==null?void 0:u.map(d=>w.jsxs("details",{children:[w.jsxs("summary",{className:"flex items-center gap-2 w-full text-left text-sm hover:text-foreground text-muted-foreground transition-colors cursor-pointer",children:[w.jsx(Ic,{className:"h-3 w-3"}),w.jsx("code",{className:"font-mono text-xs",children:d.procedure}),w.jsx("span",{className:"truncate text-xs opacity-70",children:d.description})]}),w.jsx("div",{className:"ml-5 mt-1 p-2 rounded border bg-muted/30 overflow-auto max-h-48",children:w.jsx("pre",{className:"text-xs font-mono whitespace-pre-wrap break-words m-0",children:JSON.stringify(d.parameters.jsonSchema,null,2)})})]},d.name)))??w.jsx("p",{className:"text-xs text-muted-foreground",children:"No tool details available"})})]},a)})})]})]})}var sre=/```([a-zA-Z0-9_+-]*)((?:\s+[a-zA-Z_][\w-]*="[^"]*")*)\s*\n([\s\S]*?)```/g,are=/```([a-zA-Z0-9_+-]*)((?:\s+[a-zA-Z_][\w-]*="[^"]*")*)\s*\n([\s\S]*)$/,lre=/([a-zA-Z_][\w-]*)="([^"]*)"/g;function WS(e){const t={};if(!e)return t;const n=new RegExp(lre.source,"g");let r;for(;(r=n.exec(e))!==null;){const i=r[1],o=r[2];i&&o!==void 0&&(t[i]=o)}return t}function ure(e,t={}){var f,h;const{filterLanguages:n,includeUnclosed:r=!1}=t,i=[];let o=0;const s=[],a=new RegExp(sre.source,"g");let u;for(;(u=a.exec(e))!==null;){const m=((f=u[1])==null?void 0:f.toLowerCase())||"",g=WS(u[2]||""),x=u[3]??"",b=!n||n.has(m);s.push({match:u,language:m,content:x,attributes:g,included:b})}for(const{match:m,language:g,content:x,attributes:b,included:v}of s){if(m.index>o){const C=e.slice(o,m.index);C.trim()&&i.push({type:"text",content:C})}o=m.index+m[0].length,v&&i.push({type:"code",content:x,language:g,attributes:b})}const d=e.slice(o);if(r&&d.includes("```")){const m=d.match(are);if(m){const g=((h=m[1])==null?void 0:h.toLowerCase())||"",x=WS(m[2]||""),b=m[3]??"",v=!n||n.has(g),C=d.indexOf("```");if(C>0){const _=d.slice(0,C);_.trim()&&i.push({type:"text",content:_})}v&&i.push({type:"code",content:b,language:g,attributes:x}),o=e.length}}if(o<e.length){const m=e.slice(o);m.trim()&&i.push({type:"text",content:m})}return i.length===0&&i.push({type:"text",content:e}),i}const th="https://raw.githubusercontent.com/AprovanLabs/aprovan.com/main/docs/assets/social-labs.png",Gx=A.createContext({compiler:null,namespaces:[]}),cre=()=>A.useContext(Gx).compiler,dre=()=>A.useContext(Gx).namespaces;function fre({text:e,isUser:t}){const n=cre(),r=dre();if(t)return w.jsx("div",{className:"prose prose-sm prose-invert prose-p:my-1 prose-headings:my-2 prose-ul:my-1 prose-ol:my-1 prose-li:my-0 prose-pre:my-2 prose-code:before:content-none prose-code:after:content-none",children:w.jsx(lc,{remarkPlugins:[uc],children:e})});const i=ure(e);return w.jsx("div",{className:"prose prose-sm dark:prose-invert prose-p:my-1 prose-headings:my-2 prose-ul:my-1 prose-ol:my-1 prose-li:my-0 prose-pre:my-2 prose-code:before:content-none prose-code:after:content-none",children:i.map((o,s)=>{var a;return o.type==="code"?w.jsx(tre,{code:o.content,compiler:n,services:r,filePath:(a=o.attributes)==null?void 0:a.path},s):w.jsx(lc,{remarkPlugins:[uc],children:o.content},s)})})}function hre({text:e,isStreaming:t}){return w.jsxs(a3,{defaultOpen:t,children:[w.jsxs(l3,{className:"flex items-center gap-2 text-yellow-700 dark:text-yellow-400 hover:opacity-80 w-full",children:[w.jsx(iP,{className:"h-4 w-4"}),w.jsx("span",{className:"text-xs font-medium",children:"Thinking"}),t&&w.jsx(yi,{className:"h-3 w-3 animate-spin"}),w.jsx(Ic,{className:"h-3 w-3 ml-auto transition-transform [[data-state=open]>&]:rotate-180"})]}),w.jsx(u3,{children:w.jsx("div",{className:"mt-2 p-3 rounded border-l-4 border-yellow-500 bg-yellow-50 dark:bg-yellow-950/50",children:w.jsx("p",{className:"text-sm text-muted-foreground italic whitespace-pre-wrap",children:e})})})]})}function pre({toolName:e,state:t,input:n,output:r,errorText:i}){const o=t==="input-streaming"||t==="input-available",s=t==="output-error";return w.jsxs(a3,{className:"my-1 w-full",children:[w.jsxs(l3,{className:"inline-flex items-center gap-2 px-3 py-1 rounded-full border bg-muted/50 hover:bg-muted text-xs transition-colors",children:[w.jsx(RP,{className:"h-3 w-3 text-muted-foreground"}),w.jsx("span",{className:"font-mono",children:e}),w.jsxs("span",{className:"w-3 h-3 flex items-center justify-center",children:[o&&w.jsx(yi,{className:"h-3 w-3 animate-spin text-muted-foreground"}),s&&w.jsx(Ta,{className:"h-3 w-3 text-destructive"})]}),w.jsx(Ic,{className:"h-3 w-3 text-muted-foreground transition-transform [[data-state=open]>&]:rotate-180"})]}),w.jsxs(u3,{className:"mt-2 p-3 rounded-lg border bg-white space-y-2",children:[n!==void 0&&w.jsxs("div",{children:[w.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Input"}),w.jsx("div",{className:"mt-1 p-2 bg-muted/30 rounded text-xs overflow-auto max-h-48",children:w.jsx("pre",{className:"whitespace-pre-wrap break-words m-0",children:typeof n=="string"?n:JSON.stringify(n,null,2)})})]}),r!==void 0&&w.jsxs("div",{children:[w.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Output"}),w.jsx("div",{className:"mt-1 p-2 bg-muted/30 rounded text-xs overflow-auto max-h-48",children:w.jsx("pre",{className:"whitespace-pre-wrap break-words m-0",children:typeof r=="string"?r:JSON.stringify(r,null,2)})})]}),i&&w.jsxs("div",{className:"text-sm text-destructive flex items-center gap-2",children:[w.jsx(Ta,{className:"h-4 w-4 shrink-0"}),w.jsx("span",{className:"break-words",children:i})]})]})]})}function mre({message:e}){var r,i;const t=e.role==="user",n=(r=e.parts)==null?void 0:r.some(o=>"state"in o&&(o.state==="input-streaming"||o.state==="input-available"));return w.jsxs("div",{className:`flex gap-3 ${t?"justify-end":"justify-start"}`,children:[!t&&w.jsxs(gh,{className:"h-8 w-8 shrink-0",children:[w.jsx("img",{src:th,alt:"Assistant",className:"rounded-full"}),w.jsx(yh,{className:"bg-primary text-primary-foreground",children:"A"})]}),w.jsxs("div",{className:`flex flex-col gap-1 max-w-[80%] min-w-0 ${t?"items-end":"items-start"}`,children:[w.jsxs("div",{className:"flex items-center gap-2 h-5",children:[w.jsx("span",{className:"text-xs text-muted-foreground capitalize",children:e.role}),n&&w.jsxs(bj,{variant:"outline",className:"text-xs",children:[w.jsx(yi,{className:"h-3 w-3 mr-1 animate-spin"}),"streaming"]})]}),w.jsx("div",{className:`rounded-lg px-4 py-2 overflow-hidden w-full ${t?"bg-primary text-primary-foreground":"bg-muted"}`,children:(i=e.parts)==null?void 0:i.map((o,s)=>{if(o.type==="text")return w.jsx(fre,{text:o.text,isUser:t},s);if(o.type==="reasoning")return w.jsx(hre,{text:o.text,isStreaming:o.state==="streaming"},s);if(o.type.startsWith("tool-")||o.type==="dynamic-tool"){const a=o,u=a.toolName??o.type.replace("tool-","");return w.jsx(pre,{toolName:u,state:a.state,input:a.input,output:a.output,errorText:a.errorText},s)}return null})})]}),t&&w.jsx(gh,{className:"h-8 w-8 shrink-0",children:w.jsx(yh,{className:"bg-secondary",children:"U"})})]})}const gre="/api/proxy",qS="@aprovan/patchwork-image-shadcn",yre="https://esm.sh",xre="https://esm.sh";function bre(){var C;const[e,t]=A.useState("What's the weather in Houston, Texas like?"),[n,r]=A.useState(null),[i,o]=A.useState([]),[s,a]=A.useState([]),u=A.useRef(null);A.useEffect(()=>{fetch("/api/services").then(_=>_.json()).then(_=>{o(_.namespaces??[])}).catch(()=>{o([]),a([])}),YU({image:qS,proxyUrl:gre,cdnBaseUrl:yre,widgetCdnBaseUrl:xre}).then(r).catch(console.error)},[]);const d=A.useMemo(()=>({compiler:n,namespaces:i}),[n,i]),f=A.useMemo(()=>new e_({body:()=>({metadata:{patchwork:{compilers:[qS]}}})}),[]),{messages:h,sendMessage:m,status:g,error:x}=YR({transport:f}),b=g==="submitted"||g==="streaming",v=A.useCallback(_=>{_==null||_.preventDefault(),e.trim()&&(m({text:e}),t(""))},[e,m]);return A.useEffect(()=>{var _;(_=u.current)==null||_.scrollTo({top:u.current.scrollHeight,behavior:"smooth"})},[h]),w.jsx(Gx.Provider,{value:d,children:w.jsx("div",{className:"flex flex-col h-screen max-w-4xl mx-auto p-4",children:w.jsxs(X_,{className:"flex-1 flex flex-col min-h-0 overflow-hidden border",children:[w.jsx(e3,{className:"border-b py-3",children:w.jsxs(t3,{className:"flex items-center gap-3",children:[w.jsx("img",{src:th,alt:"Aprovan",className:"h-8 w-8 rounded-full"}),w.jsx("span",{className:"text-lg",children:"patchwork"}),w.jsx(ore,{namespaces:i,services:s})]})}),w.jsx(n3,{className:"flex-1 p-0 min-h-0",children:w.jsx(U_,{className:"h-full",ref:u,children:w.jsxs("div",{className:"p-4 space-y-4",children:[h.length===0?w.jsxs("div",{className:"text-center text-muted-foreground py-12",children:[w.jsx("img",{src:th,alt:"",className:"h-12 w-12 mx-auto mb-4 opacity-50 rounded-full"}),w.jsx("p",{children:"Start a conversation"})]}):h.map(_=>w.jsx(mre,{message:_},_.id)),b&&((C=h[h.length-1])==null?void 0:C.role)!=="assistant"&&w.jsxs("div",{className:"flex gap-3 justify-start",children:[w.jsxs(gh,{className:"h-8 w-8 shrink-0",children:[w.jsx("img",{src:th,alt:"",className:"rounded-full"}),w.jsx(yh,{children:"A"})]}),w.jsxs("div",{className:"flex flex-col gap-1",children:[w.jsx("div",{className:"h-5"}),w.jsx("div",{className:"bg-muted rounded-lg px-4 py-2",children:w.jsx(yi,{className:"h-4 w-4 animate-spin"})})]})]})]})})}),x&&w.jsxs("div",{className:"px-4 py-2 bg-destructive/10 text-destructive text-sm flex items-center gap-2",children:[w.jsx(Ta,{className:"h-4 w-4"}),x.message]}),w.jsx("div",{className:"p-4 border-t",children:w.jsxs("form",{onSubmit:v,className:"flex gap-2 items-end",children:[w.jsx($A,{value:e,onChange:t,onSubmit:()=>{!b&&e.trim()&&v()},placeholder:"Type a message... (Shift+Enter for new line)",disabled:b}),w.jsx(T_,{type:"submit",disabled:b||!e.trim(),className:"shrink-0",children:b?w.jsx(yi,{className:"h-4 w-4 animate-spin"}):w.jsx(a_,{className:"h-4 w-4"})})]})})]})})})}function vre(){return w.jsx(bre,{})}ON.createRoot(document.getElementById("root")).render(w.jsx(jo.StrictMode,{children:w.jsx(vre,{})}));