@kdrgny/justjson 1.0.1 → 1.2.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.
Files changed (23) hide show
  1. package/README.md +7 -3
  2. package/dist/cli.js +573 -14
  3. package/dist/editor/assets/index-BoAqd15W.js +612 -0
  4. package/dist/editor/assets/index-CP_v5575.css +1 -0
  5. package/dist/editor/assets/public-sans-latin-ext-wght-normal-MQgHevqp.woff2 +0 -0
  6. package/dist/editor/assets/public-sans-latin-wght-normal-DdeTHZLK.woff2 +0 -0
  7. package/dist/editor/assets/public-sans-vietnamese-wght-normal-CtlIRbEm.woff2 +0 -0
  8. package/dist/editor/assets/space-mono-latin-400-normal-Rg4St2Dn.woff2 +0 -0
  9. package/dist/editor/assets/space-mono-latin-400-normal-_3DlpgIW.woff +0 -0
  10. package/dist/editor/assets/space-mono-latin-700-normal-D7A851RN.woff +0 -0
  11. package/dist/editor/assets/space-mono-latin-700-normal-mWgeinG7.woff2 +0 -0
  12. package/dist/editor/assets/space-mono-latin-ext-400-normal-D4cJI_B-.woff +0 -0
  13. package/dist/editor/assets/space-mono-latin-ext-400-normal-DTLbW2xa.woff2 +0 -0
  14. package/dist/editor/assets/space-mono-latin-ext-700-normal-B2s3bDs2.woff2 +0 -0
  15. package/dist/editor/assets/space-mono-latin-ext-700-normal-B_E7P90g.woff +0 -0
  16. package/dist/editor/assets/space-mono-vietnamese-400-normal-B0PMp_xB.woff +0 -0
  17. package/dist/editor/assets/space-mono-vietnamese-400-normal-BNOj0Qhp.woff2 +0 -0
  18. package/dist/editor/assets/space-mono-vietnamese-700-normal-D-KrLuLr.woff +0 -0
  19. package/dist/editor/assets/space-mono-vietnamese-700-normal-DWQgDHuA.woff2 +0 -0
  20. package/dist/editor/index.html +2 -2
  21. package/package.json +3 -14
  22. package/dist/editor/assets/index-BN_YWkOH.css +0 -1
  23. package/dist/editor/assets/index-DsfRA4dz.js +0 -400
@@ -1,400 +0,0 @@
1
- (function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const u of s.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&r(u)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();function hp(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Sf={exports:{}},_o={},Ef={exports:{}},be={};/**
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 dg;function qw(){if(dg)return be;dg=1;var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),u=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.iterator;function y(D){return D===null||typeof D!="object"?null:(D=m&&D[m]||D["@@iterator"],typeof D=="function"?D:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,v={};function w(D,$,xe){this.props=D,this.context=$,this.refs=v,this.updater=xe||x}w.prototype.isReactComponent={},w.prototype.setState=function(D,$){if(typeof D!="object"&&typeof D!="function"&&D!=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,D,$,"setState")},w.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function S(){}S.prototype=w.prototype;function A(D,$,xe){this.props=D,this.context=$,this.refs=v,this.updater=xe||x}var R=A.prototype=new S;R.constructor=A,b(R,w.prototype),R.isPureReactComponent=!0;var I=Array.isArray,P=Object.prototype.hasOwnProperty,F={current:null},z={key:!0,ref:!0,__self:!0,__source:!0};function Q(D,$,xe){var we,Ae={},Me=null,ze=null;if($!=null)for(we in $.ref!==void 0&&(ze=$.ref),$.key!==void 0&&(Me=""+$.key),$)P.call($,we)&&!z.hasOwnProperty(we)&&(Ae[we]=$[we]);var Ie=arguments.length-2;if(Ie===1)Ae.children=xe;else if(1<Ie){for(var Ke=Array(Ie),Gt=0;Gt<Ie;Gt++)Ke[Gt]=arguments[Gt+2];Ae.children=Ke}if(D&&D.defaultProps)for(we in Ie=D.defaultProps,Ie)Ae[we]===void 0&&(Ae[we]=Ie[we]);return{$$typeof:t,type:D,key:Me,ref:ze,props:Ae,_owner:F.current}}function ue(D,$){return{$$typeof:t,type:D.type,key:$,ref:D.ref,props:D.props,_owner:D._owner}}function Ce(D){return typeof D=="object"&&D!==null&&D.$$typeof===t}function rt(D){var $={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(xe){return $[xe]})}var Je=/\/+/g;function Te(D,$){return typeof D=="object"&&D!==null&&D.key!=null?rt(""+D.key):$.toString(36)}function Se(D,$,xe,we,Ae){var Me=typeof D;(Me==="undefined"||Me==="boolean")&&(D=null);var ze=!1;if(D===null)ze=!0;else switch(Me){case"string":case"number":ze=!0;break;case"object":switch(D.$$typeof){case t:case e:ze=!0}}if(ze)return ze=D,Ae=Ae(ze),D=we===""?"."+Te(ze,0):we,I(Ae)?(xe="",D!=null&&(xe=D.replace(Je,"$&/")+"/"),Se(Ae,$,xe,"",function(Gt){return Gt})):Ae!=null&&(Ce(Ae)&&(Ae=ue(Ae,xe+(!Ae.key||ze&&ze.key===Ae.key?"":(""+Ae.key).replace(Je,"$&/")+"/")+D)),$.push(Ae)),1;if(ze=0,we=we===""?".":we+":",I(D))for(var Ie=0;Ie<D.length;Ie++){Me=D[Ie];var Ke=we+Te(Me,Ie);ze+=Se(Me,$,xe,Ke,Ae)}else if(Ke=y(D),typeof Ke=="function")for(D=Ke.call(D),Ie=0;!(Me=D.next()).done;)Me=Me.value,Ke=we+Te(Me,Ie++),ze+=Se(Me,$,xe,Ke,Ae);else if(Me==="object")throw $=String(D),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.");return ze}function ye(D,$,xe){if(D==null)return D;var we=[],Ae=0;return Se(D,we,"","",function(Me){return $.call(xe,Me,Ae++)}),we}function Ge(D){if(D._status===-1){var $=D._result;$=$(),$.then(function(xe){(D._status===0||D._status===-1)&&(D._status=1,D._result=xe)},function(xe){(D._status===0||D._status===-1)&&(D._status=2,D._result=xe)}),D._status===-1&&(D._status=0,D._result=$)}if(D._status===1)return D._result.default;throw D._result}var Xe={current:null},K={transition:null},fe={ReactCurrentDispatcher:Xe,ReactCurrentBatchConfig:K,ReactCurrentOwner:F};function X(){throw Error("act(...) is not supported in production builds of React.")}return be.Children={map:ye,forEach:function(D,$,xe){ye(D,function(){$.apply(this,arguments)},xe)},count:function(D){var $=0;return ye(D,function(){$++}),$},toArray:function(D){return ye(D,function($){return $})||[]},only:function(D){if(!Ce(D))throw Error("React.Children.only expected to receive a single React element child.");return D}},be.Component=w,be.Fragment=n,be.Profiler=i,be.PureComponent=A,be.StrictMode=r,be.Suspense=c,be.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=fe,be.act=X,be.cloneElement=function(D,$,xe){if(D==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+D+".");var we=b({},D.props),Ae=D.key,Me=D.ref,ze=D._owner;if($!=null){if($.ref!==void 0&&(Me=$.ref,ze=F.current),$.key!==void 0&&(Ae=""+$.key),D.type&&D.type.defaultProps)var Ie=D.type.defaultProps;for(Ke in $)P.call($,Ke)&&!z.hasOwnProperty(Ke)&&(we[Ke]=$[Ke]===void 0&&Ie!==void 0?Ie[Ke]:$[Ke])}var Ke=arguments.length-2;if(Ke===1)we.children=xe;else if(1<Ke){Ie=Array(Ke);for(var Gt=0;Gt<Ke;Gt++)Ie[Gt]=arguments[Gt+2];we.children=Ie}return{$$typeof:t,type:D.type,key:Ae,ref:Me,props:we,_owner:ze}},be.createContext=function(D){return D={$$typeof:u,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},D.Provider={$$typeof:s,_context:D},D.Consumer=D},be.createElement=Q,be.createFactory=function(D){var $=Q.bind(null,D);return $.type=D,$},be.createRef=function(){return{current:null}},be.forwardRef=function(D){return{$$typeof:a,render:D}},be.isValidElement=Ce,be.lazy=function(D){return{$$typeof:p,_payload:{_status:-1,_result:D},_init:Ge}},be.memo=function(D,$){return{$$typeof:f,type:D,compare:$===void 0?null:$}},be.startTransition=function(D){var $=K.transition;K.transition={};try{D()}finally{K.transition=$}},be.unstable_act=X,be.useCallback=function(D,$){return Xe.current.useCallback(D,$)},be.useContext=function(D){return Xe.current.useContext(D)},be.useDebugValue=function(){},be.useDeferredValue=function(D){return Xe.current.useDeferredValue(D)},be.useEffect=function(D,$){return Xe.current.useEffect(D,$)},be.useId=function(){return Xe.current.useId()},be.useImperativeHandle=function(D,$,xe){return Xe.current.useImperativeHandle(D,$,xe)},be.useInsertionEffect=function(D,$){return Xe.current.useInsertionEffect(D,$)},be.useLayoutEffect=function(D,$){return Xe.current.useLayoutEffect(D,$)},be.useMemo=function(D,$){return Xe.current.useMemo(D,$)},be.useReducer=function(D,$,xe){return Xe.current.useReducer(D,$,xe)},be.useRef=function(D){return Xe.current.useRef(D)},be.useState=function(D){return Xe.current.useState(D)},be.useSyncExternalStore=function(D,$,xe){return Xe.current.useSyncExternalStore(D,$,xe)},be.useTransition=function(){return Xe.current.useTransition()},be.version="18.3.1",be}var fg;function xu(){return fg||(fg=1,Ef.exports=qw()),Ef.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 hg;function Ww(){if(hg)return _o;hg=1;var t=xu(),e=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function u(a,c,f){var p,m={},y=null,x=null;f!==void 0&&(y=""+f),c.key!==void 0&&(y=""+c.key),c.ref!==void 0&&(x=c.ref);for(p in c)r.call(c,p)&&!s.hasOwnProperty(p)&&(m[p]=c[p]);if(a&&a.defaultProps)for(p in c=a.defaultProps,c)m[p]===void 0&&(m[p]=c[p]);return{$$typeof:e,type:a,key:y,ref:x,props:m,_owner:i.current}}return _o.Fragment=n,_o.jsx=u,_o.jsxs=u,_o}var pg;function Kw(){return pg||(pg=1,Sf.exports=Ww()),Sf.exports}var _=Kw(),ce=xu();const Pi=hp(ce);var Bl={},_f={exports:{}},qt={},Tf={exports:{}},Af={};/**
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 mg;function Zw(){return mg||(mg=1,(function(t){function e(K,fe){var X=K.length;K.push(fe);e:for(;0<X;){var D=X-1>>>1,$=K[D];if(0<i($,fe))K[D]=fe,K[X]=$,X=D;else break e}}function n(K){return K.length===0?null:K[0]}function r(K){if(K.length===0)return null;var fe=K[0],X=K.pop();if(X!==fe){K[0]=X;e:for(var D=0,$=K.length,xe=$>>>1;D<xe;){var we=2*(D+1)-1,Ae=K[we],Me=we+1,ze=K[Me];if(0>i(Ae,X))Me<$&&0>i(ze,Ae)?(K[D]=ze,K[Me]=X,D=Me):(K[D]=Ae,K[we]=X,D=we);else if(Me<$&&0>i(ze,X))K[D]=ze,K[Me]=X,D=Me;else break e}}return fe}function i(K,fe){var X=K.sortIndex-fe.sortIndex;return X!==0?X:K.id-fe.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var u=Date,a=u.now();t.unstable_now=function(){return u.now()-a}}var c=[],f=[],p=1,m=null,y=3,x=!1,b=!1,v=!1,w=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function R(K){for(var fe=n(f);fe!==null;){if(fe.callback===null)r(f);else if(fe.startTime<=K)r(f),fe.sortIndex=fe.expirationTime,e(c,fe);else break;fe=n(f)}}function I(K){if(v=!1,R(K),!b)if(n(c)!==null)b=!0,Ge(P);else{var fe=n(f);fe!==null&&Xe(I,fe.startTime-K)}}function P(K,fe){b=!1,v&&(v=!1,S(Q),Q=-1),x=!0;var X=y;try{for(R(fe),m=n(c);m!==null&&(!(m.expirationTime>fe)||K&&!rt());){var D=m.callback;if(typeof D=="function"){m.callback=null,y=m.priorityLevel;var $=D(m.expirationTime<=fe);fe=t.unstable_now(),typeof $=="function"?m.callback=$:m===n(c)&&r(c),R(fe)}else r(c);m=n(c)}if(m!==null)var xe=!0;else{var we=n(f);we!==null&&Xe(I,we.startTime-fe),xe=!1}return xe}finally{m=null,y=X,x=!1}}var F=!1,z=null,Q=-1,ue=5,Ce=-1;function rt(){return!(t.unstable_now()-Ce<ue)}function Je(){if(z!==null){var K=t.unstable_now();Ce=K;var fe=!0;try{fe=z(!0,K)}finally{fe?Te():(F=!1,z=null)}}else F=!1}var Te;if(typeof A=="function")Te=function(){A(Je)};else if(typeof MessageChannel<"u"){var Se=new MessageChannel,ye=Se.port2;Se.port1.onmessage=Je,Te=function(){ye.postMessage(null)}}else Te=function(){w(Je,0)};function Ge(K){z=K,F||(F=!0,Te())}function Xe(K,fe){Q=w(function(){K(t.unstable_now())},fe)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(K){K.callback=null},t.unstable_continueExecution=function(){b||x||(b=!0,Ge(P))},t.unstable_forceFrameRate=function(K){0>K||125<K?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ue=0<K?Math.floor(1e3/K):5},t.unstable_getCurrentPriorityLevel=function(){return y},t.unstable_getFirstCallbackNode=function(){return n(c)},t.unstable_next=function(K){switch(y){case 1:case 2:case 3:var fe=3;break;default:fe=y}var X=y;y=fe;try{return K()}finally{y=X}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(K,fe){switch(K){case 1:case 2:case 3:case 4:case 5:break;default:K=3}var X=y;y=K;try{return fe()}finally{y=X}},t.unstable_scheduleCallback=function(K,fe,X){var D=t.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?D+X:D):X=D,K){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=X+$,K={id:p++,callback:fe,priorityLevel:K,startTime:X,expirationTime:$,sortIndex:-1},X>D?(K.sortIndex=X,e(f,K),n(c)===null&&K===n(f)&&(v?(S(Q),Q=-1):v=!0,Xe(I,X-D))):(K.sortIndex=$,e(c,K),b||x||(b=!0,Ge(P))),K},t.unstable_shouldYield=rt,t.unstable_wrapCallback=function(K){var fe=y;return function(){var X=y;y=fe;try{return K.apply(this,arguments)}finally{y=X}}}})(Af)),Af}var gg;function Jw(){return gg||(gg=1,Tf.exports=Zw()),Tf.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 yg;function Gw(){if(yg)return qt;yg=1;var t=xu(),e=Jw();function n(o){for(var l="https://reactjs.org/docs/error-decoder.html?invariant="+o,d=1;d<arguments.length;d++)l+="&args[]="+encodeURIComponent(arguments[d]);return"Minified React error #"+o+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,i={};function s(o,l){u(o,l),u(o+"Capture",l)}function u(o,l){for(i[o]=l,o=0;o<l.length;o++)r.add(l[o])}var a=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),c=Object.prototype.hasOwnProperty,f=/^[: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]*$/,p={},m={};function y(o){return c.call(m,o)?!0:c.call(p,o)?!1:f.test(o)?m[o]=!0:(p[o]=!0,!1)}function x(o,l,d,h){if(d!==null&&d.type===0)return!1;switch(typeof l){case"function":case"symbol":return!0;case"boolean":return h?!1:d!==null?!d.acceptsBooleans:(o=o.toLowerCase().slice(0,5),o!=="data-"&&o!=="aria-");default:return!1}}function b(o,l,d,h){if(l===null||typeof l>"u"||x(o,l,d,h))return!0;if(h)return!1;if(d!==null)switch(d.type){case 3:return!l;case 4:return l===!1;case 5:return isNaN(l);case 6:return isNaN(l)||1>l}return!1}function v(o,l,d,h,g,k,C){this.acceptsBooleans=l===2||l===3||l===4,this.attributeName=h,this.attributeNamespace=g,this.mustUseProperty=d,this.propertyName=o,this.type=l,this.sanitizeURL=k,this.removeEmptyString=C}var w={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(o){w[o]=new v(o,0,!1,o,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(o){var l=o[0];w[l]=new v(l,1,!1,o[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(o){w[o]=new v(o,2,!1,o.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(o){w[o]=new v(o,2,!1,o,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(o){w[o]=new v(o,3,!1,o.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(o){w[o]=new v(o,3,!0,o,null,!1,!1)}),["capture","download"].forEach(function(o){w[o]=new v(o,4,!1,o,null,!1,!1)}),["cols","rows","size","span"].forEach(function(o){w[o]=new v(o,6,!1,o,null,!1,!1)}),["rowSpan","start"].forEach(function(o){w[o]=new v(o,5,!1,o.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function A(o){return o[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(o){var l=o.replace(S,A);w[l]=new v(l,1,!1,o,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(o){var l=o.replace(S,A);w[l]=new v(l,1,!1,o,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(o){var l=o.replace(S,A);w[l]=new v(l,1,!1,o,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(o){w[o]=new v(o,1,!1,o.toLowerCase(),null,!1,!1)}),w.xlinkHref=new v("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(o){w[o]=new v(o,1,!1,o.toLowerCase(),null,!0,!0)});function R(o,l,d,h){var g=w.hasOwnProperty(l)?w[l]:null;(g!==null?g.type!==0:h||!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(b(l,d,g,h)&&(d=null),h||g===null?y(l)&&(d===null?o.removeAttribute(l):o.setAttribute(l,""+d)):g.mustUseProperty?o[g.propertyName]=d===null?g.type===3?!1:"":d:(l=g.attributeName,h=g.attributeNamespace,d===null?o.removeAttribute(l):(g=g.type,d=g===3||g===4&&d===!0?"":""+d,h?o.setAttributeNS(h,l,d):o.setAttribute(l,d))))}var I=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,P=Symbol.for("react.element"),F=Symbol.for("react.portal"),z=Symbol.for("react.fragment"),Q=Symbol.for("react.strict_mode"),ue=Symbol.for("react.profiler"),Ce=Symbol.for("react.provider"),rt=Symbol.for("react.context"),Je=Symbol.for("react.forward_ref"),Te=Symbol.for("react.suspense"),Se=Symbol.for("react.suspense_list"),ye=Symbol.for("react.memo"),Ge=Symbol.for("react.lazy"),Xe=Symbol.for("react.offscreen"),K=Symbol.iterator;function fe(o){return o===null||typeof o!="object"?null:(o=K&&o[K]||o["@@iterator"],typeof o=="function"?o:null)}var X=Object.assign,D;function $(o){if(D===void 0)try{throw Error()}catch(d){var l=d.stack.trim().match(/\n( *(at )?)/);D=l&&l[1]||""}return`
34
- `+D+o}var xe=!1;function we(o,l){if(!o||xe)return"";xe=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(l)if(l=function(){throw Error()},Object.defineProperty(l.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(l,[])}catch(L){var h=L}Reflect.construct(o,[],l)}else{try{l.call()}catch(L){h=L}o.call(l.prototype)}else{try{throw Error()}catch(L){h=L}o()}}catch(L){if(L&&h&&typeof L.stack=="string"){for(var g=L.stack.split(`
35
- `),k=h.stack.split(`
36
- `),C=g.length-1,E=k.length-1;1<=C&&0<=E&&g[C]!==k[E];)E--;for(;1<=C&&0<=E;C--,E--)if(g[C]!==k[E]){if(C!==1||E!==1)do if(C--,E--,0>E||g[C]!==k[E]){var T=`
37
- `+g[C].replace(" at new "," at ");return o.displayName&&T.includes("<anonymous>")&&(T=T.replace("<anonymous>",o.displayName)),T}while(1<=C&&0<=E);break}}}finally{xe=!1,Error.prepareStackTrace=d}return(o=o?o.displayName||o.name:"")?$(o):""}function Ae(o){switch(o.tag){case 5:return $(o.type);case 16:return $("Lazy");case 13:return $("Suspense");case 19:return $("SuspenseList");case 0:case 2:case 15:return o=we(o.type,!1),o;case 11:return o=we(o.type.render,!1),o;case 1:return o=we(o.type,!0),o;default:return""}}function Me(o){if(o==null)return null;if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case z:return"Fragment";case F:return"Portal";case ue:return"Profiler";case Q:return"StrictMode";case Te:return"Suspense";case Se:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case rt:return(o.displayName||"Context")+".Consumer";case Ce:return(o._context.displayName||"Context")+".Provider";case Je:var l=o.render;return o=o.displayName,o||(o=l.displayName||l.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case ye:return l=o.displayName||null,l!==null?l:Me(o.type)||"Memo";case Ge:l=o._payload,o=o._init;try{return Me(o(l))}catch{}}return null}function ze(o){var l=o.type;switch(o.tag){case 24:return"Cache";case 9:return(l.displayName||"Context")+".Consumer";case 10:return(l._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return o=l.render,o=o.displayName||o.name||"",l.displayName||(o!==""?"ForwardRef("+o+")":"ForwardRef");case 7:return"Fragment";case 5:return l;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Me(l);case 8:return l===Q?"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 l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l}return null}function Ie(o){switch(typeof o){case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function Ke(o){var l=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function Gt(o){var l=Ke(o)?"checked":"value",d=Object.getOwnPropertyDescriptor(o.constructor.prototype,l),h=""+o[l];if(!o.hasOwnProperty(l)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var g=d.get,k=d.set;return Object.defineProperty(o,l,{configurable:!0,get:function(){return g.call(this)},set:function(C){h=""+C,k.call(this,C)}}),Object.defineProperty(o,l,{enumerable:d.enumerable}),{getValue:function(){return h},setValue:function(C){h=""+C},stopTracking:function(){o._valueTracker=null,delete o[l]}}}}function Du(o){o._valueTracker||(o._valueTracker=Gt(o))}function y0(o){if(!o)return!1;var l=o._valueTracker;if(!l)return!0;var d=l.getValue(),h="";return o&&(h=Ke(o)?o.checked?"true":"false":o.value),o=h,o!==d?(l.setValue(o),!0):!1}function Nu(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}function Dc(o,l){var d=l.checked;return X({},l,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:d??o._wrapperState.initialChecked})}function x0(o,l){var d=l.defaultValue==null?"":l.defaultValue,h=l.checked!=null?l.checked:l.defaultChecked;d=Ie(l.value!=null?l.value:d),o._wrapperState={initialChecked:h,initialValue:d,controlled:l.type==="checkbox"||l.type==="radio"?l.checked!=null:l.value!=null}}function k0(o,l){l=l.checked,l!=null&&R(o,"checked",l,!1)}function Nc(o,l){k0(o,l);var d=Ie(l.value),h=l.type;if(d!=null)h==="number"?(d===0&&o.value===""||o.value!=d)&&(o.value=""+d):o.value!==""+d&&(o.value=""+d);else if(h==="submit"||h==="reset"){o.removeAttribute("value");return}l.hasOwnProperty("value")?Oc(o,l.type,d):l.hasOwnProperty("defaultValue")&&Oc(o,l.type,Ie(l.defaultValue)),l.checked==null&&l.defaultChecked!=null&&(o.defaultChecked=!!l.defaultChecked)}function b0(o,l,d){if(l.hasOwnProperty("value")||l.hasOwnProperty("defaultValue")){var h=l.type;if(!(h!=="submit"&&h!=="reset"||l.value!==void 0&&l.value!==null))return;l=""+o._wrapperState.initialValue,d||l===o.value||(o.value=l),o.defaultValue=l}d=o.name,d!==""&&(o.name=""),o.defaultChecked=!!o._wrapperState.initialChecked,d!==""&&(o.name=d)}function Oc(o,l,d){(l!=="number"||Nu(o.ownerDocument)!==o)&&(d==null?o.defaultValue=""+o._wrapperState.initialValue:o.defaultValue!==""+d&&(o.defaultValue=""+d))}var Bs=Array.isArray;function Ui(o,l,d,h){if(o=o.options,l){l={};for(var g=0;g<d.length;g++)l["$"+d[g]]=!0;for(d=0;d<o.length;d++)g=l.hasOwnProperty("$"+o[d].value),o[d].selected!==g&&(o[d].selected=g),g&&h&&(o[d].defaultSelected=!0)}else{for(d=""+Ie(d),l=null,g=0;g<o.length;g++){if(o[g].value===d){o[g].selected=!0,h&&(o[g].defaultSelected=!0);return}l!==null||o[g].disabled||(l=o[g])}l!==null&&(l.selected=!0)}}function Rc(o,l){if(l.dangerouslySetInnerHTML!=null)throw Error(n(91));return X({},l,{value:void 0,defaultValue:void 0,children:""+o._wrapperState.initialValue})}function v0(o,l){var d=l.value;if(d==null){if(d=l.children,l=l.defaultValue,d!=null){if(l!=null)throw Error(n(92));if(Bs(d)){if(1<d.length)throw Error(n(93));d=d[0]}l=d}l==null&&(l=""),d=l}o._wrapperState={initialValue:Ie(d)}}function w0(o,l){var d=Ie(l.value),h=Ie(l.defaultValue);d!=null&&(d=""+d,d!==o.value&&(o.value=d),l.defaultValue==null&&o.defaultValue!==d&&(o.defaultValue=d)),h!=null&&(o.defaultValue=""+h)}function C0(o){var l=o.textContent;l===o._wrapperState.initialValue&&l!==""&&l!==null&&(o.value=l)}function S0(o){switch(o){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 Ic(o,l){return o==null||o==="http://www.w3.org/1999/xhtml"?S0(l):o==="http://www.w3.org/2000/svg"&&l==="foreignObject"?"http://www.w3.org/1999/xhtml":o}var Ou,E0=(function(o){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(l,d,h,g){MSApp.execUnsafeLocalFunction(function(){return o(l,d,h,g)})}:o})(function(o,l){if(o.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in o)o.innerHTML=l;else{for(Ou=Ou||document.createElement("div"),Ou.innerHTML="<svg>"+l.valueOf().toString()+"</svg>",l=Ou.firstChild;o.firstChild;)o.removeChild(o.firstChild);for(;l.firstChild;)o.appendChild(l.firstChild)}});function $s(o,l){if(l){var d=o.firstChild;if(d&&d===o.lastChild&&d.nodeType===3){d.nodeValue=l;return}}o.textContent=l}var Vs={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},Jv=["Webkit","ms","Moz","O"];Object.keys(Vs).forEach(function(o){Jv.forEach(function(l){l=l+o.charAt(0).toUpperCase()+o.substring(1),Vs[l]=Vs[o]})});function _0(o,l,d){return l==null||typeof l=="boolean"||l===""?"":d||typeof l!="number"||l===0||Vs.hasOwnProperty(o)&&Vs[o]?(""+l).trim():l+"px"}function T0(o,l){o=o.style;for(var d in l)if(l.hasOwnProperty(d)){var h=d.indexOf("--")===0,g=_0(d,l[d],h);d==="float"&&(d="cssFloat"),h?o.setProperty(d,g):o[d]=g}}var Gv=X({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 Lc(o,l){if(l){if(Gv[o]&&(l.children!=null||l.dangerouslySetInnerHTML!=null))throw Error(n(137,o));if(l.dangerouslySetInnerHTML!=null){if(l.children!=null)throw Error(n(60));if(typeof l.dangerouslySetInnerHTML!="object"||!("__html"in l.dangerouslySetInnerHTML))throw Error(n(61))}if(l.style!=null&&typeof l.style!="object")throw Error(n(62))}}function Pc(o,l){if(o.indexOf("-")===-1)return typeof l.is=="string";switch(o){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 Fc=null;function zc(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var jc=null,qi=null,Wi=null;function A0(o){if(o=co(o)){if(typeof jc!="function")throw Error(n(280));var l=o.stateNode;l&&(l=tl(l),jc(o.stateNode,o.type,l))}}function M0(o){qi?Wi?Wi.push(o):Wi=[o]:qi=o}function D0(){if(qi){var o=qi,l=Wi;if(Wi=qi=null,A0(o),l)for(o=0;o<l.length;o++)A0(l[o])}}function N0(o,l){return o(l)}function O0(){}var Bc=!1;function R0(o,l,d){if(Bc)return o(l,d);Bc=!0;try{return N0(o,l,d)}finally{Bc=!1,(qi!==null||Wi!==null)&&(O0(),D0())}}function Hs(o,l){var d=o.stateNode;if(d===null)return null;var h=tl(d);if(h===null)return null;d=h[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(o=o.type,h=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!h;break e;default:o=!1}if(o)return null;if(d&&typeof d!="function")throw Error(n(231,l,typeof d));return d}var $c=!1;if(a)try{var Us={};Object.defineProperty(Us,"passive",{get:function(){$c=!0}}),window.addEventListener("test",Us,Us),window.removeEventListener("test",Us,Us)}catch{$c=!1}function Qv(o,l,d,h,g,k,C,E,T){var L=Array.prototype.slice.call(arguments,3);try{l.apply(d,L)}catch(V){this.onError(V)}}var qs=!1,Ru=null,Iu=!1,Vc=null,Yv={onError:function(o){qs=!0,Ru=o}};function Xv(o,l,d,h,g,k,C,E,T){qs=!1,Ru=null,Qv.apply(Yv,arguments)}function e3(o,l,d,h,g,k,C,E,T){if(Xv.apply(this,arguments),qs){if(qs){var L=Ru;qs=!1,Ru=null}else throw Error(n(198));Iu||(Iu=!0,Vc=L)}}function ci(o){var l=o,d=o;if(o.alternate)for(;l.return;)l=l.return;else{o=l;do l=o,(l.flags&4098)!==0&&(d=l.return),o=l.return;while(o)}return l.tag===3?d:null}function I0(o){if(o.tag===13){var l=o.memoizedState;if(l===null&&(o=o.alternate,o!==null&&(l=o.memoizedState)),l!==null)return l.dehydrated}return null}function L0(o){if(ci(o)!==o)throw Error(n(188))}function t3(o){var l=o.alternate;if(!l){if(l=ci(o),l===null)throw Error(n(188));return l!==o?null:o}for(var d=o,h=l;;){var g=d.return;if(g===null)break;var k=g.alternate;if(k===null){if(h=g.return,h!==null){d=h;continue}break}if(g.child===k.child){for(k=g.child;k;){if(k===d)return L0(g),o;if(k===h)return L0(g),l;k=k.sibling}throw Error(n(188))}if(d.return!==h.return)d=g,h=k;else{for(var C=!1,E=g.child;E;){if(E===d){C=!0,d=g,h=k;break}if(E===h){C=!0,h=g,d=k;break}E=E.sibling}if(!C){for(E=k.child;E;){if(E===d){C=!0,d=k,h=g;break}if(E===h){C=!0,h=k,d=g;break}E=E.sibling}if(!C)throw Error(n(189))}}if(d.alternate!==h)throw Error(n(190))}if(d.tag!==3)throw Error(n(188));return d.stateNode.current===d?o:l}function P0(o){return o=t3(o),o!==null?F0(o):null}function F0(o){if(o.tag===5||o.tag===6)return o;for(o=o.child;o!==null;){var l=F0(o);if(l!==null)return l;o=o.sibling}return null}var z0=e.unstable_scheduleCallback,j0=e.unstable_cancelCallback,n3=e.unstable_shouldYield,r3=e.unstable_requestPaint,it=e.unstable_now,i3=e.unstable_getCurrentPriorityLevel,Hc=e.unstable_ImmediatePriority,B0=e.unstable_UserBlockingPriority,Lu=e.unstable_NormalPriority,s3=e.unstable_LowPriority,$0=e.unstable_IdlePriority,Pu=null,Nn=null;function o3(o){if(Nn&&typeof Nn.onCommitFiberRoot=="function")try{Nn.onCommitFiberRoot(Pu,o,void 0,(o.current.flags&128)===128)}catch{}}var bn=Math.clz32?Math.clz32:a3,u3=Math.log,l3=Math.LN2;function a3(o){return o>>>=0,o===0?32:31-(u3(o)/l3|0)|0}var Fu=64,zu=4194304;function Ws(o){switch(o&-o){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 o&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return o&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return o}}function ju(o,l){var d=o.pendingLanes;if(d===0)return 0;var h=0,g=o.suspendedLanes,k=o.pingedLanes,C=d&268435455;if(C!==0){var E=C&~g;E!==0?h=Ws(E):(k&=C,k!==0&&(h=Ws(k)))}else C=d&~g,C!==0?h=Ws(C):k!==0&&(h=Ws(k));if(h===0)return 0;if(l!==0&&l!==h&&(l&g)===0&&(g=h&-h,k=l&-l,g>=k||g===16&&(k&4194240)!==0))return l;if((h&4)!==0&&(h|=d&16),l=o.entangledLanes,l!==0)for(o=o.entanglements,l&=h;0<l;)d=31-bn(l),g=1<<d,h|=o[d],l&=~g;return h}function c3(o,l){switch(o){case 1:case 2:case 4:return l+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 l+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 d3(o,l){for(var d=o.suspendedLanes,h=o.pingedLanes,g=o.expirationTimes,k=o.pendingLanes;0<k;){var C=31-bn(k),E=1<<C,T=g[C];T===-1?((E&d)===0||(E&h)!==0)&&(g[C]=c3(E,l)):T<=l&&(o.expiredLanes|=E),k&=~E}}function Uc(o){return o=o.pendingLanes&-1073741825,o!==0?o:o&1073741824?1073741824:0}function V0(){var o=Fu;return Fu<<=1,(Fu&4194240)===0&&(Fu=64),o}function qc(o){for(var l=[],d=0;31>d;d++)l.push(o);return l}function Ks(o,l,d){o.pendingLanes|=l,l!==536870912&&(o.suspendedLanes=0,o.pingedLanes=0),o=o.eventTimes,l=31-bn(l),o[l]=d}function f3(o,l){var d=o.pendingLanes&~l;o.pendingLanes=l,o.suspendedLanes=0,o.pingedLanes=0,o.expiredLanes&=l,o.mutableReadLanes&=l,o.entangledLanes&=l,l=o.entanglements;var h=o.eventTimes;for(o=o.expirationTimes;0<d;){var g=31-bn(d),k=1<<g;l[g]=0,h[g]=-1,o[g]=-1,d&=~k}}function Wc(o,l){var d=o.entangledLanes|=l;for(o=o.entanglements;d;){var h=31-bn(d),g=1<<h;g&l|o[h]&l&&(o[h]|=l),d&=~g}}var Le=0;function H0(o){return o&=-o,1<o?4<o?(o&268435455)!==0?16:536870912:4:1}var U0,Kc,q0,W0,K0,Zc=!1,Bu=[],gr=null,yr=null,xr=null,Zs=new Map,Js=new Map,kr=[],h3="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 Z0(o,l){switch(o){case"focusin":case"focusout":gr=null;break;case"dragenter":case"dragleave":yr=null;break;case"mouseover":case"mouseout":xr=null;break;case"pointerover":case"pointerout":Zs.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Js.delete(l.pointerId)}}function Gs(o,l,d,h,g,k){return o===null||o.nativeEvent!==k?(o={blockedOn:l,domEventName:d,eventSystemFlags:h,nativeEvent:k,targetContainers:[g]},l!==null&&(l=co(l),l!==null&&Kc(l)),o):(o.eventSystemFlags|=h,l=o.targetContainers,g!==null&&l.indexOf(g)===-1&&l.push(g),o)}function p3(o,l,d,h,g){switch(l){case"focusin":return gr=Gs(gr,o,l,d,h,g),!0;case"dragenter":return yr=Gs(yr,o,l,d,h,g),!0;case"mouseover":return xr=Gs(xr,o,l,d,h,g),!0;case"pointerover":var k=g.pointerId;return Zs.set(k,Gs(Zs.get(k)||null,o,l,d,h,g)),!0;case"gotpointercapture":return k=g.pointerId,Js.set(k,Gs(Js.get(k)||null,o,l,d,h,g)),!0}return!1}function J0(o){var l=di(o.target);if(l!==null){var d=ci(l);if(d!==null){if(l=d.tag,l===13){if(l=I0(d),l!==null){o.blockedOn=l,K0(o.priority,function(){q0(d)});return}}else if(l===3&&d.stateNode.current.memoizedState.isDehydrated){o.blockedOn=d.tag===3?d.stateNode.containerInfo:null;return}}}o.blockedOn=null}function $u(o){if(o.blockedOn!==null)return!1;for(var l=o.targetContainers;0<l.length;){var d=Gc(o.domEventName,o.eventSystemFlags,l[0],o.nativeEvent);if(d===null){d=o.nativeEvent;var h=new d.constructor(d.type,d);Fc=h,d.target.dispatchEvent(h),Fc=null}else return l=co(d),l!==null&&Kc(l),o.blockedOn=d,!1;l.shift()}return!0}function G0(o,l,d){$u(o)&&d.delete(l)}function m3(){Zc=!1,gr!==null&&$u(gr)&&(gr=null),yr!==null&&$u(yr)&&(yr=null),xr!==null&&$u(xr)&&(xr=null),Zs.forEach(G0),Js.forEach(G0)}function Qs(o,l){o.blockedOn===l&&(o.blockedOn=null,Zc||(Zc=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,m3)))}function Ys(o){function l(g){return Qs(g,o)}if(0<Bu.length){Qs(Bu[0],o);for(var d=1;d<Bu.length;d++){var h=Bu[d];h.blockedOn===o&&(h.blockedOn=null)}}for(gr!==null&&Qs(gr,o),yr!==null&&Qs(yr,o),xr!==null&&Qs(xr,o),Zs.forEach(l),Js.forEach(l),d=0;d<kr.length;d++)h=kr[d],h.blockedOn===o&&(h.blockedOn=null);for(;0<kr.length&&(d=kr[0],d.blockedOn===null);)J0(d),d.blockedOn===null&&kr.shift()}var Ki=I.ReactCurrentBatchConfig,Vu=!0;function g3(o,l,d,h){var g=Le,k=Ki.transition;Ki.transition=null;try{Le=1,Jc(o,l,d,h)}finally{Le=g,Ki.transition=k}}function y3(o,l,d,h){var g=Le,k=Ki.transition;Ki.transition=null;try{Le=4,Jc(o,l,d,h)}finally{Le=g,Ki.transition=k}}function Jc(o,l,d,h){if(Vu){var g=Gc(o,l,d,h);if(g===null)hd(o,l,h,Hu,d),Z0(o,h);else if(p3(g,o,l,d,h))h.stopPropagation();else if(Z0(o,h),l&4&&-1<h3.indexOf(o)){for(;g!==null;){var k=co(g);if(k!==null&&U0(k),k=Gc(o,l,d,h),k===null&&hd(o,l,h,Hu,d),k===g)break;g=k}g!==null&&h.stopPropagation()}else hd(o,l,h,null,d)}}var Hu=null;function Gc(o,l,d,h){if(Hu=null,o=zc(h),o=di(o),o!==null)if(l=ci(o),l===null)o=null;else if(d=l.tag,d===13){if(o=I0(l),o!==null)return o;o=null}else if(d===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;o=null}else l!==o&&(o=null);return Hu=o,null}function Q0(o){switch(o){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(i3()){case Hc:return 1;case B0:return 4;case Lu:case s3:return 16;case $0:return 536870912;default:return 16}default:return 16}}var br=null,Qc=null,Uu=null;function Y0(){if(Uu)return Uu;var o,l=Qc,d=l.length,h,g="value"in br?br.value:br.textContent,k=g.length;for(o=0;o<d&&l[o]===g[o];o++);var C=d-o;for(h=1;h<=C&&l[d-h]===g[k-h];h++);return Uu=g.slice(o,1<h?1-h:void 0)}function qu(o){var l=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&l===13&&(o=13)):o=l,o===10&&(o=13),32<=o||o===13?o:0}function Wu(){return!0}function X0(){return!1}function Qt(o){function l(d,h,g,k,C){this._reactName=d,this._targetInst=g,this.type=h,this.nativeEvent=k,this.target=C,this.currentTarget=null;for(var E in o)o.hasOwnProperty(E)&&(d=o[E],this[E]=d?d(k):k[E]);return this.isDefaultPrevented=(k.defaultPrevented!=null?k.defaultPrevented:k.returnValue===!1)?Wu:X0,this.isPropagationStopped=X0,this}return X(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var d=this.nativeEvent;d&&(d.preventDefault?d.preventDefault():typeof d.returnValue!="unknown"&&(d.returnValue=!1),this.isDefaultPrevented=Wu)},stopPropagation:function(){var d=this.nativeEvent;d&&(d.stopPropagation?d.stopPropagation():typeof d.cancelBubble!="unknown"&&(d.cancelBubble=!0),this.isPropagationStopped=Wu)},persist:function(){},isPersistent:Wu}),l}var Zi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Yc=Qt(Zi),Xs=X({},Zi,{view:0,detail:0}),x3=Qt(Xs),Xc,ed,eo,Ku=X({},Xs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:nd,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==eo&&(eo&&o.type==="mousemove"?(Xc=o.screenX-eo.screenX,ed=o.screenY-eo.screenY):ed=Xc=0,eo=o),Xc)},movementY:function(o){return"movementY"in o?o.movementY:ed}}),em=Qt(Ku),k3=X({},Ku,{dataTransfer:0}),b3=Qt(k3),v3=X({},Xs,{relatedTarget:0}),td=Qt(v3),w3=X({},Zi,{animationName:0,elapsedTime:0,pseudoElement:0}),C3=Qt(w3),S3=X({},Zi,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),E3=Qt(S3),_3=X({},Zi,{data:0}),tm=Qt(_3),T3={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},A3={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"},M3={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function D3(o){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(o):(o=M3[o])?!!l[o]:!1}function nd(){return D3}var N3=X({},Xs,{key:function(o){if(o.key){var l=T3[o.key]||o.key;if(l!=="Unidentified")return l}return o.type==="keypress"?(o=qu(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?A3[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:nd,charCode:function(o){return o.type==="keypress"?qu(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?qu(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),O3=Qt(N3),R3=X({},Ku,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),nm=Qt(R3),I3=X({},Xs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:nd}),L3=Qt(I3),P3=X({},Zi,{propertyName:0,elapsedTime:0,pseudoElement:0}),F3=Qt(P3),z3=X({},Ku,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),j3=Qt(z3),B3=[9,13,27,32],rd=a&&"CompositionEvent"in window,to=null;a&&"documentMode"in document&&(to=document.documentMode);var $3=a&&"TextEvent"in window&&!to,rm=a&&(!rd||to&&8<to&&11>=to),im=" ",sm=!1;function om(o,l){switch(o){case"keyup":return B3.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function um(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var Ji=!1;function V3(o,l){switch(o){case"compositionend":return um(l);case"keypress":return l.which!==32?null:(sm=!0,im);case"textInput":return o=l.data,o===im&&sm?null:o;default:return null}}function H3(o,l){if(Ji)return o==="compositionend"||!rd&&om(o,l)?(o=Y0(),Uu=Qc=br=null,Ji=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return rm&&l.locale!=="ko"?null:l.data;default:return null}}var U3={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 lm(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l==="input"?!!U3[o.type]:l==="textarea"}function am(o,l,d,h){M0(h),l=Yu(l,"onChange"),0<l.length&&(d=new Yc("onChange","change",null,d,h),o.push({event:d,listeners:l}))}var no=null,ro=null;function q3(o){Tm(o,0)}function Zu(o){var l=es(o);if(y0(l))return o}function W3(o,l){if(o==="change")return l}var cm=!1;if(a){var id;if(a){var sd="oninput"in document;if(!sd){var dm=document.createElement("div");dm.setAttribute("oninput","return;"),sd=typeof dm.oninput=="function"}id=sd}else id=!1;cm=id&&(!document.documentMode||9<document.documentMode)}function fm(){no&&(no.detachEvent("onpropertychange",hm),ro=no=null)}function hm(o){if(o.propertyName==="value"&&Zu(ro)){var l=[];am(l,ro,o,zc(o)),R0(q3,l)}}function K3(o,l,d){o==="focusin"?(fm(),no=l,ro=d,no.attachEvent("onpropertychange",hm)):o==="focusout"&&fm()}function Z3(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return Zu(ro)}function J3(o,l){if(o==="click")return Zu(l)}function G3(o,l){if(o==="input"||o==="change")return Zu(l)}function Q3(o,l){return o===l&&(o!==0||1/o===1/l)||o!==o&&l!==l}var vn=typeof Object.is=="function"?Object.is:Q3;function io(o,l){if(vn(o,l))return!0;if(typeof o!="object"||o===null||typeof l!="object"||l===null)return!1;var d=Object.keys(o),h=Object.keys(l);if(d.length!==h.length)return!1;for(h=0;h<d.length;h++){var g=d[h];if(!c.call(l,g)||!vn(o[g],l[g]))return!1}return!0}function pm(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function mm(o,l){var d=pm(o);o=0;for(var h;d;){if(d.nodeType===3){if(h=o+d.textContent.length,o<=l&&h>=l)return{node:d,offset:l-o};o=h}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=pm(d)}}function gm(o,l){return o&&l?o===l?!0:o&&o.nodeType===3?!1:l&&l.nodeType===3?gm(o,l.parentNode):"contains"in o?o.contains(l):o.compareDocumentPosition?!!(o.compareDocumentPosition(l)&16):!1:!1}function ym(){for(var o=window,l=Nu();l instanceof o.HTMLIFrameElement;){try{var d=typeof l.contentWindow.location.href=="string"}catch{d=!1}if(d)o=l.contentWindow;else break;l=Nu(o.document)}return l}function od(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l&&(l==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||l==="textarea"||o.contentEditable==="true")}function Y3(o){var l=ym(),d=o.focusedElem,h=o.selectionRange;if(l!==d&&d&&d.ownerDocument&&gm(d.ownerDocument.documentElement,d)){if(h!==null&&od(d)){if(l=h.start,o=h.end,o===void 0&&(o=l),"selectionStart"in d)d.selectionStart=l,d.selectionEnd=Math.min(o,d.value.length);else if(o=(l=d.ownerDocument||document)&&l.defaultView||window,o.getSelection){o=o.getSelection();var g=d.textContent.length,k=Math.min(h.start,g);h=h.end===void 0?k:Math.min(h.end,g),!o.extend&&k>h&&(g=h,h=k,k=g),g=mm(d,k);var C=mm(d,h);g&&C&&(o.rangeCount!==1||o.anchorNode!==g.node||o.anchorOffset!==g.offset||o.focusNode!==C.node||o.focusOffset!==C.offset)&&(l=l.createRange(),l.setStart(g.node,g.offset),o.removeAllRanges(),k>h?(o.addRange(l),o.extend(C.node,C.offset)):(l.setEnd(C.node,C.offset),o.addRange(l)))}}for(l=[],o=d;o=o.parentNode;)o.nodeType===1&&l.push({element:o,left:o.scrollLeft,top:o.scrollTop});for(typeof d.focus=="function"&&d.focus(),d=0;d<l.length;d++)o=l[d],o.element.scrollLeft=o.left,o.element.scrollTop=o.top}}var X3=a&&"documentMode"in document&&11>=document.documentMode,Gi=null,ud=null,so=null,ld=!1;function xm(o,l,d){var h=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;ld||Gi==null||Gi!==Nu(h)||(h=Gi,"selectionStart"in h&&od(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),so&&io(so,h)||(so=h,h=Yu(ud,"onSelect"),0<h.length&&(l=new Yc("onSelect","select",null,l,d),o.push({event:l,listeners:h}),l.target=Gi)))}function Ju(o,l){var d={};return d[o.toLowerCase()]=l.toLowerCase(),d["Webkit"+o]="webkit"+l,d["Moz"+o]="moz"+l,d}var Qi={animationend:Ju("Animation","AnimationEnd"),animationiteration:Ju("Animation","AnimationIteration"),animationstart:Ju("Animation","AnimationStart"),transitionend:Ju("Transition","TransitionEnd")},ad={},km={};a&&(km=document.createElement("div").style,"AnimationEvent"in window||(delete Qi.animationend.animation,delete Qi.animationiteration.animation,delete Qi.animationstart.animation),"TransitionEvent"in window||delete Qi.transitionend.transition);function Gu(o){if(ad[o])return ad[o];if(!Qi[o])return o;var l=Qi[o],d;for(d in l)if(l.hasOwnProperty(d)&&d in km)return ad[o]=l[d];return o}var bm=Gu("animationend"),vm=Gu("animationiteration"),wm=Gu("animationstart"),Cm=Gu("transitionend"),Sm=new Map,Em="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 vr(o,l){Sm.set(o,l),s(l,[o])}for(var cd=0;cd<Em.length;cd++){var dd=Em[cd],ew=dd.toLowerCase(),tw=dd[0].toUpperCase()+dd.slice(1);vr(ew,"on"+tw)}vr(bm,"onAnimationEnd"),vr(vm,"onAnimationIteration"),vr(wm,"onAnimationStart"),vr("dblclick","onDoubleClick"),vr("focusin","onFocus"),vr("focusout","onBlur"),vr(Cm,"onTransitionEnd"),u("onMouseEnter",["mouseout","mouseover"]),u("onMouseLeave",["mouseout","mouseover"]),u("onPointerEnter",["pointerout","pointerover"]),u("onPointerLeave",["pointerout","pointerover"]),s("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),s("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),s("onBeforeInput",["compositionend","keypress","textInput","paste"]),s("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var oo="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(" "),nw=new Set("cancel close invalid load scroll toggle".split(" ").concat(oo));function _m(o,l,d){var h=o.type||"unknown-event";o.currentTarget=d,e3(h,l,void 0,o),o.currentTarget=null}function Tm(o,l){l=(l&4)!==0;for(var d=0;d<o.length;d++){var h=o[d],g=h.event;h=h.listeners;e:{var k=void 0;if(l)for(var C=h.length-1;0<=C;C--){var E=h[C],T=E.instance,L=E.currentTarget;if(E=E.listener,T!==k&&g.isPropagationStopped())break e;_m(g,E,L),k=T}else for(C=0;C<h.length;C++){if(E=h[C],T=E.instance,L=E.currentTarget,E=E.listener,T!==k&&g.isPropagationStopped())break e;_m(g,E,L),k=T}}}if(Iu)throw o=Vc,Iu=!1,Vc=null,o}function Ve(o,l){var d=l[kd];d===void 0&&(d=l[kd]=new Set);var h=o+"__bubble";d.has(h)||(Am(l,o,2,!1),d.add(h))}function fd(o,l,d){var h=0;l&&(h|=4),Am(d,o,h,l)}var Qu="_reactListening"+Math.random().toString(36).slice(2);function uo(o){if(!o[Qu]){o[Qu]=!0,r.forEach(function(d){d!=="selectionchange"&&(nw.has(d)||fd(d,!1,o),fd(d,!0,o))});var l=o.nodeType===9?o:o.ownerDocument;l===null||l[Qu]||(l[Qu]=!0,fd("selectionchange",!1,l))}}function Am(o,l,d,h){switch(Q0(l)){case 1:var g=g3;break;case 4:g=y3;break;default:g=Jc}d=g.bind(null,l,d,o),g=void 0,!$c||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(g=!0),h?g!==void 0?o.addEventListener(l,d,{capture:!0,passive:g}):o.addEventListener(l,d,!0):g!==void 0?o.addEventListener(l,d,{passive:g}):o.addEventListener(l,d,!1)}function hd(o,l,d,h,g){var k=h;if((l&1)===0&&(l&2)===0&&h!==null)e:for(;;){if(h===null)return;var C=h.tag;if(C===3||C===4){var E=h.stateNode.containerInfo;if(E===g||E.nodeType===8&&E.parentNode===g)break;if(C===4)for(C=h.return;C!==null;){var T=C.tag;if((T===3||T===4)&&(T=C.stateNode.containerInfo,T===g||T.nodeType===8&&T.parentNode===g))return;C=C.return}for(;E!==null;){if(C=di(E),C===null)return;if(T=C.tag,T===5||T===6){h=k=C;continue e}E=E.parentNode}}h=h.return}R0(function(){var L=k,V=zc(d),H=[];e:{var B=Sm.get(o);if(B!==void 0){var Z=Yc,ee=o;switch(o){case"keypress":if(qu(d)===0)break e;case"keydown":case"keyup":Z=O3;break;case"focusin":ee="focus",Z=td;break;case"focusout":ee="blur",Z=td;break;case"beforeblur":case"afterblur":Z=td;break;case"click":if(d.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Z=em;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Z=b3;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Z=L3;break;case bm:case vm:case wm:Z=C3;break;case Cm:Z=F3;break;case"scroll":Z=x3;break;case"wheel":Z=j3;break;case"copy":case"cut":case"paste":Z=E3;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Z=nm}var te=(l&4)!==0,st=!te&&o==="scroll",N=te?B!==null?B+"Capture":null:B;te=[];for(var M=L,O;M!==null;){O=M;var W=O.stateNode;if(O.tag===5&&W!==null&&(O=W,N!==null&&(W=Hs(M,N),W!=null&&te.push(lo(M,W,O)))),st)break;M=M.return}0<te.length&&(B=new Z(B,ee,null,d,V),H.push({event:B,listeners:te}))}}if((l&7)===0){e:{if(B=o==="mouseover"||o==="pointerover",Z=o==="mouseout"||o==="pointerout",B&&d!==Fc&&(ee=d.relatedTarget||d.fromElement)&&(di(ee)||ee[Zn]))break e;if((Z||B)&&(B=V.window===V?V:(B=V.ownerDocument)?B.defaultView||B.parentWindow:window,Z?(ee=d.relatedTarget||d.toElement,Z=L,ee=ee?di(ee):null,ee!==null&&(st=ci(ee),ee!==st||ee.tag!==5&&ee.tag!==6)&&(ee=null)):(Z=null,ee=L),Z!==ee)){if(te=em,W="onMouseLeave",N="onMouseEnter",M="mouse",(o==="pointerout"||o==="pointerover")&&(te=nm,W="onPointerLeave",N="onPointerEnter",M="pointer"),st=Z==null?B:es(Z),O=ee==null?B:es(ee),B=new te(W,M+"leave",Z,d,V),B.target=st,B.relatedTarget=O,W=null,di(V)===L&&(te=new te(N,M+"enter",ee,d,V),te.target=O,te.relatedTarget=st,W=te),st=W,Z&&ee)t:{for(te=Z,N=ee,M=0,O=te;O;O=Yi(O))M++;for(O=0,W=N;W;W=Yi(W))O++;for(;0<M-O;)te=Yi(te),M--;for(;0<O-M;)N=Yi(N),O--;for(;M--;){if(te===N||N!==null&&te===N.alternate)break t;te=Yi(te),N=Yi(N)}te=null}else te=null;Z!==null&&Mm(H,B,Z,te,!1),ee!==null&&st!==null&&Mm(H,st,ee,te,!0)}}e:{if(B=L?es(L):window,Z=B.nodeName&&B.nodeName.toLowerCase(),Z==="select"||Z==="input"&&B.type==="file")var re=W3;else if(lm(B))if(cm)re=G3;else{re=Z3;var le=K3}else(Z=B.nodeName)&&Z.toLowerCase()==="input"&&(B.type==="checkbox"||B.type==="radio")&&(re=J3);if(re&&(re=re(o,L))){am(H,re,d,V);break e}le&&le(o,B,L),o==="focusout"&&(le=B._wrapperState)&&le.controlled&&B.type==="number"&&Oc(B,"number",B.value)}switch(le=L?es(L):window,o){case"focusin":(lm(le)||le.contentEditable==="true")&&(Gi=le,ud=L,so=null);break;case"focusout":so=ud=Gi=null;break;case"mousedown":ld=!0;break;case"contextmenu":case"mouseup":case"dragend":ld=!1,xm(H,d,V);break;case"selectionchange":if(X3)break;case"keydown":case"keyup":xm(H,d,V)}var ae;if(rd)e:{switch(o){case"compositionstart":var he="onCompositionStart";break e;case"compositionend":he="onCompositionEnd";break e;case"compositionupdate":he="onCompositionUpdate";break e}he=void 0}else Ji?om(o,d)&&(he="onCompositionEnd"):o==="keydown"&&d.keyCode===229&&(he="onCompositionStart");he&&(rm&&d.locale!=="ko"&&(Ji||he!=="onCompositionStart"?he==="onCompositionEnd"&&Ji&&(ae=Y0()):(br=V,Qc="value"in br?br.value:br.textContent,Ji=!0)),le=Yu(L,he),0<le.length&&(he=new tm(he,o,null,d,V),H.push({event:he,listeners:le}),ae?he.data=ae:(ae=um(d),ae!==null&&(he.data=ae)))),(ae=$3?V3(o,d):H3(o,d))&&(L=Yu(L,"onBeforeInput"),0<L.length&&(V=new tm("onBeforeInput","beforeinput",null,d,V),H.push({event:V,listeners:L}),V.data=ae))}Tm(H,l)})}function lo(o,l,d){return{instance:o,listener:l,currentTarget:d}}function Yu(o,l){for(var d=l+"Capture",h=[];o!==null;){var g=o,k=g.stateNode;g.tag===5&&k!==null&&(g=k,k=Hs(o,d),k!=null&&h.unshift(lo(o,k,g)),k=Hs(o,l),k!=null&&h.push(lo(o,k,g))),o=o.return}return h}function Yi(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5);return o||null}function Mm(o,l,d,h,g){for(var k=l._reactName,C=[];d!==null&&d!==h;){var E=d,T=E.alternate,L=E.stateNode;if(T!==null&&T===h)break;E.tag===5&&L!==null&&(E=L,g?(T=Hs(d,k),T!=null&&C.unshift(lo(d,T,E))):g||(T=Hs(d,k),T!=null&&C.push(lo(d,T,E)))),d=d.return}C.length!==0&&o.push({event:l,listeners:C})}var rw=/\r\n?/g,iw=/\u0000|\uFFFD/g;function Dm(o){return(typeof o=="string"?o:""+o).replace(rw,`
38
- `).replace(iw,"")}function Xu(o,l,d){if(l=Dm(l),Dm(o)!==l&&d)throw Error(n(425))}function el(){}var pd=null,md=null;function gd(o,l){return o==="textarea"||o==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var yd=typeof setTimeout=="function"?setTimeout:void 0,sw=typeof clearTimeout=="function"?clearTimeout:void 0,Nm=typeof Promise=="function"?Promise:void 0,ow=typeof queueMicrotask=="function"?queueMicrotask:typeof Nm<"u"?function(o){return Nm.resolve(null).then(o).catch(uw)}:yd;function uw(o){setTimeout(function(){throw o})}function xd(o,l){var d=l,h=0;do{var g=d.nextSibling;if(o.removeChild(d),g&&g.nodeType===8)if(d=g.data,d==="/$"){if(h===0){o.removeChild(g),Ys(l);return}h--}else d!=="$"&&d!=="$?"&&d!=="$!"||h++;d=g}while(d);Ys(l)}function wr(o){for(;o!=null;o=o.nextSibling){var l=o.nodeType;if(l===1||l===3)break;if(l===8){if(l=o.data,l==="$"||l==="$!"||l==="$?")break;if(l==="/$")return null}}return o}function Om(o){o=o.previousSibling;for(var l=0;o;){if(o.nodeType===8){var d=o.data;if(d==="$"||d==="$!"||d==="$?"){if(l===0)return o;l--}else d==="/$"&&l++}o=o.previousSibling}return null}var Xi=Math.random().toString(36).slice(2),On="__reactFiber$"+Xi,ao="__reactProps$"+Xi,Zn="__reactContainer$"+Xi,kd="__reactEvents$"+Xi,lw="__reactListeners$"+Xi,aw="__reactHandles$"+Xi;function di(o){var l=o[On];if(l)return l;for(var d=o.parentNode;d;){if(l=d[Zn]||d[On]){if(d=l.alternate,l.child!==null||d!==null&&d.child!==null)for(o=Om(o);o!==null;){if(d=o[On])return d;o=Om(o)}return l}o=d,d=o.parentNode}return null}function co(o){return o=o[On]||o[Zn],!o||o.tag!==5&&o.tag!==6&&o.tag!==13&&o.tag!==3?null:o}function es(o){if(o.tag===5||o.tag===6)return o.stateNode;throw Error(n(33))}function tl(o){return o[ao]||null}var bd=[],ts=-1;function Cr(o){return{current:o}}function He(o){0>ts||(o.current=bd[ts],bd[ts]=null,ts--)}function je(o,l){ts++,bd[ts]=o.current,o.current=l}var Sr={},At=Cr(Sr),Bt=Cr(!1),fi=Sr;function ns(o,l){var d=o.type.contextTypes;if(!d)return Sr;var h=o.stateNode;if(h&&h.__reactInternalMemoizedUnmaskedChildContext===l)return h.__reactInternalMemoizedMaskedChildContext;var g={},k;for(k in d)g[k]=l[k];return h&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=l,o.__reactInternalMemoizedMaskedChildContext=g),g}function $t(o){return o=o.childContextTypes,o!=null}function nl(){He(Bt),He(At)}function Rm(o,l,d){if(At.current!==Sr)throw Error(n(168));je(At,l),je(Bt,d)}function Im(o,l,d){var h=o.stateNode;if(l=l.childContextTypes,typeof h.getChildContext!="function")return d;h=h.getChildContext();for(var g in h)if(!(g in l))throw Error(n(108,ze(o)||"Unknown",g));return X({},d,h)}function rl(o){return o=(o=o.stateNode)&&o.__reactInternalMemoizedMergedChildContext||Sr,fi=At.current,je(At,o),je(Bt,Bt.current),!0}function Lm(o,l,d){var h=o.stateNode;if(!h)throw Error(n(169));d?(o=Im(o,l,fi),h.__reactInternalMemoizedMergedChildContext=o,He(Bt),He(At),je(At,o)):He(Bt),je(Bt,d)}var Jn=null,il=!1,vd=!1;function Pm(o){Jn===null?Jn=[o]:Jn.push(o)}function cw(o){il=!0,Pm(o)}function Er(){if(!vd&&Jn!==null){vd=!0;var o=0,l=Le;try{var d=Jn;for(Le=1;o<d.length;o++){var h=d[o];do h=h(!0);while(h!==null)}Jn=null,il=!1}catch(g){throw Jn!==null&&(Jn=Jn.slice(o+1)),z0(Hc,Er),g}finally{Le=l,vd=!1}}return null}var rs=[],is=0,sl=null,ol=0,un=[],ln=0,hi=null,Gn=1,Qn="";function pi(o,l){rs[is++]=ol,rs[is++]=sl,sl=o,ol=l}function Fm(o,l,d){un[ln++]=Gn,un[ln++]=Qn,un[ln++]=hi,hi=o;var h=Gn;o=Qn;var g=32-bn(h)-1;h&=~(1<<g),d+=1;var k=32-bn(l)+g;if(30<k){var C=g-g%5;k=(h&(1<<C)-1).toString(32),h>>=C,g-=C,Gn=1<<32-bn(l)+g|d<<g|h,Qn=k+o}else Gn=1<<k|d<<g|h,Qn=o}function wd(o){o.return!==null&&(pi(o,1),Fm(o,1,0))}function Cd(o){for(;o===sl;)sl=rs[--is],rs[is]=null,ol=rs[--is],rs[is]=null;for(;o===hi;)hi=un[--ln],un[ln]=null,Qn=un[--ln],un[ln]=null,Gn=un[--ln],un[ln]=null}var Yt=null,Xt=null,Ze=!1,wn=null;function zm(o,l){var d=fn(5,null,null,0);d.elementType="DELETED",d.stateNode=l,d.return=o,l=o.deletions,l===null?(o.deletions=[d],o.flags|=16):l.push(d)}function jm(o,l){switch(o.tag){case 5:var d=o.type;return l=l.nodeType!==1||d.toLowerCase()!==l.nodeName.toLowerCase()?null:l,l!==null?(o.stateNode=l,Yt=o,Xt=wr(l.firstChild),!0):!1;case 6:return l=o.pendingProps===""||l.nodeType!==3?null:l,l!==null?(o.stateNode=l,Yt=o,Xt=null,!0):!1;case 13:return l=l.nodeType!==8?null:l,l!==null?(d=hi!==null?{id:Gn,overflow:Qn}:null,o.memoizedState={dehydrated:l,treeContext:d,retryLane:1073741824},d=fn(18,null,null,0),d.stateNode=l,d.return=o,o.child=d,Yt=o,Xt=null,!0):!1;default:return!1}}function Sd(o){return(o.mode&1)!==0&&(o.flags&128)===0}function Ed(o){if(Ze){var l=Xt;if(l){var d=l;if(!jm(o,l)){if(Sd(o))throw Error(n(418));l=wr(d.nextSibling);var h=Yt;l&&jm(o,l)?zm(h,d):(o.flags=o.flags&-4097|2,Ze=!1,Yt=o)}}else{if(Sd(o))throw Error(n(418));o.flags=o.flags&-4097|2,Ze=!1,Yt=o}}}function Bm(o){for(o=o.return;o!==null&&o.tag!==5&&o.tag!==3&&o.tag!==13;)o=o.return;Yt=o}function ul(o){if(o!==Yt)return!1;if(!Ze)return Bm(o),Ze=!0,!1;var l;if((l=o.tag!==3)&&!(l=o.tag!==5)&&(l=o.type,l=l!=="head"&&l!=="body"&&!gd(o.type,o.memoizedProps)),l&&(l=Xt)){if(Sd(o))throw $m(),Error(n(418));for(;l;)zm(o,l),l=wr(l.nextSibling)}if(Bm(o),o.tag===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(n(317));e:{for(o=o.nextSibling,l=0;o;){if(o.nodeType===8){var d=o.data;if(d==="/$"){if(l===0){Xt=wr(o.nextSibling);break e}l--}else d!=="$"&&d!=="$!"&&d!=="$?"||l++}o=o.nextSibling}Xt=null}}else Xt=Yt?wr(o.stateNode.nextSibling):null;return!0}function $m(){for(var o=Xt;o;)o=wr(o.nextSibling)}function ss(){Xt=Yt=null,Ze=!1}function _d(o){wn===null?wn=[o]:wn.push(o)}var dw=I.ReactCurrentBatchConfig;function fo(o,l,d){if(o=d.ref,o!==null&&typeof o!="function"&&typeof o!="object"){if(d._owner){if(d=d._owner,d){if(d.tag!==1)throw Error(n(309));var h=d.stateNode}if(!h)throw Error(n(147,o));var g=h,k=""+o;return l!==null&&l.ref!==null&&typeof l.ref=="function"&&l.ref._stringRef===k?l.ref:(l=function(C){var E=g.refs;C===null?delete E[k]:E[k]=C},l._stringRef=k,l)}if(typeof o!="string")throw Error(n(284));if(!d._owner)throw Error(n(290,o))}return o}function ll(o,l){throw o=Object.prototype.toString.call(l),Error(n(31,o==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":o))}function Vm(o){var l=o._init;return l(o._payload)}function Hm(o){function l(N,M){if(o){var O=N.deletions;O===null?(N.deletions=[M],N.flags|=16):O.push(M)}}function d(N,M){if(!o)return null;for(;M!==null;)l(N,M),M=M.sibling;return null}function h(N,M){for(N=new Map;M!==null;)M.key!==null?N.set(M.key,M):N.set(M.index,M),M=M.sibling;return N}function g(N,M){return N=Rr(N,M),N.index=0,N.sibling=null,N}function k(N,M,O){return N.index=O,o?(O=N.alternate,O!==null?(O=O.index,O<M?(N.flags|=2,M):O):(N.flags|=2,M)):(N.flags|=1048576,M)}function C(N){return o&&N.alternate===null&&(N.flags|=2),N}function E(N,M,O,W){return M===null||M.tag!==6?(M=xf(O,N.mode,W),M.return=N,M):(M=g(M,O),M.return=N,M)}function T(N,M,O,W){var re=O.type;return re===z?V(N,M,O.props.children,W,O.key):M!==null&&(M.elementType===re||typeof re=="object"&&re!==null&&re.$$typeof===Ge&&Vm(re)===M.type)?(W=g(M,O.props),W.ref=fo(N,M,O),W.return=N,W):(W=Ol(O.type,O.key,O.props,null,N.mode,W),W.ref=fo(N,M,O),W.return=N,W)}function L(N,M,O,W){return M===null||M.tag!==4||M.stateNode.containerInfo!==O.containerInfo||M.stateNode.implementation!==O.implementation?(M=kf(O,N.mode,W),M.return=N,M):(M=g(M,O.children||[]),M.return=N,M)}function V(N,M,O,W,re){return M===null||M.tag!==7?(M=wi(O,N.mode,W,re),M.return=N,M):(M=g(M,O),M.return=N,M)}function H(N,M,O){if(typeof M=="string"&&M!==""||typeof M=="number")return M=xf(""+M,N.mode,O),M.return=N,M;if(typeof M=="object"&&M!==null){switch(M.$$typeof){case P:return O=Ol(M.type,M.key,M.props,null,N.mode,O),O.ref=fo(N,null,M),O.return=N,O;case F:return M=kf(M,N.mode,O),M.return=N,M;case Ge:var W=M._init;return H(N,W(M._payload),O)}if(Bs(M)||fe(M))return M=wi(M,N.mode,O,null),M.return=N,M;ll(N,M)}return null}function B(N,M,O,W){var re=M!==null?M.key:null;if(typeof O=="string"&&O!==""||typeof O=="number")return re!==null?null:E(N,M,""+O,W);if(typeof O=="object"&&O!==null){switch(O.$$typeof){case P:return O.key===re?T(N,M,O,W):null;case F:return O.key===re?L(N,M,O,W):null;case Ge:return re=O._init,B(N,M,re(O._payload),W)}if(Bs(O)||fe(O))return re!==null?null:V(N,M,O,W,null);ll(N,O)}return null}function Z(N,M,O,W,re){if(typeof W=="string"&&W!==""||typeof W=="number")return N=N.get(O)||null,E(M,N,""+W,re);if(typeof W=="object"&&W!==null){switch(W.$$typeof){case P:return N=N.get(W.key===null?O:W.key)||null,T(M,N,W,re);case F:return N=N.get(W.key===null?O:W.key)||null,L(M,N,W,re);case Ge:var le=W._init;return Z(N,M,O,le(W._payload),re)}if(Bs(W)||fe(W))return N=N.get(O)||null,V(M,N,W,re,null);ll(M,W)}return null}function ee(N,M,O,W){for(var re=null,le=null,ae=M,he=M=0,yt=null;ae!==null&&he<O.length;he++){ae.index>he?(yt=ae,ae=null):yt=ae.sibling;var De=B(N,ae,O[he],W);if(De===null){ae===null&&(ae=yt);break}o&&ae&&De.alternate===null&&l(N,ae),M=k(De,M,he),le===null?re=De:le.sibling=De,le=De,ae=yt}if(he===O.length)return d(N,ae),Ze&&pi(N,he),re;if(ae===null){for(;he<O.length;he++)ae=H(N,O[he],W),ae!==null&&(M=k(ae,M,he),le===null?re=ae:le.sibling=ae,le=ae);return Ze&&pi(N,he),re}for(ae=h(N,ae);he<O.length;he++)yt=Z(ae,N,he,O[he],W),yt!==null&&(o&&yt.alternate!==null&&ae.delete(yt.key===null?he:yt.key),M=k(yt,M,he),le===null?re=yt:le.sibling=yt,le=yt);return o&&ae.forEach(function(Ir){return l(N,Ir)}),Ze&&pi(N,he),re}function te(N,M,O,W){var re=fe(O);if(typeof re!="function")throw Error(n(150));if(O=re.call(O),O==null)throw Error(n(151));for(var le=re=null,ae=M,he=M=0,yt=null,De=O.next();ae!==null&&!De.done;he++,De=O.next()){ae.index>he?(yt=ae,ae=null):yt=ae.sibling;var Ir=B(N,ae,De.value,W);if(Ir===null){ae===null&&(ae=yt);break}o&&ae&&Ir.alternate===null&&l(N,ae),M=k(Ir,M,he),le===null?re=Ir:le.sibling=Ir,le=Ir,ae=yt}if(De.done)return d(N,ae),Ze&&pi(N,he),re;if(ae===null){for(;!De.done;he++,De=O.next())De=H(N,De.value,W),De!==null&&(M=k(De,M,he),le===null?re=De:le.sibling=De,le=De);return Ze&&pi(N,he),re}for(ae=h(N,ae);!De.done;he++,De=O.next())De=Z(ae,N,he,De.value,W),De!==null&&(o&&De.alternate!==null&&ae.delete(De.key===null?he:De.key),M=k(De,M,he),le===null?re=De:le.sibling=De,le=De);return o&&ae.forEach(function(Uw){return l(N,Uw)}),Ze&&pi(N,he),re}function st(N,M,O,W){if(typeof O=="object"&&O!==null&&O.type===z&&O.key===null&&(O=O.props.children),typeof O=="object"&&O!==null){switch(O.$$typeof){case P:e:{for(var re=O.key,le=M;le!==null;){if(le.key===re){if(re=O.type,re===z){if(le.tag===7){d(N,le.sibling),M=g(le,O.props.children),M.return=N,N=M;break e}}else if(le.elementType===re||typeof re=="object"&&re!==null&&re.$$typeof===Ge&&Vm(re)===le.type){d(N,le.sibling),M=g(le,O.props),M.ref=fo(N,le,O),M.return=N,N=M;break e}d(N,le);break}else l(N,le);le=le.sibling}O.type===z?(M=wi(O.props.children,N.mode,W,O.key),M.return=N,N=M):(W=Ol(O.type,O.key,O.props,null,N.mode,W),W.ref=fo(N,M,O),W.return=N,N=W)}return C(N);case F:e:{for(le=O.key;M!==null;){if(M.key===le)if(M.tag===4&&M.stateNode.containerInfo===O.containerInfo&&M.stateNode.implementation===O.implementation){d(N,M.sibling),M=g(M,O.children||[]),M.return=N,N=M;break e}else{d(N,M);break}else l(N,M);M=M.sibling}M=kf(O,N.mode,W),M.return=N,N=M}return C(N);case Ge:return le=O._init,st(N,M,le(O._payload),W)}if(Bs(O))return ee(N,M,O,W);if(fe(O))return te(N,M,O,W);ll(N,O)}return typeof O=="string"&&O!==""||typeof O=="number"?(O=""+O,M!==null&&M.tag===6?(d(N,M.sibling),M=g(M,O),M.return=N,N=M):(d(N,M),M=xf(O,N.mode,W),M.return=N,N=M),C(N)):d(N,M)}return st}var us=Hm(!0),Um=Hm(!1),al=Cr(null),cl=null,ls=null,Td=null;function Ad(){Td=ls=cl=null}function Md(o){var l=al.current;He(al),o._currentValue=l}function Dd(o,l,d){for(;o!==null;){var h=o.alternate;if((o.childLanes&l)!==l?(o.childLanes|=l,h!==null&&(h.childLanes|=l)):h!==null&&(h.childLanes&l)!==l&&(h.childLanes|=l),o===d)break;o=o.return}}function as(o,l){cl=o,Td=ls=null,o=o.dependencies,o!==null&&o.firstContext!==null&&((o.lanes&l)!==0&&(Vt=!0),o.firstContext=null)}function an(o){var l=o._currentValue;if(Td!==o)if(o={context:o,memoizedValue:l,next:null},ls===null){if(cl===null)throw Error(n(308));ls=o,cl.dependencies={lanes:0,firstContext:o}}else ls=ls.next=o;return l}var mi=null;function Nd(o){mi===null?mi=[o]:mi.push(o)}function qm(o,l,d,h){var g=l.interleaved;return g===null?(d.next=d,Nd(l)):(d.next=g.next,g.next=d),l.interleaved=d,Yn(o,h)}function Yn(o,l){o.lanes|=l;var d=o.alternate;for(d!==null&&(d.lanes|=l),d=o,o=o.return;o!==null;)o.childLanes|=l,d=o.alternate,d!==null&&(d.childLanes|=l),d=o,o=o.return;return d.tag===3?d.stateNode:null}var _r=!1;function Od(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Wm(o,l){o=o.updateQueue,l.updateQueue===o&&(l.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,effects:o.effects})}function Xn(o,l){return{eventTime:o,lane:l,tag:0,payload:null,callback:null,next:null}}function Tr(o,l,d){var h=o.updateQueue;if(h===null)return null;if(h=h.shared,(Ee&2)!==0){var g=h.pending;return g===null?l.next=l:(l.next=g.next,g.next=l),h.pending=l,Yn(o,d)}return g=h.interleaved,g===null?(l.next=l,Nd(h)):(l.next=g.next,g.next=l),h.interleaved=l,Yn(o,d)}function dl(o,l,d){if(l=l.updateQueue,l!==null&&(l=l.shared,(d&4194240)!==0)){var h=l.lanes;h&=o.pendingLanes,d|=h,l.lanes=d,Wc(o,d)}}function Km(o,l){var d=o.updateQueue,h=o.alternate;if(h!==null&&(h=h.updateQueue,d===h)){var g=null,k=null;if(d=d.firstBaseUpdate,d!==null){do{var C={eventTime:d.eventTime,lane:d.lane,tag:d.tag,payload:d.payload,callback:d.callback,next:null};k===null?g=k=C:k=k.next=C,d=d.next}while(d!==null);k===null?g=k=l:k=k.next=l}else g=k=l;d={baseState:h.baseState,firstBaseUpdate:g,lastBaseUpdate:k,shared:h.shared,effects:h.effects},o.updateQueue=d;return}o=d.lastBaseUpdate,o===null?d.firstBaseUpdate=l:o.next=l,d.lastBaseUpdate=l}function fl(o,l,d,h){var g=o.updateQueue;_r=!1;var k=g.firstBaseUpdate,C=g.lastBaseUpdate,E=g.shared.pending;if(E!==null){g.shared.pending=null;var T=E,L=T.next;T.next=null,C===null?k=L:C.next=L,C=T;var V=o.alternate;V!==null&&(V=V.updateQueue,E=V.lastBaseUpdate,E!==C&&(E===null?V.firstBaseUpdate=L:E.next=L,V.lastBaseUpdate=T))}if(k!==null){var H=g.baseState;C=0,V=L=T=null,E=k;do{var B=E.lane,Z=E.eventTime;if((h&B)===B){V!==null&&(V=V.next={eventTime:Z,lane:0,tag:E.tag,payload:E.payload,callback:E.callback,next:null});e:{var ee=o,te=E;switch(B=l,Z=d,te.tag){case 1:if(ee=te.payload,typeof ee=="function"){H=ee.call(Z,H,B);break e}H=ee;break e;case 3:ee.flags=ee.flags&-65537|128;case 0:if(ee=te.payload,B=typeof ee=="function"?ee.call(Z,H,B):ee,B==null)break e;H=X({},H,B);break e;case 2:_r=!0}}E.callback!==null&&E.lane!==0&&(o.flags|=64,B=g.effects,B===null?g.effects=[E]:B.push(E))}else Z={eventTime:Z,lane:B,tag:E.tag,payload:E.payload,callback:E.callback,next:null},V===null?(L=V=Z,T=H):V=V.next=Z,C|=B;if(E=E.next,E===null){if(E=g.shared.pending,E===null)break;B=E,E=B.next,B.next=null,g.lastBaseUpdate=B,g.shared.pending=null}}while(!0);if(V===null&&(T=H),g.baseState=T,g.firstBaseUpdate=L,g.lastBaseUpdate=V,l=g.shared.interleaved,l!==null){g=l;do C|=g.lane,g=g.next;while(g!==l)}else k===null&&(g.shared.lanes=0);xi|=C,o.lanes=C,o.memoizedState=H}}function Zm(o,l,d){if(o=l.effects,l.effects=null,o!==null)for(l=0;l<o.length;l++){var h=o[l],g=h.callback;if(g!==null){if(h.callback=null,h=d,typeof g!="function")throw Error(n(191,g));g.call(h)}}}var ho={},Rn=Cr(ho),po=Cr(ho),mo=Cr(ho);function gi(o){if(o===ho)throw Error(n(174));return o}function Rd(o,l){switch(je(mo,l),je(po,o),je(Rn,ho),o=l.nodeType,o){case 9:case 11:l=(l=l.documentElement)?l.namespaceURI:Ic(null,"");break;default:o=o===8?l.parentNode:l,l=o.namespaceURI||null,o=o.tagName,l=Ic(l,o)}He(Rn),je(Rn,l)}function cs(){He(Rn),He(po),He(mo)}function Jm(o){gi(mo.current);var l=gi(Rn.current),d=Ic(l,o.type);l!==d&&(je(po,o),je(Rn,d))}function Id(o){po.current===o&&(He(Rn),He(po))}var Qe=Cr(0);function hl(o){for(var l=o;l!==null;){if(l.tag===13){var d=l.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||d.data==="$?"||d.data==="$!"))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var Ld=[];function Pd(){for(var o=0;o<Ld.length;o++)Ld[o]._workInProgressVersionPrimary=null;Ld.length=0}var pl=I.ReactCurrentDispatcher,Fd=I.ReactCurrentBatchConfig,yi=0,Ye=null,ft=null,mt=null,ml=!1,go=!1,yo=0,fw=0;function Mt(){throw Error(n(321))}function zd(o,l){if(l===null)return!1;for(var d=0;d<l.length&&d<o.length;d++)if(!vn(o[d],l[d]))return!1;return!0}function jd(o,l,d,h,g,k){if(yi=k,Ye=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,pl.current=o===null||o.memoizedState===null?gw:yw,o=d(h,g),go){k=0;do{if(go=!1,yo=0,25<=k)throw Error(n(301));k+=1,mt=ft=null,l.updateQueue=null,pl.current=xw,o=d(h,g)}while(go)}if(pl.current=xl,l=ft!==null&&ft.next!==null,yi=0,mt=ft=Ye=null,ml=!1,l)throw Error(n(300));return o}function Bd(){var o=yo!==0;return yo=0,o}function In(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return mt===null?Ye.memoizedState=mt=o:mt=mt.next=o,mt}function cn(){if(ft===null){var o=Ye.alternate;o=o!==null?o.memoizedState:null}else o=ft.next;var l=mt===null?Ye.memoizedState:mt.next;if(l!==null)mt=l,ft=o;else{if(o===null)throw Error(n(310));ft=o,o={memoizedState:ft.memoizedState,baseState:ft.baseState,baseQueue:ft.baseQueue,queue:ft.queue,next:null},mt===null?Ye.memoizedState=mt=o:mt=mt.next=o}return mt}function xo(o,l){return typeof l=="function"?l(o):l}function $d(o){var l=cn(),d=l.queue;if(d===null)throw Error(n(311));d.lastRenderedReducer=o;var h=ft,g=h.baseQueue,k=d.pending;if(k!==null){if(g!==null){var C=g.next;g.next=k.next,k.next=C}h.baseQueue=g=k,d.pending=null}if(g!==null){k=g.next,h=h.baseState;var E=C=null,T=null,L=k;do{var V=L.lane;if((yi&V)===V)T!==null&&(T=T.next={lane:0,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null}),h=L.hasEagerState?L.eagerState:o(h,L.action);else{var H={lane:V,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null};T===null?(E=T=H,C=h):T=T.next=H,Ye.lanes|=V,xi|=V}L=L.next}while(L!==null&&L!==k);T===null?C=h:T.next=E,vn(h,l.memoizedState)||(Vt=!0),l.memoizedState=h,l.baseState=C,l.baseQueue=T,d.lastRenderedState=h}if(o=d.interleaved,o!==null){g=o;do k=g.lane,Ye.lanes|=k,xi|=k,g=g.next;while(g!==o)}else g===null&&(d.lanes=0);return[l.memoizedState,d.dispatch]}function Vd(o){var l=cn(),d=l.queue;if(d===null)throw Error(n(311));d.lastRenderedReducer=o;var h=d.dispatch,g=d.pending,k=l.memoizedState;if(g!==null){d.pending=null;var C=g=g.next;do k=o(k,C.action),C=C.next;while(C!==g);vn(k,l.memoizedState)||(Vt=!0),l.memoizedState=k,l.baseQueue===null&&(l.baseState=k),d.lastRenderedState=k}return[k,h]}function Gm(){}function Qm(o,l){var d=Ye,h=cn(),g=l(),k=!vn(h.memoizedState,g);if(k&&(h.memoizedState=g,Vt=!0),h=h.queue,Hd(e1.bind(null,d,h,o),[o]),h.getSnapshot!==l||k||mt!==null&&mt.memoizedState.tag&1){if(d.flags|=2048,ko(9,Xm.bind(null,d,h,g,l),void 0,null),gt===null)throw Error(n(349));(yi&30)!==0||Ym(d,l,g)}return g}function Ym(o,l,d){o.flags|=16384,o={getSnapshot:l,value:d},l=Ye.updateQueue,l===null?(l={lastEffect:null,stores:null},Ye.updateQueue=l,l.stores=[o]):(d=l.stores,d===null?l.stores=[o]:d.push(o))}function Xm(o,l,d,h){l.value=d,l.getSnapshot=h,t1(l)&&n1(o)}function e1(o,l,d){return d(function(){t1(l)&&n1(o)})}function t1(o){var l=o.getSnapshot;o=o.value;try{var d=l();return!vn(o,d)}catch{return!0}}function n1(o){var l=Yn(o,1);l!==null&&_n(l,o,1,-1)}function r1(o){var l=In();return typeof o=="function"&&(o=o()),l.memoizedState=l.baseState=o,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:xo,lastRenderedState:o},l.queue=o,o=o.dispatch=mw.bind(null,Ye,o),[l.memoizedState,o]}function ko(o,l,d,h){return o={tag:o,create:l,destroy:d,deps:h,next:null},l=Ye.updateQueue,l===null?(l={lastEffect:null,stores:null},Ye.updateQueue=l,l.lastEffect=o.next=o):(d=l.lastEffect,d===null?l.lastEffect=o.next=o:(h=d.next,d.next=o,o.next=h,l.lastEffect=o)),o}function i1(){return cn().memoizedState}function gl(o,l,d,h){var g=In();Ye.flags|=o,g.memoizedState=ko(1|l,d,void 0,h===void 0?null:h)}function yl(o,l,d,h){var g=cn();h=h===void 0?null:h;var k=void 0;if(ft!==null){var C=ft.memoizedState;if(k=C.destroy,h!==null&&zd(h,C.deps)){g.memoizedState=ko(l,d,k,h);return}}Ye.flags|=o,g.memoizedState=ko(1|l,d,k,h)}function s1(o,l){return gl(8390656,8,o,l)}function Hd(o,l){return yl(2048,8,o,l)}function o1(o,l){return yl(4,2,o,l)}function u1(o,l){return yl(4,4,o,l)}function l1(o,l){if(typeof l=="function")return o=o(),l(o),function(){l(null)};if(l!=null)return o=o(),l.current=o,function(){l.current=null}}function a1(o,l,d){return d=d!=null?d.concat([o]):null,yl(4,4,l1.bind(null,l,o),d)}function Ud(){}function c1(o,l){var d=cn();l=l===void 0?null:l;var h=d.memoizedState;return h!==null&&l!==null&&zd(l,h[1])?h[0]:(d.memoizedState=[o,l],o)}function d1(o,l){var d=cn();l=l===void 0?null:l;var h=d.memoizedState;return h!==null&&l!==null&&zd(l,h[1])?h[0]:(o=o(),d.memoizedState=[o,l],o)}function f1(o,l,d){return(yi&21)===0?(o.baseState&&(o.baseState=!1,Vt=!0),o.memoizedState=d):(vn(d,l)||(d=V0(),Ye.lanes|=d,xi|=d,o.baseState=!0),l)}function hw(o,l){var d=Le;Le=d!==0&&4>d?d:4,o(!0);var h=Fd.transition;Fd.transition={};try{o(!1),l()}finally{Le=d,Fd.transition=h}}function h1(){return cn().memoizedState}function pw(o,l,d){var h=Nr(o);if(d={lane:h,action:d,hasEagerState:!1,eagerState:null,next:null},p1(o))m1(l,d);else if(d=qm(o,l,d,h),d!==null){var g=Pt();_n(d,o,h,g),g1(d,l,h)}}function mw(o,l,d){var h=Nr(o),g={lane:h,action:d,hasEagerState:!1,eagerState:null,next:null};if(p1(o))m1(l,g);else{var k=o.alternate;if(o.lanes===0&&(k===null||k.lanes===0)&&(k=l.lastRenderedReducer,k!==null))try{var C=l.lastRenderedState,E=k(C,d);if(g.hasEagerState=!0,g.eagerState=E,vn(E,C)){var T=l.interleaved;T===null?(g.next=g,Nd(l)):(g.next=T.next,T.next=g),l.interleaved=g;return}}catch{}finally{}d=qm(o,l,g,h),d!==null&&(g=Pt(),_n(d,o,h,g),g1(d,l,h))}}function p1(o){var l=o.alternate;return o===Ye||l!==null&&l===Ye}function m1(o,l){go=ml=!0;var d=o.pending;d===null?l.next=l:(l.next=d.next,d.next=l),o.pending=l}function g1(o,l,d){if((d&4194240)!==0){var h=l.lanes;h&=o.pendingLanes,d|=h,l.lanes=d,Wc(o,d)}}var xl={readContext:an,useCallback:Mt,useContext:Mt,useEffect:Mt,useImperativeHandle:Mt,useInsertionEffect:Mt,useLayoutEffect:Mt,useMemo:Mt,useReducer:Mt,useRef:Mt,useState:Mt,useDebugValue:Mt,useDeferredValue:Mt,useTransition:Mt,useMutableSource:Mt,useSyncExternalStore:Mt,useId:Mt,unstable_isNewReconciler:!1},gw={readContext:an,useCallback:function(o,l){return In().memoizedState=[o,l===void 0?null:l],o},useContext:an,useEffect:s1,useImperativeHandle:function(o,l,d){return d=d!=null?d.concat([o]):null,gl(4194308,4,l1.bind(null,l,o),d)},useLayoutEffect:function(o,l){return gl(4194308,4,o,l)},useInsertionEffect:function(o,l){return gl(4,2,o,l)},useMemo:function(o,l){var d=In();return l=l===void 0?null:l,o=o(),d.memoizedState=[o,l],o},useReducer:function(o,l,d){var h=In();return l=d!==void 0?d(l):l,h.memoizedState=h.baseState=l,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:l},h.queue=o,o=o.dispatch=pw.bind(null,Ye,o),[h.memoizedState,o]},useRef:function(o){var l=In();return o={current:o},l.memoizedState=o},useState:r1,useDebugValue:Ud,useDeferredValue:function(o){return In().memoizedState=o},useTransition:function(){var o=r1(!1),l=o[0];return o=hw.bind(null,o[1]),In().memoizedState=o,[l,o]},useMutableSource:function(){},useSyncExternalStore:function(o,l,d){var h=Ye,g=In();if(Ze){if(d===void 0)throw Error(n(407));d=d()}else{if(d=l(),gt===null)throw Error(n(349));(yi&30)!==0||Ym(h,l,d)}g.memoizedState=d;var k={value:d,getSnapshot:l};return g.queue=k,s1(e1.bind(null,h,k,o),[o]),h.flags|=2048,ko(9,Xm.bind(null,h,k,d,l),void 0,null),d},useId:function(){var o=In(),l=gt.identifierPrefix;if(Ze){var d=Qn,h=Gn;d=(h&~(1<<32-bn(h)-1)).toString(32)+d,l=":"+l+"R"+d,d=yo++,0<d&&(l+="H"+d.toString(32)),l+=":"}else d=fw++,l=":"+l+"r"+d.toString(32)+":";return o.memoizedState=l},unstable_isNewReconciler:!1},yw={readContext:an,useCallback:c1,useContext:an,useEffect:Hd,useImperativeHandle:a1,useInsertionEffect:o1,useLayoutEffect:u1,useMemo:d1,useReducer:$d,useRef:i1,useState:function(){return $d(xo)},useDebugValue:Ud,useDeferredValue:function(o){var l=cn();return f1(l,ft.memoizedState,o)},useTransition:function(){var o=$d(xo)[0],l=cn().memoizedState;return[o,l]},useMutableSource:Gm,useSyncExternalStore:Qm,useId:h1,unstable_isNewReconciler:!1},xw={readContext:an,useCallback:c1,useContext:an,useEffect:Hd,useImperativeHandle:a1,useInsertionEffect:o1,useLayoutEffect:u1,useMemo:d1,useReducer:Vd,useRef:i1,useState:function(){return Vd(xo)},useDebugValue:Ud,useDeferredValue:function(o){var l=cn();return ft===null?l.memoizedState=o:f1(l,ft.memoizedState,o)},useTransition:function(){var o=Vd(xo)[0],l=cn().memoizedState;return[o,l]},useMutableSource:Gm,useSyncExternalStore:Qm,useId:h1,unstable_isNewReconciler:!1};function Cn(o,l){if(o&&o.defaultProps){l=X({},l),o=o.defaultProps;for(var d in o)l[d]===void 0&&(l[d]=o[d]);return l}return l}function qd(o,l,d,h){l=o.memoizedState,d=d(h,l),d=d==null?l:X({},l,d),o.memoizedState=d,o.lanes===0&&(o.updateQueue.baseState=d)}var kl={isMounted:function(o){return(o=o._reactInternals)?ci(o)===o:!1},enqueueSetState:function(o,l,d){o=o._reactInternals;var h=Pt(),g=Nr(o),k=Xn(h,g);k.payload=l,d!=null&&(k.callback=d),l=Tr(o,k,g),l!==null&&(_n(l,o,g,h),dl(l,o,g))},enqueueReplaceState:function(o,l,d){o=o._reactInternals;var h=Pt(),g=Nr(o),k=Xn(h,g);k.tag=1,k.payload=l,d!=null&&(k.callback=d),l=Tr(o,k,g),l!==null&&(_n(l,o,g,h),dl(l,o,g))},enqueueForceUpdate:function(o,l){o=o._reactInternals;var d=Pt(),h=Nr(o),g=Xn(d,h);g.tag=2,l!=null&&(g.callback=l),l=Tr(o,g,h),l!==null&&(_n(l,o,h,d),dl(l,o,h))}};function y1(o,l,d,h,g,k,C){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(h,k,C):l.prototype&&l.prototype.isPureReactComponent?!io(d,h)||!io(g,k):!0}function x1(o,l,d){var h=!1,g=Sr,k=l.contextType;return typeof k=="object"&&k!==null?k=an(k):(g=$t(l)?fi:At.current,h=l.contextTypes,k=(h=h!=null)?ns(o,g):Sr),l=new l(d,k),o.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=kl,o.stateNode=l,l._reactInternals=o,h&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=g,o.__reactInternalMemoizedMaskedChildContext=k),l}function k1(o,l,d,h){o=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(d,h),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(d,h),l.state!==o&&kl.enqueueReplaceState(l,l.state,null)}function Wd(o,l,d,h){var g=o.stateNode;g.props=d,g.state=o.memoizedState,g.refs={},Od(o);var k=l.contextType;typeof k=="object"&&k!==null?g.context=an(k):(k=$t(l)?fi:At.current,g.context=ns(o,k)),g.state=o.memoizedState,k=l.getDerivedStateFromProps,typeof k=="function"&&(qd(o,l,k,d),g.state=o.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(l=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),l!==g.state&&kl.enqueueReplaceState(g,g.state,null),fl(o,d,g,h),g.state=o.memoizedState),typeof g.componentDidMount=="function"&&(o.flags|=4194308)}function ds(o,l){try{var d="",h=l;do d+=Ae(h),h=h.return;while(h);var g=d}catch(k){g=`
39
- Error generating stack: `+k.message+`
40
- `+k.stack}return{value:o,source:l,stack:g,digest:null}}function Kd(o,l,d){return{value:o,source:null,stack:d??null,digest:l??null}}function Zd(o,l){try{console.error(l.value)}catch(d){setTimeout(function(){throw d})}}var kw=typeof WeakMap=="function"?WeakMap:Map;function b1(o,l,d){d=Xn(-1,d),d.tag=3,d.payload={element:null};var h=l.value;return d.callback=function(){_l||(_l=!0,cf=h),Zd(o,l)},d}function v1(o,l,d){d=Xn(-1,d),d.tag=3;var h=o.type.getDerivedStateFromError;if(typeof h=="function"){var g=l.value;d.payload=function(){return h(g)},d.callback=function(){Zd(o,l)}}var k=o.stateNode;return k!==null&&typeof k.componentDidCatch=="function"&&(d.callback=function(){Zd(o,l),typeof h!="function"&&(Mr===null?Mr=new Set([this]):Mr.add(this));var C=l.stack;this.componentDidCatch(l.value,{componentStack:C!==null?C:""})}),d}function w1(o,l,d){var h=o.pingCache;if(h===null){h=o.pingCache=new kw;var g=new Set;h.set(l,g)}else g=h.get(l),g===void 0&&(g=new Set,h.set(l,g));g.has(d)||(g.add(d),o=Rw.bind(null,o,l,d),l.then(o,o))}function C1(o){do{var l;if((l=o.tag===13)&&(l=o.memoizedState,l=l!==null?l.dehydrated!==null:!0),l)return o;o=o.return}while(o!==null);return null}function S1(o,l,d,h,g){return(o.mode&1)===0?(o===l?o.flags|=65536:(o.flags|=128,d.flags|=131072,d.flags&=-52805,d.tag===1&&(d.alternate===null?d.tag=17:(l=Xn(-1,1),l.tag=2,Tr(d,l,1))),d.lanes|=1),o):(o.flags|=65536,o.lanes=g,o)}var bw=I.ReactCurrentOwner,Vt=!1;function Lt(o,l,d,h){l.child=o===null?Um(l,null,d,h):us(l,o.child,d,h)}function E1(o,l,d,h,g){d=d.render;var k=l.ref;return as(l,g),h=jd(o,l,d,h,k,g),d=Bd(),o!==null&&!Vt?(l.updateQueue=o.updateQueue,l.flags&=-2053,o.lanes&=~g,er(o,l,g)):(Ze&&d&&wd(l),l.flags|=1,Lt(o,l,h,g),l.child)}function _1(o,l,d,h,g){if(o===null){var k=d.type;return typeof k=="function"&&!yf(k)&&k.defaultProps===void 0&&d.compare===null&&d.defaultProps===void 0?(l.tag=15,l.type=k,T1(o,l,k,h,g)):(o=Ol(d.type,null,h,l,l.mode,g),o.ref=l.ref,o.return=l,l.child=o)}if(k=o.child,(o.lanes&g)===0){var C=k.memoizedProps;if(d=d.compare,d=d!==null?d:io,d(C,h)&&o.ref===l.ref)return er(o,l,g)}return l.flags|=1,o=Rr(k,h),o.ref=l.ref,o.return=l,l.child=o}function T1(o,l,d,h,g){if(o!==null){var k=o.memoizedProps;if(io(k,h)&&o.ref===l.ref)if(Vt=!1,l.pendingProps=h=k,(o.lanes&g)!==0)(o.flags&131072)!==0&&(Vt=!0);else return l.lanes=o.lanes,er(o,l,g)}return Jd(o,l,d,h,g)}function A1(o,l,d){var h=l.pendingProps,g=h.children,k=o!==null?o.memoizedState:null;if(h.mode==="hidden")if((l.mode&1)===0)l.memoizedState={baseLanes:0,cachePool:null,transitions:null},je(hs,en),en|=d;else{if((d&1073741824)===0)return o=k!==null?k.baseLanes|d:d,l.lanes=l.childLanes=1073741824,l.memoizedState={baseLanes:o,cachePool:null,transitions:null},l.updateQueue=null,je(hs,en),en|=o,null;l.memoizedState={baseLanes:0,cachePool:null,transitions:null},h=k!==null?k.baseLanes:d,je(hs,en),en|=h}else k!==null?(h=k.baseLanes|d,l.memoizedState=null):h=d,je(hs,en),en|=h;return Lt(o,l,g,d),l.child}function M1(o,l){var d=l.ref;(o===null&&d!==null||o!==null&&o.ref!==d)&&(l.flags|=512,l.flags|=2097152)}function Jd(o,l,d,h,g){var k=$t(d)?fi:At.current;return k=ns(l,k),as(l,g),d=jd(o,l,d,h,k,g),h=Bd(),o!==null&&!Vt?(l.updateQueue=o.updateQueue,l.flags&=-2053,o.lanes&=~g,er(o,l,g)):(Ze&&h&&wd(l),l.flags|=1,Lt(o,l,d,g),l.child)}function D1(o,l,d,h,g){if($t(d)){var k=!0;rl(l)}else k=!1;if(as(l,g),l.stateNode===null)vl(o,l),x1(l,d,h),Wd(l,d,h,g),h=!0;else if(o===null){var C=l.stateNode,E=l.memoizedProps;C.props=E;var T=C.context,L=d.contextType;typeof L=="object"&&L!==null?L=an(L):(L=$t(d)?fi:At.current,L=ns(l,L));var V=d.getDerivedStateFromProps,H=typeof V=="function"||typeof C.getSnapshotBeforeUpdate=="function";H||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(E!==h||T!==L)&&k1(l,C,h,L),_r=!1;var B=l.memoizedState;C.state=B,fl(l,h,C,g),T=l.memoizedState,E!==h||B!==T||Bt.current||_r?(typeof V=="function"&&(qd(l,d,V,h),T=l.memoizedState),(E=_r||y1(l,d,E,h,B,T,L))?(H||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount()),typeof C.componentDidMount=="function"&&(l.flags|=4194308)):(typeof C.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=h,l.memoizedState=T),C.props=h,C.state=T,C.context=L,h=E):(typeof C.componentDidMount=="function"&&(l.flags|=4194308),h=!1)}else{C=l.stateNode,Wm(o,l),E=l.memoizedProps,L=l.type===l.elementType?E:Cn(l.type,E),C.props=L,H=l.pendingProps,B=C.context,T=d.contextType,typeof T=="object"&&T!==null?T=an(T):(T=$t(d)?fi:At.current,T=ns(l,T));var Z=d.getDerivedStateFromProps;(V=typeof Z=="function"||typeof C.getSnapshotBeforeUpdate=="function")||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(E!==H||B!==T)&&k1(l,C,h,T),_r=!1,B=l.memoizedState,C.state=B,fl(l,h,C,g);var ee=l.memoizedState;E!==H||B!==ee||Bt.current||_r?(typeof Z=="function"&&(qd(l,d,Z,h),ee=l.memoizedState),(L=_r||y1(l,d,L,h,B,ee,T)||!1)?(V||typeof C.UNSAFE_componentWillUpdate!="function"&&typeof C.componentWillUpdate!="function"||(typeof C.componentWillUpdate=="function"&&C.componentWillUpdate(h,ee,T),typeof C.UNSAFE_componentWillUpdate=="function"&&C.UNSAFE_componentWillUpdate(h,ee,T)),typeof C.componentDidUpdate=="function"&&(l.flags|=4),typeof C.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof C.componentDidUpdate!="function"||E===o.memoizedProps&&B===o.memoizedState||(l.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||E===o.memoizedProps&&B===o.memoizedState||(l.flags|=1024),l.memoizedProps=h,l.memoizedState=ee),C.props=h,C.state=ee,C.context=T,h=L):(typeof C.componentDidUpdate!="function"||E===o.memoizedProps&&B===o.memoizedState||(l.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||E===o.memoizedProps&&B===o.memoizedState||(l.flags|=1024),h=!1)}return Gd(o,l,d,h,k,g)}function Gd(o,l,d,h,g,k){M1(o,l);var C=(l.flags&128)!==0;if(!h&&!C)return g&&Lm(l,d,!1),er(o,l,k);h=l.stateNode,bw.current=l;var E=C&&typeof d.getDerivedStateFromError!="function"?null:h.render();return l.flags|=1,o!==null&&C?(l.child=us(l,o.child,null,k),l.child=us(l,null,E,k)):Lt(o,l,E,k),l.memoizedState=h.state,g&&Lm(l,d,!0),l.child}function N1(o){var l=o.stateNode;l.pendingContext?Rm(o,l.pendingContext,l.pendingContext!==l.context):l.context&&Rm(o,l.context,!1),Rd(o,l.containerInfo)}function O1(o,l,d,h,g){return ss(),_d(g),l.flags|=256,Lt(o,l,d,h),l.child}var Qd={dehydrated:null,treeContext:null,retryLane:0};function Yd(o){return{baseLanes:o,cachePool:null,transitions:null}}function R1(o,l,d){var h=l.pendingProps,g=Qe.current,k=!1,C=(l.flags&128)!==0,E;if((E=C)||(E=o!==null&&o.memoizedState===null?!1:(g&2)!==0),E?(k=!0,l.flags&=-129):(o===null||o.memoizedState!==null)&&(g|=1),je(Qe,g&1),o===null)return Ed(l),o=l.memoizedState,o!==null&&(o=o.dehydrated,o!==null)?((l.mode&1)===0?l.lanes=1:o.data==="$!"?l.lanes=8:l.lanes=1073741824,null):(C=h.children,o=h.fallback,k?(h=l.mode,k=l.child,C={mode:"hidden",children:C},(h&1)===0&&k!==null?(k.childLanes=0,k.pendingProps=C):k=Rl(C,h,0,null),o=wi(o,h,d,null),k.return=l,o.return=l,k.sibling=o,l.child=k,l.child.memoizedState=Yd(d),l.memoizedState=Qd,o):Xd(l,C));if(g=o.memoizedState,g!==null&&(E=g.dehydrated,E!==null))return vw(o,l,C,h,E,g,d);if(k){k=h.fallback,C=l.mode,g=o.child,E=g.sibling;var T={mode:"hidden",children:h.children};return(C&1)===0&&l.child!==g?(h=l.child,h.childLanes=0,h.pendingProps=T,l.deletions=null):(h=Rr(g,T),h.subtreeFlags=g.subtreeFlags&14680064),E!==null?k=Rr(E,k):(k=wi(k,C,d,null),k.flags|=2),k.return=l,h.return=l,h.sibling=k,l.child=h,h=k,k=l.child,C=o.child.memoizedState,C=C===null?Yd(d):{baseLanes:C.baseLanes|d,cachePool:null,transitions:C.transitions},k.memoizedState=C,k.childLanes=o.childLanes&~d,l.memoizedState=Qd,h}return k=o.child,o=k.sibling,h=Rr(k,{mode:"visible",children:h.children}),(l.mode&1)===0&&(h.lanes=d),h.return=l,h.sibling=null,o!==null&&(d=l.deletions,d===null?(l.deletions=[o],l.flags|=16):d.push(o)),l.child=h,l.memoizedState=null,h}function Xd(o,l){return l=Rl({mode:"visible",children:l},o.mode,0,null),l.return=o,o.child=l}function bl(o,l,d,h){return h!==null&&_d(h),us(l,o.child,null,d),o=Xd(l,l.pendingProps.children),o.flags|=2,l.memoizedState=null,o}function vw(o,l,d,h,g,k,C){if(d)return l.flags&256?(l.flags&=-257,h=Kd(Error(n(422))),bl(o,l,C,h)):l.memoizedState!==null?(l.child=o.child,l.flags|=128,null):(k=h.fallback,g=l.mode,h=Rl({mode:"visible",children:h.children},g,0,null),k=wi(k,g,C,null),k.flags|=2,h.return=l,k.return=l,h.sibling=k,l.child=h,(l.mode&1)!==0&&us(l,o.child,null,C),l.child.memoizedState=Yd(C),l.memoizedState=Qd,k);if((l.mode&1)===0)return bl(o,l,C,null);if(g.data==="$!"){if(h=g.nextSibling&&g.nextSibling.dataset,h)var E=h.dgst;return h=E,k=Error(n(419)),h=Kd(k,h,void 0),bl(o,l,C,h)}if(E=(C&o.childLanes)!==0,Vt||E){if(h=gt,h!==null){switch(C&-C){case 4:g=2;break;case 16:g=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:g=32;break;case 536870912:g=268435456;break;default:g=0}g=(g&(h.suspendedLanes|C))!==0?0:g,g!==0&&g!==k.retryLane&&(k.retryLane=g,Yn(o,g),_n(h,o,g,-1))}return gf(),h=Kd(Error(n(421))),bl(o,l,C,h)}return g.data==="$?"?(l.flags|=128,l.child=o.child,l=Iw.bind(null,o),g._reactRetry=l,null):(o=k.treeContext,Xt=wr(g.nextSibling),Yt=l,Ze=!0,wn=null,o!==null&&(un[ln++]=Gn,un[ln++]=Qn,un[ln++]=hi,Gn=o.id,Qn=o.overflow,hi=l),l=Xd(l,h.children),l.flags|=4096,l)}function I1(o,l,d){o.lanes|=l;var h=o.alternate;h!==null&&(h.lanes|=l),Dd(o.return,l,d)}function ef(o,l,d,h,g){var k=o.memoizedState;k===null?o.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:h,tail:d,tailMode:g}:(k.isBackwards=l,k.rendering=null,k.renderingStartTime=0,k.last=h,k.tail=d,k.tailMode=g)}function L1(o,l,d){var h=l.pendingProps,g=h.revealOrder,k=h.tail;if(Lt(o,l,h.children,d),h=Qe.current,(h&2)!==0)h=h&1|2,l.flags|=128;else{if(o!==null&&(o.flags&128)!==0)e:for(o=l.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&I1(o,d,l);else if(o.tag===19)I1(o,d,l);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===l)break e;for(;o.sibling===null;){if(o.return===null||o.return===l)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}h&=1}if(je(Qe,h),(l.mode&1)===0)l.memoizedState=null;else switch(g){case"forwards":for(d=l.child,g=null;d!==null;)o=d.alternate,o!==null&&hl(o)===null&&(g=d),d=d.sibling;d=g,d===null?(g=l.child,l.child=null):(g=d.sibling,d.sibling=null),ef(l,!1,g,d,k);break;case"backwards":for(d=null,g=l.child,l.child=null;g!==null;){if(o=g.alternate,o!==null&&hl(o)===null){l.child=g;break}o=g.sibling,g.sibling=d,d=g,g=o}ef(l,!0,d,null,k);break;case"together":ef(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function vl(o,l){(l.mode&1)===0&&o!==null&&(o.alternate=null,l.alternate=null,l.flags|=2)}function er(o,l,d){if(o!==null&&(l.dependencies=o.dependencies),xi|=l.lanes,(d&l.childLanes)===0)return null;if(o!==null&&l.child!==o.child)throw Error(n(153));if(l.child!==null){for(o=l.child,d=Rr(o,o.pendingProps),l.child=d,d.return=l;o.sibling!==null;)o=o.sibling,d=d.sibling=Rr(o,o.pendingProps),d.return=l;d.sibling=null}return l.child}function ww(o,l,d){switch(l.tag){case 3:N1(l),ss();break;case 5:Jm(l);break;case 1:$t(l.type)&&rl(l);break;case 4:Rd(l,l.stateNode.containerInfo);break;case 10:var h=l.type._context,g=l.memoizedProps.value;je(al,h._currentValue),h._currentValue=g;break;case 13:if(h=l.memoizedState,h!==null)return h.dehydrated!==null?(je(Qe,Qe.current&1),l.flags|=128,null):(d&l.child.childLanes)!==0?R1(o,l,d):(je(Qe,Qe.current&1),o=er(o,l,d),o!==null?o.sibling:null);je(Qe,Qe.current&1);break;case 19:if(h=(d&l.childLanes)!==0,(o.flags&128)!==0){if(h)return L1(o,l,d);l.flags|=128}if(g=l.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),je(Qe,Qe.current),h)break;return null;case 22:case 23:return l.lanes=0,A1(o,l,d)}return er(o,l,d)}var P1,tf,F1,z1;P1=function(o,l){for(var d=l.child;d!==null;){if(d.tag===5||d.tag===6)o.appendChild(d.stateNode);else if(d.tag!==4&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===l)break;for(;d.sibling===null;){if(d.return===null||d.return===l)return;d=d.return}d.sibling.return=d.return,d=d.sibling}},tf=function(){},F1=function(o,l,d,h){var g=o.memoizedProps;if(g!==h){o=l.stateNode,gi(Rn.current);var k=null;switch(d){case"input":g=Dc(o,g),h=Dc(o,h),k=[];break;case"select":g=X({},g,{value:void 0}),h=X({},h,{value:void 0}),k=[];break;case"textarea":g=Rc(o,g),h=Rc(o,h),k=[];break;default:typeof g.onClick!="function"&&typeof h.onClick=="function"&&(o.onclick=el)}Lc(d,h);var C;d=null;for(L in g)if(!h.hasOwnProperty(L)&&g.hasOwnProperty(L)&&g[L]!=null)if(L==="style"){var E=g[L];for(C in E)E.hasOwnProperty(C)&&(d||(d={}),d[C]="")}else L!=="dangerouslySetInnerHTML"&&L!=="children"&&L!=="suppressContentEditableWarning"&&L!=="suppressHydrationWarning"&&L!=="autoFocus"&&(i.hasOwnProperty(L)?k||(k=[]):(k=k||[]).push(L,null));for(L in h){var T=h[L];if(E=g!=null?g[L]:void 0,h.hasOwnProperty(L)&&T!==E&&(T!=null||E!=null))if(L==="style")if(E){for(C in E)!E.hasOwnProperty(C)||T&&T.hasOwnProperty(C)||(d||(d={}),d[C]="");for(C in T)T.hasOwnProperty(C)&&E[C]!==T[C]&&(d||(d={}),d[C]=T[C])}else d||(k||(k=[]),k.push(L,d)),d=T;else L==="dangerouslySetInnerHTML"?(T=T?T.__html:void 0,E=E?E.__html:void 0,T!=null&&E!==T&&(k=k||[]).push(L,T)):L==="children"?typeof T!="string"&&typeof T!="number"||(k=k||[]).push(L,""+T):L!=="suppressContentEditableWarning"&&L!=="suppressHydrationWarning"&&(i.hasOwnProperty(L)?(T!=null&&L==="onScroll"&&Ve("scroll",o),k||E===T||(k=[])):(k=k||[]).push(L,T))}d&&(k=k||[]).push("style",d);var L=k;(l.updateQueue=L)&&(l.flags|=4)}},z1=function(o,l,d,h){d!==h&&(l.flags|=4)};function bo(o,l){if(!Ze)switch(o.tailMode){case"hidden":l=o.tail;for(var d=null;l!==null;)l.alternate!==null&&(d=l),l=l.sibling;d===null?o.tail=null:d.sibling=null;break;case"collapsed":d=o.tail;for(var h=null;d!==null;)d.alternate!==null&&(h=d),d=d.sibling;h===null?l||o.tail===null?o.tail=null:o.tail.sibling=null:h.sibling=null}}function Dt(o){var l=o.alternate!==null&&o.alternate.child===o.child,d=0,h=0;if(l)for(var g=o.child;g!==null;)d|=g.lanes|g.childLanes,h|=g.subtreeFlags&14680064,h|=g.flags&14680064,g.return=o,g=g.sibling;else for(g=o.child;g!==null;)d|=g.lanes|g.childLanes,h|=g.subtreeFlags,h|=g.flags,g.return=o,g=g.sibling;return o.subtreeFlags|=h,o.childLanes=d,l}function Cw(o,l,d){var h=l.pendingProps;switch(Cd(l),l.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Dt(l),null;case 1:return $t(l.type)&&nl(),Dt(l),null;case 3:return h=l.stateNode,cs(),He(Bt),He(At),Pd(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(o===null||o.child===null)&&(ul(l)?l.flags|=4:o===null||o.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,wn!==null&&(hf(wn),wn=null))),tf(o,l),Dt(l),null;case 5:Id(l);var g=gi(mo.current);if(d=l.type,o!==null&&l.stateNode!=null)F1(o,l,d,h,g),o.ref!==l.ref&&(l.flags|=512,l.flags|=2097152);else{if(!h){if(l.stateNode===null)throw Error(n(166));return Dt(l),null}if(o=gi(Rn.current),ul(l)){h=l.stateNode,d=l.type;var k=l.memoizedProps;switch(h[On]=l,h[ao]=k,o=(l.mode&1)!==0,d){case"dialog":Ve("cancel",h),Ve("close",h);break;case"iframe":case"object":case"embed":Ve("load",h);break;case"video":case"audio":for(g=0;g<oo.length;g++)Ve(oo[g],h);break;case"source":Ve("error",h);break;case"img":case"image":case"link":Ve("error",h),Ve("load",h);break;case"details":Ve("toggle",h);break;case"input":x0(h,k),Ve("invalid",h);break;case"select":h._wrapperState={wasMultiple:!!k.multiple},Ve("invalid",h);break;case"textarea":v0(h,k),Ve("invalid",h)}Lc(d,k),g=null;for(var C in k)if(k.hasOwnProperty(C)){var E=k[C];C==="children"?typeof E=="string"?h.textContent!==E&&(k.suppressHydrationWarning!==!0&&Xu(h.textContent,E,o),g=["children",E]):typeof E=="number"&&h.textContent!==""+E&&(k.suppressHydrationWarning!==!0&&Xu(h.textContent,E,o),g=["children",""+E]):i.hasOwnProperty(C)&&E!=null&&C==="onScroll"&&Ve("scroll",h)}switch(d){case"input":Du(h),b0(h,k,!0);break;case"textarea":Du(h),C0(h);break;case"select":case"option":break;default:typeof k.onClick=="function"&&(h.onclick=el)}h=g,l.updateQueue=h,h!==null&&(l.flags|=4)}else{C=g.nodeType===9?g:g.ownerDocument,o==="http://www.w3.org/1999/xhtml"&&(o=S0(d)),o==="http://www.w3.org/1999/xhtml"?d==="script"?(o=C.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild)):typeof h.is=="string"?o=C.createElement(d,{is:h.is}):(o=C.createElement(d),d==="select"&&(C=o,h.multiple?C.multiple=!0:h.size&&(C.size=h.size))):o=C.createElementNS(o,d),o[On]=l,o[ao]=h,P1(o,l,!1,!1),l.stateNode=o;e:{switch(C=Pc(d,h),d){case"dialog":Ve("cancel",o),Ve("close",o),g=h;break;case"iframe":case"object":case"embed":Ve("load",o),g=h;break;case"video":case"audio":for(g=0;g<oo.length;g++)Ve(oo[g],o);g=h;break;case"source":Ve("error",o),g=h;break;case"img":case"image":case"link":Ve("error",o),Ve("load",o),g=h;break;case"details":Ve("toggle",o),g=h;break;case"input":x0(o,h),g=Dc(o,h),Ve("invalid",o);break;case"option":g=h;break;case"select":o._wrapperState={wasMultiple:!!h.multiple},g=X({},h,{value:void 0}),Ve("invalid",o);break;case"textarea":v0(o,h),g=Rc(o,h),Ve("invalid",o);break;default:g=h}Lc(d,g),E=g;for(k in E)if(E.hasOwnProperty(k)){var T=E[k];k==="style"?T0(o,T):k==="dangerouslySetInnerHTML"?(T=T?T.__html:void 0,T!=null&&E0(o,T)):k==="children"?typeof T=="string"?(d!=="textarea"||T!=="")&&$s(o,T):typeof T=="number"&&$s(o,""+T):k!=="suppressContentEditableWarning"&&k!=="suppressHydrationWarning"&&k!=="autoFocus"&&(i.hasOwnProperty(k)?T!=null&&k==="onScroll"&&Ve("scroll",o):T!=null&&R(o,k,T,C))}switch(d){case"input":Du(o),b0(o,h,!1);break;case"textarea":Du(o),C0(o);break;case"option":h.value!=null&&o.setAttribute("value",""+Ie(h.value));break;case"select":o.multiple=!!h.multiple,k=h.value,k!=null?Ui(o,!!h.multiple,k,!1):h.defaultValue!=null&&Ui(o,!!h.multiple,h.defaultValue,!0);break;default:typeof g.onClick=="function"&&(o.onclick=el)}switch(d){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}}h&&(l.flags|=4)}l.ref!==null&&(l.flags|=512,l.flags|=2097152)}return Dt(l),null;case 6:if(o&&l.stateNode!=null)z1(o,l,o.memoizedProps,h);else{if(typeof h!="string"&&l.stateNode===null)throw Error(n(166));if(d=gi(mo.current),gi(Rn.current),ul(l)){if(h=l.stateNode,d=l.memoizedProps,h[On]=l,(k=h.nodeValue!==d)&&(o=Yt,o!==null))switch(o.tag){case 3:Xu(h.nodeValue,d,(o.mode&1)!==0);break;case 5:o.memoizedProps.suppressHydrationWarning!==!0&&Xu(h.nodeValue,d,(o.mode&1)!==0)}k&&(l.flags|=4)}else h=(d.nodeType===9?d:d.ownerDocument).createTextNode(h),h[On]=l,l.stateNode=h}return Dt(l),null;case 13:if(He(Qe),h=l.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(Ze&&Xt!==null&&(l.mode&1)!==0&&(l.flags&128)===0)$m(),ss(),l.flags|=98560,k=!1;else if(k=ul(l),h!==null&&h.dehydrated!==null){if(o===null){if(!k)throw Error(n(318));if(k=l.memoizedState,k=k!==null?k.dehydrated:null,!k)throw Error(n(317));k[On]=l}else ss(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Dt(l),k=!1}else wn!==null&&(hf(wn),wn=null),k=!0;if(!k)return l.flags&65536?l:null}return(l.flags&128)!==0?(l.lanes=d,l):(h=h!==null,h!==(o!==null&&o.memoizedState!==null)&&h&&(l.child.flags|=8192,(l.mode&1)!==0&&(o===null||(Qe.current&1)!==0?ht===0&&(ht=3):gf())),l.updateQueue!==null&&(l.flags|=4),Dt(l),null);case 4:return cs(),tf(o,l),o===null&&uo(l.stateNode.containerInfo),Dt(l),null;case 10:return Md(l.type._context),Dt(l),null;case 17:return $t(l.type)&&nl(),Dt(l),null;case 19:if(He(Qe),k=l.memoizedState,k===null)return Dt(l),null;if(h=(l.flags&128)!==0,C=k.rendering,C===null)if(h)bo(k,!1);else{if(ht!==0||o!==null&&(o.flags&128)!==0)for(o=l.child;o!==null;){if(C=hl(o),C!==null){for(l.flags|=128,bo(k,!1),h=C.updateQueue,h!==null&&(l.updateQueue=h,l.flags|=4),l.subtreeFlags=0,h=d,d=l.child;d!==null;)k=d,o=h,k.flags&=14680066,C=k.alternate,C===null?(k.childLanes=0,k.lanes=o,k.child=null,k.subtreeFlags=0,k.memoizedProps=null,k.memoizedState=null,k.updateQueue=null,k.dependencies=null,k.stateNode=null):(k.childLanes=C.childLanes,k.lanes=C.lanes,k.child=C.child,k.subtreeFlags=0,k.deletions=null,k.memoizedProps=C.memoizedProps,k.memoizedState=C.memoizedState,k.updateQueue=C.updateQueue,k.type=C.type,o=C.dependencies,k.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),d=d.sibling;return je(Qe,Qe.current&1|2),l.child}o=o.sibling}k.tail!==null&&it()>ps&&(l.flags|=128,h=!0,bo(k,!1),l.lanes=4194304)}else{if(!h)if(o=hl(C),o!==null){if(l.flags|=128,h=!0,d=o.updateQueue,d!==null&&(l.updateQueue=d,l.flags|=4),bo(k,!0),k.tail===null&&k.tailMode==="hidden"&&!C.alternate&&!Ze)return Dt(l),null}else 2*it()-k.renderingStartTime>ps&&d!==1073741824&&(l.flags|=128,h=!0,bo(k,!1),l.lanes=4194304);k.isBackwards?(C.sibling=l.child,l.child=C):(d=k.last,d!==null?d.sibling=C:l.child=C,k.last=C)}return k.tail!==null?(l=k.tail,k.rendering=l,k.tail=l.sibling,k.renderingStartTime=it(),l.sibling=null,d=Qe.current,je(Qe,h?d&1|2:d&1),l):(Dt(l),null);case 22:case 23:return mf(),h=l.memoizedState!==null,o!==null&&o.memoizedState!==null!==h&&(l.flags|=8192),h&&(l.mode&1)!==0?(en&1073741824)!==0&&(Dt(l),l.subtreeFlags&6&&(l.flags|=8192)):Dt(l),null;case 24:return null;case 25:return null}throw Error(n(156,l.tag))}function Sw(o,l){switch(Cd(l),l.tag){case 1:return $t(l.type)&&nl(),o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 3:return cs(),He(Bt),He(At),Pd(),o=l.flags,(o&65536)!==0&&(o&128)===0?(l.flags=o&-65537|128,l):null;case 5:return Id(l),null;case 13:if(He(Qe),o=l.memoizedState,o!==null&&o.dehydrated!==null){if(l.alternate===null)throw Error(n(340));ss()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 19:return He(Qe),null;case 4:return cs(),null;case 10:return Md(l.type._context),null;case 22:case 23:return mf(),null;case 24:return null;default:return null}}var wl=!1,Nt=!1,Ew=typeof WeakSet=="function"?WeakSet:Set,Y=null;function fs(o,l){var d=o.ref;if(d!==null)if(typeof d=="function")try{d(null)}catch(h){et(o,l,h)}else d.current=null}function nf(o,l,d){try{d()}catch(h){et(o,l,h)}}var j1=!1;function _w(o,l){if(pd=Vu,o=ym(),od(o)){if("selectionStart"in o)var d={start:o.selectionStart,end:o.selectionEnd};else e:{d=(d=o.ownerDocument)&&d.defaultView||window;var h=d.getSelection&&d.getSelection();if(h&&h.rangeCount!==0){d=h.anchorNode;var g=h.anchorOffset,k=h.focusNode;h=h.focusOffset;try{d.nodeType,k.nodeType}catch{d=null;break e}var C=0,E=-1,T=-1,L=0,V=0,H=o,B=null;t:for(;;){for(var Z;H!==d||g!==0&&H.nodeType!==3||(E=C+g),H!==k||h!==0&&H.nodeType!==3||(T=C+h),H.nodeType===3&&(C+=H.nodeValue.length),(Z=H.firstChild)!==null;)B=H,H=Z;for(;;){if(H===o)break t;if(B===d&&++L===g&&(E=C),B===k&&++V===h&&(T=C),(Z=H.nextSibling)!==null)break;H=B,B=H.parentNode}H=Z}d=E===-1||T===-1?null:{start:E,end:T}}else d=null}d=d||{start:0,end:0}}else d=null;for(md={focusedElem:o,selectionRange:d},Vu=!1,Y=l;Y!==null;)if(l=Y,o=l.child,(l.subtreeFlags&1028)!==0&&o!==null)o.return=l,Y=o;else for(;Y!==null;){l=Y;try{var ee=l.alternate;if((l.flags&1024)!==0)switch(l.tag){case 0:case 11:case 15:break;case 1:if(ee!==null){var te=ee.memoizedProps,st=ee.memoizedState,N=l.stateNode,M=N.getSnapshotBeforeUpdate(l.elementType===l.type?te:Cn(l.type,te),st);N.__reactInternalSnapshotBeforeUpdate=M}break;case 3:var O=l.stateNode.containerInfo;O.nodeType===1?O.textContent="":O.nodeType===9&&O.documentElement&&O.removeChild(O.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(W){et(l,l.return,W)}if(o=l.sibling,o!==null){o.return=l.return,Y=o;break}Y=l.return}return ee=j1,j1=!1,ee}function vo(o,l,d){var h=l.updateQueue;if(h=h!==null?h.lastEffect:null,h!==null){var g=h=h.next;do{if((g.tag&o)===o){var k=g.destroy;g.destroy=void 0,k!==void 0&&nf(l,d,k)}g=g.next}while(g!==h)}}function Cl(o,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var d=l=l.next;do{if((d.tag&o)===o){var h=d.create;d.destroy=h()}d=d.next}while(d!==l)}}function rf(o){var l=o.ref;if(l!==null){var d=o.stateNode;switch(o.tag){case 5:o=d;break;default:o=d}typeof l=="function"?l(o):l.current=o}}function B1(o){var l=o.alternate;l!==null&&(o.alternate=null,B1(l)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(l=o.stateNode,l!==null&&(delete l[On],delete l[ao],delete l[kd],delete l[lw],delete l[aw])),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}function $1(o){return o.tag===5||o.tag===3||o.tag===4}function V1(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||$1(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function sf(o,l,d){var h=o.tag;if(h===5||h===6)o=o.stateNode,l?d.nodeType===8?d.parentNode.insertBefore(o,l):d.insertBefore(o,l):(d.nodeType===8?(l=d.parentNode,l.insertBefore(o,d)):(l=d,l.appendChild(o)),d=d._reactRootContainer,d!=null||l.onclick!==null||(l.onclick=el));else if(h!==4&&(o=o.child,o!==null))for(sf(o,l,d),o=o.sibling;o!==null;)sf(o,l,d),o=o.sibling}function of(o,l,d){var h=o.tag;if(h===5||h===6)o=o.stateNode,l?d.insertBefore(o,l):d.appendChild(o);else if(h!==4&&(o=o.child,o!==null))for(of(o,l,d),o=o.sibling;o!==null;)of(o,l,d),o=o.sibling}var wt=null,Sn=!1;function Ar(o,l,d){for(d=d.child;d!==null;)H1(o,l,d),d=d.sibling}function H1(o,l,d){if(Nn&&typeof Nn.onCommitFiberUnmount=="function")try{Nn.onCommitFiberUnmount(Pu,d)}catch{}switch(d.tag){case 5:Nt||fs(d,l);case 6:var h=wt,g=Sn;wt=null,Ar(o,l,d),wt=h,Sn=g,wt!==null&&(Sn?(o=wt,d=d.stateNode,o.nodeType===8?o.parentNode.removeChild(d):o.removeChild(d)):wt.removeChild(d.stateNode));break;case 18:wt!==null&&(Sn?(o=wt,d=d.stateNode,o.nodeType===8?xd(o.parentNode,d):o.nodeType===1&&xd(o,d),Ys(o)):xd(wt,d.stateNode));break;case 4:h=wt,g=Sn,wt=d.stateNode.containerInfo,Sn=!0,Ar(o,l,d),wt=h,Sn=g;break;case 0:case 11:case 14:case 15:if(!Nt&&(h=d.updateQueue,h!==null&&(h=h.lastEffect,h!==null))){g=h=h.next;do{var k=g,C=k.destroy;k=k.tag,C!==void 0&&((k&2)!==0||(k&4)!==0)&&nf(d,l,C),g=g.next}while(g!==h)}Ar(o,l,d);break;case 1:if(!Nt&&(fs(d,l),h=d.stateNode,typeof h.componentWillUnmount=="function"))try{h.props=d.memoizedProps,h.state=d.memoizedState,h.componentWillUnmount()}catch(E){et(d,l,E)}Ar(o,l,d);break;case 21:Ar(o,l,d);break;case 22:d.mode&1?(Nt=(h=Nt)||d.memoizedState!==null,Ar(o,l,d),Nt=h):Ar(o,l,d);break;default:Ar(o,l,d)}}function U1(o){var l=o.updateQueue;if(l!==null){o.updateQueue=null;var d=o.stateNode;d===null&&(d=o.stateNode=new Ew),l.forEach(function(h){var g=Lw.bind(null,o,h);d.has(h)||(d.add(h),h.then(g,g))})}}function En(o,l){var d=l.deletions;if(d!==null)for(var h=0;h<d.length;h++){var g=d[h];try{var k=o,C=l,E=C;e:for(;E!==null;){switch(E.tag){case 5:wt=E.stateNode,Sn=!1;break e;case 3:wt=E.stateNode.containerInfo,Sn=!0;break e;case 4:wt=E.stateNode.containerInfo,Sn=!0;break e}E=E.return}if(wt===null)throw Error(n(160));H1(k,C,g),wt=null,Sn=!1;var T=g.alternate;T!==null&&(T.return=null),g.return=null}catch(L){et(g,l,L)}}if(l.subtreeFlags&12854)for(l=l.child;l!==null;)q1(l,o),l=l.sibling}function q1(o,l){var d=o.alternate,h=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:if(En(l,o),Ln(o),h&4){try{vo(3,o,o.return),Cl(3,o)}catch(te){et(o,o.return,te)}try{vo(5,o,o.return)}catch(te){et(o,o.return,te)}}break;case 1:En(l,o),Ln(o),h&512&&d!==null&&fs(d,d.return);break;case 5:if(En(l,o),Ln(o),h&512&&d!==null&&fs(d,d.return),o.flags&32){var g=o.stateNode;try{$s(g,"")}catch(te){et(o,o.return,te)}}if(h&4&&(g=o.stateNode,g!=null)){var k=o.memoizedProps,C=d!==null?d.memoizedProps:k,E=o.type,T=o.updateQueue;if(o.updateQueue=null,T!==null)try{E==="input"&&k.type==="radio"&&k.name!=null&&k0(g,k),Pc(E,C);var L=Pc(E,k);for(C=0;C<T.length;C+=2){var V=T[C],H=T[C+1];V==="style"?T0(g,H):V==="dangerouslySetInnerHTML"?E0(g,H):V==="children"?$s(g,H):R(g,V,H,L)}switch(E){case"input":Nc(g,k);break;case"textarea":w0(g,k);break;case"select":var B=g._wrapperState.wasMultiple;g._wrapperState.wasMultiple=!!k.multiple;var Z=k.value;Z!=null?Ui(g,!!k.multiple,Z,!1):B!==!!k.multiple&&(k.defaultValue!=null?Ui(g,!!k.multiple,k.defaultValue,!0):Ui(g,!!k.multiple,k.multiple?[]:"",!1))}g[ao]=k}catch(te){et(o,o.return,te)}}break;case 6:if(En(l,o),Ln(o),h&4){if(o.stateNode===null)throw Error(n(162));g=o.stateNode,k=o.memoizedProps;try{g.nodeValue=k}catch(te){et(o,o.return,te)}}break;case 3:if(En(l,o),Ln(o),h&4&&d!==null&&d.memoizedState.isDehydrated)try{Ys(l.containerInfo)}catch(te){et(o,o.return,te)}break;case 4:En(l,o),Ln(o);break;case 13:En(l,o),Ln(o),g=o.child,g.flags&8192&&(k=g.memoizedState!==null,g.stateNode.isHidden=k,!k||g.alternate!==null&&g.alternate.memoizedState!==null||(af=it())),h&4&&U1(o);break;case 22:if(V=d!==null&&d.memoizedState!==null,o.mode&1?(Nt=(L=Nt)||V,En(l,o),Nt=L):En(l,o),Ln(o),h&8192){if(L=o.memoizedState!==null,(o.stateNode.isHidden=L)&&!V&&(o.mode&1)!==0)for(Y=o,V=o.child;V!==null;){for(H=Y=V;Y!==null;){switch(B=Y,Z=B.child,B.tag){case 0:case 11:case 14:case 15:vo(4,B,B.return);break;case 1:fs(B,B.return);var ee=B.stateNode;if(typeof ee.componentWillUnmount=="function"){h=B,d=B.return;try{l=h,ee.props=l.memoizedProps,ee.state=l.memoizedState,ee.componentWillUnmount()}catch(te){et(h,d,te)}}break;case 5:fs(B,B.return);break;case 22:if(B.memoizedState!==null){Z1(H);continue}}Z!==null?(Z.return=B,Y=Z):Z1(H)}V=V.sibling}e:for(V=null,H=o;;){if(H.tag===5){if(V===null){V=H;try{g=H.stateNode,L?(k=g.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none"):(E=H.stateNode,T=H.memoizedProps.style,C=T!=null&&T.hasOwnProperty("display")?T.display:null,E.style.display=_0("display",C))}catch(te){et(o,o.return,te)}}}else if(H.tag===6){if(V===null)try{H.stateNode.nodeValue=L?"":H.memoizedProps}catch(te){et(o,o.return,te)}}else if((H.tag!==22&&H.tag!==23||H.memoizedState===null||H===o)&&H.child!==null){H.child.return=H,H=H.child;continue}if(H===o)break e;for(;H.sibling===null;){if(H.return===null||H.return===o)break e;V===H&&(V=null),H=H.return}V===H&&(V=null),H.sibling.return=H.return,H=H.sibling}}break;case 19:En(l,o),Ln(o),h&4&&U1(o);break;case 21:break;default:En(l,o),Ln(o)}}function Ln(o){var l=o.flags;if(l&2){try{e:{for(var d=o.return;d!==null;){if($1(d)){var h=d;break e}d=d.return}throw Error(n(160))}switch(h.tag){case 5:var g=h.stateNode;h.flags&32&&($s(g,""),h.flags&=-33);var k=V1(o);of(o,k,g);break;case 3:case 4:var C=h.stateNode.containerInfo,E=V1(o);sf(o,E,C);break;default:throw Error(n(161))}}catch(T){et(o,o.return,T)}o.flags&=-3}l&4096&&(o.flags&=-4097)}function Tw(o,l,d){Y=o,W1(o)}function W1(o,l,d){for(var h=(o.mode&1)!==0;Y!==null;){var g=Y,k=g.child;if(g.tag===22&&h){var C=g.memoizedState!==null||wl;if(!C){var E=g.alternate,T=E!==null&&E.memoizedState!==null||Nt;E=wl;var L=Nt;if(wl=C,(Nt=T)&&!L)for(Y=g;Y!==null;)C=Y,T=C.child,C.tag===22&&C.memoizedState!==null?J1(g):T!==null?(T.return=C,Y=T):J1(g);for(;k!==null;)Y=k,W1(k),k=k.sibling;Y=g,wl=E,Nt=L}K1(o)}else(g.subtreeFlags&8772)!==0&&k!==null?(k.return=g,Y=k):K1(o)}}function K1(o){for(;Y!==null;){var l=Y;if((l.flags&8772)!==0){var d=l.alternate;try{if((l.flags&8772)!==0)switch(l.tag){case 0:case 11:case 15:Nt||Cl(5,l);break;case 1:var h=l.stateNode;if(l.flags&4&&!Nt)if(d===null)h.componentDidMount();else{var g=l.elementType===l.type?d.memoizedProps:Cn(l.type,d.memoizedProps);h.componentDidUpdate(g,d.memoizedState,h.__reactInternalSnapshotBeforeUpdate)}var k=l.updateQueue;k!==null&&Zm(l,k,h);break;case 3:var C=l.updateQueue;if(C!==null){if(d=null,l.child!==null)switch(l.child.tag){case 5:d=l.child.stateNode;break;case 1:d=l.child.stateNode}Zm(l,C,d)}break;case 5:var E=l.stateNode;if(d===null&&l.flags&4){d=E;var T=l.memoizedProps;switch(l.type){case"button":case"input":case"select":case"textarea":T.autoFocus&&d.focus();break;case"img":T.src&&(d.src=T.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(l.memoizedState===null){var L=l.alternate;if(L!==null){var V=L.memoizedState;if(V!==null){var H=V.dehydrated;H!==null&&Ys(H)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Nt||l.flags&512&&rf(l)}catch(B){et(l,l.return,B)}}if(l===o){Y=null;break}if(d=l.sibling,d!==null){d.return=l.return,Y=d;break}Y=l.return}}function Z1(o){for(;Y!==null;){var l=Y;if(l===o){Y=null;break}var d=l.sibling;if(d!==null){d.return=l.return,Y=d;break}Y=l.return}}function J1(o){for(;Y!==null;){var l=Y;try{switch(l.tag){case 0:case 11:case 15:var d=l.return;try{Cl(4,l)}catch(T){et(l,d,T)}break;case 1:var h=l.stateNode;if(typeof h.componentDidMount=="function"){var g=l.return;try{h.componentDidMount()}catch(T){et(l,g,T)}}var k=l.return;try{rf(l)}catch(T){et(l,k,T)}break;case 5:var C=l.return;try{rf(l)}catch(T){et(l,C,T)}}}catch(T){et(l,l.return,T)}if(l===o){Y=null;break}var E=l.sibling;if(E!==null){E.return=l.return,Y=E;break}Y=l.return}}var Aw=Math.ceil,Sl=I.ReactCurrentDispatcher,uf=I.ReactCurrentOwner,dn=I.ReactCurrentBatchConfig,Ee=0,gt=null,ot=null,Ct=0,en=0,hs=Cr(0),ht=0,wo=null,xi=0,El=0,lf=0,Co=null,Ht=null,af=0,ps=1/0,tr=null,_l=!1,cf=null,Mr=null,Tl=!1,Dr=null,Al=0,So=0,df=null,Ml=-1,Dl=0;function Pt(){return(Ee&6)!==0?it():Ml!==-1?Ml:Ml=it()}function Nr(o){return(o.mode&1)===0?1:(Ee&2)!==0&&Ct!==0?Ct&-Ct:dw.transition!==null?(Dl===0&&(Dl=V0()),Dl):(o=Le,o!==0||(o=window.event,o=o===void 0?16:Q0(o.type)),o)}function _n(o,l,d,h){if(50<So)throw So=0,df=null,Error(n(185));Ks(o,d,h),((Ee&2)===0||o!==gt)&&(o===gt&&((Ee&2)===0&&(El|=d),ht===4&&Or(o,Ct)),Ut(o,h),d===1&&Ee===0&&(l.mode&1)===0&&(ps=it()+500,il&&Er()))}function Ut(o,l){var d=o.callbackNode;d3(o,l);var h=ju(o,o===gt?Ct:0);if(h===0)d!==null&&j0(d),o.callbackNode=null,o.callbackPriority=0;else if(l=h&-h,o.callbackPriority!==l){if(d!=null&&j0(d),l===1)o.tag===0?cw(Q1.bind(null,o)):Pm(Q1.bind(null,o)),ow(function(){(Ee&6)===0&&Er()}),d=null;else{switch(H0(h)){case 1:d=Hc;break;case 4:d=B0;break;case 16:d=Lu;break;case 536870912:d=$0;break;default:d=Lu}d=sg(d,G1.bind(null,o))}o.callbackPriority=l,o.callbackNode=d}}function G1(o,l){if(Ml=-1,Dl=0,(Ee&6)!==0)throw Error(n(327));var d=o.callbackNode;if(ms()&&o.callbackNode!==d)return null;var h=ju(o,o===gt?Ct:0);if(h===0)return null;if((h&30)!==0||(h&o.expiredLanes)!==0||l)l=Nl(o,h);else{l=h;var g=Ee;Ee|=2;var k=X1();(gt!==o||Ct!==l)&&(tr=null,ps=it()+500,bi(o,l));do try{Nw();break}catch(E){Y1(o,E)}while(!0);Ad(),Sl.current=k,Ee=g,ot!==null?l=0:(gt=null,Ct=0,l=ht)}if(l!==0){if(l===2&&(g=Uc(o),g!==0&&(h=g,l=ff(o,g))),l===1)throw d=wo,bi(o,0),Or(o,h),Ut(o,it()),d;if(l===6)Or(o,h);else{if(g=o.current.alternate,(h&30)===0&&!Mw(g)&&(l=Nl(o,h),l===2&&(k=Uc(o),k!==0&&(h=k,l=ff(o,k))),l===1))throw d=wo,bi(o,0),Or(o,h),Ut(o,it()),d;switch(o.finishedWork=g,o.finishedLanes=h,l){case 0:case 1:throw Error(n(345));case 2:vi(o,Ht,tr);break;case 3:if(Or(o,h),(h&130023424)===h&&(l=af+500-it(),10<l)){if(ju(o,0)!==0)break;if(g=o.suspendedLanes,(g&h)!==h){Pt(),o.pingedLanes|=o.suspendedLanes&g;break}o.timeoutHandle=yd(vi.bind(null,o,Ht,tr),l);break}vi(o,Ht,tr);break;case 4:if(Or(o,h),(h&4194240)===h)break;for(l=o.eventTimes,g=-1;0<h;){var C=31-bn(h);k=1<<C,C=l[C],C>g&&(g=C),h&=~k}if(h=g,h=it()-h,h=(120>h?120:480>h?480:1080>h?1080:1920>h?1920:3e3>h?3e3:4320>h?4320:1960*Aw(h/1960))-h,10<h){o.timeoutHandle=yd(vi.bind(null,o,Ht,tr),h);break}vi(o,Ht,tr);break;case 5:vi(o,Ht,tr);break;default:throw Error(n(329))}}}return Ut(o,it()),o.callbackNode===d?G1.bind(null,o):null}function ff(o,l){var d=Co;return o.current.memoizedState.isDehydrated&&(bi(o,l).flags|=256),o=Nl(o,l),o!==2&&(l=Ht,Ht=d,l!==null&&hf(l)),o}function hf(o){Ht===null?Ht=o:Ht.push.apply(Ht,o)}function Mw(o){for(var l=o;;){if(l.flags&16384){var d=l.updateQueue;if(d!==null&&(d=d.stores,d!==null))for(var h=0;h<d.length;h++){var g=d[h],k=g.getSnapshot;g=g.value;try{if(!vn(k(),g))return!1}catch{return!1}}}if(d=l.child,l.subtreeFlags&16384&&d!==null)d.return=l,l=d;else{if(l===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function Or(o,l){for(l&=~lf,l&=~El,o.suspendedLanes|=l,o.pingedLanes&=~l,o=o.expirationTimes;0<l;){var d=31-bn(l),h=1<<d;o[d]=-1,l&=~h}}function Q1(o){if((Ee&6)!==0)throw Error(n(327));ms();var l=ju(o,0);if((l&1)===0)return Ut(o,it()),null;var d=Nl(o,l);if(o.tag!==0&&d===2){var h=Uc(o);h!==0&&(l=h,d=ff(o,h))}if(d===1)throw d=wo,bi(o,0),Or(o,l),Ut(o,it()),d;if(d===6)throw Error(n(345));return o.finishedWork=o.current.alternate,o.finishedLanes=l,vi(o,Ht,tr),Ut(o,it()),null}function pf(o,l){var d=Ee;Ee|=1;try{return o(l)}finally{Ee=d,Ee===0&&(ps=it()+500,il&&Er())}}function ki(o){Dr!==null&&Dr.tag===0&&(Ee&6)===0&&ms();var l=Ee;Ee|=1;var d=dn.transition,h=Le;try{if(dn.transition=null,Le=1,o)return o()}finally{Le=h,dn.transition=d,Ee=l,(Ee&6)===0&&Er()}}function mf(){en=hs.current,He(hs)}function bi(o,l){o.finishedWork=null,o.finishedLanes=0;var d=o.timeoutHandle;if(d!==-1&&(o.timeoutHandle=-1,sw(d)),ot!==null)for(d=ot.return;d!==null;){var h=d;switch(Cd(h),h.tag){case 1:h=h.type.childContextTypes,h!=null&&nl();break;case 3:cs(),He(Bt),He(At),Pd();break;case 5:Id(h);break;case 4:cs();break;case 13:He(Qe);break;case 19:He(Qe);break;case 10:Md(h.type._context);break;case 22:case 23:mf()}d=d.return}if(gt=o,ot=o=Rr(o.current,null),Ct=en=l,ht=0,wo=null,lf=El=xi=0,Ht=Co=null,mi!==null){for(l=0;l<mi.length;l++)if(d=mi[l],h=d.interleaved,h!==null){d.interleaved=null;var g=h.next,k=d.pending;if(k!==null){var C=k.next;k.next=g,h.next=C}d.pending=h}mi=null}return o}function Y1(o,l){do{var d=ot;try{if(Ad(),pl.current=xl,ml){for(var h=Ye.memoizedState;h!==null;){var g=h.queue;g!==null&&(g.pending=null),h=h.next}ml=!1}if(yi=0,mt=ft=Ye=null,go=!1,yo=0,uf.current=null,d===null||d.return===null){ht=1,wo=l,ot=null;break}e:{var k=o,C=d.return,E=d,T=l;if(l=Ct,E.flags|=32768,T!==null&&typeof T=="object"&&typeof T.then=="function"){var L=T,V=E,H=V.tag;if((V.mode&1)===0&&(H===0||H===11||H===15)){var B=V.alternate;B?(V.updateQueue=B.updateQueue,V.memoizedState=B.memoizedState,V.lanes=B.lanes):(V.updateQueue=null,V.memoizedState=null)}var Z=C1(C);if(Z!==null){Z.flags&=-257,S1(Z,C,E,k,l),Z.mode&1&&w1(k,L,l),l=Z,T=L;var ee=l.updateQueue;if(ee===null){var te=new Set;te.add(T),l.updateQueue=te}else ee.add(T);break e}else{if((l&1)===0){w1(k,L,l),gf();break e}T=Error(n(426))}}else if(Ze&&E.mode&1){var st=C1(C);if(st!==null){(st.flags&65536)===0&&(st.flags|=256),S1(st,C,E,k,l),_d(ds(T,E));break e}}k=T=ds(T,E),ht!==4&&(ht=2),Co===null?Co=[k]:Co.push(k),k=C;do{switch(k.tag){case 3:k.flags|=65536,l&=-l,k.lanes|=l;var N=b1(k,T,l);Km(k,N);break e;case 1:E=T;var M=k.type,O=k.stateNode;if((k.flags&128)===0&&(typeof M.getDerivedStateFromError=="function"||O!==null&&typeof O.componentDidCatch=="function"&&(Mr===null||!Mr.has(O)))){k.flags|=65536,l&=-l,k.lanes|=l;var W=v1(k,E,l);Km(k,W);break e}}k=k.return}while(k!==null)}tg(d)}catch(re){l=re,ot===d&&d!==null&&(ot=d=d.return);continue}break}while(!0)}function X1(){var o=Sl.current;return Sl.current=xl,o===null?xl:o}function gf(){(ht===0||ht===3||ht===2)&&(ht=4),gt===null||(xi&268435455)===0&&(El&268435455)===0||Or(gt,Ct)}function Nl(o,l){var d=Ee;Ee|=2;var h=X1();(gt!==o||Ct!==l)&&(tr=null,bi(o,l));do try{Dw();break}catch(g){Y1(o,g)}while(!0);if(Ad(),Ee=d,Sl.current=h,ot!==null)throw Error(n(261));return gt=null,Ct=0,ht}function Dw(){for(;ot!==null;)eg(ot)}function Nw(){for(;ot!==null&&!n3();)eg(ot)}function eg(o){var l=ig(o.alternate,o,en);o.memoizedProps=o.pendingProps,l===null?tg(o):ot=l,uf.current=null}function tg(o){var l=o;do{var d=l.alternate;if(o=l.return,(l.flags&32768)===0){if(d=Cw(d,l,en),d!==null){ot=d;return}}else{if(d=Sw(d,l),d!==null){d.flags&=32767,ot=d;return}if(o!==null)o.flags|=32768,o.subtreeFlags=0,o.deletions=null;else{ht=6,ot=null;return}}if(l=l.sibling,l!==null){ot=l;return}ot=l=o}while(l!==null);ht===0&&(ht=5)}function vi(o,l,d){var h=Le,g=dn.transition;try{dn.transition=null,Le=1,Ow(o,l,d,h)}finally{dn.transition=g,Le=h}return null}function Ow(o,l,d,h){do ms();while(Dr!==null);if((Ee&6)!==0)throw Error(n(327));d=o.finishedWork;var g=o.finishedLanes;if(d===null)return null;if(o.finishedWork=null,o.finishedLanes=0,d===o.current)throw Error(n(177));o.callbackNode=null,o.callbackPriority=0;var k=d.lanes|d.childLanes;if(f3(o,k),o===gt&&(ot=gt=null,Ct=0),(d.subtreeFlags&2064)===0&&(d.flags&2064)===0||Tl||(Tl=!0,sg(Lu,function(){return ms(),null})),k=(d.flags&15990)!==0,(d.subtreeFlags&15990)!==0||k){k=dn.transition,dn.transition=null;var C=Le;Le=1;var E=Ee;Ee|=4,uf.current=null,_w(o,d),q1(d,o),Y3(md),Vu=!!pd,md=pd=null,o.current=d,Tw(d),r3(),Ee=E,Le=C,dn.transition=k}else o.current=d;if(Tl&&(Tl=!1,Dr=o,Al=g),k=o.pendingLanes,k===0&&(Mr=null),o3(d.stateNode),Ut(o,it()),l!==null)for(h=o.onRecoverableError,d=0;d<l.length;d++)g=l[d],h(g.value,{componentStack:g.stack,digest:g.digest});if(_l)throw _l=!1,o=cf,cf=null,o;return(Al&1)!==0&&o.tag!==0&&ms(),k=o.pendingLanes,(k&1)!==0?o===df?So++:(So=0,df=o):So=0,Er(),null}function ms(){if(Dr!==null){var o=H0(Al),l=dn.transition,d=Le;try{if(dn.transition=null,Le=16>o?16:o,Dr===null)var h=!1;else{if(o=Dr,Dr=null,Al=0,(Ee&6)!==0)throw Error(n(331));var g=Ee;for(Ee|=4,Y=o.current;Y!==null;){var k=Y,C=k.child;if((Y.flags&16)!==0){var E=k.deletions;if(E!==null){for(var T=0;T<E.length;T++){var L=E[T];for(Y=L;Y!==null;){var V=Y;switch(V.tag){case 0:case 11:case 15:vo(8,V,k)}var H=V.child;if(H!==null)H.return=V,Y=H;else for(;Y!==null;){V=Y;var B=V.sibling,Z=V.return;if(B1(V),V===L){Y=null;break}if(B!==null){B.return=Z,Y=B;break}Y=Z}}}var ee=k.alternate;if(ee!==null){var te=ee.child;if(te!==null){ee.child=null;do{var st=te.sibling;te.sibling=null,te=st}while(te!==null)}}Y=k}}if((k.subtreeFlags&2064)!==0&&C!==null)C.return=k,Y=C;else e:for(;Y!==null;){if(k=Y,(k.flags&2048)!==0)switch(k.tag){case 0:case 11:case 15:vo(9,k,k.return)}var N=k.sibling;if(N!==null){N.return=k.return,Y=N;break e}Y=k.return}}var M=o.current;for(Y=M;Y!==null;){C=Y;var O=C.child;if((C.subtreeFlags&2064)!==0&&O!==null)O.return=C,Y=O;else e:for(C=M;Y!==null;){if(E=Y,(E.flags&2048)!==0)try{switch(E.tag){case 0:case 11:case 15:Cl(9,E)}}catch(re){et(E,E.return,re)}if(E===C){Y=null;break e}var W=E.sibling;if(W!==null){W.return=E.return,Y=W;break e}Y=E.return}}if(Ee=g,Er(),Nn&&typeof Nn.onPostCommitFiberRoot=="function")try{Nn.onPostCommitFiberRoot(Pu,o)}catch{}h=!0}return h}finally{Le=d,dn.transition=l}}return!1}function ng(o,l,d){l=ds(d,l),l=b1(o,l,1),o=Tr(o,l,1),l=Pt(),o!==null&&(Ks(o,1,l),Ut(o,l))}function et(o,l,d){if(o.tag===3)ng(o,o,d);else for(;l!==null;){if(l.tag===3){ng(l,o,d);break}else if(l.tag===1){var h=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(Mr===null||!Mr.has(h))){o=ds(d,o),o=v1(l,o,1),l=Tr(l,o,1),o=Pt(),l!==null&&(Ks(l,1,o),Ut(l,o));break}}l=l.return}}function Rw(o,l,d){var h=o.pingCache;h!==null&&h.delete(l),l=Pt(),o.pingedLanes|=o.suspendedLanes&d,gt===o&&(Ct&d)===d&&(ht===4||ht===3&&(Ct&130023424)===Ct&&500>it()-af?bi(o,0):lf|=d),Ut(o,l)}function rg(o,l){l===0&&((o.mode&1)===0?l=1:(l=zu,zu<<=1,(zu&130023424)===0&&(zu=4194304)));var d=Pt();o=Yn(o,l),o!==null&&(Ks(o,l,d),Ut(o,d))}function Iw(o){var l=o.memoizedState,d=0;l!==null&&(d=l.retryLane),rg(o,d)}function Lw(o,l){var d=0;switch(o.tag){case 13:var h=o.stateNode,g=o.memoizedState;g!==null&&(d=g.retryLane);break;case 19:h=o.stateNode;break;default:throw Error(n(314))}h!==null&&h.delete(l),rg(o,d)}var ig;ig=function(o,l,d){if(o!==null)if(o.memoizedProps!==l.pendingProps||Bt.current)Vt=!0;else{if((o.lanes&d)===0&&(l.flags&128)===0)return Vt=!1,ww(o,l,d);Vt=(o.flags&131072)!==0}else Vt=!1,Ze&&(l.flags&1048576)!==0&&Fm(l,ol,l.index);switch(l.lanes=0,l.tag){case 2:var h=l.type;vl(o,l),o=l.pendingProps;var g=ns(l,At.current);as(l,d),g=jd(null,l,h,o,g,d);var k=Bd();return l.flags|=1,typeof g=="object"&&g!==null&&typeof g.render=="function"&&g.$$typeof===void 0?(l.tag=1,l.memoizedState=null,l.updateQueue=null,$t(h)?(k=!0,rl(l)):k=!1,l.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,Od(l),g.updater=kl,l.stateNode=g,g._reactInternals=l,Wd(l,h,o,d),l=Gd(null,l,h,!0,k,d)):(l.tag=0,Ze&&k&&wd(l),Lt(null,l,g,d),l=l.child),l;case 16:h=l.elementType;e:{switch(vl(o,l),o=l.pendingProps,g=h._init,h=g(h._payload),l.type=h,g=l.tag=Fw(h),o=Cn(h,o),g){case 0:l=Jd(null,l,h,o,d);break e;case 1:l=D1(null,l,h,o,d);break e;case 11:l=E1(null,l,h,o,d);break e;case 14:l=_1(null,l,h,Cn(h.type,o),d);break e}throw Error(n(306,h,""))}return l;case 0:return h=l.type,g=l.pendingProps,g=l.elementType===h?g:Cn(h,g),Jd(o,l,h,g,d);case 1:return h=l.type,g=l.pendingProps,g=l.elementType===h?g:Cn(h,g),D1(o,l,h,g,d);case 3:e:{if(N1(l),o===null)throw Error(n(387));h=l.pendingProps,k=l.memoizedState,g=k.element,Wm(o,l),fl(l,h,null,d);var C=l.memoizedState;if(h=C.element,k.isDehydrated)if(k={element:h,isDehydrated:!1,cache:C.cache,pendingSuspenseBoundaries:C.pendingSuspenseBoundaries,transitions:C.transitions},l.updateQueue.baseState=k,l.memoizedState=k,l.flags&256){g=ds(Error(n(423)),l),l=O1(o,l,h,d,g);break e}else if(h!==g){g=ds(Error(n(424)),l),l=O1(o,l,h,d,g);break e}else for(Xt=wr(l.stateNode.containerInfo.firstChild),Yt=l,Ze=!0,wn=null,d=Um(l,null,h,d),l.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling;else{if(ss(),h===g){l=er(o,l,d);break e}Lt(o,l,h,d)}l=l.child}return l;case 5:return Jm(l),o===null&&Ed(l),h=l.type,g=l.pendingProps,k=o!==null?o.memoizedProps:null,C=g.children,gd(h,g)?C=null:k!==null&&gd(h,k)&&(l.flags|=32),M1(o,l),Lt(o,l,C,d),l.child;case 6:return o===null&&Ed(l),null;case 13:return R1(o,l,d);case 4:return Rd(l,l.stateNode.containerInfo),h=l.pendingProps,o===null?l.child=us(l,null,h,d):Lt(o,l,h,d),l.child;case 11:return h=l.type,g=l.pendingProps,g=l.elementType===h?g:Cn(h,g),E1(o,l,h,g,d);case 7:return Lt(o,l,l.pendingProps,d),l.child;case 8:return Lt(o,l,l.pendingProps.children,d),l.child;case 12:return Lt(o,l,l.pendingProps.children,d),l.child;case 10:e:{if(h=l.type._context,g=l.pendingProps,k=l.memoizedProps,C=g.value,je(al,h._currentValue),h._currentValue=C,k!==null)if(vn(k.value,C)){if(k.children===g.children&&!Bt.current){l=er(o,l,d);break e}}else for(k=l.child,k!==null&&(k.return=l);k!==null;){var E=k.dependencies;if(E!==null){C=k.child;for(var T=E.firstContext;T!==null;){if(T.context===h){if(k.tag===1){T=Xn(-1,d&-d),T.tag=2;var L=k.updateQueue;if(L!==null){L=L.shared;var V=L.pending;V===null?T.next=T:(T.next=V.next,V.next=T),L.pending=T}}k.lanes|=d,T=k.alternate,T!==null&&(T.lanes|=d),Dd(k.return,d,l),E.lanes|=d;break}T=T.next}}else if(k.tag===10)C=k.type===l.type?null:k.child;else if(k.tag===18){if(C=k.return,C===null)throw Error(n(341));C.lanes|=d,E=C.alternate,E!==null&&(E.lanes|=d),Dd(C,d,l),C=k.sibling}else C=k.child;if(C!==null)C.return=k;else for(C=k;C!==null;){if(C===l){C=null;break}if(k=C.sibling,k!==null){k.return=C.return,C=k;break}C=C.return}k=C}Lt(o,l,g.children,d),l=l.child}return l;case 9:return g=l.type,h=l.pendingProps.children,as(l,d),g=an(g),h=h(g),l.flags|=1,Lt(o,l,h,d),l.child;case 14:return h=l.type,g=Cn(h,l.pendingProps),g=Cn(h.type,g),_1(o,l,h,g,d);case 15:return T1(o,l,l.type,l.pendingProps,d);case 17:return h=l.type,g=l.pendingProps,g=l.elementType===h?g:Cn(h,g),vl(o,l),l.tag=1,$t(h)?(o=!0,rl(l)):o=!1,as(l,d),x1(l,h,g),Wd(l,h,g,d),Gd(null,l,h,!0,o,d);case 19:return L1(o,l,d);case 22:return A1(o,l,d)}throw Error(n(156,l.tag))};function sg(o,l){return z0(o,l)}function Pw(o,l,d,h){this.tag=o,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function fn(o,l,d,h){return new Pw(o,l,d,h)}function yf(o){return o=o.prototype,!(!o||!o.isReactComponent)}function Fw(o){if(typeof o=="function")return yf(o)?1:0;if(o!=null){if(o=o.$$typeof,o===Je)return 11;if(o===ye)return 14}return 2}function Rr(o,l){var d=o.alternate;return d===null?(d=fn(o.tag,l,o.key,o.mode),d.elementType=o.elementType,d.type=o.type,d.stateNode=o.stateNode,d.alternate=o,o.alternate=d):(d.pendingProps=l,d.type=o.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=o.flags&14680064,d.childLanes=o.childLanes,d.lanes=o.lanes,d.child=o.child,d.memoizedProps=o.memoizedProps,d.memoizedState=o.memoizedState,d.updateQueue=o.updateQueue,l=o.dependencies,d.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},d.sibling=o.sibling,d.index=o.index,d.ref=o.ref,d}function Ol(o,l,d,h,g,k){var C=2;if(h=o,typeof o=="function")yf(o)&&(C=1);else if(typeof o=="string")C=5;else e:switch(o){case z:return wi(d.children,g,k,l);case Q:C=8,g|=8;break;case ue:return o=fn(12,d,l,g|2),o.elementType=ue,o.lanes=k,o;case Te:return o=fn(13,d,l,g),o.elementType=Te,o.lanes=k,o;case Se:return o=fn(19,d,l,g),o.elementType=Se,o.lanes=k,o;case Xe:return Rl(d,g,k,l);default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case Ce:C=10;break e;case rt:C=9;break e;case Je:C=11;break e;case ye:C=14;break e;case Ge:C=16,h=null;break e}throw Error(n(130,o==null?o:typeof o,""))}return l=fn(C,d,l,g),l.elementType=o,l.type=h,l.lanes=k,l}function wi(o,l,d,h){return o=fn(7,o,h,l),o.lanes=d,o}function Rl(o,l,d,h){return o=fn(22,o,h,l),o.elementType=Xe,o.lanes=d,o.stateNode={isHidden:!1},o}function xf(o,l,d){return o=fn(6,o,null,l),o.lanes=d,o}function kf(o,l,d){return l=fn(4,o.children!==null?o.children:[],o.key,l),l.lanes=d,l.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},l}function zw(o,l,d,h,g){this.tag=l,this.containerInfo=o,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=qc(0),this.expirationTimes=qc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=qc(0),this.identifierPrefix=h,this.onRecoverableError=g,this.mutableSourceEagerHydrationData=null}function bf(o,l,d,h,g,k,C,E,T){return o=new zw(o,l,d,E,T),l===1?(l=1,k===!0&&(l|=8)):l=0,k=fn(3,null,null,l),o.current=k,k.stateNode=o,k.memoizedState={element:h,isDehydrated:d,cache:null,transitions:null,pendingSuspenseBoundaries:null},Od(k),o}function jw(o,l,d){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:F,key:h==null?null:""+h,children:o,containerInfo:l,implementation:d}}function og(o){if(!o)return Sr;o=o._reactInternals;e:{if(ci(o)!==o||o.tag!==1)throw Error(n(170));var l=o;do{switch(l.tag){case 3:l=l.stateNode.context;break e;case 1:if($t(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break e}}l=l.return}while(l!==null);throw Error(n(171))}if(o.tag===1){var d=o.type;if($t(d))return Im(o,d,l)}return l}function ug(o,l,d,h,g,k,C,E,T){return o=bf(d,h,!0,o,g,k,C,E,T),o.context=og(null),d=o.current,h=Pt(),g=Nr(d),k=Xn(h,g),k.callback=l??null,Tr(d,k,g),o.current.lanes=g,Ks(o,g,h),Ut(o,h),o}function Il(o,l,d,h){var g=l.current,k=Pt(),C=Nr(g);return d=og(d),l.context===null?l.context=d:l.pendingContext=d,l=Xn(k,C),l.payload={element:o},h=h===void 0?null:h,h!==null&&(l.callback=h),o=Tr(g,l,C),o!==null&&(_n(o,g,C,k),dl(o,g,C)),C}function Ll(o){if(o=o.current,!o.child)return null;switch(o.child.tag){case 5:return o.child.stateNode;default:return o.child.stateNode}}function lg(o,l){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var d=o.retryLane;o.retryLane=d!==0&&d<l?d:l}}function vf(o,l){lg(o,l),(o=o.alternate)&&lg(o,l)}function Bw(){return null}var ag=typeof reportError=="function"?reportError:function(o){console.error(o)};function wf(o){this._internalRoot=o}Pl.prototype.render=wf.prototype.render=function(o){var l=this._internalRoot;if(l===null)throw Error(n(409));Il(o,l,null,null)},Pl.prototype.unmount=wf.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var l=o.containerInfo;ki(function(){Il(null,o,null,null)}),l[Zn]=null}};function Pl(o){this._internalRoot=o}Pl.prototype.unstable_scheduleHydration=function(o){if(o){var l=W0();o={blockedOn:null,target:o,priority:l};for(var d=0;d<kr.length&&l!==0&&l<kr[d].priority;d++);kr.splice(d,0,o),d===0&&J0(o)}};function Cf(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function Fl(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11&&(o.nodeType!==8||o.nodeValue!==" react-mount-point-unstable "))}function cg(){}function $w(o,l,d,h,g){if(g){if(typeof h=="function"){var k=h;h=function(){var L=Ll(C);k.call(L)}}var C=ug(l,h,o,0,null,!1,!1,"",cg);return o._reactRootContainer=C,o[Zn]=C.current,uo(o.nodeType===8?o.parentNode:o),ki(),C}for(;g=o.lastChild;)o.removeChild(g);if(typeof h=="function"){var E=h;h=function(){var L=Ll(T);E.call(L)}}var T=bf(o,0,!1,null,null,!1,!1,"",cg);return o._reactRootContainer=T,o[Zn]=T.current,uo(o.nodeType===8?o.parentNode:o),ki(function(){Il(l,T,d,h)}),T}function zl(o,l,d,h,g){var k=d._reactRootContainer;if(k){var C=k;if(typeof g=="function"){var E=g;g=function(){var T=Ll(C);E.call(T)}}Il(l,C,o,g)}else C=$w(d,l,o,g,h);return Ll(C)}U0=function(o){switch(o.tag){case 3:var l=o.stateNode;if(l.current.memoizedState.isDehydrated){var d=Ws(l.pendingLanes);d!==0&&(Wc(l,d|1),Ut(l,it()),(Ee&6)===0&&(ps=it()+500,Er()))}break;case 13:ki(function(){var h=Yn(o,1);if(h!==null){var g=Pt();_n(h,o,1,g)}}),vf(o,1)}},Kc=function(o){if(o.tag===13){var l=Yn(o,134217728);if(l!==null){var d=Pt();_n(l,o,134217728,d)}vf(o,134217728)}},q0=function(o){if(o.tag===13){var l=Nr(o),d=Yn(o,l);if(d!==null){var h=Pt();_n(d,o,l,h)}vf(o,l)}},W0=function(){return Le},K0=function(o,l){var d=Le;try{return Le=o,l()}finally{Le=d}},jc=function(o,l,d){switch(l){case"input":if(Nc(o,d),l=d.name,d.type==="radio"&&l!=null){for(d=o;d.parentNode;)d=d.parentNode;for(d=d.querySelectorAll("input[name="+JSON.stringify(""+l)+'][type="radio"]'),l=0;l<d.length;l++){var h=d[l];if(h!==o&&h.form===o.form){var g=tl(h);if(!g)throw Error(n(90));y0(h),Nc(h,g)}}}break;case"textarea":w0(o,d);break;case"select":l=d.value,l!=null&&Ui(o,!!d.multiple,l,!1)}},N0=pf,O0=ki;var Vw={usingClientEntryPoint:!1,Events:[co,es,tl,M0,D0,pf]},Eo={findFiberByHostInstance:di,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Hw={bundleType:Eo.bundleType,version:Eo.version,rendererPackageName:Eo.rendererPackageName,rendererConfig:Eo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:I.ReactCurrentDispatcher,findHostInstanceByFiber:function(o){return o=P0(o),o===null?null:o.stateNode},findFiberByHostInstance:Eo.findFiberByHostInstance||Bw,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 jl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!jl.isDisabled&&jl.supportsFiber)try{Pu=jl.inject(Hw),Nn=jl}catch{}}return qt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Vw,qt.createPortal=function(o,l){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Cf(l))throw Error(n(200));return jw(o,l,null,d)},qt.createRoot=function(o,l){if(!Cf(o))throw Error(n(299));var d=!1,h="",g=ag;return l!=null&&(l.unstable_strictMode===!0&&(d=!0),l.identifierPrefix!==void 0&&(h=l.identifierPrefix),l.onRecoverableError!==void 0&&(g=l.onRecoverableError)),l=bf(o,1,!1,null,null,d,!1,h,g),o[Zn]=l.current,uo(o.nodeType===8?o.parentNode:o),new wf(l)},qt.findDOMNode=function(o){if(o==null)return null;if(o.nodeType===1)return o;var l=o._reactInternals;if(l===void 0)throw typeof o.render=="function"?Error(n(188)):(o=Object.keys(o).join(","),Error(n(268,o)));return o=P0(l),o=o===null?null:o.stateNode,o},qt.flushSync=function(o){return ki(o)},qt.hydrate=function(o,l,d){if(!Fl(l))throw Error(n(200));return zl(null,o,l,!0,d)},qt.hydrateRoot=function(o,l,d){if(!Cf(o))throw Error(n(405));var h=d!=null&&d.hydratedSources||null,g=!1,k="",C=ag;if(d!=null&&(d.unstable_strictMode===!0&&(g=!0),d.identifierPrefix!==void 0&&(k=d.identifierPrefix),d.onRecoverableError!==void 0&&(C=d.onRecoverableError)),l=ug(l,null,o,1,d??null,g,!1,k,C),o[Zn]=l.current,uo(o),h)for(o=0;o<h.length;o++)d=h[o],g=d._getVersion,g=g(d._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[d,g]:l.mutableSourceEagerHydrationData.push(d,g);return new Pl(l)},qt.render=function(o,l,d){if(!Fl(l))throw Error(n(200));return zl(null,o,l,!1,d)},qt.unmountComponentAtNode=function(o){if(!Fl(o))throw Error(n(40));return o._reactRootContainer?(ki(function(){zl(null,null,o,!1,function(){o._reactRootContainer=null,o[Zn]=null})}),!0):!1},qt.unstable_batchedUpdates=pf,qt.unstable_renderSubtreeIntoContainer=function(o,l,d,h){if(!Fl(d))throw Error(n(200));if(o==null||o._reactInternals===void 0)throw Error(n(38));return zl(o,l,d,!1,h)},qt.version="18.3.1-next-f1338f8080-20240426",qt}var xg;function U2(){if(xg)return _f.exports;xg=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),_f.exports=Gw(),_f.exports}var kg;function Qw(){if(kg)return Bl;kg=1;var t=U2();return Bl.createRoot=t.createRoot,Bl.hydrateRoot=t.hydrateRoot,Bl}var Yw=Qw(),Ne;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const s={};for(const u of i)s[u]=u;return s},t.getValidEnumValues=i=>{const s=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),u={};for(const a of s)u[a]=i[a];return t.objectValues(u)},t.objectValues=i=>t.objectKeys(i).map(function(s){return i[s]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const u in i)Object.prototype.hasOwnProperty.call(i,u)&&s.push(u);return s},t.find=(i,s)=>{for(const u of i)if(s(u))return u},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,s=" | "){return i.map(u=>typeof u=="string"?`'${u}'`:u).join(s)}t.joinValues=r,t.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(Ne||(Ne={}));var bg;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(bg||(bg={}));const ne=Ne.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Fr=t=>{switch(typeof t){case"undefined":return ne.undefined;case"string":return ne.string;case"number":return Number.isNaN(t)?ne.nan:ne.number;case"boolean":return ne.boolean;case"function":return ne.function;case"bigint":return ne.bigint;case"symbol":return ne.symbol;case"object":return Array.isArray(t)?ne.array:t===null?ne.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?ne.promise:typeof Map<"u"&&t instanceof Map?ne.map:typeof Set<"u"&&t instanceof Set?ne.set:typeof Date<"u"&&t instanceof Date?ne.date:ne.object;default:return ne.unknown}},U=Ne.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 pr extends Error{get errors(){return this.issues}constructor(e){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=e}format(e){const n=e||function(s){return s.message},r={_errors:[]},i=s=>{for(const u of s.issues)if(u.code==="invalid_union")u.unionErrors.map(i);else if(u.code==="invalid_return_type")i(u.returnTypeError);else if(u.code==="invalid_arguments")i(u.argumentsError);else if(u.path.length===0)r._errors.push(n(u));else{let a=r,c=0;for(;c<u.path.length;){const f=u.path[c];c===u.path.length-1?(a[f]=a[f]||{_errors:[]},a[f]._errors.push(n(u))):a[f]=a[f]||{_errors:[]},a=a[f],c++}}};return i(this),r}static assert(e){if(!(e instanceof pr))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ne.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const i of this.issues)if(i.path.length>0){const s=i.path[0];n[s]=n[s]||[],n[s].push(e(i))}else r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}pr.create=t=>new pr(t);const Ch=(t,e)=>{let n;switch(t.code){case U.invalid_type:t.received===ne.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case U.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Ne.jsonStringifyReplacer)}`;break;case U.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ne.joinValues(t.keys,", ")}`;break;case U.invalid_union:n="Invalid input";break;case U.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ne.joinValues(t.options)}`;break;case U.invalid_enum_value:n=`Invalid enum value. Expected ${Ne.joinValues(t.options)}, received '${t.received}'`;break;case U.invalid_arguments:n="Invalid function arguments";break;case U.invalid_return_type:n="Invalid function return type";break;case U.invalid_date:n="Invalid date";break;case U.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:Ne.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case U.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case U.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case U.custom:n="Invalid input";break;case U.invalid_intersection_types:n="Intersection results could not be merged";break;case U.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case U.not_finite:n="Number must be finite";break;default:n=e.defaultError,Ne.assertNever(t)}return{message:n}};let Xw=Ch;function eC(){return Xw}const tC=t=>{const{data:e,path:n,errorMaps:r,issueData:i}=t,s=[...n,...i.path||[]],u={...i,path:s};if(i.message!==void 0)return{...i,path:s,message:i.message};let a="";const c=r.filter(f=>!!f).slice().reverse();for(const f of c)a=f(u,{data:e,defaultError:a}).message;return{...i,path:s,message:a}};function J(t,e){const n=eC(),r=tC({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Ch?void 0:Ch].filter(i=>!!i)});t.common.issues.push(r)}class rn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const i of n){if(i.status==="aborted")return pe;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const i of n){const s=await i.key,u=await i.value;r.push({key:s,value:u})}return rn.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const i of n){const{key:s,value:u}=i;if(s.status==="aborted"||u.status==="aborted")return pe;s.status==="dirty"&&e.dirty(),u.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof u.value<"u"||i.alwaysSet)&&(r[s.value]=u.value)}return{status:e.value,value:r}}}const pe=Object.freeze({status:"aborted"}),Oo=t=>({status:"dirty",value:t}),kn=t=>({status:"valid",value:t}),vg=t=>t.status==="aborted",wg=t=>t.status==="dirty",Es=t=>t.status==="valid",ca=t=>typeof Promise<"u"&&t instanceof Promise;var ie;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(ie||(ie={}));class ei{constructor(e,n,r,i){this._cachedPath=[],this.parent=e,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 Cg=(t,e)=>{if(Es(e))return{success:!0,data:e.value};if(!t.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 pr(t.common.issues);return this._error=n,this._error}}};function ve(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:i}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(u,a)=>{const{message:c}=t;return u.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??r??a.defaultError}:u.code!=="invalid_type"?{message:a.defaultError}:{message:c??n??a.defaultError}},description:i}}class _e{get description(){return this._def.description}_getType(e){return Fr(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Fr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new rn,ctx:{common:e.parent.common,data:e.data,parsedType:Fr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(ca(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,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:e,parsedType:Fr(e)},i=this._parseSync({data:e,path:r.path,parent:r});return Cg(r,i)}"~validate"(e){var r,i;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Fr(e)};if(!this["~standard"].async)try{const s=this._parseSync({data:e,path:[],parent:n});return Es(s)?{value:s.value}:{issues:n.common.issues}}catch(s){(i=(r=s==null?void 0:s.message)==null?void 0:r.toLowerCase())!=null&&i.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(s=>Es(s)?{value:s.value}:{issues:n.common.issues})}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,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:e,parsedType:Fr(e)},i=this._parse({data:e,path:r.path,parent:r}),s=await(ca(i)?i:Promise.resolve(i));return Cg(r,s)}refine(e,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,s)=>{const u=e(i),a=()=>s.addIssue({code:U.custom,...r(i)});return typeof Promise<"u"&&u instanceof Promise?u.then(c=>c?!0:(a(),!1)):u?!0:(a(),!1)})}refinement(e,n){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(e){return new Ts({schema:this,typeName:me.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,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 Zr.create(this,this._def)}nullable(){return As.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Hn.create(this)}promise(){return pa.create(this,this._def)}or(e){return fa.create([this,e],this._def)}and(e){return ha.create(this,e,this._def)}transform(e){return new Ts({...ve(this._def),schema:this,typeName:me.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new Th({...ve(this._def),innerType:this,defaultValue:n,typeName:me.ZodDefault})}brand(){return new SC({typeName:me.ZodBranded,type:this,...ve(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Ah({...ve(this._def),innerType:this,catchValue:n,typeName:me.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return pp.create(this,e)}readonly(){return Mh.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const nC=/^c[^\s-]{8,}$/i,rC=/^[0-9a-z]+$/,iC=/^[0-9A-HJKMNP-TV-Z]{26}$/i,sC=/^[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,oC=/^[a-z0-9_-]{21}$/i,uC=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,lC=/^[-+]?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)?)??$/,aC=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,cC="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Mf;const dC=/^(?:(?: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])$/,fC=/^(?:(?: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])$/,hC=/^(([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]))$/,pC=/^(([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])$/,mC=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,gC=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,q2="((\\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])))",yC=new RegExp(`^${q2}$`);function W2(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function xC(t){return new RegExp(`^${W2(t)}$`)}function kC(t){let e=`${q2}T${W2(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function bC(t,e){return!!((e==="v4"||!e)&&dC.test(t)||(e==="v6"||!e)&&hC.test(t))}function vC(t,e){if(!uC.test(t))return!1;try{const[n]=t.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||e&&i.alg!==e)}catch{return!1}}function wC(t,e){return!!((e==="v4"||!e)&&fC.test(t)||(e==="v6"||!e)&&pC.test(t))}class Hr extends _e{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ne.string){const s=this._getOrReturnCtx(e);return J(s,{code:U.invalid_type,expected:ne.string,received:s.parsedType}),pe}const r=new rn;let i;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),J(i,{code:U.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),J(i,{code:U.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const u=e.data.length>s.value,a=e.data.length<s.value;(u||a)&&(i=this._getOrReturnCtx(e,i),u?J(i,{code:U.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&J(i,{code:U.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")aC.test(e.data)||(i=this._getOrReturnCtx(e,i),J(i,{validation:"email",code:U.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")Mf||(Mf=new RegExp(cC,"u")),Mf.test(e.data)||(i=this._getOrReturnCtx(e,i),J(i,{validation:"emoji",code:U.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")sC.test(e.data)||(i=this._getOrReturnCtx(e,i),J(i,{validation:"uuid",code:U.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")oC.test(e.data)||(i=this._getOrReturnCtx(e,i),J(i,{validation:"nanoid",code:U.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")nC.test(e.data)||(i=this._getOrReturnCtx(e,i),J(i,{validation:"cuid",code:U.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")rC.test(e.data)||(i=this._getOrReturnCtx(e,i),J(i,{validation:"cuid2",code:U.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")iC.test(e.data)||(i=this._getOrReturnCtx(e,i),J(i,{validation:"ulid",code:U.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),J(i,{validation:"url",code:U.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),J(i,{validation:"regex",code:U.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(e,i),J(i,{code:U.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(i=this._getOrReturnCtx(e,i),J(i,{code:U.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),J(i,{code:U.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?kC(s).test(e.data)||(i=this._getOrReturnCtx(e,i),J(i,{code:U.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?yC.test(e.data)||(i=this._getOrReturnCtx(e,i),J(i,{code:U.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?xC(s).test(e.data)||(i=this._getOrReturnCtx(e,i),J(i,{code:U.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?lC.test(e.data)||(i=this._getOrReturnCtx(e,i),J(i,{validation:"duration",code:U.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?bC(e.data,s.version)||(i=this._getOrReturnCtx(e,i),J(i,{validation:"ip",code:U.invalid_string,message:s.message}),r.dirty()):s.kind==="jwt"?vC(e.data,s.alg)||(i=this._getOrReturnCtx(e,i),J(i,{validation:"jwt",code:U.invalid_string,message:s.message}),r.dirty()):s.kind==="cidr"?wC(e.data,s.version)||(i=this._getOrReturnCtx(e,i),J(i,{validation:"cidr",code:U.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?mC.test(e.data)||(i=this._getOrReturnCtx(e,i),J(i,{validation:"base64",code:U.invalid_string,message:s.message}),r.dirty()):s.kind==="base64url"?gC.test(e.data)||(i=this._getOrReturnCtx(e,i),J(i,{validation:"base64url",code:U.invalid_string,message:s.message}),r.dirty()):Ne.assertNever(s);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(i=>e.test(i),{validation:n,code:U.invalid_string,...ie.errToObj(r)})}_addCheck(e){return new Hr({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ie.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ie.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ie.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ie.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...ie.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ie.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ie.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ie.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...ie.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...ie.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...ie.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ie.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...ie.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...ie.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...ie.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...ie.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...ie.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...ie.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...ie.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...ie.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...ie.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...ie.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...ie.errToObj(n)})}nonempty(e){return this.min(1,ie.errToObj(e))}trim(){return new Hr({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Hr({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Hr({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Hr.create=t=>new Hr({checks:[],typeName:me.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...ve(t)});function CC(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=n>r?n:r,s=Number.parseInt(t.toFixed(i).replace(".","")),u=Number.parseInt(e.toFixed(i).replace(".",""));return s%u/10**i}class Yo extends _e{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==ne.number){const s=this._getOrReturnCtx(e);return J(s,{code:U.invalid_type,expected:ne.number,received:s.parsedType}),pe}let r;const i=new rn;for(const s of this._def.checks)s.kind==="int"?Ne.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),J(r,{code:U.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),J(r,{code:U.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),J(r,{code:U.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?CC(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),J(r,{code:U.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),J(r,{code:U.not_finite,message:s.message}),i.dirty()):Ne.assertNever(s);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,ie.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ie.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ie.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ie.toString(n))}setLimit(e,n,r,i){return new Yo({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:ie.toString(i)}]})}_addCheck(e){return new Yo({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ie.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ie.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ie.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ie.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ie.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ie.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:ie.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ie.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ie.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Ne.isInteger(e.value))}get isFinite(){let e=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"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}Yo.create=t=>new Yo({checks:[],typeName:me.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...ve(t)});class Xo extends _e{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==ne.bigint)return this._getInvalidInput(e);let r;const i=new rn;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),J(r,{code:U.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),J(r,{code:U.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),J(r,{code:U.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):Ne.assertNever(s);return{status:i.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return J(n,{code:U.invalid_type,expected:ne.bigint,received:n.parsedType}),pe}gte(e,n){return this.setLimit("min",e,!0,ie.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ie.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ie.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ie.toString(n))}setLimit(e,n,r,i){return new Xo({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:ie.toString(i)}]})}_addCheck(e){return new Xo({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ie.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ie.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ie.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ie.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ie.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Xo.create=t=>new Xo({checks:[],typeName:me.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...ve(t)});class Sh extends _e{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ne.boolean){const r=this._getOrReturnCtx(e);return J(r,{code:U.invalid_type,expected:ne.boolean,received:r.parsedType}),pe}return kn(e.data)}}Sh.create=t=>new Sh({typeName:me.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...ve(t)});class da extends _e{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ne.date){const s=this._getOrReturnCtx(e);return J(s,{code:U.invalid_type,expected:ne.date,received:s.parsedType}),pe}if(Number.isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return J(s,{code:U.invalid_date}),pe}const r=new rn;let i;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),J(i,{code:U.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(i=this._getOrReturnCtx(e,i),J(i,{code:U.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):Ne.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new da({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:ie.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:ie.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}da.create=t=>new da({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:me.ZodDate,...ve(t)});class Sg extends _e{_parse(e){if(this._getType(e)!==ne.symbol){const r=this._getOrReturnCtx(e);return J(r,{code:U.invalid_type,expected:ne.symbol,received:r.parsedType}),pe}return kn(e.data)}}Sg.create=t=>new Sg({typeName:me.ZodSymbol,...ve(t)});class Eg extends _e{_parse(e){if(this._getType(e)!==ne.undefined){const r=this._getOrReturnCtx(e);return J(r,{code:U.invalid_type,expected:ne.undefined,received:r.parsedType}),pe}return kn(e.data)}}Eg.create=t=>new Eg({typeName:me.ZodUndefined,...ve(t)});class _g extends _e{_parse(e){if(this._getType(e)!==ne.null){const r=this._getOrReturnCtx(e);return J(r,{code:U.invalid_type,expected:ne.null,received:r.parsedType}),pe}return kn(e.data)}}_g.create=t=>new _g({typeName:me.ZodNull,...ve(t)});class Tg extends _e{constructor(){super(...arguments),this._any=!0}_parse(e){return kn(e.data)}}Tg.create=t=>new Tg({typeName:me.ZodAny,...ve(t)});class Ag extends _e{constructor(){super(...arguments),this._unknown=!0}_parse(e){return kn(e.data)}}Ag.create=t=>new Ag({typeName:me.ZodUnknown,...ve(t)});class ti extends _e{_parse(e){const n=this._getOrReturnCtx(e);return J(n,{code:U.invalid_type,expected:ne.never,received:n.parsedType}),pe}}ti.create=t=>new ti({typeName:me.ZodNever,...ve(t)});class Mg extends _e{_parse(e){if(this._getType(e)!==ne.undefined){const r=this._getOrReturnCtx(e);return J(r,{code:U.invalid_type,expected:ne.void,received:r.parsedType}),pe}return kn(e.data)}}Mg.create=t=>new Mg({typeName:me.ZodVoid,...ve(t)});class Hn extends _e{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),i=this._def;if(n.parsedType!==ne.array)return J(n,{code:U.invalid_type,expected:ne.array,received:n.parsedType}),pe;if(i.exactLength!==null){const u=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(u||a)&&(J(n,{code:u?U.too_big:U.too_small,minimum:a?i.exactLength.value:void 0,maximum:u?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&&(J(n,{code:U.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&&(J(n,{code:U.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((u,a)=>i.type._parseAsync(new ei(n,u,n.path,a)))).then(u=>rn.mergeArray(r,u));const s=[...n.data].map((u,a)=>i.type._parseSync(new ei(n,u,n.path,a)));return rn.mergeArray(r,s)}get element(){return this._def.type}min(e,n){return new Hn({...this._def,minLength:{value:e,message:ie.toString(n)}})}max(e,n){return new Hn({...this._def,maxLength:{value:e,message:ie.toString(n)}})}length(e,n){return new Hn({...this._def,exactLength:{value:e,message:ie.toString(n)}})}nonempty(e){return this.min(1,e)}}Hn.create=(t,e)=>new Hn({type:t,minLength:null,maxLength:null,exactLength:null,typeName:me.ZodArray,...ve(e)});function xs(t){if(t instanceof ut){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=Zr.create(xs(r))}return new ut({...t._def,shape:()=>e})}else return t instanceof Hn?new Hn({...t._def,type:xs(t.element)}):t instanceof Zr?Zr.create(xs(t.unwrap())):t instanceof As?As.create(xs(t.unwrap())):t instanceof Fi?Fi.create(t.items.map(e=>xs(e))):t}class ut extends _e{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=Ne.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==ne.object){const f=this._getOrReturnCtx(e);return J(f,{code:U.invalid_type,expected:ne.object,received:f.parsedType}),pe}const{status:r,ctx:i}=this._processInputParams(e),{shape:s,keys:u}=this._getCached(),a=[];if(!(this._def.catchall instanceof ti&&this._def.unknownKeys==="strip"))for(const f in i.data)u.includes(f)||a.push(f);const c=[];for(const f of u){const p=s[f],m=i.data[f];c.push({key:{status:"valid",value:f},value:p._parse(new ei(i,m,i.path,f)),alwaysSet:f in i.data})}if(this._def.catchall instanceof ti){const f=this._def.unknownKeys;if(f==="passthrough")for(const p of a)c.push({key:{status:"valid",value:p},value:{status:"valid",value:i.data[p]}});else if(f==="strict")a.length>0&&(J(i,{code:U.unrecognized_keys,keys:a}),r.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const p of a){const m=i.data[p];c.push({key:{status:"valid",value:p},value:f._parse(new ei(i,m,i.path,p)),alwaysSet:p in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const f=[];for(const p of c){const m=await p.key,y=await p.value;f.push({key:m,value:y,alwaysSet:p.alwaysSet})}return f}).then(f=>rn.mergeObjectSync(r,f)):rn.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(e){return ie.errToObj,new ut({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var s,u;const i=((u=(s=this._def).errorMap)==null?void 0:u.call(s,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:ie.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new ut({...this._def,unknownKeys:"strip"})}passthrough(){return new ut({...this._def,unknownKeys:"passthrough"})}extend(e){return new ut({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ut({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:me.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new ut({...this._def,catchall:e})}pick(e){const n={};for(const r of Ne.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new ut({...this._def,shape:()=>n})}omit(e){const n={};for(const r of Ne.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new ut({...this._def,shape:()=>n})}deepPartial(){return xs(this)}partial(e){const n={};for(const r of Ne.objectKeys(this.shape)){const i=this.shape[r];e&&!e[r]?n[r]=i:n[r]=i.optional()}return new ut({...this._def,shape:()=>n})}required(e){const n={};for(const r of Ne.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof Zr;)s=s._def.innerType;n[r]=s}return new ut({...this._def,shape:()=>n})}keyof(){return K2(Ne.objectKeys(this.shape))}}ut.create=(t,e)=>new ut({shape:()=>t,unknownKeys:"strip",catchall:ti.create(),typeName:me.ZodObject,...ve(e)});ut.strictCreate=(t,e)=>new ut({shape:()=>t,unknownKeys:"strict",catchall:ti.create(),typeName:me.ZodObject,...ve(e)});ut.lazycreate=(t,e)=>new ut({shape:t,unknownKeys:"strip",catchall:ti.create(),typeName:me.ZodObject,...ve(e)});class fa extends _e{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function i(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const u=s.map(a=>new pr(a.ctx.common.issues));return J(n,{code:U.invalid_union,unionErrors:u}),pe}if(n.common.async)return Promise.all(r.map(async s=>{const u={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:u}),ctx:u}})).then(i);{let s;const u=[];for(const c of r){const f={...n,common:{...n.common,issues:[]},parent:null},p=c._parseSync({data:n.data,path:n.path,parent:f});if(p.status==="valid")return p;p.status==="dirty"&&!s&&(s={result:p,ctx:f}),f.common.issues.length&&u.push(f.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const a=u.map(c=>new pr(c));return J(n,{code:U.invalid_union,unionErrors:a}),pe}}get options(){return this._def.options}}fa.create=(t,e)=>new fa({options:t,typeName:me.ZodUnion,...ve(e)});function Eh(t,e){const n=Fr(t),r=Fr(e);if(t===e)return{valid:!0,data:t};if(n===ne.object&&r===ne.object){const i=Ne.objectKeys(e),s=Ne.objectKeys(t).filter(a=>i.indexOf(a)!==-1),u={...t,...e};for(const a of s){const c=Eh(t[a],e[a]);if(!c.valid)return{valid:!1};u[a]=c.data}return{valid:!0,data:u}}else if(n===ne.array&&r===ne.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let s=0;s<t.length;s++){const u=t[s],a=e[s],c=Eh(u,a);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return n===ne.date&&r===ne.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class ha extends _e{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=(s,u)=>{if(vg(s)||vg(u))return pe;const a=Eh(s.value,u.value);return a.valid?((wg(s)||wg(u))&&n.dirty(),{status:n.value,value:a.data}):(J(r,{code:U.invalid_intersection_types}),pe)};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(([s,u])=>i(s,u)):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}))}}ha.create=(t,e,n)=>new ha({left:t,right:e,typeName:me.ZodIntersection,...ve(n)});class Fi extends _e{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ne.array)return J(r,{code:U.invalid_type,expected:ne.array,received:r.parsedType}),pe;if(r.data.length<this._def.items.length)return J(r,{code:U.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),pe;!this._def.rest&&r.data.length>this._def.items.length&&(J(r,{code:U.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...r.data].map((u,a)=>{const c=this._def.items[a]||this._def.rest;return c?c._parse(new ei(r,u,r.path,a)):null}).filter(u=>!!u);return r.common.async?Promise.all(s).then(u=>rn.mergeArray(n,u)):rn.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new Fi({...this._def,rest:e})}}Fi.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Fi({items:t,typeName:me.ZodTuple,rest:null,...ve(e)})};class Dg extends _e{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ne.map)return J(r,{code:U.invalid_type,expected:ne.map,received:r.parsedType}),pe;const i=this._def.keyType,s=this._def.valueType,u=[...r.data.entries()].map(([a,c],f)=>({key:i._parse(new ei(r,a,r.path,[f,"key"])),value:s._parse(new ei(r,c,r.path,[f,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const c of u){const f=await c.key,p=await c.value;if(f.status==="aborted"||p.status==="aborted")return pe;(f.status==="dirty"||p.status==="dirty")&&n.dirty(),a.set(f.value,p.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const c of u){const f=c.key,p=c.value;if(f.status==="aborted"||p.status==="aborted")return pe;(f.status==="dirty"||p.status==="dirty")&&n.dirty(),a.set(f.value,p.value)}return{status:n.value,value:a}}}}Dg.create=(t,e,n)=>new Dg({valueType:e,keyType:t,typeName:me.ZodMap,...ve(n)});class eu extends _e{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ne.set)return J(r,{code:U.invalid_type,expected:ne.set,received:r.parsedType}),pe;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(J(r,{code:U.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&&(J(r,{code:U.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const s=this._def.valueType;function u(c){const f=new Set;for(const p of c){if(p.status==="aborted")return pe;p.status==="dirty"&&n.dirty(),f.add(p.value)}return{status:n.value,value:f}}const a=[...r.data.values()].map((c,f)=>s._parse(new ei(r,c,r.path,f)));return r.common.async?Promise.all(a).then(c=>u(c)):u(a)}min(e,n){return new eu({...this._def,minSize:{value:e,message:ie.toString(n)}})}max(e,n){return new eu({...this._def,maxSize:{value:e,message:ie.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}eu.create=(t,e)=>new eu({valueType:t,minSize:null,maxSize:null,typeName:me.ZodSet,...ve(e)});class Ng extends _e{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Ng.create=(t,e)=>new Ng({getter:t,typeName:me.ZodLazy,...ve(e)});class _h extends _e{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return J(n,{received:n.data,code:U.invalid_literal,expected:this._def.value}),pe}return{status:"valid",value:e.data}}get value(){return this._def.value}}_h.create=(t,e)=>new _h({value:t,typeName:me.ZodLiteral,...ve(e)});function K2(t,e){return new _s({values:t,typeName:me.ZodEnum,...ve(e)})}class _s extends _e{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return J(n,{expected:Ne.joinValues(r),received:n.parsedType,code:U.invalid_type}),pe}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return J(n,{received:n.data,code:U.invalid_enum_value,options:r}),pe}return kn(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return _s.create(e,{...this._def,...n})}exclude(e,n=this._def){return _s.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}_s.create=K2;class Og extends _e{_parse(e){const n=Ne.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==ne.string&&r.parsedType!==ne.number){const i=Ne.objectValues(n);return J(r,{expected:Ne.joinValues(i),received:r.parsedType,code:U.invalid_type}),pe}if(this._cache||(this._cache=new Set(Ne.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const i=Ne.objectValues(n);return J(r,{received:r.data,code:U.invalid_enum_value,options:i}),pe}return kn(e.data)}get enum(){return this._def.values}}Og.create=(t,e)=>new Og({values:t,typeName:me.ZodNativeEnum,...ve(e)});class pa extends _e{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ne.promise&&n.common.async===!1)return J(n,{code:U.invalid_type,expected:ne.promise,received:n.parsedType}),pe;const r=n.parsedType===ne.promise?n.data:Promise.resolve(n.data);return kn(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}pa.create=(t,e)=>new pa({type:t,typeName:me.ZodPromise,...ve(e)});class Ts extends _e{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===me.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:u=>{J(r,u),u.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const u=i.transform(r.data,s);if(r.common.async)return Promise.resolve(u).then(async a=>{if(n.value==="aborted")return pe;const c=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return c.status==="aborted"?pe:c.status==="dirty"||n.value==="dirty"?Oo(c.value):c});{if(n.value==="aborted")return pe;const a=this._def.schema._parseSync({data:u,path:r.path,parent:r});return a.status==="aborted"?pe:a.status==="dirty"||n.value==="dirty"?Oo(a.value):a}}if(i.type==="refinement"){const u=a=>{const c=i.refinement(a,s);if(r.common.async)return Promise.resolve(c);if(c 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"?pe:(a.status==="dirty"&&n.dirty(),u(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"?pe:(a.status==="dirty"&&n.dirty(),u(a.value).then(()=>({status:n.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){const u=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Es(u))return pe;const a=i.transform(u.value,s);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(u=>Es(u)?Promise.resolve(i.transform(u.value,s)).then(a=>({status:n.value,value:a})):pe);Ne.assertNever(i)}}Ts.create=(t,e,n)=>new Ts({schema:t,typeName:me.ZodEffects,effect:e,...ve(n)});Ts.createWithPreprocess=(t,e,n)=>new Ts({schema:e,effect:{type:"preprocess",transform:t},typeName:me.ZodEffects,...ve(n)});class Zr extends _e{_parse(e){return this._getType(e)===ne.undefined?kn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Zr.create=(t,e)=>new Zr({innerType:t,typeName:me.ZodOptional,...ve(e)});class As extends _e{_parse(e){return this._getType(e)===ne.null?kn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}As.create=(t,e)=>new As({innerType:t,typeName:me.ZodNullable,...ve(e)});class Th extends _e{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===ne.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Th.create=(t,e)=>new Th({innerType:t,typeName:me.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ve(e)});class Ah extends _e{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return ca(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new pr(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new pr(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Ah.create=(t,e)=>new Ah({innerType:t,typeName:me.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ve(e)});class Rg extends _e{_parse(e){if(this._getType(e)!==ne.nan){const r=this._getOrReturnCtx(e);return J(r,{code:U.invalid_type,expected:ne.nan,received:r.parsedType}),pe}return{status:"valid",value:e.data}}}Rg.create=t=>new Rg({typeName:me.ZodNaN,...ve(t)});class SC extends _e{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class pp extends _e{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?pe:s.status==="dirty"?(n.dirty(),Oo(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?pe:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,n){return new pp({in:e,out:n,typeName:me.ZodPipeline})}}class Mh extends _e{_parse(e){const n=this._def.innerType._parse(e),r=i=>(Es(i)&&(i.value=Object.freeze(i.value)),i);return ca(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}Mh.create=(t,e)=>new Mh({innerType:t,typeName:me.ZodReadonly,...ve(e)});var me;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(me||(me={}));const Bn=Hr.create,EC=Sh.create;ti.create;const tu=Hn.create,lc=ut.create;fa.create;ha.create;Fi.create;const _C=_h.create,TC=_s.create;pa.create;Zr.create;As.create;var AC=["text","richtext","number","boolean","date","select","relation","image"],Z2=lc({key:Bn().min(1),label:Bn().optional(),type:TC(AC),required:EC().optional(),options:tu(Bn()).optional(),to:Bn().optional()}).superRefine((t,e)=>{t.type==="select"&&(!t.options||t.options.length===0)&&e.addIssue({code:U.custom,message:"select alanı options gerektirir"}),t.type==="relation"&&!t.to&&e.addIssue({code:U.custom,message:'relation alanı "to" gerektirir'})}),MC=lc({name:Bn().min(1),label:Bn().optional(),path:Bn().min(1),fields:tu(Z2)}),DC=lc({name:Bn().min(1),label:Bn().optional(),path:Bn().min(1),fields:tu(Z2)});lc({version:_C(1),collections:tu(MC),singletons:tu(DC)}).superRefine((t,e)=>{const n=new Set,r=new Set,i=new Set(t.collections.map(u=>u.name)),s=[...t.collections,...t.singletons];for(const u of s){n.has(u.name)&&e.addIssue({code:U.custom,message:`tekrar eden ad: ${u.name}`}),n.add(u.name),(u.path.includes("..")||u.path.startsWith("/")||u.path.includes("\\"))&&e.addIssue({code:U.custom,message:`güvensiz path: ${u.path}`}),r.has(u.path)&&e.addIssue({code:U.custom,message:`tekrar eden path: ${u.path}`}),r.add(u.path);const a=new Set;for(const c of u.fields)a.has(c.key)&&e.addIssue({code:U.custom,message:`tekrar eden field key: ${c.key}`}),a.add(c.key),c.type==="relation"&&c.to&&!i.has(c.to)&&e.addIssue({code:U.custom,message:`relation hedefi yok: ${c.to}`})}});var NC={ç:"c",ğ:"g",ı:"i",ö:"o",ş:"s",ü:"u",Ç:"c",Ğ:"g",İ:"i",Ö:"o",Ş:"s",Ü:"u",I:"i"};function mp(t){return t.replace(/[çğıöşüÇĞİÖŞÜI]/g,r=>NC[r]??r).toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"icerik"}function OC(t){return t==null||t===""}function RC(t,e){var n;switch(t.type){case"text":case"richtext":case"date":case"image":return typeof e=="string"?null:"metin bekleniyor";case"relation":return!Array.isArray(e)||e.some(r=>typeof r!="string")?"slug dizisi bekleniyor":null;case"number":return typeof e=="number"?null:"sayı bekleniyor";case"boolean":return typeof e=="boolean"?null:"boolean bekleniyor";case"select":return typeof e!="string"?"metin bekleniyor":(n=t.options)!=null&&n.includes(e)?null:"seçenek dışı değer"}}function J2(t,e){const n=[],r=new Set(t.map(i=>i.key));for(const i of t){const s=e[i.key];if(OC(s)){i.required&&n.push({key:i.key,level:"warning",message:"zorunlu alan boş"});continue}const u=RC(i,s);u&&n.push({key:i.key,level:"error",message:u})}for(const i of Object.keys(e))r.has(i)||n.push({key:i,level:"warning",message:"anahtar şemada yok"});return{ok:n.every(i=>i.level!=="error"),issues:n}}/**
41
- * @license lucide-react v1.27.0 - ISC
42
- *
43
- * This source code is licensed under the ISC license.
44
- * See the LICENSE file in the root directory of this source tree.
45
- */const G2=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/**
46
- * @license lucide-react v1.27.0 - ISC
47
- *
48
- * This source code is licensed under the ISC license.
49
- * See the LICENSE file in the root directory of this source tree.
50
- */const IC=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
51
- * @license lucide-react v1.27.0 - ISC
52
- *
53
- * This source code is licensed under the ISC license.
54
- * See the LICENSE file in the root directory of this source tree.
55
- */const LC=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
56
- * @license lucide-react v1.27.0 - ISC
57
- *
58
- * This source code is licensed under the ISC license.
59
- * See the LICENSE file in the root directory of this source tree.
60
- */const Ig=t=>{const e=LC(t);return e.charAt(0).toUpperCase()+e.slice(1)};/**
61
- * @license lucide-react v1.27.0 - ISC
62
- *
63
- * This source code is licensed under the ISC license.
64
- * See the LICENSE file in the root directory of this source tree.
65
- */var Df={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"};/**
66
- * @license lucide-react v1.27.0 - ISC
67
- *
68
- * This source code is licensed under the ISC license.
69
- * See the LICENSE file in the root directory of this source tree.
70
- */const PC=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1},FC=ce.createContext({}),zC=()=>ce.useContext(FC),jC=ce.forwardRef(({color:t,size:e,strokeWidth:n,absoluteStrokeWidth:r,className:i="",children:s,iconNode:u,...a},c)=>{const{size:f=24,strokeWidth:p=2,absoluteStrokeWidth:m=!1,color:y="currentColor",className:x=""}=zC()??{},b=r??m?Number(n??p)*24/Number(e??f):n??p;return ce.createElement("svg",{ref:c,...Df,width:e??f??Df.width,height:e??f??Df.height,stroke:t??y,strokeWidth:b,className:G2("lucide",x,i),...!s&&!PC(a)&&{"aria-hidden":"true"},...a},[...u.map(([v,w])=>ce.createElement(v,w)),...Array.isArray(s)?s:[s]])});/**
71
- * @license lucide-react v1.27.0 - ISC
72
- *
73
- * This source code is licensed under the ISC license.
74
- * See the LICENSE file in the root directory of this source tree.
75
- */const Fe=(t,e)=>{const n=ce.forwardRef(({className:r,...i},s)=>ce.createElement(jC,{ref:s,iconNode:e,className:G2(`lucide-${IC(Ig(t))}`,`lucide-${t}`,r),...i}));return n.displayName=Ig(t),n};/**
76
- * @license lucide-react v1.27.0 - ISC
77
- *
78
- * This source code is licensed under the ISC license.
79
- * See the LICENSE file in the root directory of this source tree.
80
- */const BC=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Q2=Fe("arrow-down",BC);/**
81
- * @license lucide-react v1.27.0 - ISC
82
- *
83
- * This source code is licensed under the ISC license.
84
- * See the LICENSE file in the root directory of this source tree.
85
- */const $C=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Y2=Fe("arrow-up",$C);/**
86
- * @license lucide-react v1.27.0 - ISC
87
- *
88
- * This source code is licensed under the ISC license.
89
- * See the LICENSE file in the root directory of this source tree.
90
- */const VC=[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]],HC=Fe("bold",VC);/**
91
- * @license lucide-react v1.27.0 - ISC
92
- *
93
- * This source code is licensed under the ISC license.
94
- * See the LICENSE file in the root directory of this source tree.
95
- */const UC=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],qC=Fe("calendar",UC);/**
96
- * @license lucide-react v1.27.0 - ISC
97
- *
98
- * This source code is licensed under the ISC license.
99
- * See the LICENSE file in the root directory of this source tree.
100
- */const WC=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],KC=Fe("check",WC);/**
101
- * @license lucide-react v1.27.0 - ISC
102
- *
103
- * This source code is licensed under the ISC license.
104
- * See the LICENSE file in the root directory of this source tree.
105
- */const ZC=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],JC=Fe("code",ZC);/**
106
- * @license lucide-react v1.27.0 - ISC
107
- *
108
- * This source code is licensed under the ISC license.
109
- * See the LICENSE file in the root directory of this source tree.
110
- */const GC=[["path",{d:"M15 8a1 1 0 0 1-1-1V2a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8z",key:"1ckgky"}],["path",{d:"M20 8v12a2 2 0 0 1-2 2h-4.182",key:"1726p0"}],["path",{d:"m3.305 19.53.923-.382",key:"ao1pio"}],["path",{d:"M4 10.592V4a2 2 0 0 1 2-2h8",key:"1foop0"}],["path",{d:"m4.228 16.852-.924-.383",key:"1fv9zy"}],["path",{d:"m5.852 15.228-.383-.923",key:"1a9hc2"}],["path",{d:"m5.852 20.772-.383.924",key:"1sh9ke"}],["path",{d:"m8.148 15.228.383-.923",key:"4yu6lf"}],["path",{d:"m8.53 21.696-.382-.924",key:"18b0s9"}],["path",{d:"m9.773 16.852.922-.383",key:"ti6xop"}],["path",{d:"m9.773 19.148.922.383",key:"rws47d"}],["circle",{cx:"7",cy:"18",r:"3",key:"lvkj7j"}]],QC=Fe("file-cog",GC);/**
111
- * @license lucide-react v1.27.0 - ISC
112
- *
113
- * This source code is licensed under the ISC license.
114
- * See the LICENSE file in the root directory of this source tree.
115
- */const YC=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],XC=Fe("file-text",YC);/**
116
- * @license lucide-react v1.27.0 - ISC
117
- *
118
- * This source code is licensed under the ISC license.
119
- * See the LICENSE file in the root directory of this source tree.
120
- */const e6=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],t6=Fe("hash",e6);/**
121
- * @license lucide-react v1.27.0 - ISC
122
- *
123
- * This source code is licensed under the ISC license.
124
- * See the LICENSE file in the root directory of this source tree.
125
- */const n6=[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]],r6=Fe("heading-2",n6);/**
126
- * @license lucide-react v1.27.0 - ISC
127
- *
128
- * This source code is licensed under the ISC license.
129
- * See the LICENSE file in the root directory of this source tree.
130
- */const i6=[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2",key:"68ncm8"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2",key:"1ejuhz"}]],s6=Fe("heading-3",i6);/**
131
- * @license lucide-react v1.27.0 - ISC
132
- *
133
- * This source code is licensed under the ISC license.
134
- * See the LICENSE file in the root directory of this source tree.
135
- */const o6=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],X2=Fe("image",o6);/**
136
- * @license lucide-react v1.27.0 - ISC
137
- *
138
- * This source code is licensed under the ISC license.
139
- * See the LICENSE file in the root directory of this source tree.
140
- */const u6=[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]],l6=Fe("italic",u6);/**
141
- * @license lucide-react v1.27.0 - ISC
142
- *
143
- * This source code is licensed under the ISC license.
144
- * See the LICENSE file in the root directory of this source tree.
145
- */const a6=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],c6=Fe("link-2",a6);/**
146
- * @license lucide-react v1.27.0 - ISC
147
- *
148
- * This source code is licensed under the ISC license.
149
- * See the LICENSE file in the root directory of this source tree.
150
- */const d6=[["path",{d:"M11 5h10",key:"1cz7ny"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 19h10",key:"11t30w"}],["path",{d:"M4 4h1v5",key:"10yrso"}],["path",{d:"M4 9h2",key:"r1h2o0"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",key:"xtkcd5"}]],f6=Fe("list-ordered",d6);/**
151
- * @license lucide-react v1.27.0 - ISC
152
- *
153
- * This source code is licensed under the ISC license.
154
- * See the LICENSE file in the root directory of this source tree.
155
- */const h6=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],ex=Fe("list",h6);/**
156
- * @license lucide-react v1.27.0 - ISC
157
- *
158
- * This source code is licensed under the ISC license.
159
- * See the LICENSE file in the root directory of this source tree.
160
- */const p6=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],gp=Fe("plus",p6);/**
161
- * @license lucide-react v1.27.0 - ISC
162
- *
163
- * This source code is licensed under the ISC license.
164
- * See the LICENSE file in the root directory of this source tree.
165
- */const m6=[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]],g6=Fe("quote",m6);/**
166
- * @license lucide-react v1.27.0 - ISC
167
- *
168
- * This source code is licensed under the ISC license.
169
- * See the LICENSE file in the root directory of this source tree.
170
- */const y6=[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]],x6=Fe("redo-2",y6);/**
171
- * @license lucide-react v1.27.0 - ISC
172
- *
173
- * This source code is licensed under the ISC license.
174
- * See the LICENSE file in the root directory of this source tree.
175
- */const k6=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],b6=Fe("search",k6);/**
176
- * @license lucide-react v1.27.0 - ISC
177
- *
178
- * This source code is licensed under the ISC license.
179
- * See the LICENSE file in the root directory of this source tree.
180
- */const v6=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],w6=Fe("settings-2",v6);/**
181
- * @license lucide-react v1.27.0 - ISC
182
- *
183
- * This source code is licensed under the ISC license.
184
- * See the LICENSE file in the root directory of this source tree.
185
- */const C6=[["circle",{cx:"9",cy:"12",r:"3",key:"u3jwor"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],S6=Fe("toggle-left",C6);/**
186
- * @license lucide-react v1.27.0 - ISC
187
- *
188
- * This source code is licensed under the ISC license.
189
- * See the LICENSE file in the root directory of this source tree.
190
- */const E6=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],tx=Fe("trash-2",E6);/**
191
- * @license lucide-react v1.27.0 - ISC
192
- *
193
- * This source code is licensed under the ISC license.
194
- * See the LICENSE file in the root directory of this source tree.
195
- */const _6=[["path",{d:"M12 4v16",key:"1654pz"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2",key:"e0r10z"}],["path",{d:"M9 20h6",key:"s66wpe"}]],T6=Fe("type",_6);/**
196
- * @license lucide-react v1.27.0 - ISC
197
- *
198
- * This source code is licensed under the ISC license.
199
- * See the LICENSE file in the root directory of this source tree.
200
- */const A6=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],M6=Fe("undo-2",A6);/**
201
- * @license lucide-react v1.27.0 - ISC
202
- *
203
- * This source code is licensed under the ISC license.
204
- * See the LICENSE file in the root directory of this source tree.
205
- */const D6=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],N6=Fe("upload",D6);/**
206
- * @license lucide-react v1.27.0 - ISC
207
- *
208
- * This source code is licensed under the ISC license.
209
- * See the LICENSE file in the root directory of this source tree.
210
- */const O6=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],nx=Fe("x",O6);var R6=U2();const I6=hp(R6);var Nf={exports:{}},Of={};/**
211
- * @license React
212
- * use-sync-external-store-shim.production.js
213
- *
214
- * Copyright (c) Meta Platforms, Inc. and affiliates.
215
- *
216
- * This source code is licensed under the MIT license found in the
217
- * LICENSE file in the root directory of this source tree.
218
- */var Lg;function L6(){if(Lg)return Of;Lg=1;var t=xu();function e(m,y){return m===y&&(m!==0||1/m===1/y)||m!==m&&y!==y}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,i=t.useEffect,s=t.useLayoutEffect,u=t.useDebugValue;function a(m,y){var x=y(),b=r({inst:{value:x,getSnapshot:y}}),v=b[0].inst,w=b[1];return s(function(){v.value=x,v.getSnapshot=y,c(v)&&w({inst:v})},[m,x,y]),i(function(){return c(v)&&w({inst:v}),m(function(){c(v)&&w({inst:v})})},[m]),u(x),x}function c(m){var y=m.getSnapshot;m=m.value;try{var x=y();return!n(m,x)}catch{return!0}}function f(m,y){return y()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:a;return Of.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:p,Of}var Pg;function rx(){return Pg||(Pg=1,Nf.exports=L6()),Nf.exports}var ix=rx();function St(t){this.content=t}St.prototype={constructor:St,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),s=r.content.slice();return i==-1?s.push(n||t,e):(s[i+1]=e,n&&(s[i]=n)),new St(s)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new St(n)},addToStart:function(t,e){return new St([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new St(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),s=r.find(t);return i.splice(s==-1?i.length:s,0,e,n),new St(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=St.from(t),t.size?new St(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=St.from(t),t.size?new St(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=St.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};St.from=function(t){if(t instanceof St)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new St(e)};function sx(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),s=e.child(r);if(i==s){n+=i.nodeSize;continue}if(!i.sameMarkup(s))return n;if(i.isText&&i.text!=s.text){let u=i.text,a=s.text,c=0;for(;u[c]==a[c];c++)n++;return c&&c<u.length&&c<a.length&&lx(u.charCodeAt(c-1))&&ux(u.charCodeAt(c))&&n--,n}if(i.content.size||s.content.size){let u=sx(i.content,s.content,n+1);if(u!=null)return u}n+=i.nodeSize}}function ox(t,e,n,r){for(let i=t.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:n,b:r};let u=t.child(--i),a=e.child(--s),c=u.nodeSize;if(u==a){n-=c,r-=c;continue}if(!u.sameMarkup(a))return{a:n,b:r};if(u.isText&&u.text!=a.text){let f=u.text,p=a.text,m=f.length,y=p.length;for(;m>0&&y>0&&f[m-1]==p[y-1];)m--,y--,n--,r--;return m&&y&&m<f.length&&lx(f.charCodeAt(m-1))&&ux(f.charCodeAt(m))&&(n++,r++),{a:n,b:r}}if(u.content.size||a.content.size){let f=ox(u.content,a.content,n-1,r-1);if(f)return f}n-=c,r-=c}}function ux(t){return t>=56320&&t<57344}function lx(t){return t>=55296&&t<56320}class j{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,i=0,s){for(let u=0,a=0;a<n;u++){let c=this.content[u],f=a+c.nodeSize;if(f>e&&r(c,i+a,s||null,u)!==!1&&c.content.size){let p=a+1;c.nodesBetween(Math.max(0,e-p),Math.min(c.content.size,n-p),r,i+p)}a=f}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let s="",u=!0;return this.nodesBetween(e,n,(a,c)=>{let f=a.isText?a.text.slice(Math.max(e,c)-c,n-c):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&f||a.isTextblock)&&r&&(u?u=!1:s+=r),s+=f},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new j(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let s=0,u=0;u<n;s++){let a=this.content[s],c=u+a.nodeSize;c>e&&((u<e||c>n)&&(a.isText?a=a.cut(Math.max(0,e-u),Math.min(a.text.length,n-u)):a=a.cut(Math.max(0,e-u-1),Math.min(a.content.size,n-u-1))),r.push(a),i+=a.nodeSize),u=c}return new j(r,i)}cutByIndex(e,n){return e==n?j.empty:e==0&&n==this.content.length?this:new j(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),s=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new j(i,s)}addToStart(e){return new j([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new j(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];e(i,r,n),r+=i.nodeSize}}findDiffStart(e,n=0){return sx(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return ox(this,e,n,r)}findIndex(e){if(e==0)return $l(0,e);if(e==this.size)return $l(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),s=r+i.nodeSize;if(s>=e)return s==e?$l(n+1,s):$l(n,r);r=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return j.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return j.fromArray(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return j.empty;let n,r=0;for(let i=0;i<e.length;i++){let s=e[i];r+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(n||(n=e.slice(0,i)),n[n.length-1]=s.withText(n[n.length-1].text+s.text)):n&&n.push(s)}return new j(n||e,r)}static from(e){if(!e)return j.empty;if(e instanceof j)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new j([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}j.empty=new j([],0);const Rf={index:0,offset:0};function $l(t,e){return Rf.index=t,Rf.offset=e,Rf}function ma(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!ma(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!ma(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let Re=class Dh{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))n||(n=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!r&&s.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(s)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&ma(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Dh.none;if(e instanceof Dh)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};Re.none=[];class nu extends Error{}class G{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=cx(this.content,e+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new G(r,this.openStart,this.openEnd)}removeBetween(e,n){return new G(ax(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return G.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 G(j.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)i++;return new G(e,r,i)}}G.empty=new G(j.empty,0,0);function ax(t,e,n){let{index:r,offset:i}=t.findIndex(e),s=t.maybeChild(r),{index:u,offset:a}=t.findIndex(n);if(i==e||s.isText){if(a!=n&&!t.child(u).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=u)throw new RangeError("Removing non-flat range");return t.replaceChild(r,s.copy(ax(s.content,e-i-1,n-i-1)))}function cx(t,e,n,r,i,s){let{index:u,offset:a}=t.findIndex(e),c=t.maybeChild(u);if(a==e||c.isText)return s&&r<=0&&i<=0&&!s.canReplace(u,u,n)?null:t.cut(0,e).append(n).append(t.cut(e));let f=cx(c.content,e-a-1,n,u==0?r-1:0,u==t.childCount-1?i-1:0,c);return f&&t.replaceChild(u,c.copy(f))}function P6(t,e,n){if(n.openStart>t.depth)throw new nu("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new nu("Inconsistent open depths");return dx(t,e,n,0)}function dx(t,e,n,r){let i=t.index(r),s=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let u=dx(t,e,n,r+1);return s.copy(s.content.replaceChild(i,u))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let u=t.parent,a=u.content;return Oi(u,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:u,end:a}=F6(n,t);return Oi(s,hx(t,u,a,e,r))}else return Oi(s,ga(t,e,r))}function fx(t,e){if(!e.type.compatibleContent(t.type))throw new nu("Cannot join "+e.type.name+" onto "+t.type.name)}function Nh(t,e,n){let r=t.node(n);return fx(r,e.node(n)),r}function Ni(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function jo(t,e,n,r){let i=(e||t).node(n),s=0,u=e?e.index(n):i.childCount;t&&(s=t.index(n),t.depth>n?s++:t.textOffset&&(Ni(t.nodeAfter,r),s++));for(let a=s;a<u;a++)Ni(i.child(a),r);e&&e.depth==n&&e.textOffset&&Ni(e.nodeBefore,r)}function Oi(t,e){if(!t.type.validContent(e))throw new nu("Invalid content for node "+t.type.name);return t.copy(e)}function hx(t,e,n,r,i){let s=t.depth>i&&Nh(t,e,i+1),u=r.depth>i&&Nh(n,r,i+1),a=[];return jo(null,t,i,a),s&&u&&e.index(i)==n.index(i)?(fx(s,u),Ni(Oi(s,hx(t,e,n,r,i+1)),a)):(s&&Ni(Oi(s,ga(t,e,i+1)),a),jo(e,n,i,a),u&&Ni(Oi(u,ga(n,r,i+1)),a)),jo(r,null,i,a),new j(a)}function ga(t,e,n){let r=[];if(jo(null,t,n,r),t.depth>n){let i=Nh(t,e,n+1);Ni(Oi(i,ga(t,e,n+1)),r)}return jo(e,null,n,r),new j(r)}function F6(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let s=n-1;s>=0;s--)i=e.node(s).copy(j.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class ru{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let s=0;s<e;s++)i+=r.child(s).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return Re.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let a=r;r=i,i=a}let s=r.marks;for(var u=0;u<s.length;u++)s[u].type.spec.inclusive===!1&&(!i||!s[u].isInSet(i.marks))&&(s=s[u--].removeFromSet(s));return s}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var s=0;s<r.length;s++)r[s].type.spec.inclusive===!1&&(!i||!r[s].isInSet(i.marks))&&(r=r[s--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new ya(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,s=n;for(let u=e;;){let{index:a,offset:c}=u.content.findIndex(s),f=s-c;if(r.push(u,a,i+c),!f||(u=u.child(a),u.isText))break;s=f-1,i+=c+1}return new ru(n,r,s)}static resolveCached(e,n){let r=Fg.get(e);if(r)for(let s=0;s<r.elts.length;s++){let u=r.elts[s];if(u.pos==n)return u}else Fg.set(e,r=new z6);let i=r.elts[r.i]=ru.resolve(e,n);return r.i=(r.i+1)%j6,i}}class z6{constructor(){this.elts=[],this.i=0}}const j6=12,Fg=new WeakMap;class ya{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const B6=Object.create(null);let Jr=class Oh{constructor(e,n,r,i=Re.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||j.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,i=0){this.content.nodesBetween(e,n,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,i){return this.content.textBetween(e,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&ma(this.attrs,n||e.defaultAttrs||B6)&&Re.sameSet(this.marks,r||Re.none)}copy(e=null){return e==this.content?this:new Oh(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Oh(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return G.empty;let i=this.resolve(e),s=this.resolve(n),u=r?0:i.sharedDepth(n),a=i.start(u),f=i.node(u).content.cut(i.pos-a,s.pos-a);return new G(f,i.depth-u,s.depth-u)}replace(e,n,r){return P6(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(i==e||n.isText)return n;e-=i+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(e){return ru.resolveCached(this,e)}resolveNoCache(e){return ru.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,s=>(r.isInSet(s.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),px(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=j.empty,i=0,s=r.childCount){let u=this.contentMatchAt(e).matchFragment(r,i,s),a=u&&u.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let c=i;c<s;c++)if(!this.type.allowsMarks(r.child(c).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(e).matchType(r),u=s&&s.matchFragment(this.content,n);return u?u.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=Re.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!Re.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=j.fromJSON(e,n.content),s=e.nodeType(n.type).create(n.attrs,i,r);return s.type.checkAttrs(s.attrs),s}};Jr.prototype.text=void 0;class xa extends Jr{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):px(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new xa(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new xa(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function px(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class zi{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new $6(e,n);if(r.next==null)return zi.empty;let i=mx(r);r.next&&r.err("Unexpected trailing text");let s=Z6(K6(i));return J6(s,r),s}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let s=n;i&&s<r;s++)i=i.matchType(e.child(s).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let i=[this];function s(u,a){let c=u.matchFragment(e,r);if(c&&(!n||c.validEnd))return j.from(a.map(f=>f.createAndFill()));for(let f=0;f<u.next.length;f++){let{type:p,next:m}=u.next[f];if(!(p.isText||p.hasRequiredAttrs())&&i.indexOf(m)==-1){i.push(m);let y=s(m,a.concat(p));if(y)return y}}return null}return s(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),s=i.match;if(s.matchType(e)){let u=[];for(let a=i;a.type;a=a.via)u.push(a.type);return u.reverse()}for(let u=0;u<s.next.length;u++){let{type:a,next:c}=s.next[u];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!i.type||c.validEnd)&&(r.push({match:a.contentMatch,type:a,via:i}),n[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let s=i+(r.validEnd?"*":" ")+" ";for(let u=0;u<r.next.length;u++)s+=(u?", ":"")+r.next[u].type.name+"->"+e.indexOf(r.next[u].next);return s}).join(`
219
- `)}}zi.empty=new zi(!0);class $6{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function mx(t){let e=[];do e.push(V6(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function V6(t){let e=[];do e.push(H6(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function H6(t){let e=W6(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=U6(t,e);else break;return e}function zg(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function U6(t,e){let n=zg(t),r=n;return t.eat(",")&&(t.next!="}"?r=zg(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function q6(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let s in n){let u=n[s];u.isInGroup(e)&&i.push(u)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function W6(t){if(t.eat("(")){let e=mx(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=q6(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function K6(t){let e=[[]];return i(s(t,0),n()),e;function n(){return e.push([])-1}function r(u,a,c){let f={term:c,to:a};return e[u].push(f),f}function i(u,a){u.forEach(c=>c.to=a)}function s(u,a){if(u.type=="choice")return u.exprs.reduce((c,f)=>c.concat(s(f,a)),[]);if(u.type=="seq")for(let c=0;;c++){let f=s(u.exprs[c],a);if(c==u.exprs.length-1)return f;i(f,a=n())}else if(u.type=="star"){let c=n();return r(a,c),i(s(u.expr,c),c),[r(c)]}else if(u.type=="plus"){let c=n();return i(s(u.expr,a),c),i(s(u.expr,c),c),[r(c)]}else{if(u.type=="opt")return[r(a)].concat(s(u.expr,a));if(u.type=="range"){let c=a;for(let f=0;f<u.min;f++){let p=n();i(s(u.expr,c),p),c=p}if(u.max==-1)i(s(u.expr,c),c);else for(let f=u.min;f<u.max;f++){let p=n();r(c,p),i(s(u.expr,c),p),c=p}return[r(c)]}else{if(u.type=="name")return[r(a,void 0,u.value)];throw new Error("Unknown expr type")}}}}function gx(t,e){return e-t}function jg(t,e){let n=[];return r(e),n.sort(gx);function r(i){let s=t[i];if(s.length==1&&!s[0].term)return r(s[0].to);n.push(i);for(let u=0;u<s.length;u++){let{term:a,to:c}=s[u];!a&&n.indexOf(c)==-1&&r(c)}}}function Z6(t){let e=Object.create(null);return n(jg(t,0));function n(r){let i=[];r.forEach(u=>{t[u].forEach(({term:a,to:c})=>{if(!a)return;let f;for(let p=0;p<i.length;p++)i[p][0]==a&&(f=i[p][1]);jg(t,c).forEach(p=>{f||i.push([a,f=[]]),f.indexOf(p)==-1&&f.push(p)})})});let s=e[r.join(",")]=new zi(r.indexOf(t.length-1)>-1);for(let u=0;u<i.length;u++){let a=i[u][1].sort(gx);s.next.push({type:i[u][0],next:e[a.join(",")]||n(a)})}return s}}function J6(t,e){for(let n=0,r=[t];n<r.length;n++){let i=r[n],s=!i.validEnd,u=[];for(let a=0;a<i.next.length;a++){let{type:c,next:f}=i.next[a];u.push(c.name),s&&!(c.isText||c.hasRequiredAttrs())&&(s=!1),r.indexOf(f)==-1&&r.push(f)}s&&e.err("Only non-generatable nodes ("+u.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function yx(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function xx(t,e){let n=Object.create(null);for(let r in t){let i=e&&e[r];if(i===void 0){let s=t[r];if(s.hasDefault)i=s.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function kx(t,e,n,r){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${r}`);for(let i in t)t[i].validate&&t[i].validate(e[i])}function bx(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new Q6(t,r,e[r]);return n}let Bg=class vx{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=bx(e,r.attrs),this.defaultAttrs=yx(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==zi.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:xx(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Jr(this,this.computeAttrs(e),j.from(n),Re.setFrom(r))}createChecked(e=null,n,r){return n=j.from(n),this.checkContent(n),new Jr(this,this.computeAttrs(e),n,Re.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=j.from(n),n.size){let u=this.contentMatch.fillBefore(n);if(!u)return null;n=u.append(n)}let i=this.contentMatch.matchFragment(n),s=i&&i.fillBefore(j.empty,!0);return s?new Jr(this,e,n.append(s),Re.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){kx(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:Re.none:e}static compile(e,n){let r=Object.create(null);e.forEach((s,u)=>r[s]=new vx(s,n,u));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 s in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function G6(t,e,n){let r=n.split("|");return i=>{let s=i===null?"null":typeof i;if(r.indexOf(s)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${s}`)}}class Q6{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?G6(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class ac{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=bx(e,i.attrs),this.excluded=null;let s=yx(this.attrs);this.instance=s?new Re(this,s):null}create(e=null){return!e&&this.instance?this.instance:new Re(this,xx(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((s,u)=>r[s]=new ac(s,i++,n,u)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){kx(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class yp{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=St.from(e.nodes),n.marks=St.from(e.marks||{}),this.nodes=Bg.compile(this.spec.nodes,this),this.marks=ac.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 s=this.nodes[i],u=s.spec.content||"",a=s.spec.marks;if(s.contentMatch=r[u]||(r[u]=zi.parse(u,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=a=="_"?null:a?$g(this,a.split(" ")):a==""||!s.inlineContent?[]:null}for(let i in this.marks){let s=this.marks[i],u=s.spec.excludes;s.excluded=u==null?[s]:u==""?[]:$g(this,u.split(" "))}this.nodeFromJSON=i=>Jr.fromJSON(this,i),this.markFromJSON=i=>Re.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Bg){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,i)}text(e,n){let r=this.nodes.text;return new xa(r,r.defaultAttrs,e,Re.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function $g(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],s=t.marks[i],u=s;if(s)n.push(s);else for(let a in t.marks){let c=t.marks[a];(i=="_"||c.spec.group&&c.spec.group.split(" ").indexOf(i)>-1)&&n.push(u=c)}if(!u)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function Y6(t){return t.tag!=null}function X6(t){return t.style!=null}class dr{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(Y6(i))this.tags.push(i);else if(X6(i)){let s=/[^=]*/.exec(i.style)[0];r.indexOf(s)<0&&r.push(s),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let s=e.nodes[i.node];return s.contentMatch.matchType(s)})}parse(e,n={}){let r=new Hg(this,n,!1);return r.addAll(e,Re.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new Hg(this,n,!0);return r.addAll(e,Re.none,n.from,n.to),G.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let s=this.tags[i];if(n4(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||n.matchesContext(s.context))){if(s.getAttrs){let u=s.getAttrs(e);if(u===!1)continue;s.attrs=u||void 0}return s}}}matchStyle(e,n,r,i){for(let s=i?this.styles.indexOf(i)+1:0;s<this.styles.length;s++){let u=this.styles[s],a=u.style;if(!(a.indexOf(e)!=0||u.context&&!r.matchesContext(u.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(u.getAttrs){let c=u.getAttrs(n);if(c===!1)continue;u.attrs=c||void 0}return u}}}static schemaRules(e){let n=[];function r(i){let s=i.priority==null?50:i.priority,u=0;for(;u<n.length;u++){let a=n[u];if((a.priority==null?50:a.priority)<s)break}n.splice(u,0,i)}for(let i in e.marks){let s=e.marks[i].spec.parseDOM;s&&s.forEach(u=>{r(u=Ug(u)),u.mark||u.ignore||u.clearMark||(u.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(u=>{r(u=Ug(u)),u.node||u.ignore||u.mark||(u.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new dr(e,dr.schemaRules(e)))}}const wx={address:!0,article:!0,aside:!0,blockquote:!0,body:!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},e4={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Cx={ol:!0,ul:!0},iu=1,Rh=2,Bo=4;function Vg(t,e,n){return e!=null?(e?iu:0)|(e==="full"?Rh:0):t&&t.whitespace=="pre"?iu|Rh:n&~Bo}class Vl{constructor(e,n,r,i,s,u){this.type=e,this.attrs=n,this.marks=r,this.solid=i,this.options=u,this.content=[],this.activeMarks=Re.none,this.match=s||(u&Bo?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(j.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&iu)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let s=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-i[0].length))}}let n=j.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(j.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!wx.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Hg{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,s,u=Vg(null,n.preserveWhitespace,0)|(r?Bo:0);i?s=new Vl(i.type,i.attrs,Re.none,!0,n.topMatch||i.type.contentMatch,u):r?s=new Vl(null,null,Re.none,!0,null,u):s=new Vl(e.schema.topNodeType,null,Re.none,!0,null,u),this.nodes=[s],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,i=this.top,s=i.options&Rh?"full":this.localPreserveWS||(i.options&iu)>0,{schema:u}=this.parser;if(s==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(s)if(s==="full")r=r.replace(/\r\n?/g,`
220
- `);else if(u.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(u.linebreakReplacement.create())){let a=r.split(/\r?\n|\r/);for(let c=0;c<a.length;c++)c&&this.insertNode(u.linebreakReplacement.create(),n,!0),a[c]&&this.insertNode(u.text(a[c]),n,!/\S/.test(a[c]));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],c=e.previousSibling;(!a||c&&c.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(r=r.slice(1))}r&&this.insertNode(u.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let i=this.localPreserveWS,s=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let u=e.nodeName.toLowerCase(),a;Cx.hasOwnProperty(u)&&this.parser.normalizeLists&&t4(e);let c=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,r));e:if(c?c.ignore:e4.hasOwnProperty(u))this.findInside(e),this.ignoreFallback(e,n);else if(!c||c.skip||c.closeParent){c&&c.closeParent?this.open=Math.max(0,this.open-1):c&&c.skip.nodeType&&(e=c.skip);let f,p=this.needsBlock;if(wx.hasOwnProperty(u))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),f=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let m=c&&c.skip?n:this.readStyles(e,n);m&&this.addAll(e,m),f&&this.sync(s),this.needsBlock=p}else{let f=this.readStyles(e,n);f&&this.addElementByRule(e,c,f,c.consuming===!1?a:void 0)}this.localPreserveWS=i}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
221
- `),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let s=this.parser.matchedStyles[i],u=r.getPropertyValue(s);if(u)for(let a=void 0;;){let c=this.parser.matchStyle(s,u,this,a);if(!c)break;if(c.ignore)return null;if(c.clearMark?n=n.filter(f=>!c.clearMark(f)):n=n.concat(this.parser.schema.marks[c.mark].create(c.attrs)),c.consuming===!1)a=c;else break}}return n}addElementByRule(e,n,r,i){let s,u;if(n.node)if(u=this.parser.schema.nodes[n.node],u.isLeaf)this.insertNode(u.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let c=this.enter(u,n.attrs||null,r,n.preserveWhitespace);c&&(s=!0,r=c)}else{let c=this.parser.schema.marks[n.mark];r=r.concat(c.create(n.attrs))}let a=this.top;if(u&&u.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(c=>this.insertNode(c,r,!1));else{let c=e;typeof n.contentElement=="string"?c=e.querySelector(n.contentElement):typeof n.contentElement=="function"?c=n.contentElement(e):n.contentElement&&(c=n.contentElement),this.findAround(e,c,!0),this.addAll(c,r),this.findAround(e,c,!1)}s&&this.sync(a)&&this.open--}addAll(e,n,r,i){let s=r||0;for(let u=r?e.childNodes[r]:e.firstChild,a=i==null?null:e.childNodes[i];u!=a;u=u.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(u,n);this.findAtPoint(e,s)}findPlace(e,n,r){let i,s;for(let u=this.open,a=0;u>=0;u--){let c=this.nodes[u],f=c.findWrapping(e);if(f&&(!i||i.length>f.length+a)&&(i=f,s=c,!f.length))break;if(c.solid){if(r)break;a+=2}}if(!i)return null;this.sync(s);for(let u=0;u<i.length;u++)n=this.enterInner(i[u],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let s=this.textblockFromContext();s&&(n=this.enterInner(s,null,n))}let i=this.findPlace(e,n,r);if(i){this.closeExtra();let s=this.top;s.match&&(s.match=s.match.matchType(e.type));let u=Re.none;for(let a of i.concat(e.marks))(s.type?s.type.allowsMarkType(a.type):qg(a.type,e.type))&&(u=a.addToSet(u));return s.content.push(e.mark(u)),!0}return!1}enter(e,n,r,i){let s=this.findPlace(e.create(n),r,!1);return s&&(s=this.enterInner(e,n,r,!0,i)),s}enterInner(e,n,r,i=!1,s){this.closeExtra();let u=this.top;u.match=u.match&&u.match.matchType(e);let a=Vg(e,s,u.options);u.options&Bo&&u.content.length==0&&(a|=Bo);let c=Re.none;return r=r.filter(f=>(u.type?u.type.allowsMarkType(f.type):qg(f.type,e))?(c=f.addToSet(c),!1):!0),this.nodes.push(new Vl(e,n,c,i,null,a)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=iu)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),s=-(r?r.depth+1:0)+(i?0:1),u=(a,c)=>{for(;a>=0;a--){let f=n[a];if(f==""){if(a==n.length-1||a==0)continue;for(;c>=s;c--)if(u(a-1,c))return!0;return!1}else{let p=c>0||c==0&&i?this.nodes[c].type:r&&c>=s?r.node(c-s).type:null;if(!p||p.name!=f&&!p.isInGroup(f))return!1;c--}}return!0};return u(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function t4(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Cx.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function n4(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Ug(t){let e={};for(let n in t)e[n]=t[n];return e}function qg(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let s=[],u=a=>{s.push(a);for(let c=0;c<a.edgeCount;c++){let{type:f,next:p}=a.edge(c);if(f==e||s.indexOf(p)<0&&u(p))return!0}};if(u(i.contentMatch))return!0}}class Vi{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=Hl(n).createDocumentFragment());let i=r,s=[];return e.forEach(u=>{if(s.length||u.marks.length){let a=0,c=0;for(;a<s.length&&c<u.marks.length;){let f=u.marks[c];if(!this.marks[f.type.name]){c++;continue}if(!f.eq(s[a][0])||f.type.spec.spanning===!1)break;a++,c++}for(;a<s.length;)i=s.pop()[1];for(;c<u.marks.length;){let f=u.marks[c++],p=this.serializeMark(f,u.isInline,n);p&&(s.push([f,i]),i.appendChild(p.dom),i=p.contentDOM||p.dom)}}i.appendChild(this.serializeNodeInner(u,n))}),r}serializeNodeInner(e,n){if(e.isText)return Hl(n).createTextNode(e.text);let{dom:r,contentDOM:i}=ia(Hl(n),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,i)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let i=e.marks.length-1;i>=0;i--){let s=this.serializeMark(e.marks[i],e.isInline,n);s&&((s.contentDOM||s.dom).appendChild(r),r=s.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&ia(Hl(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return typeof n=="string"?{dom:e.createTextNode(n)}:ia(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Vi(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=Wg(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return Wg(e.marks)}}function Wg(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Hl(t){return t.document||window.document}const Kg=new WeakMap;function r4(t){let e=Kg.get(t);return e===void 0&&Kg.set(t,e=i4(t)),e}function i4(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i<r.length;i++)n(r[i]);else for(let i in r)n(r[i])}return n(t),e}function ia(t,e,n,r){if(e.nodeType==1)return{dom:e};if(e.dom&&e.dom.nodeType==1)return e;let i=e[0],s;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(s=r4(r))&&s.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let u=i.indexOf(" ");u>0&&(n=i.slice(0,u),i=i.slice(u+1));let a,c=n?t.createElementNS(n,i):t.createElement(i),f=e[1],p=1;if(f&&typeof f=="object"&&f.nodeType==null&&!Array.isArray(f)){p=2;for(let m in f)if(f[m]!=null){let y=m.indexOf(" ");y>0?c.setAttributeNS(m.slice(0,y),m.slice(y+1),f[m]):m=="style"&&c.style?c.style.cssText=f[m]:c.setAttribute(m,f[m])}}for(let m=p;m<e.length;m++){let y=e[m];if(y===0){if(m<e.length-1||m>p)throw new RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}else if(typeof y=="string")c.appendChild(t.createTextNode(y));else{let{dom:x,contentDOM:b}=ia(t,y,n,r);if(c.appendChild(x),b){if(a)throw new RangeError("Multiple content holes");a=b}}}return{dom:c,contentDOM:a}}const Sx=65535,Ex=Math.pow(2,16);function s4(t,e){return t+e*Ex}function Zg(t){return t&Sx}function o4(t){return(t-(t&Sx))/Ex}const _x=1,Tx=2,sa=4,Ax=8;class Ih{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&Ax)>0}get deletedBefore(){return(this.delInfo&(_x|sa))>0}get deletedAfter(){return(this.delInfo&(Tx|sa))>0}get deletedAcross(){return(this.delInfo&sa)>0}}class tn{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&tn.empty)return tn.empty}recover(e){let n=0,r=Zg(e);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+o4(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let i=0,s=this.inverted?2:1,u=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let c=this.ranges[a]-(this.inverted?i:0);if(c>e)break;let f=this.ranges[a+s],p=this.ranges[a+u],m=c+f;if(e<=m){let y=f?e==c?-1:e==m?1:n:n,x=c+i+(y<0?0:p);if(r)return x;let b=e==(n<0?c:m)?null:s4(a/3,e-c),v=e==c?Tx:e==m?_x:sa;return(n<0?e!=c:e!=m)&&(v|=Ax),new Ih(x,v,b)}i+=p-f}return r?e+i:new Ih(e+i,0,null)}touches(e,n){let r=0,i=Zg(n),s=this.inverted?2:1,u=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let c=this.ranges[a]-(this.inverted?r:0);if(c>e)break;let f=this.ranges[a+s],p=c+f;if(e<=p&&a==i*3)return!0;r+=this.ranges[a+u]-f}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,s=0;i<this.ranges.length;i+=3){let u=this.ranges[i],a=u-(this.inverted?s:0),c=u+(this.inverted?0:s),f=this.ranges[i+n],p=this.ranges[i+r];e(a,a+f,c,c+p),s+=p-f}}invert(){return new tn(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?tn.empty:new tn(e<0?[0,-e,0]:[0,0,e])}}tn.empty=new tn([]);class su{constructor(e,n,r=0,i=e?e.length:0){this.mirror=n,this.from=r,this.to=i,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new su(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,r=this._maps.length;n<e._maps.length;n++){let i=e.getMirror(n);this.appendMap(e._maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this._maps.length+e._maps.length;n>=0;n--){let i=e.getMirror(n);this.appendMap(e._maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new su;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let i=0;for(let s=this.from;s<this.to;s++){let u=this._maps[s],a=u.mapResult(e,n);if(a.recover!=null){let c=this.getMirror(s);if(c!=null&&c>s&&c<this.to){s=c,e=this._maps[c].recover(a.recover);continue}}i|=a.delInfo,e=a.pos}return r?e:new Ih(e,i,null)}}const If=Object.create(null);class It{getMap(){return tn.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=If[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in If)throw new RangeError("Duplicate use of step JSON ID "+e);return If[e]=n,n.prototype.jsonID=e,n}}class at{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new at(e,null)}static fail(e){return new at(null,e)}static fromReplace(e,n,r,i){try{return at.ok(e.replace(n,r,i))}catch(s){if(s instanceof nu)return at.fail(s.message);throw s}}}function xp(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let s=t.child(i);s.content.size&&(s=s.copy(xp(s.content,e,s))),s.isInline&&(s=e(s,n,i)),r.push(s)}return j.fromArray(r)}class Ur extends It{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),s=new G(xp(n.content,(u,a)=>!u.isAtom||!a.type.allowsMarkType(this.mark.type)?u:u.mark(this.mark.addToSet(u.marks)),i),n.openStart,n.openEnd);return at.fromReplace(e,this.from,this.to,s)}invert(){return new An(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Ur(n.pos,r.pos,this.mark)}merge(e){return e instanceof Ur&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ur(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Ur(n.from,n.to,e.markFromJSON(n.mark))}}It.jsonID("addMark",Ur);class An extends It{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new G(xp(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return at.fromReplace(e,this.from,this.to,r)}invert(){return new Ur(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new An(n.pos,r.pos,this.mark)}merge(e){return e instanceof An&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new An(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new An(n.from,n.to,e.markFromJSON(n.mark))}}It.jsonID("removeMark",An);class qr extends It{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return at.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return at.fromReplace(e,this.pos,this.pos+1,new G(j.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new qr(this.pos,n.marks[i]);return new qr(this.pos,this.mark)}}return new ji(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new qr(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new qr(n.pos,e.markFromJSON(n.mark))}}It.jsonID("addNodeMark",qr);class ji extends It{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return at.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return at.fromReplace(e,this.pos,this.pos+1,new G(j.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new qr(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new ji(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new ji(n.pos,e.markFromJSON(n.mark))}}It.jsonID("removeNodeMark",ji);class lt extends It{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i}apply(e){return this.structure&&Lh(e,this.from,this.to)?at.fail("Structure replace would overwrite content"):at.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new tn([this.from,this.to-this.from,this.slice.size])}invert(e){return new lt(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.to,-1),r=this.from==this.to&&lt.MAP_BIAS<0?n:e.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new lt(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof lt)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?G.empty:new G(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new lt(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?G.empty:new G(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new lt(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new lt(n.from,n.to,G.fromJSON(e,n.slice),!!n.structure)}}lt.MAP_BIAS=1;It.jsonID("replace",lt);class bt extends It{constructor(e,n,r,i,s,u,a=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=s,this.insert=u,this.structure=a}apply(e){if(this.structure&&(Lh(e,this.from,this.gapFrom)||Lh(e,this.gapTo,this.to)))return at.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return at.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?at.fromReplace(e,this.from,this.to,r):at.fail("Content does not fit in gap")}getMap(){return new tn([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new bt(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||s>r.pos?null:new bt(n.pos,r.pos,i,s,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new bt(n.from,n.to,n.gapFrom,n.gapTo,G.fromJSON(e,n.slice),n.insert,!!n.structure)}}It.jsonID("replaceAround",bt);function Lh(t,e,n){let r=t.resolve(e),i=n-e,s=r.depth;for(;i>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,i--;if(i>0){let u=r.node(s).maybeChild(r.indexAfter(s));for(;i>0;){if(!u||u.isLeaf)return!0;u=u.firstChild,i--}}return!1}function u4(t,e,n,r){let i=[],s=[],u,a;t.doc.nodesBetween(e,n,(c,f,p)=>{if(!c.isInline)return;let m=c.marks;if(!r.isInSet(m)&&p.type.allowsMarkType(r.type)){let y=Math.max(f,e),x=Math.min(f+c.nodeSize,n),b=r.addToSet(m);for(let v=0;v<m.length;v++)m[v].isInSet(b)||(u&&u.to==y&&u.mark.eq(m[v])?u.to=x:i.push(u=new An(y,x,m[v])));a&&a.to==y?a.to=x:s.push(a=new Ur(y,x,r))}}),i.forEach(c=>t.step(c)),s.forEach(c=>t.step(c))}function l4(t,e,n,r){let i=[],s=0;t.doc.nodesBetween(e,n,(u,a)=>{if(!u.isInline)return;s++;let c=null;if(r instanceof ac){let f=u.marks,p;for(;p=r.isInSet(f);)(c||(c=[])).push(p),f=p.removeFromSet(f)}else r?r.isInSet(u.marks)&&(c=[r]):c=u.marks;if(c&&c.length){let f=Math.min(a+u.nodeSize,n);for(let p=0;p<c.length;p++){let m=c[p],y;for(let x=0;x<i.length;x++){let b=i[x];b.step==s-1&&m.eq(i[x].style)&&(y=b)}y?(y.to=f,y.step=s):i.push({style:m,from:Math.max(a,e),to:f,step:s})}}}),i.forEach(u=>t.step(new An(u.from,u.to,u.style)))}function kp(t,e,n,r=n.contentMatch,i=!0){let s=t.doc.nodeAt(e),u=[],a=e+1;for(let c=0;c<s.childCount;c++){let f=s.child(c),p=a+f.nodeSize,m=r.matchType(f.type);if(!m)u.push(new lt(a,p,G.empty));else{r=m;for(let y=0;y<f.marks.length;y++)n.allowsMarkType(f.marks[y].type)||t.step(new An(a,p,f.marks[y]));if(i&&f.isText&&n.whitespace!="pre"){let y,x=/\r?\n|\r/g,b;for(;y=x.exec(f.text);)b||(b=new G(j.from(n.schema.text(" ",n.allowedMarks(f.marks))),0,0)),u.push(new lt(a+y.index,a+y.index+y[0].length,b))}}a=p}if(!r.validEnd){let c=r.fillBefore(j.empty,!0);t.replace(a,a,new G(c,0,0))}for(let c=u.length-1;c>=0;c--)t.step(u[c])}function a4(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function zs(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth,i=0,s=0;;--r){let u=t.$from.node(r),a=t.$from.index(r)+i,c=t.$to.indexAfter(r)-s;if(r<t.depth&&u.canReplace(a,c,n))return r;if(r==0||u.type.spec.isolating||!a4(u,a,c))break;a&&(i=1),c<u.childCount&&(s=1)}return null}function c4(t,e,n){let{$from:r,$to:i,depth:s}=e,u=r.before(s+1),a=i.after(s+1),c=u,f=a,p=j.empty,m=0;for(let b=s,v=!1;b>n;b--)v||r.index(b)>0?(v=!0,p=j.from(r.node(b).copy(p)),m++):c--;let y=j.empty,x=0;for(let b=s,v=!1;b>n;b--)v||i.after(b+1)<i.end(b)?(v=!0,y=j.from(i.node(b).copy(y)),x++):f++;t.step(new bt(c,f,u,a,new G(p.append(y),m,x),p.size-m,!0))}function bp(t,e,n=null,r=t){let i=d4(t,e),s=i&&f4(r,e);return s?i.map(Jg).concat({type:e,attrs:n}).concat(s.map(Jg)):null}function Jg(t){return{type:t,attrs:null}}function d4(t,e){let{parent:n,startIndex:r,endIndex:i}=t,s=n.contentMatchAt(r).findWrapping(e);if(!s)return null;let u=s.length?s[0]:e;return n.canReplaceWith(r,i,u)?s:null}function f4(t,e){let{parent:n,startIndex:r,endIndex:i}=t,s=n.child(r),u=e.contentMatch.findWrapping(s.type);if(!u)return null;let c=(u.length?u[u.length-1]:e).contentMatch;for(let f=r;c&&f<i;f++)c=c.matchType(n.child(f).type);return!c||!c.validEnd?null:u}function h4(t,e,n){let r=j.empty;for(let u=n.length-1;u>=0;u--){if(r.size){let a=n[u].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=j.from(n[u].type.create(n[u].attrs,r))}let i=e.start,s=e.end;t.step(new bt(i,s,i,s,new G(r,0,0),n.length,!0))}function p4(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=t.steps.length;t.doc.nodesBetween(e,n,(u,a)=>{let c=typeof i=="function"?i(u):i;if(u.isTextblock&&!u.hasMarkup(r,c)&&m4(t.doc,t.mapping.slice(s).map(a),r)){let f=null;if(r.schema.linebreakReplacement){let x=r.whitespace=="pre",b=!!r.contentMatch.matchType(r.schema.linebreakReplacement);x&&!b?f=!1:!x&&b&&(f=!0)}f===!1&&Dx(t,u,a,s),kp(t,t.mapping.slice(s).map(a,1),r,void 0,f===null);let p=t.mapping.slice(s),m=p.map(a,1),y=p.map(a+u.nodeSize,1);return t.step(new bt(m,y,m+1,y-1,new G(j.from(r.create(c,null,u.marks)),0,0),1,!0)),f===!0&&Mx(t,u,a,s),!1}})}function Mx(t,e,n,r){e.forEach((i,s)=>{if(i.isText){let u,a=/\r?\n|\r/g;for(;u=a.exec(i.text);){let c=t.mapping.slice(r).map(n+1+s+u.index);t.replaceWith(c,c+1,e.type.schema.linebreakReplacement.create())}}})}function Dx(t,e,n,r){e.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let u=t.mapping.slice(r).map(n+1+s);t.replaceWith(u,u+1,e.type.schema.text(`
222
- `))}})}function m4(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function g4(t,e,n,r,i){let s=t.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let u=n.create(r,null,i||s.marks);if(s.isLeaf)return t.replaceWith(e,e+s.nodeSize,u);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new bt(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new G(j.from(u),0,0),1,!0))}function fr(t,e,n=1,r){let i=t.resolve(e),s=i.depth-n,u=r&&r[r.length-1]||i.parent;if(s<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!u.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let f=i.depth-1,p=n-2;f>s;f--,p--){let m=i.node(f),y=i.index(f);if(m.type.spec.isolating)return!1;let x=m.content.cutByIndex(y,m.childCount),b=r&&r[p+1];b&&(x=x.replaceChild(0,b.type.create(b.attrs)));let v=r&&r[p]||m;if(!m.canReplace(y+1,m.childCount)||!v.type.validContent(x))return!1}let a=i.indexAfter(s),c=r&&r[0];return i.node(s).canReplaceWith(a,a,c?c.type:i.node(s+1).type)}function y4(t,e,n=1,r){let i=t.doc.resolve(e),s=j.empty,u=j.empty;for(let a=i.depth,c=i.depth-n,f=n-1;a>c;a--,f--){s=j.from(i.node(a).copy(s));let p=r&&r[f];u=j.from(p?p.type.create(p.attrs,u):i.node(a).copy(u))}t.step(new lt(e,e,new G(s.append(u),n,n),!0))}function oi(t,e){let n=t.resolve(e),r=n.index();return Nx(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function x4(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let i=0;i<e.childCount;i++){let s=e.child(i),u=s.type==r?t.type.schema.nodes.text:s.type;if(n=n.matchType(u),!n||!t.type.allowsMarks(s.marks))return!1}return n.validEnd}function Nx(t,e){return!!(t&&e&&!t.isLeaf&&x4(t,e))}function cc(t,e,n=-1){let r=t.resolve(e);for(let i=r.depth;;i--){let s,u,a=r.index(i);if(i==r.depth?(s=r.nodeBefore,u=r.nodeAfter):n>0?(s=r.node(i+1),a++,u=r.node(i).maybeChild(a)):(s=r.node(i).maybeChild(a-1),u=r.node(i+1)),s&&!s.isTextblock&&Nx(s,u)&&r.node(i).canReplace(a,a+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}function k4(t,e,n){let r=null,{linebreakReplacement:i}=t.doc.type.schema,s=t.doc.resolve(e-n),u=s.node().type;if(i&&u.inlineContent){let p=u.whitespace=="pre",m=!!u.contentMatch.matchType(i);p&&!m?r=!1:!p&&m&&(r=!0)}let a=t.steps.length;if(r===!1){let p=t.doc.resolve(e+n);Dx(t,p.node(),p.before(),a)}u.inlineContent&&kp(t,e+n-1,u,s.node().contentMatchAt(s.index()),r==null);let c=t.mapping.slice(a),f=c.map(e-n);if(t.step(new lt(f,c.map(e+n,-1),G.empty,!0)),r===!0){let p=t.doc.resolve(f);Mx(t,p.node(),p.before(),t.steps.length)}return t}function b4(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let s=r.index(i);if(r.node(i).canReplaceWith(s,s,n))return r.before(i+1);if(s>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let s=r.indexAfter(i);if(r.node(i).canReplaceWith(s,s,n))return r.after(i+1);if(s<r.node(i).childCount)return null}return null}function Ox(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let s=0;s<n.openStart;s++)i=i.firstChild.content;for(let s=1;s<=(n.openStart==0&&n.size?2:1);s++)for(let u=r.depth;u>=0;u--){let a=u==r.depth?0:r.pos<=(r.start(u+1)+r.end(u+1))/2?-1:1,c=r.index(u)+(a>0?1:0),f=r.node(u),p=!1;if(s==1)p=f.canReplace(c,c,i);else{let m=f.contentMatchAt(c).findWrapping(i.firstChild.type);p=m&&f.canReplaceWith(c,c,m[0])}if(p)return a==0?r.pos:a<0?r.before(u+1):r.after(u+1)}return null}function dc(t,e,n=e,r=G.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),s=t.resolve(n);return Rx(i,s,r)?new lt(e,n,r):new v4(i,s,r).fit()}function Rx(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class v4{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=j.empty;for(let i=0;i<=e.depth;i++){let s=e.node(i);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=j.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let f=this.findFittable();f?this.placeNodes(f):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let s=this.placed,u=r.depth,a=i.depth;for(;u&&a&&s.childCount==1;)s=s.firstChild.content,u--,a--;let c=new G(s,u,a);return e>-1?new bt(r.pos,e,this.$to.pos,this.$to.end(),c,n):c.size||r.pos!=this.$to.pos?new lt(r.pos,i.pos,c):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let s=n.firstChild;if(n.childCount>1&&(i=0),s.type.spec.isolating&&i<=r){e=r;break}n=s.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,s=null;r?(s=Lf(this.unplaced.content,r-1).firstChild,i=s.content):i=this.unplaced.content;let u=i.firstChild;for(let a=this.depth;a>=0;a--){let{type:c,match:f}=this.frontier[a],p,m=null;if(n==1&&(u?f.matchType(u.type)||(m=f.fillBefore(j.from(u),!1)):s&&c.compatibleContent(s.type)))return{sliceDepth:r,frontierDepth:a,parent:s,inject:m};if(n==2&&u&&(p=f.findWrapping(u.type)))return{sliceDepth:r,frontierDepth:a,parent:s,wrap:p};if(s&&f.matchType(s.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=Lf(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new G(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=Lf(e,n);if(i.childCount<=1&&n>0){let s=e.size-n<=n+i.size;this.unplaced=new G(Ro(e,n-1,1),n-1,s?n-1:r)}else this.unplaced=new G(Ro(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:s}){for(;this.depth>n;)this.closeFrontierNode();if(s)for(let v=0;v<s.length;v++)this.openFrontierNode(s[v]);let u=this.unplaced,a=r?r.content:u.content,c=u.openStart-e,f=0,p=[],{match:m,type:y}=this.frontier[n];if(i){for(let v=0;v<i.childCount;v++)p.push(i.child(v));m=m.matchFragment(i)}let x=a.size+e-(u.content.size-u.openEnd);for(;f<a.childCount;){let v=a.child(f),w=m.matchType(v.type);if(!w)break;f++,(f>1||c==0||v.content.size)&&(m=w,p.push(Ix(v.mark(y.allowedMarks(v.marks)),f==1?c:0,f==a.childCount?x:-1)))}let b=f==a.childCount;b||(x=-1),this.placed=Io(this.placed,n,j.from(p)),this.frontier[n].match=m,b&&x<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let v=0,w=a;v<x;v++){let S=w.lastChild;this.frontier.push({type:S.type,match:S.contentMatchAt(S.childCount)}),w=S.content}this.unplaced=b?e==0?G.empty:new G(Ro(u.content,e-1,1),e-1,x<0?u.openEnd:e-1):new G(Ro(u.content,e,f),u.openStart,u.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!Pf(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],s=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),u=Pf(e,n,i,r,s);if(u){for(let a=n-1;a>=0;a--){let{match:c,type:f}=this.frontier[a],p=Pf(e,a,f,c,!0);if(!p||p.childCount)continue e}return{depth:n,fit:u,move:s?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Io(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),s=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,s)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=Io(this.placed,this.depth,j.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(j.empty,!0);n.childCount&&(this.placed=Io(this.placed,this.frontier.length,n))}}function Ro(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Ro(t.firstChild.content,e-1,n)))}function Io(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Io(t.lastChild.content,e-1,n)))}function Lf(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function Ix(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,Ix(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(j.empty,!0)))),t.copy(r)}function Pf(t,e,n,r,i){let s=t.node(e),u=i?t.indexAfter(e):t.index(e);if(u==s.childCount&&!n.compatibleContent(s.type))return null;let a=r.fillBefore(s.content,!0,u);return a&&!w4(n,s.content,u)?a:null}function w4(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function C4(t){return t.spec.defining||t.spec.definingForContent}function S4(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),s=t.doc.resolve(n);if(Rx(i,s,r))return t.step(new lt(e,n,r));let u=Px(i,s);u[u.length-1]==0&&u.pop();let a=-(i.depth+1);u.unshift(a);for(let y=i.depth,x=i.pos-1;y>0;y--,x--){let b=i.node(y).type.spec;if(b.defining||b.definingAsContext||b.isolating)break;u.indexOf(y)>-1?a=y:i.before(y)==x&&u.splice(1,0,-y)}let c=u.indexOf(a),f=[],p=r.openStart;for(let y=r.content,x=0;;x++){let b=y.firstChild;if(f.push(b),x==r.openStart)break;y=b.content}for(let y=p-1;y>=0;y--){let x=f[y],b=C4(x.type);if(b&&!x.sameMarkup(i.node(Math.abs(a)-1)))p=y;else if(b||!x.type.isTextblock)break}for(let y=r.openStart;y>=0;y--){let x=(y+p+1)%(r.openStart+1),b=f[x];if(b)for(let v=0;v<u.length;v++){let w=u[(v+c)%u.length],S=!0;w<0&&(S=!1,w=-w);let A=i.node(w-1),R=i.index(w-1);if(A.canReplaceWith(R,R,b.type,b.marks))return t.replace(i.before(w),S?s.after(w):n,new G(Lx(r.content,0,r.openStart,x),x,r.openEnd))}}let m=t.steps.length;for(let y=u.length-1;y>=0&&(t.replace(e,n,r),!(t.steps.length>m));y--){let x=u[y];x<0||(e=i.before(x),n=s.after(x))}}function Lx(t,e,n,r,i){if(e<n){let s=t.firstChild;t=t.replaceChild(0,s.copy(Lx(s.content,e+1,n,r,s)))}if(e>r){let s=i.contentMatchAt(0),u=s.fillBefore(t).append(t);t=u.append(s.matchFragment(u).fillBefore(j.empty,!0))}return t}function E4(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=b4(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new G(j.from(r),0,0))}function _4(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n);if(r.parent.isTextblock&&i.parent.isTextblock&&r.start()!=i.start()&&r.parentOffset==0&&i.parentOffset==0){let u=r.sharedDepth(n),a=!1;for(let c=r.depth;c>u;c--)r.node(c).type.spec.isolating&&(a=!0);for(let c=i.depth;c>u;c--)i.node(c).type.spec.isolating&&(a=!0);if(!a){for(let c=r.depth;c>0&&e==r.start(c);c--)e=r.before(c);for(let c=i.depth;c>0&&n==i.start(c);c--)n=i.before(c);r=t.doc.resolve(e),i=t.doc.resolve(n)}}let s=Px(r,i);for(let u=0;u<s.length;u++){let a=s[u],c=u==s.length-1;if(c&&a==0||r.node(a).type.contentMatch.validEnd)return t.delete(r.start(a),i.end(a));if(a>0&&(c||r.node(a-1).canReplace(r.index(a-1),i.indexAfter(a-1))))return t.delete(r.before(a),i.after(a))}for(let u=1;u<=r.depth&&u<=i.depth;u++)if(e-r.start(u)==r.depth-u&&n>r.end(u)&&i.end(u)-n!=i.depth-u&&r.start(u-1)==i.start(u-1)&&r.node(u-1).canReplace(r.index(u-1),i.index(u-1)))return t.delete(r.before(u),n);t.delete(e,n)}function Px(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let s=t.start(i);if(s<t.pos-(t.depth-i)||e.end(i)>e.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(s==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==s-1)&&n.push(i)}return n}class ws extends It{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return at.fail("No node at attribute step's position");let r=Object.create(null);for(let s in n.attrs)r[s]=n.attrs[s];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return at.fromReplace(e,this.pos,this.pos+1,new G(j.from(i),0,n.isLeaf?0:1))}getMap(){return tn.empty}invert(e){return new ws(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new ws(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new ws(n.pos,n.attr,n.value)}}It.jsonID("attr",ws);class ou extends It{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return at.ok(r)}getMap(){return tn.empty}invert(e){return new ou(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new ou(n.attr,n.value)}}It.jsonID("docAttr",ou);let Ms=class extends Error{};Ms=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};Ms.prototype=Object.create(Error.prototype);Ms.prototype.constructor=Ms;Ms.prototype.name="TransformError";class Fx{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new su}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Ms(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,n=-1e9;for(let r=0;r<this.mapping.maps.length;r++){let i=this.mapping.maps[r];r&&(e=i.map(e,1),n=i.map(n,-1)),i.forEach((s,u,a,c)=>{e=Math.min(e,a),n=Math.max(n,c)})}return e==1e9?null:{from:e,to:n}}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=G.empty){let i=dc(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new G(j.from(r),0,0))}delete(e,n){return this.replace(e,n,G.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return S4(this,e,n,r),this}replaceRangeWith(e,n,r){return E4(this,e,n,r),this}deleteRange(e,n){return _4(this,e,n),this}lift(e,n){return c4(this,e,n),this}join(e,n=1){return k4(this,e,n),this}wrap(e,n){return h4(this,e,n),this}setBlockType(e,n=e,r,i=null){return p4(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return g4(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new ws(e,n,r)),this}setDocAttribute(e,n){return this.step(new ou(e,n)),this}addNodeMark(e,n){return this.step(new qr(e,n)),this}removeNodeMark(e,n){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n instanceof Re)n.isInSet(r.marks)&&this.step(new ji(e,n));else{let i=r.marks,s,u=[];for(;s=n.isInSet(i);)u.push(new ji(e,s)),i=s.removeFromSet(i);for(let a=u.length-1;a>=0;a--)this.step(u[a])}return this}split(e,n=1,r){return y4(this,e,n,r),this}addMark(e,n,r){return u4(this,e,n,r),this}removeMark(e,n,r){return l4(this,e,n,r),this}clearIncompatible(e,n,r){return kp(this,e,n,r),this}}const Ff=Object.create(null);class ge{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new T4(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=G.empty){let r=n.content.lastChild,i=null;for(let a=0;a<n.openEnd;a++)i=r,r=r.lastChild;let s=e.steps.length,u=this.ranges;for(let a=0;a<u.length;a++){let{$from:c,$to:f}=u[a],p=e.mapping.slice(s);e.replaceRange(p.map(c.pos),p.map(f.pos),a?G.empty:n),a==0&&Yg(e,s,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:u,$to:a}=i[s],c=e.mapping.slice(r),f=c.map(u.pos),p=c.map(a.pos);s?e.deleteRange(f,p):(e.replaceRangeWith(f,p,n),Yg(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let i=e.parent.inlineContent?new de(e):ks(e.node(0),e.parent,e.pos,e.index(),n,r);if(i)return i;for(let s=e.depth-1;s>=0;s--){let u=n<0?ks(e.node(0),e.node(s),e.before(s+1),e.index(s),n,r):ks(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,n,r);if(u)return u}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new nn(e.node(0))}static atStart(e){return ks(e,e,0,0,1)||new nn(e)}static atEnd(e){return ks(e,e,e.content.size,e.childCount,-1)||new nn(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Ff[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Ff)throw new RangeError("Duplicate use of selection JSON ID "+e);return Ff[e]=n,n.prototype.jsonID=e,n}getBookmark(){return de.between(this.$anchor,this.$head).getBookmark()}}ge.prototype.visible=!0;class T4{constructor(e,n){this.$from=e,this.$to=n}}let Gg=!1;function Qg(t){!Gg&&!t.parent.inlineContent&&(Gg=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class de extends ge{constructor(e,n=e){Qg(e),Qg(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return ge.near(r);let i=e.resolve(n.map(this.anchor));return new de(i.parent.inlineContent?i:r,r)}replace(e,n=G.empty){if(super.replace(e,n),n==G.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof de&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new fc(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new de(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let s=ge.findFrom(n,r,!0)||ge.findFrom(n,-r,!0);if(s)n=s.$head;else return ge.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(ge.findFrom(e,-r,!0)||ge.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=i<0&&(e=n))),new de(e,n)}}ge.jsonID("text",de);class fc{constructor(e,n){this.anchor=e,this.head=n}map(e){return new fc(e.map(this.anchor),e.map(this.head))}resolve(e){return de.between(e.resolve(this.anchor),e.resolve(this.head))}}class oe extends ge{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),s=e.resolve(i);return r?ge.near(s):new oe(s)}content(){return new G(j.from(this.node),0,0)}eq(e){return e instanceof oe&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new vp(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new oe(e.resolve(n.anchor))}static create(e,n){return new oe(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}oe.prototype.visible=!1;ge.jsonID("node",oe);class vp{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new fc(r,r):new vp(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&oe.isSelectable(r)?new oe(n):ge.near(n)}}class nn extends ge{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=G.empty){if(n==G.empty){e.delete(0,e.doc.content.size);let r=ge.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new nn(e)}map(e){return new nn(e)}eq(e){return e instanceof nn}getBookmark(){return A4}}ge.jsonID("all",nn);const A4={map(){return this},resolve(t){return new nn(t)}};function ks(t,e,n,r,i,s=!1){if(e.inlineContent)return de.create(t,n);for(let u=r-(i>0?0:1);i>0?u<e.childCount:u>=0;u+=i){let a=e.child(u);if(a.isAtom){if(!s&&oe.isSelectable(a))return oe.create(t,n-(i<0?a.nodeSize:0))}else{let c=ks(t,a,n+i,i<0?a.childCount:0,i,s);if(c)return c}n+=a.nodeSize*i}return null}function Yg(t,e,n){let r=t.steps.length-1;if(r<e)return;let i=t.steps[r];if(!(i instanceof lt||i instanceof bt))return;let s=t.mapping.maps[r],u;s.forEach((a,c,f,p)=>{u==null&&(u=p)}),t.setSelection(ge.near(t.doc.resolve(u),n))}const Xg=1,Ul=2,ey=4;class M4 extends Fx{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|Xg)&~Ul,this.storedMarks=null,this}get selectionSet(){return(this.updated&Xg)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Ul,this}ensureMarks(e){return Re.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Ul)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~Ul,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||Re.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),!e)return this.deleteRange(n,r);let s=this.storedMarks;if(!s){let u=this.doc.resolve(n);s=r==n?u.marks():u.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(e,s)),!this.selection.empty&&this.selection.to==n+e.length&&this.setSelection(ge.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=ey,this}get scrolledIntoView(){return(this.updated&ey)>0}}function ty(t,e){return!e||!t?t:t.bind(e)}class Lo{constructor(e,n,r){this.name=e,this.init=ty(n.init,r),this.apply=ty(n.apply,r)}}const D4=[new Lo("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Lo("selection",{init(t,e){return t.selection||ge.atStart(e.doc)},apply(t){return t.selection}}),new Lo("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Lo("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class zf{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=D4.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 Lo(r.key,r.spec.state,r))})}}class Ei{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),i=null;for(;;){let s=!1;for(let u=0;u<this.config.plugins.length;u++){let a=this.config.plugins[u];if(a.spec.appendTransaction){let c=i?i[u].n:0,f=i?i[u].state:this,p=c<n.length&&a.spec.appendTransaction.call(a,c?n.slice(c):n,f,r);if(p&&r.filterTransaction(p,u)){if(p.setMeta("appendedTransaction",e),!i){i=[];for(let m=0;m<this.config.plugins.length;m++)i.push(m<u?{state:r,n:n.length}:{state:this,n:0})}n.push(p),r=r.applyInner(p),s=!0}i&&(i[u]={state:r,n:n.length})}}if(!s)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new Ei(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let s=r[i];n[s.name]=s.apply(e,this[s.name],this,n)}return n}get tr(){return new M4(this)}static create(e){let n=new zf(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new Ei(n);for(let i=0;i<n.fields.length;i++)r[n.fields[i].name]=n.fields[i].init(e,r);return r}reconfigure(e){let n=new zf(this.schema,e.plugins),r=n.fields,i=new Ei(n);for(let s=0;s<r.length;s++){let u=r[s].name;i[u]=this.hasOwnProperty(u)?this[u]:r[s].init(e,i)}return i}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],s=i.spec.state;s&&s.toJSON&&(n[r]=s.toJSON.call(i,this[i.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new zf(e.schema,e.plugins),s=new Ei(i);return i.fields.forEach(u=>{if(u.name=="doc")s.doc=Jr.fromJSON(e.schema,n.doc);else if(u.name=="selection")s.selection=ge.fromJSON(s.doc,n.selection);else if(u.name=="storedMarks")n.storedMarks&&(s.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let c=r[a],f=c.spec.state;if(c.key==u.name&&f&&f.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){s[u.name]=f.fromJSON.call(c,e,n[a],s);return}}s[u.name]=u.init(e,s)}}),s}}function zx(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=zx(i,e,{})),n[r]=i}return n}class qe{constructor(e){this.spec=e,this.props={},e.props&&zx(e.props,this,this.props),this.key=e.key?e.key.key:jx("plugin")}getState(e){return e[this.key]}}const jf=Object.create(null);function jx(t){return t in jf?t+"$"+ ++jf[t]:(jf[t]=0,t+"$")}class dt{constructor(e="key"){this.key=jx(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Bx=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function $x(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const Vx=(t,e,n)=>{let r=$x(t,n);if(!r)return!1;let i=wp(r);if(!i){let u=r.blockRange(),a=u&&zs(u);return a==null?!1:(e&&e(t.tr.lift(u,a).scrollIntoView()),!0)}let s=i.nodeBefore;if(Qx(t,i,e,-1))return!0;if(r.parent.content.size==0&&(Ds(s,"end")||oe.isSelectable(s)))for(let u=r.depth;;u--){let a=dc(t.doc,r.before(u),r.after(u),G.empty);if(a&&a.slice.size<a.to-a.from){if(e){let c=t.tr.step(a);c.setSelection(Ds(s,"end")?ge.findFrom(c.doc.resolve(c.mapping.map(i.pos,-1)),-1):oe.create(c.doc,i.pos-s.nodeSize)),e(c.scrollIntoView())}return!0}if(u==1||r.node(u-1).childCount>1)break}return s.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos-s.nodeSize,i.pos).scrollIntoView()),!0):!1},N4=(t,e,n)=>{let r=$x(t,n);if(!r)return!1;let i=wp(r);return i?Hx(t,i,e):!1},O4=(t,e,n)=>{let r=qx(t,n);if(!r)return!1;let i=Cp(r);return i?Hx(t,i,e):!1};function Hx(t,e,n){let r=e.nodeBefore,i=r,s=e.pos-1;for(;!i.isTextblock;s--){if(i.type.spec.isolating)return!1;let p=i.lastChild;if(!p)return!1;i=p}let u=e.nodeAfter,a=u,c=e.pos+1;for(;!a.isTextblock;c++){if(a.type.spec.isolating)return!1;let p=a.firstChild;if(!p)return!1;a=p}let f=dc(t.doc,s,c,G.empty);if(!f||f.from!=s||f instanceof lt&&f.slice.size>=c-s)return!1;if(n){let p=t.tr.step(f);p.setSelection(de.create(p.doc,s)),n(p.scrollIntoView())}return!0}function Ds(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const Ux=(t,e,n)=>{let{$head:r,empty:i}=t.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;s=wp(r)}let u=s&&s.nodeBefore;return!u||!oe.isSelectable(u)?!1:(e&&e(t.tr.setSelection(oe.create(t.doc,s.pos-u.nodeSize)).scrollIntoView()),!0)};function wp(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function qx(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const Wx=(t,e,n)=>{let r=qx(t,n);if(!r)return!1;let i=Cp(r);if(!i)return!1;let s=i.nodeAfter;if(Qx(t,i,e,1))return!0;if(r.parent.content.size==0&&(Ds(s,"start")||oe.isSelectable(s))){let u=dc(t.doc,r.before(),r.after(),G.empty);if(u&&u.slice.size<u.to-u.from){if(e){let a=t.tr.step(u);a.setSelection(Ds(s,"start")?ge.findFrom(a.doc.resolve(a.mapping.map(i.pos)),1):oe.create(a.doc,a.mapping.map(i.pos))),e(a.scrollIntoView())}return!0}}return s.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos,i.pos+s.nodeSize).scrollIntoView()),!0):!1},Kx=(t,e,n)=>{let{$head:r,empty:i}=t.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;s=Cp(r)}let u=s&&s.nodeAfter;return!u||!oe.isSelectable(u)?!1:(e&&e(t.tr.setSelection(oe.create(t.doc,s.pos)).scrollIntoView()),!0)};function Cp(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const R4=(t,e)=>{let n=t.selection,r=n instanceof oe,i;if(r){if(n.node.isTextblock||!oi(t.doc,n.from))return!1;i=n.from}else if(i=cc(t.doc,n.from,-1),i==null)return!1;if(e){let s=t.tr.join(i);r&&s.setSelection(oe.create(s.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0},I4=(t,e)=>{let n=t.selection,r;if(n instanceof oe){if(n.node.isTextblock||!oi(t.doc,n.to))return!1;r=n.to}else if(r=cc(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},L4=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),s=i&&zs(i);return s==null?!1:(e&&e(t.tr.lift(i,s).scrollIntoView()),!0)},Zx=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
223
- `).scrollIntoView()),!0)};function Sp(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const P4=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),s=n.indexAfter(-1),u=Sp(i.contentMatchAt(s));if(!u||!i.canReplaceWith(s,s,u))return!1;if(e){let a=n.after(),c=t.tr.replaceWith(a,a,u.createAndFill());c.setSelection(ge.near(c.doc.resolve(a),1)),e(c.scrollIntoView())}return!0},Jx=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof nn||r.parent.inlineContent||i.parent.inlineContent)return!1;let s=Sp(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let u=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,a=t.tr.insert(u,s.createAndFill());a.setSelection(de.create(a.doc,u+1)),e(a.scrollIntoView())}return!0},Gx=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let s=n.before();if(fr(t.doc,s))return e&&e(t.tr.split(s).scrollIntoView()),!0}let r=n.blockRange(),i=r&&zs(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)};function F4(t){return(e,n)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof oe&&e.selection.node.isBlock)return!r.parentOffset||!fr(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let s=[],u,a,c=!1,f=!1;for(let x=r.depth;;x--)if(r.node(x).isBlock){c=r.end(x)==r.pos+(r.depth-x),f=r.start(x)==r.pos-(r.depth-x),a=Sp(r.node(x-1).contentMatchAt(r.indexAfter(x-1))),s.unshift(c&&a?{type:a}:null),u=x;break}else{if(x==1)return!1;s.unshift(null)}let p=e.tr;(e.selection instanceof de||e.selection instanceof nn)&&p.deleteSelection();let m=p.mapping.map(r.pos),y=fr(p.doc,m,s.length,s);if(y||(s[0]=a?{type:a}:null,y=fr(p.doc,m,s.length,s)),!y)return!1;if(p.split(m,s.length,s),!c&&f&&r.node(u).type!=a){let x=p.mapping.map(r.before(u)),b=p.doc.resolve(x);a&&r.node(u-1).canReplaceWith(b.index(),b.index()+1,a)&&p.setNodeMarkup(p.mapping.map(r.before(u)),a)}return n&&n(p.scrollIntoView()),!0}}const z4=F4(),j4=(t,e)=>{let{$from:n,to:r}=t.selection,i,s=n.sharedDepth(r);return s==0?!1:(i=n.before(s),e&&e(t.tr.setSelection(oe.create(t.doc,i))),!0)};function B4(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,s=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(s-1,s)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(s,s+1)||!(i.isTextblock||oi(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function Qx(t,e,n,r){let i=e.nodeBefore,s=e.nodeAfter,u,a,c=i.type.spec.isolating||s.type.spec.isolating;if(!c&&B4(t,e,n))return!0;let f=!c&&e.parent.canReplace(e.index(),e.index()+1);if(f&&(u=(a=i.contentMatchAt(i.childCount)).findWrapping(s.type))&&a.matchType(u[0]||s.type).validEnd){if(n){let x=e.pos+s.nodeSize,b=j.empty;for(let S=u.length-1;S>=0;S--)b=j.from(u[S].create(null,b));b=j.from(i.copy(b));let v=t.tr.step(new bt(e.pos-1,x,e.pos,x,new G(b,1,0),u.length,!0)),w=v.doc.resolve(x+2*u.length);w.nodeAfter&&w.nodeAfter.type==i.type&&oi(v.doc,w.pos)&&v.join(w.pos),n(v.scrollIntoView())}return!0}let p=s.type.spec.isolating||r>0&&c?null:ge.findFrom(e,1),m=p&&p.$from.blockRange(p.$to),y=m&&zs(m);if(y!=null&&y>=e.depth)return n&&n(t.tr.lift(m,y).scrollIntoView()),!0;if(f&&Ds(s,"start",!0)&&Ds(i,"end")){let x=i,b=[];for(;b.push(x),!x.isTextblock;)x=x.lastChild;let v=s,w=1;for(;!v.isTextblock;v=v.firstChild)w++;if(x.canReplace(x.childCount,x.childCount,v.content)){if(n){let S=j.empty;for(let R=b.length-1;R>=0;R--)S=j.from(b[R].copy(S));let A=t.tr.step(new bt(e.pos-b.length,e.pos+s.nodeSize,e.pos+w,e.pos+s.nodeSize-w,new G(S,b.length,0),0,!0));n(A.scrollIntoView())}return!0}}return!1}function Yx(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return i.node(s).isTextblock?(n&&n(e.tr.setSelection(de.create(e.doc,t<0?i.start(s):i.end(s)))),!0):!1}}const $4=Yx(-1),V4=Yx(1);function H4(t,e=null){return function(n,r){let{$from:i,$to:s}=n.selection,u=i.blockRange(s),a=u&&bp(u,t,e);return a?(r&&r(n.tr.wrap(u,a).scrollIntoView()),!0):!1}}function ny(t,e=null){return function(n,r){let i=!1;for(let s=0;s<n.selection.ranges.length&&!i;s++){let{$from:{pos:u},$to:{pos:a}}=n.selection.ranges[s];n.doc.nodesBetween(u,a,(c,f)=>{if(i)return!1;if(!(!c.isTextblock||c.hasMarkup(t,e)))if(c.type==t)i=!0;else{let p=n.doc.resolve(f),m=p.index();i=p.parent.canReplaceWith(m,m+1,t)}})}if(!i)return!1;if(r){let s=n.tr;for(let u=0;u<n.selection.ranges.length;u++){let{$from:{pos:a},$to:{pos:c}}=n.selection.ranges[u];s.setBlockType(a,c,t,e)}r(s.scrollIntoView())}return!0}}function Ep(...t){return function(e,n,r){for(let i=0;i<t.length;i++)if(t[i](e,n,r))return!0;return!1}}Ep(Bx,Vx,Ux);Ep(Bx,Wx,Kx);Ep(Zx,Jx,Gx,z4);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function U4(t,e=null){return function(n,r){let{$from:i,$to:s}=n.selection,u=i.blockRange(s);if(!u)return!1;let a=r?n.tr:null;return q4(a,u,t,e)?(r&&r(a.scrollIntoView()),!0):!1}}function q4(t,e,n,r=null){let i=!1,s=e,u=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let c=u.resolve(e.start-2);s=new ya(c,c,e.depth),e.endIndex<e.parent.childCount&&(e=new ya(e.$from,u.resolve(e.$to.end(e.depth)),e.depth)),i=!0}let a=bp(s,n,r,e);return a?(t&&W4(t,e,a,i,n),!0):!1}function W4(t,e,n,r,i){let s=j.empty;for(let p=n.length-1;p>=0;p--)s=j.from(n[p].type.create(n[p].attrs,s));t.step(new bt(e.start-(r?2:0),e.end,e.start,e.end,new G(s,0,0),n.length,!0));let u=0;for(let p=0;p<n.length;p++)n[p].type==i&&(u=p+1);let a=n.length-u,c=e.start+n.length-(r?2:0),f=e.parent;for(let p=e.startIndex,m=e.endIndex,y=!0;p<m;p++,y=!1)!y&&fr(t.doc,c,a)&&(t.split(c,a),c+=2*a),c+=f.child(p).nodeSize;return t}function K4(t){return function(e,n){let{$from:r,$to:i}=e.selection,s=r.blockRange(i,u=>u.childCount>0&&u.firstChild.type==t);return s?n?r.node(s.depth-1).type==t?Z4(e,n,t,s):J4(e,n,s):!0:!1}}function Z4(t,e,n,r){let i=t.tr,s=r.end,u=r.$to.end(r.depth);s<u&&(i.step(new bt(s-1,u,s,u,new G(j.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new ya(i.doc.resolve(r.$from.pos),i.doc.resolve(u),r.depth));const a=zs(r);if(a==null)return!1;i.lift(r,a);let c=i.doc.resolve(i.mapping.map(s,-1)-1);return oi(i.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&i.join(c.pos),e(i.scrollIntoView()),!0}function J4(t,e,n){let r=t.tr,i=n.parent;for(let x=n.end,b=n.endIndex-1,v=n.startIndex;b>v;b--)x-=i.child(b).nodeSize,r.delete(x-1,x+1);let s=r.doc.resolve(n.start),u=s.nodeAfter;if(r.mapping.map(n.end)!=n.start+s.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,c=n.endIndex==i.childCount,f=s.node(-1),p=s.index(-1);if(!f.canReplace(p+(a?0:1),p+1,u.content.append(c?j.empty:j.from(i))))return!1;let m=s.pos,y=m+u.nodeSize;return r.step(new bt(m-(a?1:0),y+(c?1:0),m+1,y-1,new G((a?j.empty:j.from(i.copy(j.empty))).append(c?j.empty:j.from(i.copy(j.empty))),a?0:1,c?0:1),a?0:1)),e(r.scrollIntoView()),!0}function G4(t){return function(e,n){let{$from:r,$to:i}=e.selection,s=r.blockRange(i,f=>f.childCount>0&&f.firstChild.type==t);if(!s)return!1;let u=s.startIndex;if(u==0)return!1;let a=s.parent,c=a.child(u-1);if(c.type!=t)return!1;if(n){let f=c.lastChild&&c.lastChild.type==a.type,p=j.from(f?t.create():null),m=new G(j.from(t.create(null,j.from(a.type.create(null,p)))),f?3:1,0),y=s.start,x=s.end;n(e.tr.step(new bt(y-(f?3:1),x,y,x,m,1,!0)).scrollIntoView())}return!0}}const Et=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Ns=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let Ph=null;const ur=function(t,e,n){let r=Ph||(Ph=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},Q4=function(){Ph=null},Bi=function(t,e,n,r){return n&&(ry(t,e,n,r,-1)||ry(t,e,n,r,1))},Y4=/^(img|br|input|textarea|hr)$/i;function ry(t,e,n,r,i){for(var s;;){if(t==n&&e==r)return!0;if(e==(i<0?0:gn(t))){let u=t.parentNode;if(!u||u.nodeType!=1||ku(t)||Y4.test(t.nodeName)||t.contentEditable=="false")return!1;e=Et(t)+(i<0?0:1),t=u}else if(t.nodeType==1){let u=t.childNodes[e+(i<0?-1:0)];if(u.nodeType==1&&u.contentEditable=="false")if(!((s=u.pmViewDesc)===null||s===void 0)&&s.ignoreForSelection)e+=i;else return!1;else t=u,e=i<0?gn(t):0}else return!1}}function gn(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function X4(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=gn(t)}else if(t.parentNode&&!ku(t))e=Et(t),t=t.parentNode;else return null}}function eS(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!ku(t))e=Et(t)+1,t=t.parentNode;else return null}}function tS(t,e,n){for(let r=e==0,i=e==gn(t);r||i;){if(t==n)return!0;let s=Et(t);if(t=t.parentNode,!t)return!1;r=r&&s==0,i=i&&s==gn(t)}}function ku(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const hc=function(t){return t.focusNode&&Bi(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Si(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function nS(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function rS(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(gn(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(gn(r.startContainer),r.startOffset)}}}const Un=typeof navigator<"u"?navigator:null,iy=typeof document<"u"?document:null,ui=Un&&Un.userAgent||"",Fh=/Edge\/(\d+)/.exec(ui),Xx=/MSIE \d/.exec(ui),zh=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ui),Kt=!!(Xx||zh||Fh),Gr=Xx?document.documentMode:zh?+zh[1]:Fh?+Fh[1]:0,yn=!Kt&&/gecko\/(\d+)/i.test(ui);yn&&+(/Firefox\/(\d+)/.exec(ui)||[0,0])[1];const jh=!Kt&&/Chrome\/(\d+)/.exec(ui),Tt=!!jh,ek=jh?+jh[1]:0,Rt=!Kt&&!!Un&&/Apple Computer/.test(Un.vendor),Os=Rt&&(/Mobile\/\w+/.test(ui)||!!Un&&Un.maxTouchPoints>2),mn=Os||(Un?/Mac/.test(Un.platform):!1),tk=Un?/Win/.test(Un.platform):!1,ar=/Android \d/.test(ui),bu=!!iy&&"webkitFontSmoothing"in iy.documentElement.style,iS=bu?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function sS(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function nr(t,e){return typeof t=="number"?t:t[e]}function oS(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function sy(t,e,n){if(!Bh(e)&&e.left==0)return;let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,s=t.dom.ownerDocument;for(let u=n||t.dom;u;){if(u.nodeType!=1){u=Ns(u);continue}let a=u,c=a==s.body,f=c?sS(s):oS(a),p=0,m=0;if(e.top<f.top+nr(r,"top")?m=-(f.top-e.top+nr(i,"top")):e.bottom>f.bottom-nr(r,"bottom")&&(m=e.bottom-e.top>f.bottom-f.top?e.top+nr(i,"top")-f.top:e.bottom-f.bottom+nr(i,"bottom")),e.left<f.left+nr(r,"left")?p=-(f.left-e.left+nr(i,"left")):e.right>f.right-nr(r,"right")&&(p=e.right-f.right+nr(i,"right")),p||m)if(c)s.defaultView.scrollBy(p,m);else{let x=a.scrollLeft,b=a.scrollTop;m&&(a.scrollTop+=m),p&&(a.scrollLeft+=p);let v=a.scrollLeft-x,w=a.scrollTop-b;e={left:e.left-v,top:e.top-w,right:e.right-v,bottom:e.bottom-w}}let y=c?"fixed":getComputedStyle(u).position;if(/^(fixed|sticky)$/.test(y))break;u=y=="absolute"?u.offsetParent:Ns(u)}}function uS(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let s=(e.left+e.right)/2,u=n+1;u<Math.min(innerHeight,e.bottom);u+=5){let a=t.root.elementFromPoint(s,u);if(!a||a==t.dom||!t.dom.contains(a))continue;let c=a.getBoundingClientRect();if(c.top>=n-20){r=a,i=c.top;break}}return{refDOM:r,refTop:i,stack:nk(t.dom)}}function nk(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Ns(r));return e}function lS({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;rk(n,r==0?0:r-e)}function rk(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:i,left:s}=t[n];r.scrollTop!=i+e&&(r.scrollTop=i+e),r.scrollLeft!=s&&(r.scrollLeft=s)}}let gs=null;function aS(t){if(t.setActive)return t.setActive();if(gs)return t.focus(gs);let e=nk(t);t.focus(gs==null?{get preventScroll(){return gs={preventScroll:!0},!0}}:void 0),gs||(gs=!1,rk(e,0))}function ik(t,e){let n,r=2e8,i,s=0,u=e.top,a=e.top,c,f;for(let p=t.firstChild,m=0;p;p=p.nextSibling,m++){let y;if(p.nodeType==1)y=p.getClientRects();else if(p.nodeType==3)y=ur(p).getClientRects();else continue;for(let x=0;x<y.length;x++){let b=y[x];if(b.top<=u&&b.bottom>=a){u=Math.max(b.bottom,u),a=Math.min(b.top,a);let v=b.left>e.left?b.left-e.left:b.right<e.left?e.left-b.right:0;if(v<r){n=p,r=v,i=v&&n.nodeType==3?{left:b.right<e.left?b.right:b.left,top:e.top}:e,p.nodeType==1&&v&&(s=m+(e.left>=(b.left+b.right)/2?1:0));continue}}else b.top>e.top&&!c&&b.left<=e.left&&b.right>=e.left&&(c=p,f={left:Math.max(b.left,Math.min(b.right,e.left)),top:b.top});!n&&(e.left>=b.right&&e.top>=b.top||e.left>=b.left&&e.top>=b.bottom)&&(s=m+1)}}return!n&&c&&(n=c,i=f,r=0),n&&n.nodeType==3?cS(n,i):!n||r&&n.nodeType==1?{node:t,offset:s}:ik(n,i)}function cS(t,e){let n=t.nodeValue.length,r=document.createRange(),i;for(let s=0;s<n;s++){r.setEnd(t,s+1),r.setStart(t,s);let u=Pr(r,1);if(u.top!=u.bottom&&_p(e,u)){i={node:t,offset:s+(e.left>=(u.left+u.right)/2?1:0)};break}}return r.detach(),i||{node:t,offset:0}}function _p(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function dS(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function fS(t,e,n){let{node:r,offset:i}=ik(e,n),s=-1;if(r.nodeType==1&&!r.firstChild){let u=r.getBoundingClientRect();s=u.left!=u.right&&n.left>(u.left+u.right)/2?1:-1}return t.docView.posFromDOM(r,i,s)}function hS(t,e,n,r){let i=-1;for(let s=e,u=!1;s!=t.dom;){let a=t.docView.nearestDesc(s,!0),c;if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((c=a.dom.getBoundingClientRect()).width||c.height)&&(a.node.isBlock&&a.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(a.dom.nodeName)&&(!u&&c.left>r.left||c.top>r.top?i=a.posBefore:(!u&&c.right<r.left||c.bottom<r.top)&&(i=a.posAfter),u=!0),!a.contentDOM&&i<0&&!a.node.isText))return(a.node.isBlock?r.top<(c.top+c.bottom)/2:r.left<(c.left+c.right)/2)?a.posBefore:a.posAfter;s=a.dom.parentNode}return i>-1?i:t.docView.posFromDOM(e,n,-1)}function sk(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),s=i;;){let u=t.childNodes[s];if(u.nodeType==1){let a=u.getClientRects();for(let c=0;c<a.length;c++){let f=a[c];if(_p(e,f))return sk(u,e,f)}}if((s=(s+1)%r)==i)break}return t}function pS(t,e){let n=t.dom.ownerDocument,r,i=0,s=rS(n,e.left,e.top);s&&({node:r,offset:i}=s);let u=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),a;if(!u||!t.dom.contains(u.nodeType!=1?u.parentNode:u)){let f=t.dom.getBoundingClientRect();if(!_p(e,f)||(u=sk(t.dom,e,f),!u))return null}if(Rt)for(let f=u;r&&f;f=Ns(f))f.draggable&&(r=void 0);if(u=dS(u,e),r){if(yn&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let p=r.childNodes[i],m;p.nodeName=="IMG"&&(m=p.getBoundingClientRect()).right<=e.left&&m.bottom>e.top&&i++}let f;bu&&i&&r.nodeType==1&&(f=r.childNodes[i-1]).nodeType==1&&f.contentEditable=="false"&&f.getBoundingClientRect().top>=e.top&&i--,r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(a=hS(t,r,i,e))}a==null&&(a=fS(t,u,e));let c=t.docView.nearestDesc(u,!0);return{pos:a,inside:c?c.posAtStart-c.border:-1}}function Bh(t){return t.top<t.bottom||t.left<t.right}function Pr(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(Bh(r))return r}return Array.prototype.find.call(n,Bh)||t.getBoundingClientRect()}const mS=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function ok(t,e,n){let{node:r,offset:i,atom:s}=t.docView.domFromPos(e,n<0?-1:1),u=bu||yn;if(r.nodeType==3)if(u&&(mS.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let c=Pr(ur(r,i,i),n);if(yn&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let f=Pr(ur(r,i-1,i-1),-1);if(f.top==c.top){let p=Pr(ur(r,i,i+1),-1);if(p.top!=c.top)return To(p,p.left<f.left)}}return c}else{let c=i,f=i,p=n<0?1:-1;return n<0&&!i?(f++,p=-1):n>=0&&i==r.nodeValue.length?(c--,p=1):n<0?c--:f++,To(Pr(ur(r,c,f),p),p<0)}if(!t.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&i&&(n<0||i==gn(r))){let c=r.childNodes[i-1];if(c.nodeType==1)return Bf(c.getBoundingClientRect(),!1)}if(s==null&&i<gn(r)){let c=r.childNodes[i];if(c.nodeType==1)return Bf(c.getBoundingClientRect(),!0)}return Bf(r.getBoundingClientRect(),n>=0)}if(s==null&&i&&(n<0||i==gn(r))){let c=r.childNodes[i-1],f=c.nodeType==3?ur(c,gn(c)-(u?0:1)):c.nodeType==1&&(c.nodeName!="BR"||!c.nextSibling)?c:null;if(f)return To(Pr(f,1),!1)}if(s==null&&i<gn(r)){let c=r.childNodes[i];for(;c.pmViewDesc&&c.pmViewDesc.ignoreForCoords;)c=c.nextSibling;let f=c?c.nodeType==3?ur(c,0,u?0:1):c.nodeType==1?c:null:null;if(f)return To(Pr(f,-1),!0)}return To(Pr(r.nodeType==3?ur(r):r,-n),n>=0)}function To(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function Bf(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function uk(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}function gS(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return uk(t,e,()=>{let{node:s}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(s,!0);if(!a)break;if(a.node.isBlock){s=a.contentDOM||a.dom;break}s=a.dom.parentNode}let u=ok(t,i.pos,1);for(let a=s.firstChild;a;a=a.nextSibling){let c;if(a.nodeType==1)c=a.getClientRects();else if(a.nodeType==3)c=ur(a,0,a.nodeValue.length).getClientRects();else continue;for(let f=0;f<c.length;f++){let p=c[f];if(p.bottom>p.top+1&&(n=="up"?u.top-p.top>(p.bottom-u.top)*2:p.bottom-u.bottom>(u.bottom-p.top)*2))return!1}}return!0})}const yS=/[\u0590-\u08ac]/;function xS(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,s=!i,u=i==r.parent.content.size,a=t.domSelection();return a?!yS.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?s:u:uk(t,e,()=>{let{focusNode:c,focusOffset:f,anchorNode:p,anchorOffset:m}=t.domSelectionRange(),y=a.caretBidiLevel;a.modify("move",n,"character");let x=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:b,focusOffset:v}=t.domSelectionRange(),w=b&&!x.contains(b.nodeType==1?b:b.parentNode)||c==b&&f==v;try{a.collapse(p,m),c&&(c!=p||f!=m)&&a.extend&&a.extend(c,f)}catch{}return y!=null&&(a.caretBidiLevel=y),w}):r.pos==r.start()||r.pos==r.end()}let oy=null,uy=null,ly=!1;function kS(t,e,n){return oy==e&&uy==n?ly:(oy=e,uy=n,ly=n=="up"||n=="down"?gS(t,e,n):xS(t,e,n))}const xn=0,ay=1,_i=2,Mn=3;class vu{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=xn,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(e){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,r=this.posAtStart;;n++){let i=this.children[n];if(i==e)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(e,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let s,u;if(e==this.contentDOM)s=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.previousSibling}for(;s&&!((u=s.pmViewDesc)&&u.parent==this);)s=s.previousSibling;return s?this.posBeforeChild(u)+u.size:this.posAtStart}else{let s,u;if(e==this.contentDOM)s=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.nextSibling}for(;s&&!((u=s.pmViewDesc)&&u.parent==this);)s=s.nextSibling;return s?this.posBeforeChild(u):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=n>Et(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!1;break}if(s.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!0;break}if(s.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,i=e;i;i=i.parentNode){let s=this.getDesc(i),u;if(s&&(!n||s.node))if(r&&(u=s.nodeDOM)&&!(u.nodeType==1?u.contains(e.nodeType==1?e:e.parentNode):u==e))r=!1;else return s}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let i=e;i;i=i.parentNode){let s=this.getDesc(i);if(s)return s.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let i=this.children[n],s=r+i.size;if(r==e&&s!=r){for(;!i.border&&i.children.length;)for(let u=0;u<i.children.length;u++){let a=i.children[u];if(a.size){i=a;break}}return i}if(e<s)return i.descAt(e-r-i.border);r=s}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,i=0;for(let s=0;r<this.children.length;r++){let u=this.children[r],a=s+u.size;if(a>e||u instanceof ak){i=e-s;break}s=a}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let s;r&&!(s=this.children[r-1]).size&&s instanceof lk&&s.side>=0;r--);if(n<=0){let s,u=!0;for(;s=r?this.children[r-1]:null,!(!s||s.dom.parentNode==this.contentDOM);r--,u=!1);return s&&n&&u&&!s.border&&!s.domAtom?s.domFromPos(s.size,n):{node:this.contentDOM,offset:s?Et(s.dom)+1:0}}else{let s,u=!0;for(;s=r<this.children.length?this.children[r]:null,!(!s||s.dom.parentNode==this.contentDOM);r++,u=!1);return s&&u&&!s.border&&!s.domAtom?s.domFromPos(0,n):{node:this.contentDOM,offset:s?Et(s.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,s=-1;for(let u=r,a=0;;a++){let c=this.children[a],f=u+c.size;if(i==-1&&e<=f){let p=u+c.border;if(e>=p&&n<=f-c.border&&c.node&&c.contentDOM&&this.contentDOM.contains(c.contentDOM))return c.parseRange(e,n,p);e=u;for(let m=a;m>0;m--){let y=this.children[m-1];if(y.size&&y.dom.parentNode==this.contentDOM&&!y.emptyChildAt(1)){i=Et(y.dom)+1;break}e-=y.size}i==-1&&(i=0)}if(i>-1&&(f>n||a==this.children.length-1)){n=f;for(let p=a+1;p<this.children.length;p++){let m=this.children[p];if(m.size&&m.dom.parentNode==this.contentDOM&&!m.emptyChildAt(-1)){s=Et(m.dom);break}n+=m.size}s==-1&&(s=this.contentDOM.childNodes.length);break}u=f}return{node:this.contentDOM,from:e,to:n,fromOffset:i,toOffset:s}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,i=!1){let s=Math.min(e,n),u=Math.max(e,n);for(let x=0,b=0;x<this.children.length;x++){let v=this.children[x],w=b+v.size;if(s>b&&u<w)return v.setSelection(e-b-v.border,n-b-v.border,r,i);b=w}let a=this.domFromPos(e,e?-1:1),c=n==e?a:this.domFromPos(n,n?-1:1),f=r.root.getSelection(),p=r.domSelectionRange(),m=!1;if((yn||Rt)&&e==n){let{node:x,offset:b}=a;if(x.nodeType==3){if(m=!!(b&&x.nodeValue[b-1]==`
224
- `),m&&b==x.nodeValue.length)for(let v=x,w;v;v=v.parentNode){if(w=v.nextSibling){w.nodeName=="BR"&&(a=c={node:w.parentNode,offset:Et(w)+1});break}let S=v.pmViewDesc;if(S&&S.node&&S.node.isBlock)break}}else{let v=x.childNodes[b-1];m=v&&(v.nodeName=="BR"||v.contentEditable=="false")}}if(yn&&p.focusNode&&p.focusNode!=c.node&&p.focusNode.nodeType==1){let x=p.focusNode.childNodes[p.focusOffset];x&&x.contentEditable=="false"&&(i=!0)}if(!(i||m&&Rt)&&Bi(a.node,a.offset,p.anchorNode,p.anchorOffset)&&Bi(c.node,c.offset,p.focusNode,p.focusOffset))return;let y=!1;if((f.extend||e==n)&&!(m&&yn)){f.collapse(a.node,a.offset);try{e!=n&&f.extend(c.node,c.offset),y=!0}catch{}}if(!y){if(e>n){let b=a;a=c,c=b}let x=document.createRange();x.setEnd(c.node,c.offset),x.setStart(a.node,a.offset),f.removeAllRanges(),f.addRange(x)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,i=0;i<this.children.length;i++){let s=this.children[i],u=r+s.size;if(r==u?e<=u&&n>=r:e<u&&n>r){let a=r+s.border,c=u-s.border;if(e>=a&&n<=c){this.dirty=e==r||n==u?_i:ay,e==a&&n==c&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=Mn:s.markDirty(e-a,n-a);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?_i:Mn}r=u}this.dirty=_i}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?_i:ay;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class lk extends vu{constructor(e,n,r,i){let s,u=n.type.toDOM;if(typeof u=="function"&&(u=u(r,()=>{if(!s)return i;if(s.parent)return s.parent.posBeforeChild(s)})),!n.type.spec.raw){if(u.nodeType!=1){let a=document.createElement("span");a.appendChild(u),u=a}u.contentEditable="false",u.classList.add("ProseMirror-widget")}super(e,[],u,null),this.widget=n,this.widget=n,s=this}matchesWidget(e){return this.dirty==xn&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class bS extends vu{constructor(e,n,r,i){super(e,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class Qr extends vu{constructor(e,n,r,i,s){super(e,[],r,i),this.mark=n,this.spec=s}static create(e,n,r,i){let s=i.nodeViews[n.type.name],u=s&&s(n,i,r);return(!u||!u.dom)&&(u=Vi.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new Qr(e,n,u.dom,u.contentDOM||u.dom,u)}parseRule(){return this.dirty&Mn||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Mn&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=xn){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=xn}}slice(e,n,r){let i=Qr.create(this.parent,this.mark,!0,r),s=this.children,u=this.size;n<u&&(s=Vh(s,n,u,r)),e>0&&(s=Vh(s,0,e,r));for(let a=0;a<s.length;a++)s[a].parent=i;return i.children=s,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class Yr extends vu{constructor(e,n,r,i,s,u,a){super(e,[],s,u),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=a}static create(e,n,r,i,s,u){let a=s.nodeViews[n.type.name],c,f=a&&a(n,s,()=>{if(!c)return u;if(c.parent)return c.parent.posBeforeChild(c)},r,i),p=f&&f.dom,m=f&&f.contentDOM;if(n.isText){if(!p)p=document.createTextNode(n.text);else if(p.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else p||({dom:p,contentDOM:m}=Vi.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!m&&!n.isText&&p.nodeName!="BR"&&(p.hasAttribute("contenteditable")||(p.contentEditable="false"),n.type.spec.draggable&&(p.draggable=!0));let y=p;return p=fk(p,r,n),f?c=new vS(e,n,r,i,p,m||null,y,f):n.isText?new pc(e,n,r,i,p,y):new Yr(e,n,r,i,p,m||null,y)}parseRule(e){if(this.node.type.spec.reparseInView)return null;let n={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(n.preserveWhitespace="full"),!this.contentDOM)n.getContent=()=>this.node.content;else if(!this.contentLost)n.contentElement=this.contentDOM;else{for(let r=this.children.length-1;r>=0;r--){let i=this.children[r];if(this.dom.contains(i.dom.parentNode)){n.contentElement=i.dom.parentNode;break}}if(!n.contentElement){let r=e&&e.find(i=>i.nodeType==1&&e.indexOf(i.parentNode)<0&&this.dom.contains(i));r?n.contentElement=r:n.getContent=()=>j.empty}}return n}matchesNode(e,n,r){return this.dirty==xn&&e.eq(this.node)&&ka(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,i=n,s=e.composing?this.localCompositionInfo(e,n):null,u=s&&s.pos>-1?s:null,a=s&&s.pos<0,c=new CS(this,u&&u.node,e);_S(this.node,this.innerDeco,(f,p,m)=>{f.spec.marks?c.syncToMarks(f.spec.marks,r,e,p):f.type.side>=0&&!m&&c.syncToMarks(p==this.node.childCount?Re.none:this.node.child(p).marks,r,e,p),c.placeWidget(f,e,i)},(f,p,m,y)=>{c.syncToMarks(f.marks,r,e,y);let x;c.findNodeMatch(f,p,m,y)||a&&e.state.selection.from>i&&e.state.selection.to<i+f.nodeSize&&(x=c.findIndexWithChild(s.node))>-1&&c.updateNodeAt(f,p,m,x,e)||c.updateNextNode(f,p,m,e,y,i)||c.addNode(f,p,m,e,i),i+=f.nodeSize}),c.syncToMarks([],r,e,0),this.node.isTextblock&&c.addTextblockHacks(),c.destroyRest(),(c.changed||this.dirty==_i)&&(u&&this.protectLocalComposition(e,u),ck(this.contentDOM,this.children,e),Os&&TS(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof de)||r<n||i>n+this.node.content.size)return null;let s=e.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let u=s.nodeValue,a=AS(this.node.content,u,r-n,i-n);return a<0?null:{node:s,pos:a,text:u}}else return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let s=n;for(;s.parentNode!=this.contentDOM;s=s.parentNode){for(;s.previousSibling;)s.parentNode.removeChild(s.previousSibling);for(;s.nextSibling;)s.parentNode.removeChild(s.nextSibling);s.pmViewDesc&&(s.pmViewDesc=void 0)}let u=new bS(this,s,n,i);e.input.compositionNodes.push(u),this.children=Vh(this.children,r,r+i.length,e,u)}update(e,n,r,i){return this.dirty==Mn||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,i),!0)}updateInner(e,n,r,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=xn}updateOuterDeco(e){if(ka(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=dk(this.dom,this.nodeDOM,$h(this.outerDeco,this.node,n),$h(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function cy(t,e,n,r,i){fk(r,e,t);let s=new Yr(void 0,t,e,n,r,r,r);return s.contentDOM&&s.updateChildren(i,0),s}class pc extends Yr{constructor(e,n,r,i,s,u){super(e,n,r,i,s,null,u)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,i){return this.dirty==Mn||this.dirty!=xn&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=xn||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=xn,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let i=this.node.cut(e,n),s=document.createTextNode(i.text);return new pc(this.parent,i,this.outerDeco,this.innerDeco,s,s)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=Mn)}get domAtom(){return!1}isText(e){return this.node.text==e}}class ak extends vu{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==xn&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class vS extends Yr{constructor(e,n,r,i,s,u,a,c){super(e,n,r,i,s,u,a),this.spec=c}update(e,n,r,i){if(this.dirty==Mn)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let s=this.spec.update(e,n,r);return s&&this.updateInner(e,n,r,i),s}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,i){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function ck(t,e,n){let r=t.firstChild,i=!1;for(let s=0;s<e.length;s++){let u=e[s],a=u.dom;if(a.parentNode==t){for(;a!=r;)r=dy(r),i=!0;r=r.nextSibling}else i=!0,t.insertBefore(a,r);if(u instanceof Qr){let c=r?r.previousSibling:t.lastChild;ck(u.contentDOM,u.children,n),r=c?c.nextSibling:t.firstChild}}for(;r;)r=dy(r),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}const $o=function(t){t&&(this.nodeName=t)};$o.prototype=Object.create(null);const Ti=[new $o];function $h(t,e,n){if(t.length==0)return Ti;let r=n?Ti[0]:new $o,i=[r];for(let s=0;s<t.length;s++){let u=t[s].type.attrs;if(u){u.nodeName&&i.push(r=new $o(u.nodeName));for(let a in u){let c=u[a];c!=null&&(n&&i.length==1&&i.push(r=new $o(e.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+c:a=="style"?r.style=(r.style?r.style+";":"")+c:a!="nodeName"&&(r[a]=c))}}}return i}function dk(t,e,n,r){if(n==Ti&&r==Ti)return e;let i=e;for(let s=0;s<r.length;s++){let u=r[s],a=n[s];if(s){let c;a&&a.nodeName==u.nodeName&&i!=t&&(c=i.parentNode)&&c.nodeName.toLowerCase()==u.nodeName||(c=document.createElement(u.nodeName),c.pmIsDeco=!0,c.appendChild(i),a=Ti[0]),i=c}wS(i,a||Ti[0],u)}return i}function wS(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let s=0;s<r.length;s++)i.indexOf(r[s])==-1&&t.classList.remove(r[s]);for(let s=0;s<i.length;s++)r.indexOf(i[s])==-1&&t.classList.add(i[s]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(e.style);)t.style.removeProperty(i[1])}n.style&&(t.style.cssText+=n.style)}}function fk(t,e,n){return dk(t,t,Ti,$h(e,n,t.nodeType!=1))}function ka(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function dy(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class CS{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=SS(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r,i){let s=0,u=this.stack.length>>1,a=Math.min(u,e.length);for(;s<a&&(s==u-1?this.top:this.stack[s+1<<1]).matchesMark(e[s])&&e[s].type.spec.spanning!==!1;)s++;for(;s<u;)this.destroyRest(),this.top.dirty=xn,this.index=this.stack.pop(),this.top=this.stack.pop(),u--;for(;u<e.length;){this.stack.push(this.top,this.index+1);let c=-1,f=this.top.children.length;i<this.preMatch.index&&(f=Math.min(this.index+3,f));for(let p=this.index;p<f;p++){let m=this.top.children[p];if(m.matchesMark(e[u])&&!this.isLocked(m.dom)){c=p;break}}if(c<0&&this.index<this.top.children.length){let p=this.top.children[this.index];p instanceof Qr&&p.dirty!=Mn&&p.mark.type==e[u].type&&p.spec.update&&!this.isLocked(p.dom)&&p.spec.update(e[u])&&(p.mark=e[u],c=this.index,this.changed=!0)}if(c>-1)c>this.index&&(this.changed=!0,this.destroyBetween(this.index,c)),this.top=this.top.children[this.index];else{let p=Qr.create(this.top,e[u],n,r);this.top.children.splice(this.index,0,p),this.top=p,this.changed=!0}this.index=0,u++}}findNodeMatch(e,n,r,i){let s=-1,u;if(i>=this.preMatch.index&&(u=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&u.matchesNode(e,n,r))s=this.top.children.indexOf(u,this.index);else for(let a=this.index,c=Math.min(this.top.children.length,a+5);a<c;a++){let f=this.top.children[a];if(f.matchesNode(e,n,r)&&!this.preMatch.matched.has(f)){s=a;break}}return s<0?!1:(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(e,n,r,i,s){let u=this.top.children[i];return u.dirty==Mn&&u.dom==u.contentDOM&&(u.dirty=_i),u.update(e,n,r,s)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}e=n}}updateNextNode(e,n,r,i,s,u){for(let a=this.index;a<this.top.children.length;a++){let c=this.top.children[a];if(c instanceof Yr){let f=this.preMatch.matched.get(c);if(f!=null&&f!=s)return!1;let p=c.dom,m,y=this.isLocked(p)&&!(e.isText&&c.node&&c.node.isText&&c.nodeDOM.nodeValue==e.text&&c.dirty!=Mn&&ka(n,c.outerDeco));if(!y&&c.update(e,n,r,i))return this.destroyBetween(this.index,a),c.dom!=p&&(this.changed=!0),this.index++,!0;if(!y&&(m=this.recreateWrapper(c,e,n,r,i,u)))return this.destroyBetween(this.index,a),this.top.children[this.index]=m,m.contentDOM&&(m.dirty=_i,m.updateChildren(i,u+1),m.dirty=xn),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,i,s,u){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!ka(r,e.outerDeco)||!i.eq(e.innerDeco))return null;let a=Yr.create(this.top,n,r,i,s,u);if(a.contentDOM){a.children=e.children,e.children=[];for(let c of a.children)c.parent=a}return e.destroy(),a}addNode(e,n,r,i,s){let u=Yr.create(this.top,e,n,r,i,s);u.contentDOM&&u.updateChildren(i,s+1),this.top.children.splice(this.index++,0,u),this.changed=!0}placeWidget(e,n,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let s=new lk(this.top,e,n,r);this.top.children.splice(this.index++,0,s),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof Qr;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof pc)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Rt||Tt)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new ak(this.top,[],r,null);n!=this.top?n.children.push(i):n.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function SS(t,e){let n=e,r=n.children.length,i=t.childCount,s=new Map,u=[];e:for(;i>0;){let a;for(;;)if(r){let f=n.children[r-1];if(f instanceof Qr)n=f,r=f.children.length;else{a=f,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let c=a.node;if(c){if(c!=t.child(i-1))break;--i,s.set(a,i),u.push(a)}}return{index:i,matched:s,matches:u.reverse()}}function ES(t,e){return t.type.side-e.type.side}function _S(t,e,n,r){let i=e.locals(t),s=0;if(i.length==0){for(let f=0;f<t.childCount;f++){let p=t.child(f);r(p,i,e.forChild(s,p),f),s+=p.nodeSize}return}let u=0,a=[],c=null;for(let f=0;;){let p,m;for(;u<i.length&&i[u].to==s;){let w=i[u++];w.widget&&(p?(m||(m=[p])).push(w):p=w)}if(p)if(m){m.sort(ES);for(let w=0;w<m.length;w++)n(m[w],f,!!c)}else n(p,f,!!c);let y,x;if(c)x=-1,y=c,c=null;else if(f<t.childCount)x=f,y=t.child(f++);else break;for(let w=0;w<a.length;w++)a[w].to<=s&&a.splice(w--,1);for(;u<i.length&&i[u].from<=s&&i[u].to>s;)a.push(i[u++]);let b=s+y.nodeSize;if(y.isText){let w=b;u<i.length&&i[u].from<w&&(w=i[u].from);for(let S=0;S<a.length;S++)a[S].to<w&&(w=a[S].to);w<b&&(c=y.cut(w-s),y=y.cut(0,w-s),b=w,x=-1)}else for(;u<i.length&&i[u].to<b;)u++;let v=y.isInline&&!y.isLeaf?a.filter(w=>!w.inline):a.slice();r(y,v,e.forChild(s,y),x),s=b}}function TS(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function AS(t,e,n,r){for(let i=0,s=0;i<t.childCount&&s<=r;){let u=t.child(i++),a=s;if(s+=u.nodeSize,!u.isText)continue;let c=u.text;for(;i<t.childCount;){let f=t.child(i++);if(s+=f.nodeSize,!f.isText)break;c+=f.text}if(s>=n){if(s>=r&&c.slice(r-e.length-a,r-a)==e)return r-e.length;let f=a<r?c.lastIndexOf(e,r-a-1):-1;if(f>=0&&f+e.length+a>=n)return a+f;if(n==r&&c.length>=r+e.length-a&&c.slice(r-a,r-a+e.length)==e)return r}}return-1}function Vh(t,e,n,r,i){let s=[];for(let u=0,a=0;u<t.length;u++){let c=t[u],f=a,p=a+=c.size;f>=n||p<=e?s.push(c):(f<e&&s.push(c.slice(0,e-f,r)),i&&(s.push(i),i=void 0),p>n&&s.push(c.slice(n-f,c.size,r)))}return s}function Tp(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),s=i&&i.size==0,u=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(u<0)return null;let a=r.resolve(u),c,f;if(hc(n)){for(c=u;i&&!i.node;)i=i.parent;let m=i.node;if(i&&m.isAtom&&oe.isSelectable(m)&&i.parent&&!(m.isInline&&tS(n.focusNode,n.focusOffset,i.dom))){let y=i.posBefore;f=new oe(u==y?a:r.resolve(y))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let m=u,y=u;for(let x=0;x<n.rangeCount;x++){let b=n.getRangeAt(x);m=Math.min(m,t.docView.posFromDOM(b.startContainer,b.startOffset,1)),y=Math.max(y,t.docView.posFromDOM(b.endContainer,b.endOffset,-1))}if(m<0)return null;[c,u]=y==t.state.selection.anchor?[y,m]:[m,y],a=r.resolve(u)}else c=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null}let p=r.resolve(c);if(!f){let m=e=="pointer"||t.state.selection.head<a.pos&&!s?1:-1;f=Ap(t,p,a,m)}return f}function hk(t){return t.editable?t.hasFocus():mk(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function hr(t,e=!1){let n=t.state.selection;if(pk(t,n),!hk(t))return;let r=t.input.mouseDown;if(!e&&Tt&&r){let i=t.domSelectionRange(),s=t.domObserver.currentSelection;if(i.anchorNode&&s.anchorNode&&Bi(i.anchorNode,i.anchorOffset,s.anchorNode,s.anchorOffset)&&r.delaySelUpdate()){t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)DS(t);else{let{anchor:i,head:s}=n,u,a;fy&&!(n instanceof de)&&(n.$from.parent.inlineContent||(u=hy(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(a=hy(t,n.to))),t.docView.setSelection(i,s,t,e),fy&&(u&&py(u),a&&py(a)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&MS(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}const fy=Rt||Tt&&ek<63;function hy(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),i=r<n.childNodes.length?n.childNodes[r]:null,s=r?n.childNodes[r-1]:null;if(Rt&&i&&i.contentEditable=="false")return $f(i);if((!i||i.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(i)return $f(i);if(s)return $f(s)}}function $f(t){return t.contentEditable="true",Rt&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function py(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function MS(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!hk(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function DS(t){let e=t.domSelection();if(!e)return;let n=t.cursorWrapper.dom,r=n.nodeName=="IMG";r?e.collapse(n.parentNode,Et(n)+1):e.collapse(n,0),!r&&!t.state.selection.visible&&Kt&&Gr<=11&&(n.disabled=!0,n.disabled=!1)}function pk(t,e){if(e instanceof oe){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(my(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else my(t)}function my(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Ap(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||de.between(e,n,r)}function gy(t){return t.editable&&!t.hasFocus()?!1:mk(t)}function mk(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function NS(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return Bi(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Hh(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),s=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return s&&ge.findFrom(s,e)}function zr(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function yy(t,e,n){let r=t.state.selection;if(r instanceof de)if(n.indexOf("s")>-1){let{$head:i}=r,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let u=t.state.doc.resolve(i.pos+s.nodeSize*(e<0?-1:1));return zr(t,new de(r.$anchor,u))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=Hh(t.state,e);return i&&i instanceof oe?zr(t,i):!1}else if(!(mn&&n.indexOf("m")>-1)){let i=r.$head,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,u;if(!s||s.isText)return!1;let a=e<0?i.pos-s.nodeSize:i.pos;return s.isAtom||(u=t.docView.descAt(a))&&!u.contentDOM?oe.isSelectable(s)?zr(t,new oe(e<0?t.state.doc.resolve(i.pos-s.nodeSize):i)):bu?zr(t,new de(t.state.doc.resolve(e<0?a:a+s.nodeSize))):!1:!1}}else return!1;else{if(r instanceof oe&&r.node.isInline)return zr(t,new de(e>0?r.$to:r.$from));{let i=Hh(t.state,e);return i?zr(t,i):!1}}}function ba(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Vo(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function ys(t,e){return e<0?OS(t):RS(t)}function OS(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,s,u=!1;for(yn&&n.nodeType==1&&r<ba(n)&&Vo(n.childNodes[r],-1)&&(u=!0);;)if(r>0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(Vo(a,-1))i=n,s=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(gk(n))break;{let a=n.previousSibling;for(;a&&Vo(a,-1);)i=n.parentNode,s=Et(a),a=a.previousSibling;if(a)n=a,r=ba(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}u?Uh(t,n,r):i&&Uh(t,i,s)}function RS(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=ba(n),s,u;for(;;)if(r<i){if(n.nodeType!=1)break;let a=n.childNodes[r];if(Vo(a,1))s=n,u=++r;else break}else{if(gk(n))break;{let a=n.nextSibling;for(;a&&Vo(a,1);)s=a.parentNode,u=Et(a)+1,a=a.nextSibling;if(a)n=a,r=0,i=ba(n);else{if(n=n.parentNode,n==t.dom)break;r=i=0}}}s&&Uh(t,s,u)}function gk(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function IS(t,e){for(;t&&e==t.childNodes.length&&!ku(t);)e=Et(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=0}}function LS(t,e){for(;t&&!e&&!ku(t);)e=Et(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function Uh(t,e,n){if(e.nodeType!=3){let s,u;(u=IS(e,n))?(e=u,n=0):(s=LS(e,n))&&(e=s,n=s.nodeValue.length)}let r=t.domSelection();if(!r)return;if(hc(r)){let s=document.createRange();s.setEnd(e,n),s.setStart(e,n),r.removeAllRanges(),r.addRange(s)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:i}=t;setTimeout(()=>{t.state==i&&hr(t)},50)}function xy(t,e){let n=t.state.doc.resolve(e);if(!(Tt||tk)&&n.parent.inlineContent){let i=t.coordsAtPos(e);if(e>n.start()){let s=t.coordsAtPos(e-1),u=(s.top+s.bottom)/2;if(u>i.top&&u<i.bottom&&Math.abs(s.left-i.left)>1)return s.left<i.left?"ltr":"rtl"}if(e<n.end()){let s=t.coordsAtPos(e+1),u=(s.top+s.bottom)/2;if(u>i.top&&u<i.bottom&&Math.abs(s.left-i.left)>1)return s.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function ky(t,e,n){let r=t.state.selection;if(r instanceof de&&!r.empty||n.indexOf("s")>-1||mn&&n.indexOf("m")>-1)return!1;let{$from:i,$to:s}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let u=Hh(t.state,e);if(u&&u instanceof oe)return zr(t,u)}if(!i.parent.inlineContent){let u=e<0?i:s,a=r instanceof nn?ge.near(u,e):ge.findFrom(u,e);return a?zr(t,a):!1}return!1}function by(t,e){if(!(t.state.selection instanceof de))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let s=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){let u=t.state.tr;return e<0?u.delete(n.pos-s.nodeSize,n.pos):u.delete(n.pos,n.pos+s.nodeSize),t.dispatch(u),!0}return!1}function vy(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function PS(t){if(!Rt||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;vy(t,r,"true"),setTimeout(()=>vy(t,r,"false"),20)}return!1}function FS(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function zS(t,e){let n=e.keyCode,r=FS(e);if(n==8||mn&&n==72&&r=="c")return by(t,-1)||ys(t,-1);if(n==46&&!e.shiftKey||mn&&n==68&&r=="c")return by(t,1)||ys(t,1);if(n==13||n==27)return!0;if(n==37||mn&&n==66&&r=="c"){let i=n==37?xy(t,t.state.selection.from)=="ltr"?-1:1:-1;return yy(t,i,r)||ys(t,i)}else if(n==39||mn&&n==70&&r=="c"){let i=n==39?xy(t,t.state.selection.from)=="ltr"?1:-1:1;return yy(t,i,r)||ys(t,i)}else{if(n==38||mn&&n==80&&r=="c")return ky(t,-1,r)||ys(t,-1);if(n==40||mn&&n==78&&r=="c")return PS(t)||ky(t,1,r)||ys(t,1);if(r==(mn?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function Mp(t,e){t.someProp("transformCopied",x=>{e=x(e,t)});let n=[],{content:r,openStart:i,openEnd:s}=e;for(;i>1&&s>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,s--;let x=r.firstChild;n.push(x.type.name,x.attrs!=x.type.defaultAttrs?x.attrs:null),r=x.content}let u=t.someProp("clipboardSerializer")||Vi.fromSchema(t.state.schema),a=wk(),c=a.createElement("div");c.appendChild(u.serializeFragment(r,{document:a}));let f=c.firstChild,p,m=0;for(;f&&f.nodeType==1&&(p=vk[f.nodeName.toLowerCase()]);){for(let x=p.length-1;x>=0;x--){let b=a.createElement(p[x]);for(;c.firstChild;)b.appendChild(c.firstChild);c.appendChild(b),m++}f=c.firstChild}f&&f.nodeType==1&&f.setAttribute("data-pm-slice",`${i} ${s}${m?` -${m}`:""} ${JSON.stringify(n)}`);let y=t.someProp("clipboardTextSerializer",x=>x(e,t))||e.content.textBetween(0,e.content.size,`
225
-
226
- `);return{dom:c,text:y,slice:e}}function yk(t,e,n,r,i){let s=i.parent.type.spec.code,u,a;if(!n&&!e)return null;let c=!!e&&(r||s||!n);if(c){if(t.someProp("transformPastedText",y=>{e=y(e,s||r,t)}),s)return a=new G(j.from(t.state.schema.text(e.replace(/\r\n?/g,`
227
- `))),0,0),t.someProp("transformPasted",y=>{a=y(a,t,!0)}),a;let m=t.someProp("clipboardTextParser",y=>y(e,i,r,t));if(m)a=m;else{let y=i.marks(),{schema:x}=t.state,b=Vi.fromSchema(x);u=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(v=>{let w=u.appendChild(document.createElement("p"));v&&w.appendChild(b.serializeNode(x.text(v,y)))})}}else t.someProp("transformPastedHTML",m=>{n=m(n,t)}),u=VS(n),bu&&HS(u);let f=u&&u.querySelector("[data-pm-slice]"),p=f&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(f.getAttribute("data-pm-slice")||"");if(p&&p[3])for(let m=+p[3];m>0;m--){let y=u.firstChild;for(;y&&y.nodeType!=1;)y=y.nextSibling;if(!y)break;u=y}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||dr.fromSchema(t.state.schema)).parseSlice(u,{preserveWhitespace:!!(c||p),context:i,ruleFromNode(y){return y.nodeName=="BR"&&!y.nextSibling&&y.parentNode&&!jS.test(y.parentNode.nodeName)?{ignore:!0}:null}})),p)a=US(wy(a,+p[1],+p[2]),p[4]);else if(a=G.maxOpen(BS(a.content,i),!0),a.openStart||a.openEnd){let m=0,y=0;for(let x=a.content.firstChild;m<a.openStart&&!x.type.spec.isolating;m++,x=x.firstChild);for(let x=a.content.lastChild;y<a.openEnd&&!x.type.spec.isolating;y++,x=x.lastChild);a=wy(a,m,y)}return t.someProp("transformPasted",m=>{a=m(a,t,c)}),a}const jS=/^(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 BS(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.index(n)),s,u=[];if(t.forEach(a=>{if(!u)return;let c=i.findWrapping(a.type),f;if(!c)return u=null;if(f=u.length&&s.length&&kk(c,s,a,u[u.length-1],0))u[u.length-1]=f;else{u.length&&(u[u.length-1]=bk(u[u.length-1],s.length));let p=xk(a,c);u.push(p),i=i.matchType(p.type),s=c}}),u)return j.from(u)}return t}function xk(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,j.from(t));return t}function kk(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let s=kk(t,e,n,r.lastChild,i+1);if(s)return r.copy(r.content.replaceChild(r.childCount-1,s));if(r.contentMatchAt(r.childCount).matchType(i==t.length-1?n.type:t[i+1]))return r.copy(r.content.append(j.from(xk(n,t,i+1))))}}function bk(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,bk(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(j.empty,!0);return t.copy(n.append(r))}function qh(t,e,n,r,i,s){let u=e<0?t.firstChild:t.lastChild,a=u.content;return t.childCount>1&&(s=0),i<r-1&&(a=qh(a,e,n,r,i+1,s)),i>=n&&(a=e<0?u.contentMatchAt(0).fillBefore(a,s<=i).append(a):a.append(u.contentMatchAt(u.childCount).fillBefore(j.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,u.copy(a))}function wy(t,e,n){return e<t.openStart&&(t=new G(qh(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new G(qh(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const vk={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};function wk(){return document.implementation.createHTMLDocument("title")}let Vf=null;function $S(t){let e=window.trustedTypes;return e?(Vf||(Vf=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),Vf.createHTML(t)):t}function VS(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=wk(),r=n.body,i=/<([a-z][^>\s]+)/i.exec(t),s;if((s=i&&vk[i[1].toLowerCase()])&&(t=s.map(u=>"<"+u+">").join("")+t+s.map(u=>"</"+u+">").reverse().join("")),r.innerHTML=$S(t),s)for(let u=0;u<s.length;u++)r=r.querySelector(s[u])||r;for(let u=0;u<n.styleSheets.length;u++){let a=n.styleSheets[u];for(let c=0;c<a.rules.length;c++){let f=a.rules[c];if(f instanceof CSSStyleRule){let p=r.querySelectorAll(f.selectorText);for(let m=0;m<p.length;m++)p[m].style.cssText+=f.style.cssText}}}return r}function HS(t){let e=t.querySelectorAll(Tt?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function US(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:i,openStart:s,openEnd:u}=t;for(let a=r.length-2;a>=0;a-=2){let c=n.nodes[r[a]];if(!c||c.hasRequiredAttrs())break;i=j.from(c.create(r[a+1],i)),s++,u++}return new G(i,s,u)}const zt={},jt={},qS={touchstart:!0,touchmove:!0};class WS{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 KS(t){for(let e in zt){let n=zt[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{JS(t,r)&&!Dp(t,r)&&(t.editable||!(r.type in jt))&&n(t,r)},qS[e]?{passive:!0}:void 0)}Rt&&t.dom.addEventListener("input",()=>null),Wh(t)}function cr(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function ZS(t){t.input.mouseDown&&t.input.mouseDown.done(),t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function Wh(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>Dp(t,r))})}function Dp(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function JS(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function GS(t,e){!Dp(t,e)&&zt[e.type]&&(t.editable||!(e.type in jt))&&zt[e.type](t,e)}jt.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!_k(t)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(ar&&Tt&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),Os&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",i=>i(t,Si(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||zS(t,n)?n.preventDefault():cr(t,"key")};jt.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};jt.keypress=(t,e)=>{let n=e;if(_k(t)||!n.charCode||n.ctrlKey&&!n.altKey||mn&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof de)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode),s=()=>t.state.tr.insertText(i).scrollIntoView();!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",u=>u(t,r.$from.pos,r.$to.pos,i,s))&&t.dispatch(s()),n.preventDefault()}};function wu(t){return{left:t.clientX,top:t.clientY}}function QS(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function Np(t,e,n,r,i){if(r==-1)return!1;let s=t.state.doc.resolve(r);for(let u=s.depth+1;u>0;u--)if(t.someProp(e,a=>u>s.depth?a(t,n,s.nodeAfter,s.before(u),i,!0):a(t,n,s.node(u),s.before(u),i,!1)))return!0;return!1}function Cu(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function YS(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&oe.isSelectable(r)?(Cu(t,new oe(n)),!0):!1}function XS(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof oe&&(r=n.node);let s=t.state.doc.resolve(e);for(let u=s.depth+1;u>0;u--){let a=u>s.depth?s.nodeAfter:s.node(u);if(oe.isSelectable(a)){r&&n.$from.depth>0&&u>=n.$from.depth&&s.before(n.$from.depth+1)==n.$from.pos?i=s.before(n.$from.depth):i=s.before(u);break}}return i!=null?(Cu(t,oe.create(t.state.doc,i)),!0):!1}function eE(t,e,n,r,i){return Np(t,"handleClickOn",e,n,r)||t.someProp("handleClick",s=>s(t,e,r))||(i?XS(t,n):YS(t,n))}function tE(t,e,n,r){return Np(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function nE(t,e,n,r){return Np(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||rE(t,n,r)}function rE(t,e,n){if(n.button!=0)return!1;let r=Ck(t,e,!0),i=t.state.doc;return r?(Cu(t,r),r instanceof de&&i.eq(t.state.doc)&&(t.input.mouseDown=new sE(t,r)),!0):!1}function Ck(t,e,n){let r=t.state.doc;if(e==-1)return r.inlineContent?de.create(r,0,r.content.size):null;let i=r.resolve(e);for(let s=i.depth+1;s>0;s--){let u=s>i.depth?i.nodeAfter:i.node(s),a=i.before(s);if(u.inlineContent)return de.create(r,a+1,a+1+u.content.size);if(n&&oe.isSelectable(u))return oe.create(r,a)}return null}function Op(t){return va(t)}const Sk=mn?"metaKey":"ctrlKey";zt.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Op(t),i=Date.now(),s="singleClick";i-t.input.lastClick.time<500&&QS(n,t.input.lastClick)&&!n[Sk]&&t.input.lastClick.button==n.button&&(t.input.lastClick.type=="singleClick"?s="doubleClick":t.input.lastClick.type=="doubleClick"&&(s="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:s,button:n.button},t.input.mouseDown&&t.input.mouseDown.done();let u=t.posAtCoords(wu(n));u&&(s=="singleClick"?t.input.mouseDown=new iE(t,u,n,!!r):(s=="doubleClick"?tE:nE)(t,u.pos,u.inside,n)?n.preventDefault():cr(t,"pointer"))};class Ek{constructor(e){this.view=e,this.mightDrag=null,e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this))}up(e){this.done()}move(e){e.buttons==0&&this.done()}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}}class iE extends Ek{constructor(e,n,r,i){super(e),this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.startDoc=e.state.doc,this.selectNode=!!r[Sk],this.allowDefault=r.shiftKey;let s,u;if(n.inside>-1)s=e.state.doc.nodeAt(n.inside),u=n.inside;else{let p=e.state.doc.resolve(n.pos);s=p.parent,u=p.depth?p.before():0}const a=i?null:r.target,c=a?e.docView.nearestDesc(a,!0):null;this.target=c&&c.nodeDOM.nodeType==1?c.nodeDOM:null;let{selection:f}=e.state;r.button==0&&(s.type.spec.draggable&&s.type.spec.selectable!==!1||f instanceof oe&&f.from<=u&&f.to>u)&&(this.mightDrag={node:s,pos:u,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&yn&&!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()),cr(e,"pointer")}done(){super.done(),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(()=>{this.view.isDestroyed||hr(this.view)})}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(wu(e))),this.updateAllowDefault(e),this.allowDefault||!n?cr(this.view,"pointer"):eE(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Rt&&this.mightDrag&&!this.mightDrag.node.isAtom||Tt&&!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)?(Cu(this.view,ge.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):cr(this.view,"pointer")}move(e){this.updateAllowDefault(e),cr(this.view,"pointer"),super.move(e)}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}}class sE extends Ek{constructor(e,n){super(e),this.startSelection=n,this.startDoc=e.state.doc}move(e){if(e.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}e.preventDefault(),cr(this.view,"pointer");let n=this.view.posAtCoords(wu(e)),r=n&&Ck(this.view,n.inside,!1);if(!r)return;let{doc:i}=this.view.state,s=this.startSelection,[u,a]=r.from<s.from?[s.to,r.from]:[s.from,r.to];Cu(this.view,de.create(i,u,a))}}zt.touchstart=t=>{t.input.lastTouch=Date.now(),Op(t),cr(t,"pointer")};zt.touchmove=t=>{t.input.lastTouch=Date.now(),cr(t,"pointer")};zt.contextmenu=t=>Op(t);function _k(t,e){return t.composing?!0:Rt&&Math.abs(Date.now()-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const oE=ar?5e3:-1;jt.compositionstart=jt.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof de&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||Tt&&tk&&uE(t)))t.markCursor=t.state.storedMarks||n.marks(),va(t,!0),t.markCursor=null;else if(va(t,!e.selection.empty),yn&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let i=r.focusNode,s=r.focusOffset;i&&i.nodeType==1&&s!=0;){let u=s<0?i.lastChild:i.childNodes[s-1];if(!u)break;if(u.nodeType==3){let a=t.domSelection();a&&a.collapse(u,u.nodeValue.length);break}else i=u,s=-1}}t.input.composing=!0}Tk(t,oE)};function uE(t){let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(!e||e.nodeType!=1||n>=e.childNodes.length)return!1;let r=e.childNodes[n];return r.nodeType==1&&r.contentEditable=="false"}jt.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Date.now(),t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.badSafariComposition?t.domObserver.forceFlush():t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,Tk(t,20))};function Tk(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>va(t),e))}function Ak(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Date.now());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function lE(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=X4(e.focusNode,e.focusOffset),r=eS(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,s=t.domObserver.lastChangedTextNode;if(n==s||r==s)return s;if(!i||!i.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let u=n.pmViewDesc;if(!(!u||!u.isText(n.nodeValue)))return r}}return n||r}function va(t,e=!1){if(!(ar&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Ak(t),e||t.docView&&t.docView.dirty){let n=Tp(t),r=t.state.selection;return n&&!n.eq(r)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function aE(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const uu=Kt&&Gr<15||Os&&iS<604;zt.copy=jt.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let s=uu?null:n.clipboardData,u=r.content(),{dom:a,text:c}=Mp(t,u);s?(n.preventDefault(),s.clearData(),s.setData("text/html",a.innerHTML),s.setData("text/plain",c)):aE(t,a),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function cE(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function dE(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?lu(t,r.value,null,i,e):lu(t,r.textContent,r.innerHTML,i,e)},50)}function lu(t,e,n,r,i){let s=yk(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",c=>c(t,i,s||G.empty)))return!0;if(!s)return!1;let u=cE(s),a=u?t.state.tr.replaceSelectionWith(u,r):t.state.tr.replaceSelection(s);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Mk(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}jt.paste=(t,e)=>{let n=e;if(t.composing&&!ar)return;let r=uu?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&lu(t,Mk(r),r.getData("text/html"),i,n)?n.preventDefault():dE(t,n)};class Dk{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const fE=mn?"altKey":"ctrlKey";function Nk(t,e){let n;return t.someProp("dragCopies",r=>{n=n||r(e)}),n!=null?!n:!e[fE]}zt.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=t.state.selection,s=i.empty?null:t.posAtCoords(wu(n)),u;if(!(s&&s.pos>=i.from&&s.pos<=(i instanceof oe?i.to-1:i.to))){if(r&&r.mightDrag)u=oe.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let m=t.docView.nearestDesc(n.target,!0);m&&m.node.type.spec.draggable&&m!=t.docView&&(u=oe.create(t.state.doc,m.posBefore))}}let a=(u||t.state.selection).content(),{dom:c,text:f,slice:p}=Mp(t,a);(!n.dataTransfer.files.length||!Tt||ek>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(uu?"Text":"text/html",c.innerHTML),n.dataTransfer.effectAllowed="copyMove",uu||n.dataTransfer.setData("text/plain",f),t.dragging=new Dk(p,Nk(t,n),u)};zt.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};jt.dragover=jt.dragenter=(t,e)=>e.preventDefault();jt.drop=(t,e)=>{try{hE(t,e,t.dragging)}finally{t.dragging=null}};function hE(t,e,n){if(!e.dataTransfer)return;let r=t.posAtCoords(wu(e));if(!r)return;let i=t.state.doc.resolve(r.pos),s=n&&n.slice;s?t.someProp("transformPasted",x=>{s=x(s,t,!1)}):s=yk(t,Mk(e.dataTransfer),uu?null:e.dataTransfer.getData("text/html"),!1,i);let u=!!(n&&Nk(t,e));if(t.someProp("handleDrop",x=>x(t,e,s||G.empty,u))){e.preventDefault();return}if(!s)return;e.preventDefault();let a=s?Ox(t.state.doc,i.pos,s):i.pos;a==null&&(a=i.pos);let c=t.state.tr;if(u){let{node:x}=n;x?x.replace(c):c.deleteSelection()}let f=c.mapping.map(a),p=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,m=c.doc;if(p?c.replaceRangeWith(f,f,s.content.firstChild):c.replaceRange(f,f,s),c.doc.eq(m))return;let y=c.doc.resolve(f);if(p&&oe.isSelectable(s.content.firstChild)&&y.nodeAfter&&y.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new oe(y));else{let x=c.mapping.map(a);c.mapping.maps[c.mapping.maps.length-1].forEach((b,v,w,S)=>x=S),c.setSelection(Ap(t,y,c.doc.resolve(x)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))}zt.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&hr(t)},20))};zt.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};zt.beforeinput=(t,e)=>{if(ar&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",s=>s(t,Si(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in jt)zt[t]=jt[t];function au(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class wa{constructor(e,n){this.toDOM=e,this.spec=n||Ri,this.side=this.spec.side||0}map(e,n,r,i){let{pos:s,deleted:u}=e.mapResult(n.from+i,this.side<0?-1:1);return u?null:new Ft(s-r,s-r,this)}valid(){return!0}eq(e){return this==e||e instanceof wa&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&au(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Xr{constructor(e,n){this.attrs=e,this.spec=n||Ri}map(e,n,r,i){let s=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,u=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return s>=u?null:new Ft(s,u,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof Xr&&au(this.attrs,e.attrs)&&au(this.spec,e.spec)}static is(e){return e.type instanceof Xr}destroy(){}}class Rp{constructor(e,n){this.attrs=e,this.spec=n||Ri}map(e,n,r,i){let s=e.mapResult(n.from+i,1);if(s.deleted)return null;let u=e.mapResult(n.to+i,-1);return u.deleted||u.pos<=s.pos?null:new Ft(s.pos-r,u.pos-r,this)}valid(e,n){let{index:r,offset:i}=e.content.findIndex(n.from),s;return i==n.from&&!(s=e.child(r)).isText&&i+s.nodeSize==n.to}eq(e){return this==e||e instanceof Rp&&au(this.attrs,e.attrs)&&au(this.spec,e.spec)}destroy(){}}class Ft{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new Ft(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new Ft(e,e,new wa(n,r))}static inline(e,n,r,i){return new Ft(e,n,new Xr(r,i))}static node(e,n,r,i){return new Ft(e,n,new Rp(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Xr}get widget(){return this.type instanceof wa}}const bs=[],Ri={};class Be{constructor(e,n){this.local=e.length?e:bs,this.children=n.length?n:bs}static create(e,n){return n.length?Ca(n,e,0,Ri):Ot}find(e,n,r){let i=[];return this.findInner(e??0,n??1e9,i,0,r),i}findInner(e,n,r,i,s){for(let u=0;u<this.local.length;u++){let a=this.local[u];a.from<=n&&a.to>=e&&(!s||s(a.spec))&&r.push(a.copy(a.from+i,a.to+i))}for(let u=0;u<this.children.length;u+=3)if(this.children[u]<n&&this.children[u+1]>e){let a=this.children[u]+1;this.children[u+2].findInner(e-a,n-a,r,i+a,s)}}map(e,n,r){return this==Ot||e.maps.length==0?this:this.mapInner(e,n,0,0,r||Ri)}mapInner(e,n,r,i,s){let u;for(let a=0;a<this.local.length;a++){let c=this.local[a].map(e,r,i);c&&c.type.valid(n,c)?(u||(u=[])).push(c):s.onRemove&&s.onRemove(this.local[a].spec)}return this.children.length?pE(this.children,u||[],e,n,r,i,s):u?new Be(u.sort(Ii),bs):Ot}add(e,n){return n.length?this==Ot?Be.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let i,s=0;e.forEach((a,c)=>{let f=c+r,p;if(p=Rk(n,a,f)){for(i||(i=this.children.slice());s<i.length&&i[s]<c;)s+=3;i[s]==c?i[s+2]=i[s+2].addInner(a,p,f+1):i.splice(s,0,c,c+a.nodeSize,Ca(p,a,f+1,Ri)),s+=3}});let u=Ok(s?Ik(n):n,-r);for(let a=0;a<u.length;a++)u[a].type.valid(e,u[a])||u.splice(a--,1);return new Be(u.length?this.local.concat(u).sort(Ii):this.local,i||this.children)}remove(e){return e.length==0||this==Ot?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,i=this.local;for(let s=0;s<r.length;s+=3){let u,a=r[s]+n,c=r[s+1]+n;for(let p=0,m;p<e.length;p++)(m=e[p])&&m.from>a&&m.to<c&&(e[p]=null,(u||(u=[])).push(m));if(!u)continue;r==this.children&&(r=this.children.slice());let f=r[s+2].removeInner(u,a+1);f!=Ot?r[s+2]=f:(r.splice(s,3),s-=3)}if(i.length){for(let s=0,u;s<e.length;s++)if(u=e[s])for(let a=0;a<i.length;a++)i[a].eq(u,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 Be(i,r):Ot}forChild(e,n){if(this==Ot)return this;if(n.isLeaf)return Be.empty;let r,i;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(r=this.children[a+2]);break}let s=e+1,u=s+n.content.size;for(let a=0;a<this.local.length;a++){let c=this.local[a];if(c.from<u&&c.to>s&&c.type instanceof Xr){let f=Math.max(s,c.from)-s,p=Math.min(u,c.to)-s;f<p&&(i||(i=[])).push(c.copy(f,p))}}if(i){let a=new Be(i.sort(Ii),bs);return r?new Vr([a,r]):a}return r||Ot}eq(e){if(this==e)return!0;if(!(e instanceof Be)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return Ip(this.localsInner(e))}localsInner(e){if(this==Ot)return bs;if(e.inlineContent||!this.local.some(Xr.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Xr||n.push(this.local[r]);return n}forEachSet(e){e(this)}}Be.empty=new Be([],[]);Be.removeOverlap=Ip;const Ot=Be.empty;class Vr{constructor(e){this.members=e}map(e,n){const r=this.members.map(i=>i.map(e,n,Ri));return Vr.from(r)}forChild(e,n){if(n.isLeaf)return Be.empty;let r=[];for(let i=0;i<this.members.length;i++){let s=this.members[i].forChild(e,n);s!=Ot&&(s instanceof Vr?r=r.concat(s.members):r.push(s))}return Vr.from(r)}eq(e){if(!(e instanceof Vr)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let i=0;i<this.members.length;i++){let s=this.members[i].localsInner(e);if(s.length)if(!n)n=s;else{r&&(n=n.slice(),r=!1);for(let u=0;u<s.length;u++)n.push(s[u])}}return n?Ip(r?n:n.sort(Ii)):bs}static from(e){switch(e.length){case 0:return Ot;case 1:return e[0];default:return new Vr(e.every(n=>n instanceof Be)?e:e.reduce((n,r)=>n.concat(r instanceof Be?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function pE(t,e,n,r,i,s,u){let a=t.slice();for(let f=0,p=s;f<n.maps.length;f++){let m=0;n.maps[f].forEach((y,x,b,v)=>{let w=v-b-(x-y);for(let S=0;S<a.length;S+=3){let A=a[S+1];if(A<0||y>A+p-m)continue;let R=a[S]+p-m;x>=R?a[S+1]=y<=R?-2:-1:y>=p&&w&&(a[S]+=w,a[S+1]+=w)}m+=w}),p=n.maps[f].map(p,-1)}let c=!1;for(let f=0;f<a.length;f+=3)if(a[f+1]<0){if(a[f+1]==-2){c=!0,a[f+1]=-1;continue}let p=n.map(t[f]+s),m=p-i;if(m<0||m>=r.content.size){c=!0;continue}let y=n.map(t[f+1]+s,-1),x=y-i,{index:b,offset:v}=r.content.findIndex(m),w=r.maybeChild(b);if(w&&v==m&&v+w.nodeSize==x){let S=a[f+2].mapInner(n,w,p+1,t[f]+s+1,u);S!=Ot?(a[f]=m,a[f+1]=x,a[f+2]=S):(a[f+1]=-2,c=!0)}else c=!0}if(c){let f=mE(a,t,e,n,i,s,u),p=Ca(f,r,0,u);e=p.local;for(let m=0;m<a.length;m+=3)a[m+1]<0&&(a.splice(m,3),m-=3);for(let m=0,y=0;m<p.children.length;m+=3){let x=p.children[m];for(;y<a.length&&a[y]<x;)y+=3;a.splice(y,0,p.children[m],p.children[m+1],p.children[m+2])}}return new Be(e.sort(Ii),a)}function Ok(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let i=t[r];n.push(new Ft(i.from+e,i.to+e,i.type))}return n}function mE(t,e,n,r,i,s,u){function a(c,f){for(let p=0;p<c.local.length;p++){let m=c.local[p].map(r,i,f);m?n.push(m):u.onRemove&&u.onRemove(c.local[p].spec)}for(let p=0;p<c.children.length;p+=3)a(c.children[p+2],c.children[p]+f+1)}for(let c=0;c<t.length;c+=3)t[c+1]==-1&&a(t[c+2],e[c]+s+1);return n}function Rk(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,i=null;for(let s=0,u;s<t.length;s++)(u=t[s])&&u.from>n&&u.to<r&&((i||(i=[])).push(u),t[s]=null);return i}function Ik(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function Ca(t,e,n,r){let i=[],s=!1;e.forEach((a,c)=>{let f=Rk(t,a,c+n);if(f){s=!0;let p=Ca(f,a,n+c+1,r);p!=Ot&&i.push(c,c+a.nodeSize,p)}});let u=Ok(s?Ik(t):t,-n).sort(Ii);for(let a=0;a<u.length;a++)u[a].type.valid(e,u[a])||(r.onRemove&&r.onRemove(u[a].spec),u.splice(a--,1));return u.length||i.length?new Be(u,i):Ot}function Ii(t,e){return t.from-e.from||t.to-e.to}function Ip(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let i=n+1;i<e.length;i++){let s=e[i];if(s.from==r.from){s.to!=r.to&&(e==t&&(e=t.slice()),e[i]=s.copy(s.from,r.to),Cy(e,i+1,s.copy(r.to,s.to)));continue}else{s.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,s.from),Cy(e,i,r.copy(s.from,r.to)));break}}}return e}function Cy(t,e,n){for(;e<t.length&&Ii(n,t[e])>0;)e++;t.splice(e,0,n)}function Hf(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=Ot&&e.push(r)}),t.cursorWrapper&&e.push(Be.create(t.state.doc,[t.cursorWrapper.deco])),Vr.from(e)}const gE={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},yE=Kt&&Gr<=11;class xE{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class kE{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new xE,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]);Kt&&Gr<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():Rt&&e.composing&&r.some(i=>i.type=="childList"&&i.target.nodeName=="TR")?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),yE&&(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,gE)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(gy(this.view)){if(this.suppressingSelectionUpdates)return hr(this.view);if(Kt&&Gr<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Bi(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let s=e.focusNode;s;s=Ns(s))n.add(s);for(let s=e.anchorNode;s;s=Ns(s))if(n.has(s)){r=s;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&gy(e)&&!this.ignoreSelectionChange(r),s=-1,u=-1,a=!1,c=[];if(e.editable)for(let p=0;p<n.length;p++){let m=this.registerMutation(n[p],c);m&&(s=s<0?m.from:Math.min(m.from,s),u=u<0?m.to:Math.max(m.to,u),m.typeOver&&(a=!0))}if(c.some(p=>p.nodeName=="BR")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46||Tt&&(e.composing||e.input.compositionEndedAt>Date.now()-50)&&n.some(p=>p.type=="childList"&&p.removedNodes.length))){for(let p of c)if(p.nodeName=="BR"&&p.parentNode){let m=p.nextSibling;for(;m&&m.nodeType==1;){if(m.contentEditable=="false"){p.parentNode.removeChild(p);break}m=m.firstChild}}}else if(yn&&c.length){let p=c.filter(m=>m.nodeName=="BR");if(p.length==2){let[m,y]=p;m.parentNode&&m.parentNode.parentNode==y.parentNode?y.remove():m.remove()}else{let{focusNode:m}=this.currentSelection;for(let y of p){let x=y.parentNode;x&&x.nodeName=="LI"&&(!m||wE(e,m)!=x)&&y.remove()}}}let f=null;s<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&hc(r)&&(f=Tp(e))&&f.eq(ge.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,hr(e),this.currentSelection.set(r),e.scrollToSelection()):(s>-1||i)&&(s>-1&&(e.docView.markDirty(s,u),bE(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,CE(e,c)),this.handleDOMChange(s,u,a,c),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||hr(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let p=0;p<e.addedNodes.length;p++){let m=e.addedNodes[p];n.push(m),m.nodeType==3&&(this.lastChangedTextNode=m)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let i=e.previousSibling,s=e.nextSibling;if(Kt&&Gr<=11&&e.addedNodes.length)for(let p=0;p<e.addedNodes.length;p++){let{previousSibling:m,nextSibling:y}=e.addedNodes[p];(!m||Array.prototype.indexOf.call(e.addedNodes,m)<0)&&(i=m),(!y||Array.prototype.indexOf.call(e.addedNodes,y)<0)&&(s=y)}let u=i&&i.parentNode==e.target?Et(i)+1:0,a=r.localPosFromDOM(e.target,u,-1),c=s&&s.parentNode==e.target?Et(s):e.target.childNodes.length,f=r.localPosFromDOM(e.target,c,1);return{from:a,to:f}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let Sy=new WeakMap,Ey=!1;function bE(t){if(!Sy.has(t)&&(Sy.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=yn,Ey)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."),Ey=!0}}function _y(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,s=e.endOffset,u=t.domAtPos(t.state.selection.anchor);return Bi(u.node,u.offset,i,s)&&([n,r,i,s]=[i,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}}function vE(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return _y(t,i)}let n;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?_y(t,n):null}function wE(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function CE(t,e){var n;let{focusNode:r,focusOffset:i}=t.domSelectionRange();for(let s of e)if(((n=s.parentNode)===null||n===void 0?void 0:n.nodeName)=="TR"){let u=s.nextSibling;for(;u&&u.nodeName!="TD"&&u.nodeName!="TH";)u=u.nextSibling;if(u){let a=u;for(;;){let c=a.firstChild;if(!c||c.nodeType!=1||c.contentEditable=="false"||/^(BR|IMG)$/.test(c.nodeName))break;a=c}a.insertBefore(s,a.firstChild),r==s&&t.domSelection().collapse(s,i)}else s.parentNode.removeChild(s)}}function SE(t,e,n,r){let{node:i,fromOffset:s,toOffset:u,from:a,to:c}=t.docView.parseRange(e,n),f=t.domSelectionRange(),p,m=f.anchorNode;if(m&&t.dom.contains(m.nodeType==1?m:m.parentNode)&&(p=[{node:m,offset:f.anchorOffset}],hc(f)||p.push({node:f.focusNode,offset:f.focusOffset})),Tt&&t.input.lastKeyCode===8)for(let S=u;S>s;S--){let A=i.childNodes[S-1],R=A.pmViewDesc;if(A.nodeName=="BR"&&!R){u=S;break}if(!R||R.size)break}let y=t.state.doc,x=t.someProp("domParser")||dr.fromSchema(t.state.schema),b=y.resolve(a),v=null,w=x.parse(i,{topNode:b.parent,topMatch:b.parent.contentMatchAt(b.index()),topOpen:!0,from:s,to:u,preserveWhitespace:b.parent.type.whitespace=="pre"?"full":!0,findPositions:p,ruleFromNode:EE(r),context:b});if(p&&p[0].pos!=null){let S=p[0].pos,A=p[1]&&p[1].pos;A==null&&(A=S),v={anchor:S+a,head:A+a}}return{doc:w,sel:v,from:a,to:c}}const EE=t=>e=>{let n=e.pmViewDesc;if(n)return n.parseRule(t);if(e.nodeName=="BR"&&e.parentNode){if(Rt&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let r=document.createElement("div");return r.appendChild(document.createElement("li")),{skip:r}}else if(e.parentNode.lastChild==e||Rt&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null},_E=/^(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 TE(t,e,n,r,i){let s=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let z=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,Q=Tp(t,z);if(Q&&!t.state.selection.eq(Q)){if(Tt&&ar&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",Ce=>Ce(t,Si(13,"Enter"))))return;let ue=t.state.tr.setSelection(Q);z=="pointer"?ue.setMeta("pointer",!0):z=="key"&&ue.scrollIntoView(),s&&ue.setMeta("composition",s),t.dispatch(ue)}return}let u=t.state.doc.resolve(e),a=u.sharedDepth(n);e=u.before(a+1),n=t.state.doc.resolve(n).after(a+1);let c=t.state.selection,f=SE(t,e,n,i),p=t.state.doc,m=p.slice(f.from,f.to),y,x;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(y=t.state.selection.to,x="end"):(y=t.state.selection.from,x="start"),t.input.lastKeyCode=null;let b=DE(m.content,f.doc.content,f.from,y,x);if(b&&t.input.domChangeCount++,(Os&&t.input.lastIOSEnter>Date.now()-225||ar)&&i.some(z=>z.nodeType==1&&!_E.test(z.nodeName))&&(!b||b.endA>=b.endB)&&t.someProp("handleKeyDown",z=>z(t,Si(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!b)if(r&&c instanceof de&&!c.empty&&c.$head.sameParent(c.$anchor)&&!t.composing&&!(f.sel&&f.sel.anchor!=f.sel.head))b={start:c.from,endA:c.to,endB:c.to};else{if(f.sel){let z=Ty(t,t.state.doc,f.sel);if(z&&!z.eq(t.state.selection)){let Q=t.state.tr.setSelection(z);s&&Q.setMeta("composition",s),t.dispatch(Q)}}return}t.state.selection.from<t.state.selection.to&&b.start==b.endB&&t.state.selection instanceof de&&(b.start>t.state.selection.from&&b.start<=t.state.selection.from+2&&t.state.selection.from>=f.from?b.start=t.state.selection.from:b.endA<t.state.selection.to&&b.endA>=t.state.selection.to-2&&t.state.selection.to<=f.to&&(b.endB+=t.state.selection.to-b.endA,b.endA=t.state.selection.to)),Kt&&Gr<=11&&b.endB==b.start+1&&b.endA==b.start&&b.start>f.from&&f.doc.textBetween(b.start-f.from-1,b.start-f.from+1)=="  "&&(b.start--,b.endA--,b.endB--);let v=f.doc.resolveNoCache(b.start-f.from),w=f.doc.resolveNoCache(b.endB-f.from),S=p.resolve(b.start),A=v.sameParent(w)&&v.parent.inlineContent&&S.end()>=b.endA;if((Os&&t.input.lastIOSEnter>Date.now()-225&&(!A||i.some(z=>z.nodeName=="DIV"||z.nodeName=="P"))||!A&&v.pos<f.doc.content.size&&(!v.sameParent(w)||!v.parent.inlineContent)&&v.pos<w.pos&&!/\S/.test(f.doc.textBetween(v.pos,w.pos,"","")))&&t.someProp("handleKeyDown",z=>z(t,Si(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>b.start&&ME(p,b.start,b.endA,v,w)&&t.someProp("handleKeyDown",z=>z(t,Si(8,"Backspace")))){ar&&Tt&&t.domObserver.suppressSelectionUpdates();return}Tt&&b.endB==b.start&&(t.input.lastChromeDelete=Date.now()),ar&&!A&&v.start()!=w.start()&&w.parentOffset==0&&v.depth==w.depth&&f.sel&&f.sel.anchor==f.sel.head&&f.sel.head==b.endA&&(b.endB-=2,w=f.doc.resolveNoCache(b.endB-f.from),setTimeout(()=>{t.someProp("handleKeyDown",function(z){return z(t,Si(13,"Enter"))})},20));let R=b.start,I=b.endA,P=z=>{let Q=z||t.state.tr.replace(R,I,f.doc.slice(b.start-f.from,b.endB-f.from));if(f.sel){let ue=Ty(t,Q.doc,f.sel);ue&&!(Tt&&t.composing&&ue.empty&&(b.start!=b.endB||t.input.lastChromeDelete<Date.now()-100)&&(ue.head==R||ue.head==Q.mapping.map(I)-1)||Kt&&ue.empty&&ue.head==R)&&Q.setSelection(ue)}return s&&Q.setMeta("composition",s),Q.scrollIntoView()},F;if(A)if(v.pos==w.pos){Kt&&Gr<=11&&v.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>hr(t),20));let z=P(t.state.tr.delete(R,I)),Q=p.resolve(b.start).marksAcross(p.resolve(b.endA));Q&&z.ensureMarks(Q),t.dispatch(z)}else if(b.endA==b.endB&&(F=AE(v.parent.content.cut(v.parentOffset,w.parentOffset),S.parent.content.cut(S.parentOffset,b.endA-S.start())))){let z=P(t.state.tr);F.type=="add"?z.addMark(R,I,F.mark):z.removeMark(R,I,F.mark),t.dispatch(z)}else if(v.parent.child(v.index()).isText&&v.index()==w.index()-(w.textOffset?0:1)){let z=v.parent.textBetween(v.parentOffset,w.parentOffset),Q=()=>P(t.state.tr.insertText(z,R,I));t.someProp("handleTextInput",ue=>ue(t,R,I,z,Q))||t.dispatch(Q())}else t.dispatch(P());else t.dispatch(P())}function Ty(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:Ap(t,e.resolve(n.anchor),e.resolve(n.head))}function AE(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,s=r,u,a,c;for(let p=0;p<r.length;p++)i=r[p].removeFromSet(i);for(let p=0;p<n.length;p++)s=n[p].removeFromSet(s);if(i.length==1&&s.length==0)a=i[0],u="add",c=p=>p.mark(a.addToSet(p.marks));else if(i.length==0&&s.length==1)a=s[0],u="remove",c=p=>p.mark(a.removeFromSet(p.marks));else return null;let f=[];for(let p=0;p<e.childCount;p++)f.push(c(e.child(p)));if(j.from(f).eq(t))return{mark:a,type:u}}function ME(t,e,n,r,i){if(n-e<=i.pos-r.pos||Uf(r,!0,!1)<i.pos)return!1;let s=t.resolve(e);if(!r.parent.isTextblock){let a=s.nodeAfter;return a!=null&&n==e+a.nodeSize}if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let u=t.resolve(Uf(s,!0,!0));return!u.parent.isTextblock||u.pos>n||Uf(u,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(u.parent.content)}function Uf(t,e,n){let r=t.depth,i=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let s=t.node(r).maybeChild(t.indexAfter(r));for(;s&&!s.isLeaf;)s=s.firstChild,i++}return i}function DE(t,e,n,r,i){let s=t.findDiffStart(e,n),u=n+t.size,a=n+e.size;if(s==null)return null;let{a:c,b:f}=t.findDiffEnd(e,u,a);if(i=="end"){let p=Math.max(0,s-Math.min(c,f));r-=c+p-s}if(c<s&&u<a){let p=r<=s&&r>=c?s-r:0;s-=p,f=s+(f-c),c=s}else if(f<s){let p=r<=s&&r>=f?s-r:0;s-=p,c=s+(c-f),f=s}return{start:s,endA:c,endB:f}}class Lk{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new WS,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Oy),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Dy(this),My(this),this.nodeViews=Ny(this),this.docView=cy(this.state.doc,Ay(this),Hf(this),this.dom,this),this.domObserver=new kE(this,(r,i,s,u)=>TE(this,r,i,s,u)),this.domObserver.start(),KS(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Wh(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Oy),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let i=this.state,s=!1,u=!1;e.storedMarks&&this.composing&&(Ak(this),u=!0),this.state=e;let a=i.plugins!=e.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let x=Ny(this);OE(x,this.nodeViews)&&(this.nodeViews=x,s=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&Wh(this),this.editable=Dy(this),My(this);let c=Hf(this),f=Ay(this),p=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",m=s||!this.docView.matchesNode(e.doc,f,c);(m||!e.selection.eq(i.selection))&&(u=!0);let y=p=="preserve"&&u&&this.dom.style.overflowAnchor==null&&uS(this);if(u){this.domObserver.stop();let x=m&&(Kt||Tt)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&NE(i.selection,e.selection);if(m){let v=Tt?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=lE(this)),(s||!this.docView.update(e.doc,f,c,this))&&(this.docView.updateOuterDeco(f),this.docView.destroy(),this.docView=cy(e.doc,f,c,this.dom,this)),v&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(x=!0)}let b=this.input.mouseDown;x||!(b&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&NS(this)&&b.delaySelUpdate())?hr(this,x):(pk(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),p=="reset"?this.dom.scrollTop=0:p=="to selection"?this.scrollToSelection():y&&lS(y)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof oe){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&sy(this,n.getBoundingClientRect(),e)}else sy(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}updateDraggedNode(e,n){let r=e.node,i=-1;if(r.from<this.state.doc.content.size&&this.state.doc.nodeAt(r.from)==r.node)i=r.from;else{let s=r.from+(this.state.doc.content.size-n.doc.content.size);(s>0&&s<this.state.doc.content.size&&this.state.doc.nodeAt(s))==r.node&&(i=s)}this.dragging=new Dk(e.slice,e.move,i<0?void 0:oe.create(this.state.doc,i))}someProp(e,n){let r=this._props&&this._props[e],i;if(r!=null&&(i=n?n(r):r))return i;for(let u=0;u<this.directPlugins.length;u++){let a=this.directPlugins[u].props[e];if(a!=null&&(i=n?n(a):a))return i}let s=this.state.plugins;if(s)for(let u=0;u<s.length;u++){let a=s[u].props[e];if(a!=null&&(i=n?n(a):a))return i}}hasFocus(){if(Kt){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&aS(this.dom),hr(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return pS(this,e)}coordsAtPos(e,n=1){return ok(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let i=this.docView.posFromDOM(e,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,n){return kS(this,n||this.state,e)}pasteHTML(e,n){return lu(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return lu(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return Mp(this,e)}destroy(){this.docView&&(ZS(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Hf(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,Q4())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return GS(this,e)}domSelectionRange(){let e=this.domSelection();return e?Rt&&this.root.nodeType===11&&nS(this.dom.ownerDocument)==this.dom&&vE(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}Lk.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function Ay(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[Ft.node(0,t.state.doc.content.size,e)]}function My(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Ft.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function Dy(t){return!t.someProp("editable",e=>e(t.state)===!1)}function NE(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function Ny(t){let e=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function OE(t,e){let n=0,r=0;for(let i in t){if(t[i]!=e[i])return!0;n++}for(let i in e)r++;return n!=r}function Oy(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var ni={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:"'"},Sa={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},RE=typeof navigator<"u"&&/Mac/.test(navigator.platform),IE=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var _t=0;_t<10;_t++)ni[48+_t]=ni[96+_t]=String(_t);for(var _t=1;_t<=24;_t++)ni[_t+111]="F"+_t;for(var _t=65;_t<=90;_t++)ni[_t]=String.fromCharCode(_t+32),Sa[_t]=String.fromCharCode(_t);for(var qf in ni)Sa.hasOwnProperty(qf)||(Sa[qf]=ni[qf]);function LE(t){var e=RE&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||IE&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Sa:ni)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const PE=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),FE=typeof navigator<"u"&&/Win/.test(navigator.platform);function zE(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,s,u;for(let a=0;a<e.length-1;a++){let c=e[a];if(/^(cmd|meta|m)$/i.test(c))u=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))i=!0;else if(/^s(hift)?$/i.test(c))s=!0;else if(/^mod$/i.test(c))PE?u=!0:i=!0;else throw new Error("Unrecognized modifier name: "+c)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),u&&(n="Meta-"+n),s&&(n="Shift-"+n),n}function jE(t){let e=Object.create(null);for(let n in t)e[zE(n)]=t[n];return e}function Wf(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function BE(t){return new qe({props:{handleKeyDown:Pk(t)}})}function Pk(t){let e=jE(t);return function(n,r){let i=LE(r),s,u=e[Wf(i,r)];if(u&&u(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let a=e[Wf(i,r,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(FE&&r.ctrlKey&&r.altKey)&&(s=ni[r.keyCode])&&s!=i){let a=e[Wf(s,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}var $E=Object.defineProperty,Lp=(t,e)=>{for(var n in e)$E(t,n,{get:e[n],enumerable:!0})};function mc(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:i}=n,{storedMarks:s}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,s=n.storedMarks,n}}}var gc=class{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:e,state:n}=this,{view:r}=e,{tr:i}=n,s=this.buildProps(i);return Object.fromEntries(Object.entries(t).map(([u,a])=>[u,(...f)=>{const p=a(...f)(s);return!i.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(i),p}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){const{rawCommands:n,editor:r,state:i}=this,{view:s}=r,u=[],a=!!t,c=t||i.tr,f=()=>(!a&&e&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(c),u.every(m=>m===!0)),p={...Object.fromEntries(Object.entries(n).map(([m,y])=>[m,(...b)=>{const v=this.buildProps(c,e),w=y(...b)(v);return u.push(w),p}])),run:f};return p}createCan(t){const{rawCommands:e,state:n}=this,r=!1,i=t||n.tr,s=this.buildProps(i,r);return{...Object.fromEntries(Object.entries(e).map(([a,c])=>[a,(...f)=>c(...f)({...s,dispatch:void 0})])),chain:()=>this.createChain(i,r)}}buildProps(t,e=!0){const{rawCommands:n,editor:r,state:i}=this,{view:s}=r,u={tr:t,editor:r,view:s,state:mc({state:i,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t,e),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(n).map(([a,c])=>[a,(...f)=>c(...f)(u)]))}};return u}},Fk={};Lp(Fk,{blur:()=>VE,clearContent:()=>HE,clearNodes:()=>UE,command:()=>qE,createParagraphNear:()=>WE,cut:()=>KE,deleteCurrentNode:()=>ZE,deleteNode:()=>JE,deleteRange:()=>GE,deleteSelection:()=>XE,enter:()=>e_,exitCode:()=>t_,extendMarkRange:()=>n_,first:()=>r_,focus:()=>s_,forEach:()=>o_,insertContent:()=>u_,insertContentAt:()=>a_,insertDefaultBlock:()=>c_,joinBackward:()=>h_,joinDown:()=>f_,joinForward:()=>p_,joinItemBackward:()=>m_,joinItemForward:()=>g_,joinTextblockBackward:()=>y_,joinTextblockForward:()=>x_,joinUp:()=>d_,keyboardShortcut:()=>b_,lift:()=>v_,liftEmptyBlock:()=>w_,liftListItem:()=>C_,newlineInCode:()=>S_,resetAttributes:()=>E_,scrollIntoView:()=>__,selectAll:()=>T_,selectNodeBackward:()=>A_,selectNodeForward:()=>M_,selectParentNode:()=>D_,selectTextblockEnd:()=>N_,selectTextblockStart:()=>O_,setContent:()=>R_,setMark:()=>X_,setMeta:()=>e8,setNode:()=>t8,setNodeSelection:()=>n8,setTextDirection:()=>r8,setTextSelection:()=>i8,sinkListItem:()=>s8,splitBlock:()=>o8,splitListItem:()=>u8,toggleList:()=>a8,toggleMark:()=>c8,toggleNode:()=>d8,toggleWrap:()=>f8,undoInputRule:()=>h8,unsetAllMarks:()=>p8,unsetMark:()=>m8,unsetTextDirection:()=>g8,updateAttributes:()=>y8,wrapIn:()=>x8,wrapInList:()=>k8});var VE=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),HE=(t=!0)=>({commands:e})=>e.setContent("",{emitUpdate:t}),UE=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:i}=r;return n&&i.forEach(({$from:s,$to:u})=>{t.doc.nodesBetween(s.pos,u.pos,(a,c)=>{if(a.type.isText)return;const{doc:f,mapping:p}=e,m=f.resolve(p.map(c)),y=f.resolve(p.map(c+a.nodeSize)),x=m.blockRange(y);if(!x)return;const b=zs(x);if(a.type.isTextblock){const{defaultType:v}=m.parent.contentMatchAt(m.index());e.setNodeMarkup(x.start,v)}(b||b===0)&&e.lift(x,b)})}),!0},qE=t=>e=>t(e),WE=()=>({state:t,dispatch:e})=>Jx(t,e),KE=(t,e)=>({editor:n,tr:r})=>{const{state:i}=n,s=i.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const u=r.mapping.map(e);return r.insert(u,s.content),r.setSelection(new de(r.doc.resolve(Math.max(u-1,0)))),!0},ZE=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const i=t.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===r.type){if(e){const a=i.before(s),c=i.after(s);t.delete(a,c).scrollIntoView()}return!0}return!1};function ct(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}var JE=t=>({tr:e,state:n,dispatch:r})=>{const i=ct(t,n.schema),s=e.selection.$anchor;for(let u=s.depth;u>0;u-=1)if(s.node(u).type===i){if(r){const c=s.before(u),f=s.after(u);e.delete(c,f).scrollIntoView()}return!0}return!1},GE=t=>({tr:e,dispatch:n})=>{const{from:r,to:i}=t;return n&&e.delete(r,i),!0},QE=t=>t.content?/^text(\*|\+)/.test(t.content):!1,Ry=(t,e,n)=>{if(!t.parent.isInline||n==="left"&&t.pos>t.start()||n==="right"&&t.pos<t.end())return t.pos;const r=e.nodes[t.parent.type.name].spec;return QE(r)?n==="left"?t.start()-1:t.end()+1:t.pos},YE=(t,e,n)=>{const r=Ry(t,n,"left"),i=Ry(e,n,"right");return{from:r,to:i}},XE=()=>({state:t,dispatch:e})=>{if(t.selection.empty)return!1;if(e){const n=t.tr,{ranges:r}=t.selection,i=n.steps.length;r.forEach(s=>{const u=n.mapping.slice(i),a=n.doc.resolve(u.map(s.$from.pos)),c=n.doc.resolve(u.map(s.$to.pos)),{from:f,to:p}=YE(a,c,t.schema);n.deleteRange(f,p)}),n.selection.empty||n.setSelection(de.near(n.doc.resolve(n.selection.from))),n.scrollIntoView(),e(n)}return!0},e_=()=>({commands:t})=>t.keyboardShortcut("Enter"),t_=()=>({state:t,dispatch:e})=>P4(t,e);function Pp(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function Ea(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:Pp(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function zk(t,e,n={}){return t.find(r=>r.type===e&&Ea(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}function Iy(t,e,n={}){return!!zk(t,e,n)}function Fp(t,e,n){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if((!r.node||!r.node.marks.some(f=>f.type===e))&&(r=t.parent.childBefore(t.parentOffset)),!r.node||!r.node.marks.some(f=>f.type===e))return;if(!n){const f=r.node.marks.find(p=>p.type===e);f&&(n=f.attrs)}if(!zk([...r.node.marks],e,n))return;let s=r.index,u=t.start()+r.offset,a=s+1,c=u+r.node.nodeSize;for(;s>0&&Iy([...t.parent.child(s-1).marks],e,n);)s-=1,u-=t.parent.child(s).nodeSize;for(;a<t.parent.childCount&&Iy([...t.parent.child(a).marks],e,n);)c+=t.parent.child(a).nodeSize,a+=1;return{from:u,to:c}}function mr(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}var n_=(t,e)=>({tr:n,state:r,dispatch:i})=>{const s=mr(t,r.schema),{doc:u,selection:a}=n,{$from:c,from:f,to:p}=a;if(i){const m=Fp(c,s,e);if(m&&m.from<=f&&m.to>=p){const y=de.create(u,m.from,m.to);n.setSelection(y)}}return!0},r_=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function jk(t){return t instanceof de}function Ai(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function Kh(t,e=null){if(!e)return null;const n=ge.atStart(t),r=ge.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const i=n.from,s=r.to;return e==="all"?de.create(t,Ai(0,i,s),Ai(t.content.size,i,s)):de.create(t,Ai(e,i,s),Ai(e,i,s))}function Ly(){return["Android"].includes(navigator.platform)||/android/i.test(navigator.userAgent)}function _a(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function i_(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var s_=(t=null,e={})=>({editor:n,view:r,tr:i,dispatch:s})=>{e={scrollIntoView:!0,...e};const u=()=>{(_a()||Ly())&&r.dom.focus(),i_()&&!_a()&&!Ly()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&t===null||t===!1)return!0}catch{return!1}if(s&&t===null&&!jk(n.state.selection))return u(),!0;const a=Kh(i.doc,t)||n.state.selection,c=n.state.selection.eq(a);return s&&(c||i.setSelection(a),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),u()),!0},o_=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),u_=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),Bk=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&Bk(r)}return t};function ql(t){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return Bk(n)}function Rs(t,e,n){if(t instanceof Jr||t instanceof j)return t;n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,i=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return j.fromArray(t.map(a=>e.nodeFromJSON(a)));const u=e.nodeFromJSON(t);return n.errorOnInvalidContent&&u.check(),u}catch(s){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:s});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",s),Rs("",e,n)}if(i){if(n.errorOnInvalidContent){let u=!1,a="";const c=new yp({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:f=>(u=!0,a=typeof f=="string"?f:f.outerHTML,null)}]}})});if(n.slice?dr.fromSchema(c).parseSlice(ql(t),n.parseOptions):dr.fromSchema(c).parse(ql(t),n.parseOptions),n.errorOnInvalidContent&&u)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const s=dr.fromSchema(e);return n.slice?s.parseSlice(ql(t),n.parseOptions).content:s.parse(ql(t),n.parseOptions)}return Rs("",e,n)}function $k(t,e,n){const r=t.steps.length-1;if(r<e)return;const i=t.steps[r];if(!(i instanceof lt||i instanceof bt))return;const s=t.mapping.maps[r];let u=0;s.forEach((a,c,f,p)=>{u===0&&(u=p)}),t.setSelection(ge.near(t.doc.resolve(u),n))}var l_=t=>!("type"in t),a_=(t,e,n)=>({tr:r,dispatch:i,editor:s})=>{var u;if(i){n={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let a;const c=w=>{s.emit("contentError",{editor:s,error:w,disableCollaboration:()=>{"collaboration"in s.storage&&typeof s.storage.collaboration=="object"&&s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},f={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{Rs(e,s.schema,{parseOptions:f,errorOnInvalidContent:!0})}catch(w){c(w)}try{a=Rs(e,s.schema,{parseOptions:f,errorOnInvalidContent:(u=n.errorOnInvalidContent)!=null?u:s.options.enableContentCheck})}catch(w){return c(w),!1}let{from:p,to:m}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},y=!0,x=!0;if((l_(a)?a:[a]).forEach(w=>{w.check(),y=y?w.isText&&w.marks.length===0:!1,x=x?w.isBlock:!1}),p===m&&x){const{parent:w}=r.doc.resolve(p);w.isTextblock&&!w.type.spec.code&&!w.childCount&&(p-=1,m+=1)}let v;if(y){if(Array.isArray(e))v=e.map(w=>w.text||"").join("");else if(e instanceof j){let w="";e.forEach(S=>{S.text&&(w+=S.text)}),v=w}else typeof e=="object"&&e&&e.text?v=e.text:v=e;r.insertText(v,p,m)}else{v=a;const w=r.doc.resolve(p),S=w.node(),A=w.parentOffset===0,R=S.isText||S.isTextblock,I=S.content.size>0;A&&R&&I&&x&&(p=Math.max(0,p-1)),r.replaceWith(p,m,v)}n.updateSelection&&$k(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:p,text:v}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:p,text:v})}return!0};function Vk(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var c_=(t={})=>({tr:e,dispatch:n,editor:r})=>{const{pos:i,attrs:s,content:u,updateSelection:a=!0}=t;let c;typeof i=="number"?c=e.doc.resolve(i):i?c=i:c=e.selection.$from;const f=Vk(c.parent.contentMatchAt(c.index()));if(!f)return!1;const p=Object.keys(f.spec.attrs||{}),m=s?Object.fromEntries(Object.entries(s).filter(([x])=>p.includes(x))):{};let y;if(u){const x=Rs(u,r.schema);y=f.createAndFill(m,x)}else y=f.createAndFill(m);return y?(n&&(e.insert(c.pos,y),a&&$k(e,e.steps.length-1,-1)),!0):!1},d_=()=>({state:t,dispatch:e})=>R4(t,e),f_=()=>({state:t,dispatch:e})=>I4(t,e),h_=()=>({state:t,dispatch:e})=>Vx(t,e),p_=()=>({state:t,dispatch:e})=>Wx(t,e),m_=()=>({state:t,dispatch:e,tr:n})=>{try{const r=cc(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},g_=()=>({state:t,dispatch:e,tr:n})=>{try{const r=cc(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},y_=()=>({state:t,dispatch:e})=>N4(t,e),x_=()=>({state:t,dispatch:e})=>O4(t,e);function Hk(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function k_(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,i,s,u;for(let a=0;a<e.length-1;a+=1){const c=e[a];if(/^(cmd|meta|m)$/i.test(c))u=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))i=!0;else if(/^s(hift)?$/i.test(c))s=!0;else if(/^mod$/i.test(c))_a()||Hk()?u=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${c}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),u&&(n=`Meta-${n}`),s&&(n=`Shift-${n}`),n}var b_=t=>({editor:e,view:n,tr:r,dispatch:i})=>{const s=k_(t).split(/-(?!$)/),u=s.find(f=>!["Alt","Ctrl","Meta","Shift"].includes(f)),a=new KeyboardEvent("keydown",{key:u==="Space"?" ":u,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),c=e.captureTransaction(()=>{n.someProp("handleKeyDown",f=>f(n,a))});return c==null||c.steps.forEach(f=>{const p=f.map(r.mapping);p&&i&&r.maybeStep(p)}),!0};function ri(t,e,n={}){const{from:r,to:i,empty:s}=t.selection,u=e?ct(e,t.schema):null,a=[];t.doc.nodesBetween(r,i,(m,y)=>{if(m.isText)return;const x=Math.max(r,y),b=Math.min(i,y+m.nodeSize);a.push({node:m,from:x,to:b})});const c=i-r,f=a.filter(m=>u?u.name===m.node.type.name:!0).filter(m=>Ea(m.node.attrs,n,{strict:!1}));return s?!!f.length:f.reduce((m,y)=>m+y.to-y.from,0)>=c}var v_=(t,e={})=>({state:n,dispatch:r})=>{const i=ct(t,n.schema);return ri(n,i,e)?L4(n,r):!1},w_=()=>({state:t,dispatch:e})=>Gx(t,e),C_=t=>({state:e,dispatch:n})=>{const r=ct(t,e.schema);return K4(r)(e,n)},S_=()=>({state:t,dispatch:e})=>Zx(t,e);function yc(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function Py(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,i)=>(n.includes(i)||(r[i]=t[i]),r),{})}var E_=(t,e)=>({tr:n,state:r,dispatch:i})=>{let s=null,u=null;const a=yc(typeof t=="string"?t:t.name,r.schema);if(!a)return!1;a==="node"&&(s=ct(t,r.schema)),a==="mark"&&(u=mr(t,r.schema));let c=!1;return n.selection.ranges.forEach(f=>{r.doc.nodesBetween(f.$from.pos,f.$to.pos,(p,m)=>{s&&s===p.type&&(c=!0,i&&n.setNodeMarkup(m,void 0,Py(p.attrs,e))),u&&p.marks.length&&p.marks.forEach(y=>{u===y.type&&(c=!0,i&&n.addMark(m,m+p.nodeSize,u.create(Py(y.attrs,e))))})})}),c},__=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),T_=()=>({tr:t,dispatch:e})=>{if(e){const n=new nn(t.doc);t.setSelection(n)}return!0},A_=()=>({state:t,dispatch:e})=>Ux(t,e),M_=()=>({state:t,dispatch:e})=>Kx(t,e),D_=()=>({state:t,dispatch:e})=>j4(t,e),N_=()=>({state:t,dispatch:e})=>V4(t,e),O_=()=>({state:t,dispatch:e})=>$4(t,e);function Zh(t,e,n={},r={}){return Rs(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var R_=(t,{errorOnInvalidContent:e,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:s,dispatch:u,commands:a})=>{const{doc:c}=s;if(r.preserveWhitespace!=="full"){const f=Zh(t,i.schema,r,{errorOnInvalidContent:e??i.options.enableContentCheck});return u&&s.replaceWith(0,c.content.size,f).setMeta("preventUpdate",!n),!0}return u&&s.setMeta("preventUpdate",!n),a.insertContentAt({from:0,to:c.content.size},t,{parseOptions:r,errorOnInvalidContent:e??i.options.enableContentCheck})};function Uk(t,e){const n=mr(e,t.schema),{from:r,to:i,empty:s}=t.selection,u=[];s?(t.storedMarks&&u.push(...t.storedMarks),u.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,i,c=>{u.push(...c.marks)});const a=u.find(c=>c.type.name===n.name);return a?{...a.attrs}:{}}function qk(t,e){const n=new Fx(t);return e.forEach(r=>{r.steps.forEach(i=>{n.step(i)})}),n}function I_(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,(i,s)=>{n(i)&&r.push({node:i,pos:s})}),r}function L_(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function xc(t){return e=>L_(e.$from,t)}function se(t,e,n){return t.config[e]===void 0&&t.parent?se(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?se(t.parent,e,n):null}):t.config[e]}function zp(t){return t.map(e=>{const n={name:e.name,options:e.options,storage:e.storage},r=se(e,"addExtensions",n);return r?[e,...zp(r())]:e}).flat(10)}function Su(t,e){const n=Vi.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function Wk(t){return typeof t=="function"}function Oe(t,e=void 0,...n){return Wk(t)?e?t.bind(e)(...n):t(...n):t}function P_(t={}){return Object.keys(t).length===0&&t.constructor===Object}function Is(t){const e=t.filter(i=>i.type==="extension"),n=t.filter(i=>i.type==="node"),r=t.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function Kk(t){const e=[],{nodeExtensions:n,markExtensions:r}=Is(t),i=[...n,...r],s={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},u=n.filter(f=>f.name!=="text").map(f=>f.name),a=r.map(f=>f.name),c=[...u,...a];return t.forEach(f=>{const p={name:f.name,options:f.options,storage:f.storage,extensions:i},m=se(f,"addGlobalAttributes",p);if(!m)return;m().forEach(x=>{let b;Array.isArray(x.types)?b=x.types:x.types==="*"?b=c:x.types==="nodes"?b=u:x.types==="marks"?b=a:b=[],b.forEach(v=>{Object.entries(x.attributes).forEach(([w,S])=>{e.push({type:v,name:w,attribute:{...s,...S}})})})})}),i.forEach(f=>{const p={name:f.name,options:f.options,storage:f.storage},m=se(f,"addAttributes",p);if(!m)return;const y=m();Object.entries(y).forEach(([x,b])=>{const v={...s,...b};typeof(v==null?void 0:v.default)=="function"&&(v.default=v.default()),v!=null&&v.isRequired&&(v==null?void 0:v.default)===void 0&&delete v.default,e.push({type:f.name,name:x,attribute:v})})}),e}function F_(t){const e=[];let n="",r=!1,i=!1,s=0;const u=t.length;for(let a=0;a<u;a+=1){const c=t[a];if(c==="'"&&!i){r=!r,n+=c;continue}if(c==='"'&&!r){i=!i,n+=c;continue}if(!r&&!i){if(c==="("){s+=1,n+=c;continue}if(c===")"&&s>0){s-=1,n+=c;continue}if(c===";"&&s===0){e.push(n),n="";continue}}n+=c}return n&&e.push(n),e}function Fy(t){const e=[],n=F_(t||""),r=n.length;for(let i=0;i<r;i+=1){const s=n[i],u=s.indexOf(":");if(u===-1)continue;const a=s.slice(0,u).trim(),c=s.slice(u+1).trim();a&&c&&e.push([a,c])}return e}function pt(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([i,s])=>{if(!r[i]){r[i]=s;return}if(i==="class"){const a=s?String(s).split(" "):[],c=r[i]?r[i].split(" "):[],f=a.filter(p=>!c.includes(p));r[i]=[...c,...f].join(" ")}else if(i==="style"){const a=new Map([...Fy(r[i]),...Fy(s)]);r[i]=Array.from(a.entries()).map(([c,f])=>`${c}: ${f}`).join("; ")}else r[i]=s}),r},{})}function cu(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>pt(n,r),{})}function z_(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function zy(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const i=e.reduce((s,u)=>{const a=u.attribute.parseHTML?u.attribute.parseHTML(n):z_(n.getAttribute(u.name));return a==null?s:{...s,[u.name]:a}},{});return{...r,...i}}}}function jy(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&P_(n)?!1:n!=null))}function By(t){var e,n;const r={};return!((e=t==null?void 0:t.attribute)!=null&&e.isRequired)&&"default"in((t==null?void 0:t.attribute)||{})&&(r.default=t.attribute.default),((n=t==null?void 0:t.attribute)==null?void 0:n.validate)!==void 0&&(r.validate=t.attribute.validate),[t.name,r]}function j_(t,e){var n;const r=Kk(t),{nodeExtensions:i,markExtensions:s}=Is(t),u=(n=i.find(f=>se(f,"topNode")))==null?void 0:n.name,a=Object.fromEntries(i.map(f=>{const p=r.filter(S=>S.type===f.name),m={name:f.name,options:f.options,storage:f.storage,editor:e},y=t.reduce((S,A)=>{const R=se(A,"extendNodeSchema",m);return{...S,...R?R(f):{}}},{}),x=jy({...y,content:Oe(se(f,"content",m)),marks:Oe(se(f,"marks",m)),group:Oe(se(f,"group",m)),inline:Oe(se(f,"inline",m)),atom:Oe(se(f,"atom",m)),selectable:Oe(se(f,"selectable",m)),draggable:Oe(se(f,"draggable",m)),code:Oe(se(f,"code",m)),whitespace:Oe(se(f,"whitespace",m)),linebreakReplacement:Oe(se(f,"linebreakReplacement",m)),defining:Oe(se(f,"defining",m)),isolating:Oe(se(f,"isolating",m)),attrs:Object.fromEntries(p.map(By))}),b=Oe(se(f,"parseHTML",m));b&&(x.parseDOM=b.map(S=>zy(S,p)));const v=se(f,"renderHTML",m);v&&(x.toDOM=S=>v({node:S,HTMLAttributes:cu(S,p)}));const w=se(f,"renderText",m);return w&&(x.toText=w),[f.name,x]})),c=Object.fromEntries(s.map(f=>{const p=r.filter(w=>w.type===f.name),m={name:f.name,options:f.options,storage:f.storage,editor:e},y=t.reduce((w,S)=>{const A=se(S,"extendMarkSchema",m);return{...w,...A?A(f):{}}},{}),x=jy({...y,inclusive:Oe(se(f,"inclusive",m)),excludes:Oe(se(f,"excludes",m)),group:Oe(se(f,"group",m)),spanning:Oe(se(f,"spanning",m)),code:Oe(se(f,"code",m)),attrs:Object.fromEntries(p.map(By))}),b=Oe(se(f,"parseHTML",m));b&&(x.parseDOM=b.map(w=>zy(w,p)));const v=se(f,"renderHTML",m);return v&&(x.toDOM=w=>v({mark:w,HTMLAttributes:cu(w,p)})),[f.name,x]}));return new yp({topNode:u,nodes:a,marks:c})}function B_(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}function Ho(t){return t.sort((n,r)=>{const i=se(n,"priority")||100,s=se(r,"priority")||100;return i>s?-1:i<s?1:0})}function Zk(t){const e=Ho(zp(t)),n=B_(e.map(r=>r.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),e}function Jk(t,e,n){const{from:r,to:i}=e,{blockSeparator:s=`
228
-
229
- `,textSerializers:u={}}=n||{};let a="";return t.nodesBetween(r,i,(c,f,p,m)=>{var y;c.isBlock&&f>r&&(a+=s);const x=u==null?void 0:u[c.type.name];if(x)return p&&(a+=x({node:c,pos:f,parent:p,index:m,range:e})),!1;c.isText&&(a+=(y=c==null?void 0:c.text)==null?void 0:y.slice(Math.max(r,f)-f,i-f))}),a}function $_(t,e){const n={from:0,to:t.content.size};return Jk(t,n,e)}function Gk(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}function V_(t,e){const n=ct(e,t.schema),{from:r,to:i}=t.selection,s=[];t.doc.nodesBetween(r,i,a=>{s.push(a)});const u=s.reverse().find(a=>a.type.name===n.name);return u?{...u.attrs}:{}}function Qk(t,e){const n=yc(typeof e=="string"?e:e.name,t.schema);return n==="node"?V_(t,e):n==="mark"?Uk(t,e):{}}function H_(t,e=JSON.stringify){const n={};return t.filter(r=>{const i=e(r);return Object.prototype.hasOwnProperty.call(n,i)?!1:n[i]=!0})}function U_(t){const e=H_(t);return e.length===1?e:e.filter((n,r)=>!e.filter((s,u)=>u!==r).some(s=>n.oldRange.from>=s.oldRange.from&&n.oldRange.to<=s.oldRange.to&&n.newRange.from>=s.newRange.from&&n.newRange.to<=s.newRange.to))}function jp(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((i,s)=>{const u=[];if(i.ranges.length)i.forEach((a,c)=>{u.push({from:a,to:c})});else{const{from:a,to:c}=n[s];if(a===void 0||c===void 0)return;u.push({from:a,to:c})}u.forEach(({from:a,to:c})=>{const f=e.slice(s).map(a,-1),p=e.slice(s).map(c),m=e.invert().map(f,-1),y=e.invert().map(p);r.push({oldRange:{from:m,to:y},newRange:{from:f,to:p}})})}),U_(r)}function Bp(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(i=>{const s=n.resolve(t),u=Fp(s,i.type);u&&r.push({mark:i,...u})}):n.nodesBetween(t,e,(i,s)=>{!i||(i==null?void 0:i.nodeSize)===void 0||r.push(...i.marks.map(u=>({from:s,to:s+i.nodeSize,mark:u})))}),r}var q_=(t,e,n,r=20)=>{const i=t.doc.resolve(n);let s=r,u=null;for(;s>0&&u===null;){const a=i.node(s);(a==null?void 0:a.type.name)===e?u=a:s-=1}return[u,s]};function Ao(t,e){return e.nodes[t]||e.marks[t]||null}function oa(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=t.find(s=>s.type===e&&s.name===r);return i?i.attribute.keepOnSplit:!1}))}var W_=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(i,s,u,a)=>{var c,f;const p=((f=(c=i.type.spec).toText)==null?void 0:f.call(c,{node:i,pos:s,parent:u,index:a}))||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?p:p.slice(0,Math.max(0,r-s))}),n};function Jh(t,e,n={}){const{empty:r,ranges:i}=t.selection,s=e?mr(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(m=>s?s.name===m.type.name:!0).find(m=>Ea(m.attrs,n,{strict:!1}));let u=0;const a=[];if(i.forEach(({$from:m,$to:y})=>{const x=m.pos,b=y.pos;t.doc.nodesBetween(x,b,(v,w)=>{if(s&&v.inlineContent&&!v.type.allowsMarkType(s))return!1;if(!v.isText&&!v.marks.length)return;const S=Math.max(x,w),A=Math.min(b,w+v.nodeSize),R=A-S;u+=R,a.push(...v.marks.map(I=>({mark:I,from:S,to:A})))})}),u===0)return!1;const c=a.filter(m=>s?s.name===m.mark.type.name:!0).filter(m=>Ea(m.mark.attrs,n,{strict:!1})).reduce((m,y)=>m+y.to-y.from,0),f=a.filter(m=>s?m.mark.type!==s&&m.mark.type.excludes(s):!0).reduce((m,y)=>m+y.to-y.from,0);return(c>0?c+f:c)>=u}function K_(t,e,n={}){if(!e)return ri(t,null,n)||Jh(t,null,n);const r=yc(e,t.schema);return r==="node"?ri(t,e,n):r==="mark"?Jh(t,e,n):!1}var Z_=(t,e)=>{const{$from:n,$to:r,$anchor:i}=t.selection;if(e){const s=xc(a=>a.type.name===e)(t.selection);if(!s)return!1;const u=t.doc.resolve(s.pos+1);return i.pos+1===u.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},J_=t=>{const{$from:e,$to:n}=t.selection;return!(e.parentOffset>0||e.pos!==n.pos)};function $y(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function Kf(t,e){const{nodeExtensions:n}=Is(e),r=n.find(u=>u.name===t);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},s=Oe(se(r,"group",i));return typeof s!="string"?!1:s.split(" ").includes("list")}function Eu(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return!/\S/.test((r=t.text)!=null?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let i=!0;return t.content.forEach(s=>{i!==!1&&(Eu(s,{ignoreWhitespace:n,checkChildren:e})||(i=!1))}),i}return!1}function Yk(t){return t instanceof oe}var Xk=class eb{constructor(e){this.position=e}static fromJSON(e){return new eb(e.position)}toJSON(){return{position:this.position}}};function G_(t,e){const n=e.mapping.mapResult(t.position);return{position:new Xk(n.pos),mapResult:n}}function Q_(t){return new Xk(t)}function Y_(t,e,n){var r;const{selection:i}=e;let s=null;if(jk(i)&&(s=i.$cursor),s){const a=(r=t.storedMarks)!=null?r:s.marks();return s.parent.type.allowsMarkType(n)&&(!!n.isInSet(a)||!a.some(f=>f.type.excludes(n)))}const{ranges:u}=i;return u.some(({$from:a,$to:c})=>{let f=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.pos,c.pos,(p,m,y)=>{if(f)return!1;if(p.isInline){const x=!y||y.type.allowsMarkType(n),b=!!n.isInSet(p.marks)||!p.marks.some(v=>v.type.excludes(n));f=x&&b}return!f}),f})}var X_=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const{selection:s}=n,{empty:u,ranges:a}=s,c=mr(t,r.schema);if(i)if(u){const f=Uk(r,c);n.addStoredMark(c.create({...f,...e}))}else a.forEach(f=>{const p=f.$from.pos,m=f.$to.pos;r.doc.nodesBetween(p,m,(y,x)=>{const b=Math.max(x,p),v=Math.min(x+y.nodeSize,m);y.marks.find(S=>S.type===c)?y.marks.forEach(S=>{c===S.type&&n.addMark(b,v,c.create({...S.attrs,...e}))}):n.addMark(b,v,c.create(e))})});return Y_(r,n,c)},e8=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),t8=(t,e={})=>({state:n,dispatch:r,chain:i})=>{const s=ct(t,n.schema);let u;return n.selection.$anchor.sameParent(n.selection.$head)&&(u=n.selection.$anchor.parent.attrs),s.isTextblock?i().command(({commands:a})=>ny(s,{...u,...e})(n)?!0:a.clearNodes()).command(({state:a})=>ny(s,{...u,...e})(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},n8=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,i=Ai(t,0,r.content.size),s=oe.create(r,i);e.setSelection(s)}return!0},r8=(t,e)=>({tr:n,state:r,dispatch:i})=>{const{selection:s}=r;let u,a;return typeof e=="number"?(u=e,a=e):e&&"from"in e&&"to"in e?(u=e.from,a=e.to):(u=s.from,a=s.to),i&&n.doc.nodesBetween(u,a,(c,f)=>{c.isText||n.setNodeMarkup(f,void 0,{...c.attrs,dir:t})}),!0},i8=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:i,to:s}=typeof t=="number"?{from:t,to:t}:t,u=de.atStart(r).from,a=de.atEnd(r).to,c=Ai(i,u,a),f=Ai(s,u,a),p=de.create(r,c,f);e.setSelection(p)}return!0},s8=t=>({state:e,dispatch:n})=>{const r=ct(t,e.schema);return G4(r)(e,n)};function Vy(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(i=>e==null?void 0:e.includes(i.type.name));t.tr.ensureMarks(r)}}var o8=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{const{selection:s,doc:u}=e,{$from:a,$to:c}=s,f=i.extensionManager.attributes,p=oa(f,a.node().type.name,a.node().attrs);if(s instanceof oe&&s.node.isBlock)return!a.parentOffset||!fr(u,a.pos)?!1:(r&&(t&&Vy(n,i.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const m=c.parentOffset===c.parent.content.size,y=a.depth===0?void 0:Vk(a.node(-1).contentMatchAt(a.indexAfter(-1)));let x=m&&y?[{type:y,attrs:p}]:void 0,b=fr(e.doc,e.mapping.map(a.pos),1,x);if(!x&&!b&&fr(e.doc,e.mapping.map(a.pos),1,y?[{type:y}]:void 0)&&(b=!0,x=y?[{type:y,attrs:p}]:void 0),r){if(b&&(s instanceof de&&e.deleteSelection(),e.split(e.mapping.map(a.pos),1,x),y&&!m&&!a.parentOffset&&a.parent.type!==y)){const v=e.mapping.map(a.before()),w=e.doc.resolve(v);a.node(-1).canReplaceWith(w.index(),w.index()+1,y)&&e.setNodeMarkup(e.mapping.map(a.before()),y)}t&&Vy(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return b},u8=(t,e={})=>({tr:n,state:r,dispatch:i,editor:s})=>{var u;const a=ct(t,r.schema),{$from:c,$to:f}=r.selection,p=r.selection.node;if(p&&p.isBlock||c.depth<2||!c.sameParent(f))return!1;const m=c.node(-1);if(m.type!==a)return!1;const y=s.extensionManager.attributes;if(c.parent.content.size===0&&c.node(-1).childCount===c.indexAfter(-1)){if(c.depth===2||c.node(-3).type!==a||c.index(-2)!==c.node(-2).childCount-1)return!1;if(i){let S=j.empty;const A=c.index(-1)?1:c.index(-2)?2:3;for(let Q=c.depth-A;Q>=c.depth-3;Q-=1)S=j.from(c.node(Q).copy(S));const R=c.indexAfter(-1)<c.node(-2).childCount?1:c.indexAfter(-2)<c.node(-3).childCount?2:3,I={...oa(y,c.node().type.name,c.node().attrs),...e},P=((u=a.contentMatch.defaultType)==null?void 0:u.createAndFill(I))||void 0;S=S.append(j.from(a.createAndFill(null,P)||void 0));const F=c.before(c.depth-(A-1));n.replace(F,c.after(-R),new G(S,4-A,0));let z=-1;n.doc.nodesBetween(F,n.doc.content.size,(Q,ue)=>{if(z>-1)return!1;Q.isTextblock&&Q.content.size===0&&(z=ue+1)}),z>-1&&n.setSelection(de.near(n.doc.resolve(z))),n.scrollIntoView()}return!0}const x=f.pos===c.end()?m.contentMatchAt(0).defaultType:null,b={...oa(y,m.type.name,m.attrs),...e},v={...oa(y,c.node().type.name,c.node().attrs),...e};n.delete(c.pos,f.pos);const w=x?[{type:a,attrs:b},{type:x,attrs:v}]:[{type:a,attrs:b}];if(!fr(n.doc,c.pos,2))return!1;if(i){const{selection:S,storedMarks:A}=r,{splittableMarks:R}=s.extensionManager,I=A||S.$to.parentOffset&&S.$from.marks();if(n.split(c.pos,2,w).scrollIntoView(),!I||!i)return!0;const P=I.filter(F=>R.includes(F.type.name));n.ensureMarks(P)}return!0};function Hy(t){return!t||t==="1"?null:t}function tb(t,e){return Hy(t)===Hy(e)}var Zf=(t,e)=>{const n=xc(u=>u.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return!(n.node.type===(i==null?void 0:i.type)&&oi(t.doc,n.pos))||!tb(n.node.attrs.type,i==null?void 0:i.attrs.type)||t.join(n.pos),!0},Jf=(t,e)=>{const n=xc(u=>u.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return!(n.node.type===(i==null?void 0:i.type)&&oi(t.doc,r))||!tb(n.node.attrs.type,i==null?void 0:i.attrs.type)||t.join(r),!0};function l8(t){const e=t.doc,n=e.firstChild;if(!n)return null;const r=e.resolve(1),i=e.resolve(n.nodeSize-1);return de.between(r,i)}var a8=(t,e,n,r={})=>({editor:i,tr:s,state:u,dispatch:a,chain:c,commands:f,can:p})=>{const{extensions:m,splittableMarks:y}=i.extensionManager,x=ct(t,u.schema),b=ct(e,u.schema),{selection:v,storedMarks:w}=u,{$from:S,$to:A}=v,R=S.blockRange(A),I=w||v.$to.parentOffset&&v.$from.marks();if(!R)return!1;const P=xc(Te=>Kf(Te.type.name,m))(v),F=v.from===0&&v.to===u.doc.content.size,z=u.doc.content.content,Q=z.length===1?z[0]:null,ue=F&&Q&&Kf(Q.type.name,m)?{node:Q,pos:0}:null,Ce=P??ue,rt=!!P&&R.depth>=1&&R.depth-P.depth<=1,Je=!!ue;if((rt||Je)&&Ce){if(Ce.node.type===x)return F&&Je?c().command(({tr:Te,dispatch:Se})=>{const ye=l8(Te);return ye?(Te.setSelection(ye),Se&&Se(Te),!0):!1}).liftListItem(b).run():f.liftListItem(b);if(Kf(Ce.node.type.name,m)&&x.validContent(Ce.node.content))return c().command(()=>(s.setNodeMarkup(Ce.pos,x),!0)).command(()=>Zf(s,x)).command(()=>Jf(s,x)).run()}return!n||!I||!a?c().command(()=>p().wrapInList(x,r)?!0:f.clearNodes()).wrapInList(x,r).command(()=>Zf(s,x)).command(()=>Jf(s,x)).run():c().command(()=>{const Te=p().wrapInList(x,r),Se=I.filter(ye=>y.includes(ye.type.name));return s.ensureMarks(Se),Te?!0:f.clearNodes()}).wrapInList(x,r).command(()=>Zf(s,x)).command(()=>Jf(s,x)).run()},c8=(t,e={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:s=!1}=n,u=mr(t,r.schema);return Jh(r,u,e)?i.unsetMark(u,{extendEmptyMarkRange:s}):i.setMark(u,e)},d8=(t,e,n={})=>({state:r,commands:i})=>{const s=ct(t,r.schema),u=ct(e,r.schema),a=ri(r,s,n);let c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),a?i.setNode(u,c):i.setNode(s,{...c,...n})},f8=(t,e={})=>({state:n,commands:r})=>{const i=ct(t,n.schema);return ri(n,i,e)?r.lift(i):r.wrapIn(i,e)},h8=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let s;if(i.spec.isInputRules&&(s=i.getState(t))){if(e){const u=t.tr,a=s.transform;for(let c=a.steps.length-1;c>=0;c-=1)u.step(a.steps[c].invert(a.docs[c]));if(s.text){const c=u.doc.resolve(s.from).marks();u.replaceWith(s.from,s.to,t.schema.text(s.text,c))}else u.delete(s.from,s.to)}return!0}}return!1},p8=(t={})=>({tr:e,dispatch:n,editor:r})=>{const{ignoreClearable:i=!1}=t,{selection:s}=e,{empty:u,ranges:a}=s;if(u)return!0;const{nonClearableMarks:c}=r.extensionManager;if(n){const f=Object.values(r.schema.marks).filter(p=>i||!c.includes(p.name));a.forEach(p=>{for(const m of f)e.removeMark(p.$from.pos,p.$to.pos,m)})}return!0},m8=(t,e={})=>({tr:n,state:r,dispatch:i})=>{var s;const{extendEmptyMarkRange:u=!1}=e,{selection:a}=n,c=mr(t,r.schema),{$from:f,empty:p,ranges:m}=a;if(!i)return!0;if(p&&u){let{from:y,to:x}=a;const b=(s=f.marks().find(w=>w.type===c))==null?void 0:s.attrs,v=Fp(f,c,b);v&&(y=v.from,x=v.to),n.removeMark(y,x,c)}else m.forEach(y=>{n.removeMark(y.$from.pos,y.$to.pos,c)});return n.removeStoredMark(c),!0},g8=t=>({tr:e,state:n,dispatch:r})=>{const{selection:i}=n;let s,u;return typeof t=="number"?(s=t,u=t):t&&"from"in t&&"to"in t?(s=t.from,u=t.to):(s=i.from,u=i.to),r&&e.doc.nodesBetween(s,u,(a,c)=>{if(a.isText)return;const f={...a.attrs};delete f.dir,e.setNodeMarkup(c,void 0,f)}),!0},y8=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let s=null,u=null;const a=yc(typeof t=="string"?t:t.name,r.schema);if(!a)return!1;a==="node"&&(s=ct(t,r.schema)),a==="mark"&&(u=mr(t,r.schema));let c=!1;return n.selection.ranges.forEach(f=>{const p=f.$from.pos,m=f.$to.pos;let y,x,b,v;n.selection.empty?r.doc.nodesBetween(p,m,(w,S)=>{s&&s===w.type&&(c=!0,b=Math.max(S,p),v=Math.min(S+w.nodeSize,m),y=S,x=w)}):r.doc.nodesBetween(p,m,(w,S)=>{S<p&&s&&s===w.type&&(c=!0,b=Math.max(S,p),v=Math.min(S+w.nodeSize,m),y=S,x=w),S>=p&&S<=m&&(s&&s===w.type&&(c=!0,i&&n.setNodeMarkup(S,void 0,{...w.attrs,...e})),u&&w.marks.length&&w.marks.forEach(A=>{if(u===A.type&&(c=!0,i)){const R=Math.max(S,p),I=Math.min(S+w.nodeSize,m);n.addMark(R,I,u.create({...A.attrs,...e}))}}))}),x&&(y!==void 0&&i&&n.setNodeMarkup(y,void 0,{...x.attrs,...e}),u&&x.marks.length&&x.marks.forEach(w=>{u===w.type&&i&&n.addMark(b,v,u.create({...w.attrs,...e}))}))}),c},x8=(t,e={})=>({state:n,dispatch:r})=>{const i=ct(t,n.schema);return H4(i,e)(n,r)},k8=(t,e={})=>({state:n,dispatch:r})=>{const i=ct(t,n.schema);return U4(i,e)(n,r)},b8=class{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){const n=this.callbacks[t];return n&&n.forEach(r=>r.apply(this,e)),this}off(t,e){const n=this.callbacks[t];return n&&(e?this.callbacks[t]=n.filter(r=>r!==e):delete this.callbacks[t]),this}once(t,e){const n=(...r)=>{this.off(t,n),e.apply(this,r)};return this.on(t,n)}removeAllListeners(){this.callbacks={}}};function v8(t,e){const{selection:n}=t,{$from:r}=n;if(n instanceof oe){const s=r.index();return r.parent.canReplaceWith(s,s+1,e)}let i=r.depth;for(;i>=0;){const s=r.index(i);if(r.node(i).contentMatchAt(s).matchType(e))return!0;i-=1}return!1}function w8(t,e,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute("data-tiptap-style",""),i.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(i),i}function C8(t){return typeof t=="number"}function S8(t){return Object.prototype.toString.call(t).slice(8,-1)}function Wl(t){return S8(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}var E8={};Lp(E8,{createAtomBlockMarkdownSpec:()=>_8,createBlockMarkdownSpec:()=>T8,createInlineMarkdownSpec:()=>D8,parseAttributes:()=>$p,parseIndentedBlocks:()=>Gh,renderNestedMarkdownContent:()=>Hp,serializeAttributes:()=>Vp});function $p(t){if(!(t!=null&&t.trim()))return{};const e={},n=[],r=t.replace(/["']([^"']*)["']/g,f=>(n.push(f),`__QUOTED_${n.length-1}__`)),i=r.match(/(?:^|\s)\.([\w-]+)/g);if(i){const f=i.map(p=>p.trim().slice(1));e.class=f.join(" ")}const s=r.match(/(?:^|\s)#([\w-]+)/);s&&(e.id=s[1]);const u=/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;Array.from(r.matchAll(u)).forEach(([,f,p])=>{var m;const y=parseInt(((m=p.match(/__QUOTED_(\d+)__/))==null?void 0:m[1])||"0",10),x=n[y];x&&(e[f]=x.slice(1,-1))});const c=r.replace(/(?:^|\s)\.([\w-]+)/g,"").replace(/(?:^|\s)#([\w-]+)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return c&&c.split(/\s+/).filter(Boolean).forEach(p=>{p.match(/^[a-zA-Z][\w-]*$/)&&(e[p]=!0)}),e}function Vp(t){if(!t||Object.keys(t).length===0)return"";const e=[];return t.class&&String(t.class).split(/\s+/).filter(Boolean).forEach(r=>e.push(`.${r}`)),t.id&&e.push(`#${t.id}`),Object.entries(t).forEach(([n,r])=>{n==="class"||n==="id"||(r===!0?e.push(n):r!==!1&&r!=null&&e.push(`${n}="${String(r)}"`))}),e.join(" ")}function _8(t){const{nodeName:e,name:n,parseAttributes:r=$p,serializeAttributes:i=Vp,defaultAttributes:s={},requiredAttributes:u=[],allowedAttributes:a}=t,c=n||e,f=p=>{if(!a)return p;const m={};return a.forEach(y=>{y in p&&(m[y]=p[y])}),m};return{parseMarkdown:(p,m)=>{const y={...s,...p.attributes};return m.createNode(e,y,[])},markdownTokenizer:{name:e,level:"block",start(p){var m;const y=new RegExp(`^:::${c}(?:\\s|$)`,"m"),x=(m=p.match(y))==null?void 0:m.index;return x!==void 0?x:-1},tokenize(p,m,y){const x=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),b=p.match(x);if(!b)return;const v=b[1]||"",w=r(v);if(!u.find(A=>!(A in w)))return{type:e,raw:b[0],attributes:w}}},renderMarkdown:p=>{const m=f(p.attrs||{}),y=i(m),x=y?` {${y}}`:"";return`:::${c}${x} :::`}}}function T8(t){const{nodeName:e,name:n,getContent:r,parseAttributes:i=$p,serializeAttributes:s=Vp,defaultAttributes:u={},content:a="block",allowedAttributes:c}=t,f=n||e,p=m=>{if(!c)return m;const y={};return c.forEach(x=>{x in m&&(y[x]=m[x])}),y};return{parseMarkdown:(m,y)=>{let x;if(r){const v=r(m);x=typeof v=="string"?[{type:"text",text:v}]:v}else a==="block"?x=y.parseChildren(m.tokens||[]):x=y.parseInline(m.tokens||[]);const b={...u,...m.attributes};return y.createNode(e,b,x)},markdownTokenizer:{name:e,level:"block",start(m){var y;const x=new RegExp(`^:::${f}`,"m"),b=(y=m.match(x))==null?void 0:y.index;return b!==void 0?b:-1},tokenize(m,y,x){var b;const v=new RegExp(`^:::${f}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),w=m.match(v);if(!w)return;const[S,A=""]=w,R=i(A);let I=1;const P=S.length;let F="";const z=/^:::([\w-]*)(\s.*)?/gm,Q=m.slice(P);for(z.lastIndex=0;;){const ue=z.exec(Q);if(ue===null)break;const Ce=ue.index,rt=ue[1];if(!((b=ue[2])!=null&&b.endsWith(":::"))){if(rt)I+=1;else if(I-=1,I===0){const Je=Q.slice(0,Ce);F=Je.trim();const Te=m.slice(0,P+Ce+ue[0].length);let Se=[];if(F)if(a==="block")for(Se=x.blockTokens(Je),Se.forEach(ye=>{ye.text&&(!ye.tokens||ye.tokens.length===0)&&(ye.tokens=x.inlineTokens(ye.text))});Se.length>0;){const ye=Se[Se.length-1];if(ye.type==="paragraph"&&(!ye.text||ye.text.trim()===""))Se.pop();else break}else Se=x.inlineTokens(F);return{type:e,raw:Te,attributes:R,content:F,tokens:Se}}}}}},renderMarkdown:(m,y)=>{const x=p(m.attrs||{}),b=s(x),v=b?` {${b}}`:"",w=y.renderChildren(m.content||[],`
230
-
231
- `);return`:::${f}${v}
232
-
233
- ${w}
234
-
235
- :::`}}}function A8(t){if(!t.trim())return{};const e={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(t);for(;r!==null;){const[,i,s,u]=r;e[i]=s||u,r=n.exec(t)}return e}function M8(t){return Object.entries(t).filter(([,e])=>e!=null).map(([e,n])=>`${e}="${n}"`).join(" ")}function D8(t){const{nodeName:e,name:n,getContent:r,parseAttributes:i=A8,serializeAttributes:s=M8,defaultAttributes:u={},selfClosing:a=!1,allowedAttributes:c}=t,f=n||e,p=y=>{if(!c)return y;const x={};return c.forEach(b=>{const v=typeof b=="string"?b:b.name,w=typeof b=="string"?void 0:b.skipIfDefault;if(v in y){const S=y[v];if(w!==void 0&&S===w)return;x[v]=S}}),x},m=f.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(y,x)=>{const b={...u,...y.attributes};if(a)return x.createNode(e,b);const v=r?r(y):y.content||"";return v?x.createNode(e,b,[x.createTextNode(v)]):x.createNode(e,b,[])},markdownTokenizer:{name:e,level:"inline",start(y){const x=a?new RegExp(`\\[${m}\\s*[^\\]]*\\]`):new RegExp(`\\[${m}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${m}\\]`),b=y.match(x),v=b==null?void 0:b.index;return v!==void 0?v:-1},tokenize(y,x,b){const v=a?new RegExp(`^\\[${m}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${m}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${m}\\]`),w=y.match(v);if(!w)return;let S="",A="";if(a){const[,I]=w;A=I}else{const[,I,P]=w;A=I,S=P||""}const R=i(A.trim());return{type:e,raw:w[0],content:S.trim(),attributes:R}}},renderMarkdown:y=>{let x="";r?x=r(y):y.content&&y.content.length>0&&(x=y.content.filter(S=>S.type==="text").map(S=>S.text).join(""));const b=p(y.attrs||{}),v=s(b),w=v?` ${v}`:"";return a?`[${f}${w}]`:`[${f}${w}]${x}[/${f}]`}}}function Gh(t,e,n){var r,i,s,u;const a=t.split(`
236
- `),c=[];let f="",p=0;const m=e.baseIndentSize||2;for(;p<a.length;){const y=a[p],x=y.match(e.itemPattern);if(!x){if(c.length>0)break;if(y.trim()===""){p+=1,f=`${f}${y}
237
- `;continue}else return}const b=e.extractItemData(x),{indentLevel:v,mainContent:w}=b;f=`${f}${y}
238
- `;const S=[w];for(p+=1;p<a.length;){const P=a[p];if(P.trim()===""){const z=a.slice(p+1).findIndex(Ce=>Ce.trim()!=="");if(z===-1)break;if((((i=(r=a[p+1+z].match(/^(\s*)/))==null?void 0:r[1])==null?void 0:i.length)||0)>v){S.push(P),f=`${f}${P}
239
- `,p+=1;continue}else break}if((((u=(s=P.match(/^(\s*)/))==null?void 0:s[1])==null?void 0:u.length)||0)>v)S.push(P),f=`${f}${P}
240
- `,p+=1;else break}let A;const R=S.slice(1);if(R.length>0){const P=R.map(F=>F.slice(v+m)).join(`
241
- `);P.trim()&&(e.customNestedParser?A=e.customNestedParser(P):A=n.blockTokens(P))}const I=e.createToken(b,A);c.push(I)}if(c.length!==0)return{items:c,raw:f}}function Hp(t,e,n,r){if(!t||!Array.isArray(t.content))return"";const i=typeof n=="function"?n(r):n,[s,...u]=t.content,a=e.renderChildren([s]);let c=`${i}${a}`;return u&&u.length>0&&u.forEach((f,p)=>{var m,y;const x=(y=(m=e.renderChild)==null?void 0:m.call(e,f,p+1))!=null?y:e.renderChildren([f]);if(x!=null){const b=x.split(`
242
- `).map(v=>v?e.indent(v):e.indent("")).join(`
243
- `);c+=f.type==="paragraph"?`
244
-
245
- ${b}`:`
246
- ${b}`}}),c}function nb(t,e){const n={...t};return Wl(t)&&Wl(e)&&Object.keys(e).forEach(r=>{Wl(e[r])&&Wl(t[r])?n[r]=nb(t[r],e[r]):n[r]=e[r]}),n}function N8(t,e,n={}){const{state:r}=e,{doc:i,tr:s}=r,u=t;i.descendants((a,c)=>{const f=s.mapping.map(c),p=s.mapping.map(c)+a.nodeSize;let m=null;if(a.marks.forEach(x=>{if(x!==u)return!1;m=x}),!m)return;let y=!1;if(Object.keys(n).forEach(x=>{n[x]!==m.attrs[x]&&(y=!0)}),y){const x=t.type.create({...t.attrs,...n});s.removeMark(f,p,t.type),s.addMark(f,p,x)}}),s.docChanged&&e.view.dispatch(s)}var _u=class{constructor(t){var e;this.find=t.find,this.handler=t.handler,this.undoable=(e=t.undoable)!=null?e:!0}},O8=(t,e)=>{if(Pp(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function Kl(t){var e;const{editor:n,from:r,to:i,text:s,rules:u,plugin:a}=t,{view:c}=n;if(c.composing)return!1;const f=c.state.doc.resolve(r);if(f.parent.type.spec.code||(e=f.nodeBefore||f.nodeAfter)!=null&&e.marks.find(y=>y.type.spec.code))return!1;let p=!1;const m=W_(f)+s;return u.forEach(y=>{if(p)return;const x=O8(m,y.find);if(!x)return;const b=x[0].length-s.length;if(b>0){const F=f.parentOffset-b;if(F<0||f.parent.textBetween(F,f.parentOffset)!==x[0].slice(0,b))return}const v=c.state.tr,w=mc({state:c.state,transaction:v}),S={from:r-(x[0].length-s.length),to:i},{commands:A,chain:R,can:I}=new gc({editor:n,state:w});y.handler({state:w,range:S,match:x,commands:A,chain:R,can:I})===null||!v.steps.length||(y.undoable&&v.setMeta(a,{transform:v,from:r,to:i,text:s}),c.dispatch(v),p=!0)}),p}function R8(t){const{editor:e,rules:n}=t,r=new qe({state:{init(){return null},apply(i,s,u){const a=i.getMeta(r);if(a)return a;const c=i.getMeta("applyInputRules");return!!c&&setTimeout(()=>{let{text:p}=c;typeof p=="string"?p=p:p=Su(j.from(p),u.schema);const{from:m}=c,y=m+p.length;Kl({editor:e,from:m,to:y,text:p,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:s}},props:{handleTextInput(i,s,u,a){return Kl({editor:e,from:s,to:u,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:s}=i.state.selection;s&&Kl({editor:e,from:s.pos,to:s.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,s){if(s.key!=="Enter")return!1;const{$cursor:u}=i.state.selection;return u?Kl({editor:e,from:u.pos,to:u.pos,text:`
247
- `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}var Up=class{constructor(t={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...t},this.name=this.config.name}get options(){return{...Oe(se(this,"addOptions",{name:this.name}))}}get storage(){return{...Oe(se(this,"addStorage",{name:this.name,options:this.options}))}}configure(t={}){const e=this.extend({...this.config,addOptions:()=>nb(this.options,t)});return e.name=this.name,e.parent=this.parent,this.child=null,e}extend(t={}){const e=new this.constructor({...this.config,...t});return e.parent=this,this.child=e,e.name="name"in t?t.name:e.parent.name,e}},on=class rb extends Up{constructor(){super(...arguments),this.type="mark"}static create(e={}){const n=typeof e=="function"?e():e;return new rb(n)}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const u=i.marks();if(!!!u.find(f=>(f==null?void 0:f.type.name)===n.name))return!1;const c=u.find(f=>(f==null?void 0:f.type.name)===n.name);return c&&r.removeStoredMark(c),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},ib=class{constructor(t){this.find=t.find,this.handler=t.handler}},I8=(t,e,n)=>{if(Pp(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(i=>{const s=[i.text];return s.index=i.index,s.input=t,s.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),s.push(i.replaceWith)),s}):[]};function L8(t){const{editor:e,state:n,from:r,to:i,rule:s,pasteEvent:u,dropEvent:a}=t,{commands:c,chain:f,can:p}=new gc({editor:e,state:n}),m=[];return n.doc.nodesBetween(r,i,(x,b)=>{var v,w,S,A,R;if((w=(v=x.type)==null?void 0:v.spec)!=null&&w.code||!(x.isText||x.isTextblock||x.isInline))return;const I=(R=(A=(S=x.content)==null?void 0:S.size)!=null?A:x.nodeSize)!=null?R:0,P=Math.max(r,b),F=Math.min(i,b+I);if(P>=F)return;const z=x.isText?x.text||"":x.textBetween(P-b,F-b,void 0,"");I8(z,s.find,u).forEach(ue=>{if(ue.index===void 0)return;const Ce=P+ue.index+1,rt=Ce+ue[0].length,Je={from:n.tr.mapping.map(Ce),to:n.tr.mapping.map(rt)},Te=s.handler({state:n,range:Je,match:ue,commands:c,chain:f,can:p,pasteEvent:u,dropEvent:a});m.push(Te)})}),m.every(x=>x!==null)}var Zl=null,P8=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)==null||e.setData("text/html",t),n};function F8(t){const{editor:e,rules:n}=t;let r=null,i=!1,s=!1,u=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a;try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}const c=({state:p,from:m,to:y,rule:x,pasteEvt:b})=>{const v=p.tr,w=mc({state:p,transaction:v});if(!(!L8({editor:e,state:w,from:Math.max(m-1,0),to:y.b-1,rule:x,pasteEvent:b,dropEvent:a})||!v.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}return u=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,v}};return n.map(p=>new qe({view(m){const y=b=>{var v;r=(v=m.dom.parentElement)!=null&&v.contains(b.target)?m.dom.parentElement:null,r&&(Zl=e)},x=()=>{Zl&&(Zl=null)};return window.addEventListener("dragstart",y),window.addEventListener("dragend",x),{destroy(){window.removeEventListener("dragstart",y),window.removeEventListener("dragend",x)}}},props:{handleDOMEvents:{drop:(m,y)=>{if(s=r===m.dom.parentElement,a=y,!s){const x=Zl;x!=null&&x.isEditable&&setTimeout(()=>{const b=x.state.selection;b&&x.commands.deleteRange({from:b.from,to:b.to})},10)}return!1},paste:(m,y)=>{var x;const b=(x=y.clipboardData)==null?void 0:x.getData("text/html");return u=y,i=!!(b!=null&&b.includes("data-pm-slice")),!1}}},appendTransaction:(m,y,x)=>{const b=m[0],v=b.getMeta("uiEvent")==="paste"&&!i,w=b.getMeta("uiEvent")==="drop"&&!s,S=b.getMeta("applyPasteRules"),A=!!S;if(!v&&!w&&!A)return;if(A){let{text:P}=S;typeof P=="string"?P=P:P=Su(j.from(P),x.schema);const{from:F}=S,z=F+P.length,Q=P8(P);return c({rule:p,state:x,from:F,to:{b:z},pasteEvt:Q})}const R=y.doc.content.findDiffStart(x.doc.content),I=y.doc.content.findDiffEnd(x.doc.content);if(!(!C8(R)||!I||R===I.b))return c({rule:p,state:x,from:R,to:I,pasteEvt:u})}}))}var kc=class{constructor(t,e){this.splittableMarks=[],this.nonClearableMarks=[],this.editor=e,this.baseExtensions=t,this.extensions=Zk(t),this.schema=j_(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((t,e)=>{const n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Ao(e.name,this.schema)},r=se(e,"addCommands",n);return r?{...t,...r()}:t},{})}get plugins(){const{editor:t}=this;return Ho([...this.extensions].reverse()).flatMap(r=>{const i={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:t,type:Ao(r.name,this.schema)},s=[],u=se(r,"addKeyboardShortcuts",i);let a={};if(r.type==="mark"&&se(r,"exitable",i)&&(a.ArrowRight=()=>on.handleExit({editor:t,mark:r})),u){const y=Object.fromEntries(Object.entries(u()).map(([x,b])=>[x,()=>b({editor:t})]));a={...a,...y}}const c=BE(a);s.push(c);const f=se(r,"addInputRules",i);if($y(r,t.options.enableInputRules)&&f){const y=f();if(y&&y.length){const x=R8({editor:t,rules:y}),b=Array.isArray(x)?x:[x];s.push(...b)}}const p=se(r,"addPasteRules",i);if($y(r,t.options.enablePasteRules)&&p){const y=p();if(y&&y.length){const x=F8({editor:t,rules:y});s.push(...x)}}const m=se(r,"addProseMirrorPlugins",i);if(m){const y=m();s.push(...y)}return s})}get attributes(){return Kk(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=Is(this.extensions);return Object.fromEntries(e.filter(n=>!!se(n,"addNodeView")).map(n=>{const r=this.attributes.filter(c=>c.type===n.name),i={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:ct(n.name,this.schema)},s=se(n,"addNodeView",i);if(!s)return[];const u=s();if(!u)return[];const a=(c,f,p,m,y)=>{const x=cu(c,r);return u({node:c,view:f,getPos:p,decorations:m,innerDecorations:y,editor:t,extension:n,HTMLAttributes:x})};return[n.name,a]}))}dispatchTransaction(t){const{editor:e}=this;return Ho([...this.extensions].reverse()).reduceRight((r,i)=>{const s={name:i.name,options:i.options,storage:this.editor.extensionStorage[i.name],editor:e,type:Ao(i.name,this.schema)},u=se(i,"dispatchTransaction",s);return u?a=>{u.call(s,{transaction:a,next:r})}:r},t)}transformPastedHTML(t){const{editor:e}=this;return Ho([...this.extensions]).reduce((r,i)=>{const s={name:i.name,options:i.options,storage:this.editor.extensionStorage[i.name],editor:e,type:Ao(i.name,this.schema)},u=se(i,"transformPastedHTML",s);return u?(a,c)=>{const f=r(a,c);return u.call(s,f)}:r},t||(r=>r))}get markViews(){const{editor:t}=this,{markExtensions:e}=Is(this.extensions);return Object.fromEntries(e.filter(n=>!!se(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:t,type:mr(n.name,this.schema)},s=se(n,"addMarkView",i);if(!s)return[];const u=(a,c,f)=>{const p=cu(a,r);return s()({mark:a,view:c,inline:f,editor:t,extension:n,HTMLAttributes:p,updateAttributes:m=>{N8(a,t,m)}})};return[n.name,u]}))}destroy(){this.extensions.forEach(t=>{let e=t;for(;e.parent;){const n=e.parent;n.child===e&&(n.child=null),e=n}}),this.extensions=[],this.baseExtensions=[],this.schema=null,this.editor=null}setupExtensions(){const t=this.extensions;this.editor.extensionStorage=Object.fromEntries(t.map(e=>[e.name,e.storage])),t.forEach(e=>{var n,r;const i={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Ao(e.name,this.schema)};e.type==="mark"&&(((n=Oe(se(e,"keepOnSplit",i)))==null||n)&&this.splittableMarks.push(e.name),(r=Oe(se(e,"clearable",i)))==null||r||this.nonClearableMarks.push(e.name));const s=se(e,"onBeforeCreate",i),u=se(e,"onCreate",i),a=se(e,"onUpdate",i),c=se(e,"onSelectionUpdate",i),f=se(e,"onTransaction",i),p=se(e,"onFocus",i),m=se(e,"onBlur",i),y=se(e,"onDestroy",i);s&&this.editor.on("beforeCreate",s),u&&this.editor.on("create",u),a&&this.editor.on("update",a),c&&this.editor.on("selectionUpdate",c),f&&this.editor.on("transaction",f),p&&this.editor.on("focus",p),m&&this.editor.on("blur",m),y&&this.editor.on("destroy",y)})}};kc.resolve=Zk;kc.sort=Ho;kc.flatten=zp;var sb={};Lp(sb,{ClipboardTextSerializer:()=>ub,Commands:()=>lb,Delete:()=>ab,Drop:()=>cb,Editable:()=>db,FocusEvents:()=>hb,Keymap:()=>pb,Paste:()=>mb,Tabindex:()=>gb,TextDirection:()=>yb,focusEventsPluginKey:()=>fb});var We=class ob extends Up{constructor(){super(...arguments),this.type="extension"}static create(e={}){const n=typeof e=="function"?e():e;return new ob(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},ub=We.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new qe({key:new dt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,s=Gk(n),{blockSeparator:u}=this.options,a={...u!==void 0?{blockSeparator:u}:{},textSerializers:s};return[...i.ranges].sort((f,p)=>f.$from.pos-p.$from.pos).map(({$from:f,$to:p})=>Jk(r,{from:f.pos,to:p.pos},a)).join(u??`
248
-
249
- `)}}})]}}),lb=We.create({name:"commands",addCommands(){return{...Fk}}}),ab=We.create({name:"delete",onUpdate({transaction:t,appendedTransactions:e}){var n,r,i;const s=()=>{var u,a,c,f;if((f=(c=(a=(u=this.editor.options.coreExtensionOptions)==null?void 0:u.delete)==null?void 0:a.filterTransaction)==null?void 0:c.call(a,t))!=null?f:t.getMeta("y-sync$"))return;const p=qk(t.before,[t,...e]);jp(p).forEach(x=>{p.mapping.mapResult(x.oldRange.from).deletedAfter&&p.mapping.mapResult(x.oldRange.to).deletedBefore&&p.before.nodesBetween(x.oldRange.from,x.oldRange.to,(b,v)=>{const w=v+b.nodeSize-2,S=x.oldRange.from<=v&&w<=x.oldRange.to;this.editor.emit("delete",{type:"node",node:b,from:v,to:w,newFrom:p.mapping.map(v),newTo:p.mapping.map(w),deletedRange:x.oldRange,newRange:x.newRange,partial:!S,editor:this.editor,transaction:t,combinedTransform:p})})});const y=p.mapping;p.steps.forEach((x,b)=>{var v,w;if(x instanceof An){const S=y.slice(b).map(x.from,-1),A=y.slice(b).map(x.to),R=y.invert().map(S,-1),I=y.invert().map(A),P=S>0?(v=p.doc.nodeAt(S-1))==null?void 0:v.marks.some(z=>z.eq(x.mark)):!1,F=(w=p.doc.nodeAt(A))==null?void 0:w.marks.some(z=>z.eq(x.mark));this.editor.emit("delete",{type:"mark",mark:x.mark,from:x.from,to:x.to,deletedRange:{from:R,to:I},newRange:{from:S,to:A},partial:!!(F||P),editor:this.editor,transaction:t,combinedTransform:p})}})};(i=(r=(n=this.editor.options.coreExtensionOptions)==null?void 0:n.delete)==null?void 0:r.async)==null||i?setTimeout(s,0):s()}}),cb=We.create({name:"drop",addProseMirrorPlugins(){return[new qe({key:new dt("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),db=We.create({name:"editable",addProseMirrorPlugins(){return[new qe({key:new dt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),fb=new dt("focusEvents"),hb=We.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new qe({key:fb,props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),pb=We.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:u})=>[()=>u.undoInputRule(),()=>u.command(({tr:a})=>{const{selection:c,doc:f}=a,{empty:p,$anchor:m}=c,{pos:y,parent:x}=m,b=m.parent.isTextblock&&y>0?a.doc.resolve(y-1):m,v=b.parent.type.spec.isolating,w=m.pos-m.parentOffset,S=v&&b.parent.childCount===1?w===m.pos:ge.atStart(f).from===y;return!p||!x.type.isTextblock||x.textContent.length||!S||S&&m.parent.type.name==="paragraph"?!1:u.clearNodes()}),()=>u.deleteSelection(),()=>u.joinBackward(),()=>u.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:u})=>[()=>u.deleteSelection(),()=>u.deleteCurrentNode(),()=>u.joinForward(),()=>u.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:u})=>[()=>u.newlineInCode(),()=>u.createParagraphNear(),()=>u.liftEmptyBlock(),()=>u.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},s={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return _a()||Hk()?s:i},addProseMirrorPlugins(){return[new qe({key:new dt("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(v=>v.getMeta("composition")))return;const r=t.some(v=>v.docChanged)&&!e.doc.eq(n.doc),i=t.some(v=>v.getMeta("preventClearDocument"));if(!r||i)return;const{empty:s,from:u,to:a}=e.selection,c=ge.atStart(e.doc).from,f=ge.atEnd(e.doc).to;if(s||!(u===c&&a===f)||!Eu(n.doc))return;const y=n.tr,x=mc({state:n,transaction:y}),{commands:b}=new gc({editor:this.editor,state:x});if(b.clearNodes(),!!y.steps.length)return y}})]}}),mb=We.create({name:"paste",addProseMirrorPlugins(){return[new qe({key:new dt("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),gb=We.create({name:"tabindex",addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new qe({key:new dt("tabindex"),props:{attributes:()=>{var t;return!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:(t=this.options.value)!=null?t:"0"}}}})]}}),yb=We.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:t}=Is(this.extensions);return[{types:t.filter(e=>e.name!=="text").map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{const n=e.getAttribute("dir");return n&&(n==="ltr"||n==="rtl"||n==="auto")?n:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new qe({key:new dt("textDirection"),props:{attributes:()=>{const t=this.options.direction;return t?{dir:t}:{}}}})]}}),z8=class Po{constructor(e,n,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=i}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!=null?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new Po(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new Po(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new Po(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const i=n.isBlock&&!n.isTextblock,s=n.isAtom&&!n.isText,u=n.isInline,a=this.pos+r+(s?0:1);if(a<0||a>this.resolvedPos.doc.nodeSize-2)return;const c=this.resolvedPos.doc.resolve(a);if(!i&&!u&&c.depth<=this.depth)return;const f=new Po(c,this.editor,i,i||u?n:null);i&&(f.actualDepth=this.depth+1),e.push(f)}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===e)if(Object.keys(n).length>0){const s=i.node.attrs,u=Object.keys(n);for(let a=0;a<u.length;a+=1){const c=u[a];if(s[c]!==n[c])break}}else r=i;i=i.parent}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let i=[];if(!this.children||this.children.length===0)return i;const s=Object.keys(n);return this.children.forEach(u=>{r&&i.length>0||(u.node.type.name===e&&s.every(c=>n[c]===u.node.attrs[c])&&i.push(u),!(r&&i.length>0)&&(i=i.concat(u.querySelectorAll(e,n,r))))}),i}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}},j8=`.ProseMirror {
250
- position: relative;
251
- }
252
-
253
- .ProseMirror {
254
- word-wrap: break-word;
255
- white-space: pre-wrap;
256
- white-space: break-spaces;
257
- -webkit-font-variant-ligatures: none;
258
- font-variant-ligatures: none;
259
- font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
260
- }
261
-
262
- .ProseMirror [contenteditable="false"] {
263
- white-space: normal;
264
- }
265
-
266
- .ProseMirror [contenteditable="false"] [contenteditable="true"] {
267
- white-space: pre-wrap;
268
- }
269
-
270
- .ProseMirror pre {
271
- white-space: pre-wrap;
272
- }
273
-
274
- img.ProseMirror-separator {
275
- display: inline !important;
276
- border: none !important;
277
- margin: 0 !important;
278
- width: 0 !important;
279
- height: 0 !important;
280
- }
281
-
282
- .ProseMirror-gapcursor {
283
- display: none;
284
- pointer-events: none;
285
- position: absolute;
286
- margin: 0;
287
- }
288
-
289
- .ProseMirror-gapcursor:after {
290
- content: "";
291
- display: block;
292
- position: absolute;
293
- top: -2px;
294
- width: 20px;
295
- border-top: 1px solid black;
296
- animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
297
- }
298
-
299
- @keyframes ProseMirror-cursor-blink {
300
- to {
301
- visibility: hidden;
302
- }
303
- }
304
-
305
- .ProseMirror-hideselection *::selection {
306
- background: transparent;
307
- }
308
-
309
- .ProseMirror-hideselection *::-moz-selection {
310
- background: transparent;
311
- }
312
-
313
- .ProseMirror-hideselection * {
314
- caret-color: transparent;
315
- }
316
-
317
- .ProseMirror-focused .ProseMirror-gapcursor {
318
- display: block;
319
- }`,B8=class extends b8{constructor(t={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.destroyed=!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:n})=>{throw n},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:G_,createMappablePosition:Q_},this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:n,slice:r,moved:i})=>this.options.onDrop(n,r,i)),this.on("paste",({event:n,slice:r})=>this.options.onPaste(n,r)),this.on("delete",this.options.onDelete);const e=this.createDoc();if(!this.editorState){const n=Kh(e,this.options.autofocus);this.editorState=Ei.create({doc:e,schema:this.schema,selection:n||void 0})}this.options.element&&this.mount(this.options.element)}mount(t){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(t),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const t=this.editorView.dom;t!=null&&t.editor&&delete t.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(t){console.warn("Failed to remove CSS element:",t)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=w8(j8,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,e=!0){this.setOptions({editable:t}),e&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:t=>{this.editorState=t},dispatch:t=>{this.dispatchTransaction(t)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(t,e)=>{if(this.editorView)return this.editorView[e];if(e==="state")return this.editorState;if(e in t)return Reflect.get(t,e);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(t,e){const n=Wk(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(t){if(this.isDestroyed)return;const e=this.state.plugins;let n=e;if([].concat(t).forEach(i=>{const s=typeof i=="string"?`${i}$`:i.key;n=n.filter(u=>!u.key.startsWith(s))}),e.length===n.length)return;const r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var t,e,n,r;const s=[...this.options.enableCoreExtensions?[db,ub.configure({blockSeparator:(e=(t=this.options.coreExtensionOptions)==null?void 0:t.clipboardTextSerializer)==null?void 0:e.blockSeparator}),lb,hb,pb,gb.configure({value:(r=(n=this.options.coreExtensionOptions)==null?void 0:n.tabindex)==null?void 0:r.value}),cb,mb,ab,yb.configure({direction:this.options.textDirection})].filter(u=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[u.name]!==!1:!0):[],...this.options.extensions].filter(u=>["extension","node","mark"].includes(u==null?void 0:u.type));this.extensionManager=new kc(s,this)}createCommandManager(){this.commandManager=new gc({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let t;try{t=Zh(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(e.message))throw e;const n=Zh(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1});return this.editorState=Ei.create({doc:n,schema:this.schema,selection:Kh(n,this.options.autofocus)||void 0}),this.emit("contentError",{editor:this,error:e,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(r=>r.name!=="collaboration"),this.createExtensionManager()}}),this.editorState.doc}return t}createView(t){const{editorProps:e,enableExtensionDispatchTransaction:n}=this.options,r=e.dispatchTransaction||this.dispatchTransaction.bind(this),i=n?this.extensionManager.dispatchTransaction(r):r,s=e.transformPastedHTML,u=this.extensionManager.transformPastedHTML(s);this.editorView=new Lk(t,{...e,attributes:{role:"textbox",...e==null?void 0:e.attributes},dispatchTransaction:i,transformPastedHTML:u,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 c=this.view.dom;c.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(f=>{var p;return(p=this.capturedTransaction)==null?void 0:p.step(f)});return}const{state:e,transactions:n}=this.state.applyTransaction(t),r=!this.state.selection.eq(e.selection),i=n.includes(t),s=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:t,nextState:e}),!i)return;this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:t});const u=n.findLast(f=>f.getMeta("focus")||f.getMeta("blur")),a=u==null?void 0:u.getMeta("focus"),c=u==null?void 0:u.getMeta("blur");a&&this.emit("focus",{editor:this,event:a.event,transaction:u}),c&&this.emit("blur",{editor:this,event:c.event,transaction:u}),!(t.getMeta("preventUpdate")||!n.some(f=>f.docChanged)||s.doc.eq(e.doc))&&this.emit("update",{editor:this,transaction:t,appendedTransactions:n.slice(1)})}getAttributes(t){return Qk(this.state,t)}isActive(t,e){const n=typeof t=="string"?t:null,r=typeof t=="string"?e:t;return K_(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Su(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e=`
320
-
321
- `,textSerializers:n={}}=t||{};return $_(this.state.doc,{blockSeparator:e,textSerializers:{...Gk(this.schema),...n}})}get isEmpty(){return Eu(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit("destroy"),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){var t,e;return(e=(t=this.editorView)==null?void 0:t.isDestroyed)!=null?e:!0}$node(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelector(t,e))||null}$nodes(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelectorAll(t,e))||null}$pos(t){const e=this.state.doc.resolve(t),n=t>0&&e.nodeAfter&&!e.nodeAfter.isText&&e.nodeAfter.isAtom?e.nodeAfter:null;return new z8(e,this,!1,n)}get $doc(){return this.$pos(0)}};function $i(t){return new _u({find:t.find,handler:({state:e,range:n,match:r})=>{const i=Oe(t.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:s}=e,u=r[r.length-1],a=r[0];if(u){const c=a.search(/\S/),f=n.from+a.indexOf(u),p=f+u.length;if(Bp(n.from,n.to,e.doc).filter(x=>x.mark.type.excluded.find(v=>v===t.type&&v!==x.mark.type)).filter(x=>x.to>f).length)return null;p<n.to&&s.delete(p,n.to),f>n.from&&s.delete(n.from+c,f);const y=n.from+c+u.length;s.addMark(n.from+c,y,t.type.create(i||{})),s.removeStoredMark(t.type)}},undoable:t.undoable})}function $8(t){return new _u({find:t.find,handler:({state:e,range:n,match:r})=>{const i=Oe(t.getAttributes,void 0,r)||{},{tr:s}=e,u=n.from;let a=n.to;const c=t.type.create(i);if(r[1]){const f=r[0].lastIndexOf(r[1]);let p=u+f;p>a?p=a:a=p+r[1].length;const m=r[0][r[0].length-1];s.insertText(m,u+r[0].length-1),s.replaceWith(p,a,c)}else if(r[0]){const f=t.type.isInline?u:u-1;s.insert(f,t.type.create(i)).delete(s.mapping.map(u),s.mapping.map(a))}s.scrollIntoView()},undoable:t.undoable})}function Qh(t){return new _u({find:t.find,handler:({state:e,range:n,match:r})=>{const i=e.doc.resolve(n.from),s=Oe(t.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,s)},undoable:t.undoable})}function Ls(t){return new _u({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{const s=Oe(t.getAttributes,void 0,r)||{},u=e.tr.delete(n.from,n.to),c=u.doc.resolve(n.from).blockRange(),f=c&&bp(c,t.type,s);if(!f)return null;if(u.wrap(c,f),t.keepMarks&&t.editor){const{selection:m,storedMarks:y}=e,{splittableMarks:x}=t.editor.extensionManager,b=y||m.$to.parentOffset&&m.$from.marks();if(b){const v=b.filter(w=>x.includes(w.type.name));u.ensureMarks(v)}}if(t.keepAttributes){const m=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(m,s).run()}const p=u.doc.resolve(n.from-1).nodeBefore;p&&p.type===t.type&&oi(u.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,p))&&u.join(n.from-1)},undoable:t.undoable})}var Pe=class xb extends Up{constructor(){super(...arguments),this.type="node"}static create(e={}){const n=typeof e=="function"?e():e;return new xb(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}};function ii(t){return new ib({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{const s=Oe(t.getAttributes,void 0,r,i);if(s===!1||s===null)return null;const{tr:u}=e,a=r[r.length-1],c=r[0];let f=n.to;if(a){const p=c.search(/\S/),m=n.from+c.indexOf(a),y=m+a.length;if(Bp(n.from,n.to,e.doc).filter(v=>v.mark.type.excluded.find(S=>S===t.type&&S!==v.mark.type)).filter(v=>v.to>m).length)return null;y<n.to&&u.delete(y,n.to),m>n.from&&u.delete(n.from+p,m),f=n.from+p+a.length,u.addMark(n.from+p,f,t.type.create(s||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||u.removeStoredMark(t.type)}}})}const{getOwnPropertyNames:V8,getOwnPropertySymbols:H8}=Object,{hasOwnProperty:U8}=Object.prototype;function Gf(t,e){return function(r,i,s){return t(r,i,s)&&e(r,i,s)}}function Jl(t){return function(n,r,i){if(!n||!r||typeof n!="object"||typeof r!="object")return t(n,r,i);const{cache:s}=i,u=s.get(n),a=s.get(r);if(u&&a)return u===r&&a===n;s.set(n,r),s.set(r,n);const c=t(n,r,i);return s.delete(n),s.delete(r),c}}function q8(t){return t!=null?t[Symbol.toStringTag]:void 0}function Uy(t){return V8(t).concat(H8(t))}const W8=Object.hasOwn||((t,e)=>U8.call(t,e));function Hi(t,e){return t===e||!t&&!e&&t!==t&&e!==e}const K8="__v",Z8="__o",J8="_owner",{getOwnPropertyDescriptor:qy,keys:Wy}=Object;function G8(t,e){return t.byteLength===e.byteLength&&Ta(new Uint8Array(t),new Uint8Array(e))}function Q8(t,e,n){let r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function Y8(t,e){return t.byteLength===e.byteLength&&Ta(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function X8(t,e){return Hi(t.getTime(),e.getTime())}function e5(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function t5(t,e){return t===e}function Ky(t,e,n){const r=t.size;if(r!==e.size)return!1;if(!r)return!0;const i=new Array(r),s=t.entries();let u,a,c=0;for(;(u=s.next())&&!u.done;){const f=e.entries();let p=!1,m=0;for(;(a=f.next())&&!a.done;){if(i[m]){m++;continue}const y=u.value,x=a.value;if(n.equals(y[0],x[0],c,m,t,e,n)&&n.equals(y[1],x[1],y[0],x[0],t,e,n)){p=i[m]=!0;break}m++}if(!p)return!1;c++}return!0}const n5=Hi;function r5(t,e,n){const r=Wy(t);let i=r.length;if(Wy(e).length!==i)return!1;for(;i-- >0;)if(!kb(t,e,n,r[i]))return!1;return!0}function Mo(t,e,n){const r=Uy(t);let i=r.length;if(Uy(e).length!==i)return!1;let s,u,a;for(;i-- >0;)if(s=r[i],!kb(t,e,n,s)||(u=qy(t,s),a=qy(e,s),(u||a)&&(!u||!a||u.configurable!==a.configurable||u.enumerable!==a.enumerable||u.writable!==a.writable)))return!1;return!0}function i5(t,e){return Hi(t.valueOf(),e.valueOf())}function s5(t,e){return t.source===e.source&&t.flags===e.flags}function Zy(t,e,n){const r=t.size;if(r!==e.size)return!1;if(!r)return!0;const i=new Array(r),s=t.values();let u,a;for(;(u=s.next())&&!u.done;){const c=e.values();let f=!1,p=0;for(;(a=c.next())&&!a.done;){if(!i[p]&&n.equals(u.value,a.value,u.value,a.value,t,e,n)){f=i[p]=!0;break}p++}if(!f)return!1}return!0}function Ta(t,e){let n=t.byteLength;if(e.byteLength!==n||t.byteOffset!==e.byteOffset)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}function o5(t,e){return t.hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function kb(t,e,n,r){return(r===J8||r===Z8||r===K8)&&(t.$$typeof||e.$$typeof)?!0:W8(e,r)&&n.equals(t[r],e[r],r,r,t,e,n)}const u5="[object ArrayBuffer]",l5="[object Arguments]",a5="[object Boolean]",c5="[object DataView]",d5="[object Date]",f5="[object Error]",h5="[object Map]",p5="[object Number]",m5="[object Object]",g5="[object RegExp]",y5="[object Set]",x5="[object String]",k5={"[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},b5="[object URL]",v5=Object.prototype.toString;function w5({areArrayBuffersEqual:t,areArraysEqual:e,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:s,areMapsEqual:u,areNumbersEqual:a,areObjectsEqual:c,arePrimitiveWrappersEqual:f,areRegExpsEqual:p,areSetsEqual:m,areTypedArraysEqual:y,areUrlsEqual:x,unknownTagComparators:b}){return function(w,S,A){if(w===S)return!0;if(w==null||S==null)return!1;const R=typeof w;if(R!==typeof S)return!1;if(R!=="object")return R==="number"?a(w,S,A):R==="function"?s(w,S,A):!1;const I=w.constructor;if(I!==S.constructor)return!1;if(I===Object)return c(w,S,A);if(Array.isArray(w))return e(w,S,A);if(I===Date)return r(w,S,A);if(I===RegExp)return p(w,S,A);if(I===Map)return u(w,S,A);if(I===Set)return m(w,S,A);const P=v5.call(w);if(P===d5)return r(w,S,A);if(P===g5)return p(w,S,A);if(P===h5)return u(w,S,A);if(P===y5)return m(w,S,A);if(P===m5)return typeof w.then!="function"&&typeof S.then!="function"&&c(w,S,A);if(P===b5)return x(w,S,A);if(P===f5)return i(w,S,A);if(P===l5)return c(w,S,A);if(k5[P])return y(w,S,A);if(P===u5)return t(w,S,A);if(P===c5)return n(w,S,A);if(P===a5||P===p5||P===x5)return f(w,S,A);if(b){let F=b[P];if(!F){const z=q8(w);z&&(F=b[z])}if(F)return F(w,S,A)}return!1}}function C5({circular:t,createCustomConfig:e,strict:n}){let r={areArrayBuffersEqual:G8,areArraysEqual:n?Mo:Q8,areDataViewsEqual:Y8,areDatesEqual:X8,areErrorsEqual:e5,areFunctionsEqual:t5,areMapsEqual:n?Gf(Ky,Mo):Ky,areNumbersEqual:n5,areObjectsEqual:n?Mo:r5,arePrimitiveWrappersEqual:i5,areRegExpsEqual:s5,areSetsEqual:n?Gf(Zy,Mo):Zy,areTypedArraysEqual:n?Gf(Ta,Mo):Ta,areUrlsEqual:o5,unknownTagComparators:void 0};if(e&&(r=Object.assign({},r,e(r))),t){const i=Jl(r.areArraysEqual),s=Jl(r.areMapsEqual),u=Jl(r.areObjectsEqual),a=Jl(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:i,areMapsEqual:s,areObjectsEqual:u,areSetsEqual:a})}return r}function S5(t){return function(e,n,r,i,s,u,a){return t(e,n,a)}}function E5({circular:t,comparator:e,createState:n,equals:r,strict:i}){if(n)return function(a,c){const{cache:f=t?new WeakMap:void 0,meta:p}=n();return e(a,c,{cache:f,equals:r,meta:p,strict:i})};if(t)return function(a,c){return e(a,c,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};const s={cache:void 0,equals:r,meta:void 0,strict:i};return function(a,c){return e(a,c,s)}}const _5=li();li({strict:!0});li({circular:!0});li({circular:!0,strict:!0});li({createInternalComparator:()=>Hi});li({strict:!0,createInternalComparator:()=>Hi});li({circular:!0,createInternalComparator:()=>Hi});li({circular:!0,createInternalComparator:()=>Hi,strict:!0});function li(t={}){const{circular:e=!1,createInternalComparator:n,createState:r,strict:i=!1}=t,s=C5(t),u=w5(s),a=n?n(u):S5(u);return E5({circular:e,comparator:u,createState:r,equals:a,strict:i})}var Qf={exports:{}},Yf={};/**
322
- * @license React
323
- * use-sync-external-store-shim/with-selector.production.js
324
- *
325
- * Copyright (c) Meta Platforms, Inc. and affiliates.
326
- *
327
- * This source code is licensed under the MIT license found in the
328
- * LICENSE file in the root directory of this source tree.
329
- */var Jy;function T5(){if(Jy)return Yf;Jy=1;var t=xu(),e=rx();function n(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var r=typeof Object.is=="function"?Object.is:n,i=e.useSyncExternalStore,s=t.useRef,u=t.useEffect,a=t.useMemo,c=t.useDebugValue;return Yf.useSyncExternalStoreWithSelector=function(f,p,m,y,x){var b=s(null);if(b.current===null){var v={hasValue:!1,value:null};b.current=v}else v=b.current;b=a(function(){function S(F){if(!A){if(A=!0,R=F,F=y(F),x!==void 0&&v.hasValue){var z=v.value;if(x(z,F))return I=z}return I=F}if(z=I,r(R,F))return z;var Q=y(F);return x!==void 0&&x(z,Q)?(R=F,z):(R=F,I=Q)}var A=!1,R,I,P=m===void 0?null:m;return[function(){return S(p())},P===null?void 0:function(){return S(P())}]},[p,m,y,x]);var w=i(f,b[0],b[1]);return u(function(){v.hasValue=!0,v.value=w},[w]),c(w),w},Yf}var Gy;function A5(){return Gy||(Gy=1,Qf.exports=T5()),Qf.exports}var M5=A5(),D5=(...t)=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n&&(n.current=e)})},N5=({contentComponent:t})=>{const e=ix.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return _.jsx(_.Fragment,{children:Object.values(e)})};function O5(){const t=new Set;let e={},n=!1;const r=()=>{n||!t.size||(n=!0,queueMicrotask(()=>{n=!1,t.forEach(i=>i())}))};return{subscribe(i){return t.add(i),()=>{t.delete(i)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(i,s){e={...e,[i]:I6.createPortal(s.reactElement,s.element,i)},r()},removeRenderer(i){const s={...e};delete s[i],e=s,r()}}}var R5=class extends Pi.Component{constructor(t){super(t),this.editorContentRef=Pi.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var t;const e=this.props.editor;if(e&&!e.isDestroyed&&((t=e.view.dom)!=null&&t.parentNode)){if(e.contentComponent)return;const n=this.editorContentRef.current;n.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:n}),e.contentComponent=O5(),e.createNodeViews(),e.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){var t;const e=this.props.editor;if(e){e.isEditorContentInitialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null;try{if(!((t=e.view.dom)!=null&&t.parentNode))return;const n=document.createElement("div");n.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:n})}catch{}}}render(){const{editor:t,innerRef:e,...n}=this.props;return _.jsxs(_.Fragment,{children:[_.jsx("div",{ref:D5(e,this.editorContentRef),...n}),(t==null?void 0:t.contentComponent)&&_.jsx(N5,{contentComponent:t.contentComponent})]})}},I5=ce.forwardRef((t,e)=>{const n=Pi.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return Pi.createElement(R5,{key:n,innerRef:e,...t})}),bb=Pi.memo(I5),L5=typeof window<"u"?ce.useLayoutEffect:ce.useEffect,P5=class{constructor(t){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=t,this.lastSnapshot={editor:t,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(t){return this.subscribers.add(t),()=>{this.subscribers.delete(t)}}watch(t){if(this.editor=t,this.editor){let e;const n=i=>{(i==null?void 0:i.transaction)!==void 0&&i.transaction===e||(e=i==null?void 0:i.transaction,this.transactionNumber+=1,this.subscribers.forEach(s=>s()))},r=this.editor;return r.on("transaction",n),r.on("update",n),()=>{r.off("transaction",n),r.off("update",n)}}}};function F5(t){var e;const[n]=ce.useState(()=>new P5(t.editor)),r=M5.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,t.selector,(e=t.equalityFn)!=null?e:_5);return L5(()=>n.watch(t.editor),[t.editor,n]),ce.useDebugValue(r),r}var z5=!1,vb=typeof window>"u",j5=vb||!!(typeof window<"u"&&window.next),B5=class wb{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){const e=this.options.current.immediatelyRender;let n=e??!0;return vb?(n&&z5&&console.warn("SSR detected. `immediatelyRender` has been set to false to avoid hydration mismatches"),n=!1):j5&&e===void 0&&(n=!1),n?this.createEditor():null}createEditor(){const e={...this.options.current,onBeforeCreate:(...r)=>{var i,s;return(s=(i=this.options.current).onBeforeCreate)==null?void 0:s.call(i,...r)},onBlur:(...r)=>{var i,s;return(s=(i=this.options.current).onBlur)==null?void 0:s.call(i,...r)},onCreate:(...r)=>{var i,s;return(s=(i=this.options.current).onCreate)==null?void 0:s.call(i,...r)},onDestroy:(...r)=>{var i,s;return(s=(i=this.options.current).onDestroy)==null?void 0:s.call(i,...r)},onFocus:(...r)=>{var i,s;return(s=(i=this.options.current).onFocus)==null?void 0:s.call(i,...r)},onSelectionUpdate:(...r)=>{var i,s;return(s=(i=this.options.current).onSelectionUpdate)==null?void 0:s.call(i,...r)},onTransaction:(...r)=>{var i,s;return(s=(i=this.options.current).onTransaction)==null?void 0:s.call(i,...r)},onUpdate:(...r)=>{var i,s;return(s=(i=this.options.current).onUpdate)==null?void 0:s.call(i,...r)},onContentError:(...r)=>{var i,s;return(s=(i=this.options.current).onContentError)==null?void 0:s.call(i,...r)},onDrop:(...r)=>{var i,s;return(s=(i=this.options.current).onDrop)==null?void 0:s.call(i,...r)},onPaste:(...r)=>{var i,s;return(s=(i=this.options.current).onPaste)==null?void 0:s.call(i,...r)},onDelete:(...r)=>{var i,s;return(s=(i=this.options.current).onDelete)==null?void 0:s.call(i,...r)},onMount:(...r)=>{var i,s;return(s=(i=this.options.current).onMount)==null?void 0:s.call(i,...r)},onUnmount:(...r)=>{var i,s;return(s=(i=this.options.current).onUnmount)==null?void 0:s.call(i,...r)}};return new B8(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,n){return Object.keys(e).every(r=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(r)?!0:r==="extensions"&&e.extensions&&n.extensions?e.extensions.length!==n.extensions.length?!1:e.extensions.every((i,s)=>{var u;return i===((u=n.extensions)==null?void 0:u[s])}):e[r]===n[r])}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?wb.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((r,i)=>r===e[i]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function $5(t={},e=[]){const n=ce.useRef(t);n.current=t;const[r]=ce.useState(()=>new B5(n)),i=ix.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return ce.useDebugValue(i),ce.useEffect(r.onRender(e)),F5({editor:i,selector:({transactionNumber:s})=>t.shouldRerenderOnTransaction===!1||t.shouldRerenderOnTransaction===void 0?null:t.immediatelyRender&&s===0?0:s+1}),i}var Cb=ce.createContext({editor:null});Cb.Consumer;var V5=ce.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),H5=()=>ce.useContext(V5);Pi.forwardRef((t,e)=>{const{onDragStart:n}=H5(),r=t.as||"div";return _.jsx(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});Pi.createContext({markViewContentRef:()=>{}});var qp=ce.createContext({get editor(){throw new Error("useTiptap must be used within a <Tiptap> provider")}});qp.displayName="TiptapContext";var U5=()=>ce.useContext(qp);function Sb({children:t,...e}){const n="editor"in e?e.editor:e.instance;if(!n)throw new Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");const r=ce.useMemo(()=>({editor:n}),[n]),i=ce.useMemo(()=>({editor:n}),[n]);return _.jsx(Cb.Provider,{value:i,children:_.jsx(qp.Provider,{value:r,children:t})})}Sb.displayName="Tiptap";function Eb({...t}){const{editor:e}=U5();return _.jsx(bb,{editor:e,...t})}Eb.displayName="Tiptap.Content";Object.assign(Sb,{Content:Eb});var Aa=(t,e)=>{if(t==="slot")return 0;if(t instanceof Function)return t(e);const{children:n,...r}=e??{};if(t==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[t,r,n]},q5=(t,e)=>{var n;const{state:r,view:i}=t,{selection:s}=r;if(!s.empty)return!1;const{$from:u}=s;if(u.parentOffset!==0)return!1;const a=u.depth-1;if(a<0)return!1;const c=u.node(a),f=u.index(a);if(f===0)return!1;if(c.type===e)return t.commands.lift(e.name);const p=c.child(f-1);if(p.type!==e||!((n=p.lastChild)!=null&&n.isTextblock))return!1;const m=u.before(),x=m-1-1,{tr:b}=r;return b.delete(m,u.after()).insert(x,u.parent.content),b.setSelection(de.create(b.doc,x)),i.dispatch(b.scrollIntoView()),!0},W5=/^\s*>\s$/,K5=Pe.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return Aa("blockquote",{...pt(this.options.HTMLAttributes,t),children:Aa("slot",{})})},parseMarkdown:(t,e)=>{var n;const r=(n=e.parseBlockChildren)!=null?n:e.parseChildren;return e.createNode("blockquote",void 0,r(t.tokens||[]))},renderMarkdown:(t,e)=>{if(!t.content)return"";const n=">",r=[];return t.content.forEach((i,s)=>{var u,a;const p=((a=(u=e.renderChild)==null?void 0:u.call(e,i,s))!=null?a:e.renderChildren([i])).split(`
330
- `).map(m=>m.trim()===""?n:`${n} ${m}`);r.push(p.join(`
331
- `))}),r.join(`
332
- ${n}
333
- `)},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote(),Backspace:()=>q5(this.editor,this.type)}},addInputRules(){return[Ls({find:W5,type:this.type})]}}),Z5=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,J5=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,G5=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,Q5=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,Y5=on.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return Aa("strong",{...pt(this.options.HTMLAttributes,t),children:Aa("slot",{})})},markdownTokenName:"strong",parseMarkdown:(t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"<strong>",close:"</strong>"}},renderMarkdown:(t,e)=>`**${e.renderChildren(t)}**`,addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[$i({find:Z5,type:this.type}),$i({find:G5,type:this.type})]},addPasteRules(){return[ii({find:J5,type:this.type}),ii({find:Q5,type:this.type})]}}),X5=t=>{const e=/`([^`]+)`(?!`)$/.exec(t);return!e||e.index>0&&t[e.index-1]==="`"?null:{index:e.index,text:e[0],replaceWith:e[1]}},eT=t=>{const e=/`([^`]+)`(?!`)/g,n=[];let r;for(;(r=e.exec(t))!==null;)r.index>0&&t[r.index-1]==="`"||n.push({index:r.index,text:r[0],replaceWith:r[1]});return n},tT=on.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",pt(this.options.HTMLAttributes,t),0]},markdownTokenName:"codespan",parseMarkdown:(t,e)=>e.applyMark("code",[{type:"text",text:t.text||""}]),renderMarkdown:(t,e)=>t.content?`\`${e.renderChildren(t.content)}\``:"",addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[$i({find:X5,type:this.type})]},addPasteRules(){return[ii({find:eT,type:this.type})]}}),Xf=4,nT=/^```([a-z]+)?[\s\n]$/,rT=/^~~~([a-z]+)?[\s\n]$/,iT=Pe.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,exitOnArrowUp:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:Xf,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options;if(!n)return null;const s=[...((e=t.firstElementChild)==null?void 0:e.classList)||[]].filter(u=>u.startsWith(n)).map(u=>u.replace(n,""))[0];return s||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",pt(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(t,e)=>{var n,r;return((n=t.raw)==null?void 0:n.startsWith("```"))===!1&&((r=t.raw)==null?void 0:r.startsWith("~~~"))===!1&&t.codeBlockStyle!=="indented"?[]:e.createNode("codeBlock",{language:t.lang||null},t.text?[e.createTextNode(t.text)]:[])},renderMarkdown:(t,e)=>{var n;let r="";const i=((n=t.attrs)==null?void 0:n.language)||"";return t.content?r=[`\`\`\`${i}`,e.renderChildren(t.content),"```"].join(`
334
- `):r=`\`\`\`${i}
335
-
336
- \`\`\``,r},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const n=(e=this.options.tabSize)!=null?e:Xf,{state:r}=t,{selection:i}=r,{$from:s,empty:u}=i;if(s.parent.type!==this.type)return!1;const a=" ".repeat(n);return u?t.commands.insertContent(a):t.commands.command(({tr:c})=>{const{from:f,to:p}=i,x=r.doc.textBetween(f,p,`
337
- `,`
338
- `).split(`
339
- `).map(b=>a+b).join(`
340
- `);return c.replaceWith(f,p,r.schema.text(x)),!0})},"Shift-Tab":({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const n=(e=this.options.tabSize)!=null?e:Xf,{state:r}=t,{selection:i}=r,{$from:s,empty:u}=i;return s.parent.type!==this.type?!1:u?t.commands.command(({tr:a})=>{var c;const{pos:f}=s,p=s.start(),m=s.end(),x=r.doc.textBetween(p,m,`
341
- `,`
342
- `).split(`
343
- `);let b=0,v=0;const w=f-p;for(let F=0;F<x.length;F+=1){if(v+x[F].length>=w){b=F;break}v+=x[F].length+1}const A=((c=x[b].match(/^ */))==null?void 0:c[0])||"",R=Math.min(A.length,n);if(R===0)return!0;let I=p;for(let F=0;F<b;F+=1)I+=x[F].length+1;return a.delete(I,I+R),f-I<=R&&a.setSelection(de.create(a.doc,I)),!0}):t.commands.command(({tr:a})=>{const{from:c,to:f}=i,y=r.doc.textBetween(c,f,`
344
- `,`
345
- `).split(`
346
- `).map(x=>{var b;const v=((b=x.match(/^ */))==null?void 0:b[0])||"",w=Math.min(v.length,n);return x.slice(w)}).join(`
347
- `);return a.replaceWith(c,f,r.schema.text(y)),!0})},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const s=r.parentOffset===r.parent.nodeSize-2,u=r.parent.textContent.endsWith(`
348
-
349
- `);return!s||!u?!1:t.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowUp:({editor:t})=>{if(!this.options.exitOnArrowUp)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type||r.parentOffset!==0)return!1;const s=r.before();return s>0?!1:t.commands.insertDefaultBlock({pos:s})},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:i,empty:s}=n;if(!s||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)?t.commands.command(({tr:f})=>(f.setSelection(ge.near(r.resolve(a))),!0)):t.commands.exitCode()}}},addInputRules(){return[Qh({find:nT,type:this.type,getAttributes:t=>({language:t[1]})}),Qh({find:rT,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new qe({key:new dt("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,s=i==null?void 0:i.mode;if(!n||!s)return!1;const{tr:u,schema:a}=t.state,c=a.text(n.replace(/\r\n?/g,`
350
- `));return u.replaceSelectionWith(this.type.create({language:s},c)),u.selection.$from.parent.type!==this.type&&u.setSelection(de.near(u.doc.resolve(Math.max(0,u.selection.from-2)))),u.setMeta("paste",!0),t.dispatch(u),!0}}})]}}),sT=Pe.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
351
-
352
- `):""}),oT=Pe.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",pt(this.options.HTMLAttributes,t)]},renderText(){return`
353
- `},renderMarkdown:()=>`
354
- `,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:i,storedMarks:s}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:u}=this.options,{splittableMarks:a}=r.extensionManager,c=s||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:f,dispatch:p})=>{if(p&&c&&u){const m=c.filter(y=>a.includes(y.type.name));f.ensureMarks(m)}return!0}).scrollIntoView().run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),uT=Pe.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,pt(this.options.HTMLAttributes,e),0]},parseMarkdown:(t,e)=>e.createNode("heading",{level:t.depth||1},e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>{var n;const r=(n=t.attrs)!=null&&n.level?parseInt(t.attrs.level,10):1,i="#".repeat(r);return t.content?`${i} ${e.renderChildren(t.content)}`:""},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>Qh({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),lT=Pe.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",pt(this.options.HTMLAttributes,t)]},markdownTokenName:"hr",parseMarkdown:(t,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!v8(e,e.schema.nodes[this.name]))return!1;const{selection:n}=e,{$to:r}=n,i=t();return Yk(n)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:s,tr:u,dispatch:a})=>{if(a){const{$to:c}=u.selection,f=c.end();if(c.nodeAfter)c.nodeAfter.isTextblock?u.setSelection(de.create(u.doc,c.pos+1)):c.nodeAfter.isBlock?u.setSelection(oe.create(u.doc,c.pos)):u.setSelection(de.create(u.doc,c.pos));else{const p=s.schema.nodes[this.options.nextNodeType]||c.parent.type.contentMatch.defaultType,m=p==null?void 0:p.create();m&&(u.insert(f,m),u.setSelection(de.create(u.doc,f+1)))}u.scrollIntoView()}return!0}).run()}}},addInputRules(){return[$8({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),aT=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,cT=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,dT=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,fT=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,hT=on.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",pt(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(t,e)=>e.applyMark("italic",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"<em>",close:"</em>"}},renderMarkdown:(t,e)=>`*${e.renderChildren(t)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[$i({find:aT,type:this.type}),$i({find:dT,type:this.type})]},addPasteRules(){return[ii({find:cT,type:this.type}),ii({find:fT,type:this.type})]}});const pT="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",mT="ελ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",Yh="numeric",Xh="ascii",ep="alpha",Uo="asciinumeric",Fo="alphanumeric",tp="domain",_b="emoji",gT="scheme",yT="slashscheme",eh="whitespace";function xT(t,e){return t in e||(e[t]=[]),e[t]}function Mi(t,e,n){e[Yh]&&(e[Uo]=!0,e[Fo]=!0),e[Xh]&&(e[Uo]=!0,e[ep]=!0),e[Uo]&&(e[Fo]=!0),e[ep]&&(e[Fo]=!0),e[Fo]&&(e[tp]=!0),e[_b]&&(e[tp]=!0);for(const r in e){const i=xT(r,n);i.indexOf(t)<0&&i.push(t)}}function kT(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function Wt(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}Wt.groups={};Wt.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let r=0;r<e.jr.length;r++){const i=e.jr[r][0],s=e.jr[r][1];if(s&&i.test(t))return s}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,n,r){for(let i=0;i<t.length;i++)this.tt(t[i],e,n,r)},tr(t,e,n,r){r=r||Wt.groups;let i;return e&&e.j?i=e:(i=new Wt(e),n&&r&&Mi(e,n,r)),this.jr.push([t,i]),i},ts(t,e,n,r){let i=this;const s=t.length;if(!s)return i;for(let u=0;u<s-1;u++)i=i.tt(t[u]);return i.tt(t[s-1],e,n,r)},tt(t,e,n,r){r=r||Wt.groups;const i=this;if(e&&e.j)return i.j[t]=e,e;const s=e;let u,a=i.go(t);if(a?(u=new Wt,Object.assign(u.j,a.j),u.jr.push.apply(u.jr,a.jr),u.jd=a.jd,u.t=a.t):u=new Wt,s){if(r)if(u.t&&typeof u.t=="string"){const c=Object.assign(kT(u.t,r),n);Mi(s,c,r)}else n&&Mi(s,n,r);u.t=s}return i.j[t]=u,u}};const ke=(t,e,n,r,i)=>t.ta(e,n,r,i),tt=(t,e,n,r,i)=>t.tr(e,n,r,i),Qy=(t,e,n,r,i)=>t.ts(e,n,r,i),q=(t,e,n,r,i)=>t.tt(e,n,r,i),or="WORD",np="UWORD",Tb="ASCIINUMERICAL",Ab="ALPHANUMERICAL",du="LOCALHOST",rp="TLD",ip="UTLD",ua="SCHEME",vs="SLASH_SCHEME",Wp="NUM",sp="WS",Kp="NL",qo="OPENBRACE",Wo="CLOSEBRACE",Ma="OPENBRACKET",Da="CLOSEBRACKET",Na="OPENPAREN",Oa="CLOSEPAREN",Ra="OPENANGLEBRACKET",Ia="CLOSEANGLEBRACKET",La="FULLWIDTHLEFTPAREN",Pa="FULLWIDTHRIGHTPAREN",Fa="LEFTCORNERBRACKET",za="RIGHTCORNERBRACKET",ja="LEFTWHITECORNERBRACKET",Ba="RIGHTWHITECORNERBRACKET",$a="FULLWIDTHLESSTHAN",Va="FULLWIDTHGREATERTHAN",Ha="AMPERSAND",Ua="APOSTROPHE",qa="ASTERISK",jr="AT",Wa="BACKSLASH",Ka="BACKTICK",Za="CARET",Di="COLON",Zp="COMMA",Ja="DOLLAR",Fn="DOT",Ga="EQUALS",Jp="EXCLAMATION",pn="HYPHEN",Ko="PERCENT",Qa="PIPE",Ya="PLUS",Xa="POUND",Zo="QUERY",Gp="QUOTE",Mb="FULLWIDTHMIDDLEDOT",Qp="SEMI",zn="SLASH",Jo="TILDE",ec="UNDERSCORE",Db="EMOJI",tc="SYM";var Nb=Object.freeze({__proto__:null,ALPHANUMERICAL:Ab,AMPERSAND:Ha,APOSTROPHE:Ua,ASCIINUMERICAL:Tb,ASTERISK:qa,AT:jr,BACKSLASH:Wa,BACKTICK:Ka,CARET:Za,CLOSEANGLEBRACKET:Ia,CLOSEBRACE:Wo,CLOSEBRACKET:Da,CLOSEPAREN:Oa,COLON:Di,COMMA:Zp,DOLLAR:Ja,DOT:Fn,EMOJI:Db,EQUALS:Ga,EXCLAMATION:Jp,FULLWIDTHGREATERTHAN:Va,FULLWIDTHLEFTPAREN:La,FULLWIDTHLESSTHAN:$a,FULLWIDTHMIDDLEDOT:Mb,FULLWIDTHRIGHTPAREN:Pa,HYPHEN:pn,LEFTCORNERBRACKET:Fa,LEFTWHITECORNERBRACKET:ja,LOCALHOST:du,NL:Kp,NUM:Wp,OPENANGLEBRACKET:Ra,OPENBRACE:qo,OPENBRACKET:Ma,OPENPAREN:Na,PERCENT:Ko,PIPE:Qa,PLUS:Ya,POUND:Xa,QUERY:Zo,QUOTE:Gp,RIGHTCORNERBRACKET:za,RIGHTWHITECORNERBRACKET:Ba,SCHEME:ua,SEMI:Qp,SLASH:zn,SLASH_SCHEME:vs,SYM:tc,TILDE:Jo,TLD:rp,UNDERSCORE:ec,UTLD:ip,UWORD:np,WORD:or,WS:sp});const rr=/[a-z]/,Do=new RegExp("\\p{L}","u"),th=new RegExp("\\p{Emoji}","u"),ir=/\d/,nh=/\s/,Yy="\r",rh=`
355
- `,bT="️",vT="‍",ih="";let Gl=null,Ql=null;function wT(t=[]){const e={};Wt.groups=e;const n=new Wt;Gl==null&&(Gl=Xy(pT)),Ql==null&&(Ql=Xy(mT)),q(n,"'",Ua),q(n,"{",qo),q(n,"}",Wo),q(n,"[",Ma),q(n,"]",Da),q(n,"(",Na),q(n,")",Oa),q(n,"<",Ra),q(n,">",Ia),q(n,"(",La),q(n,")",Pa),q(n,"「",Fa),q(n,"」",za),q(n,"『",ja),q(n,"』",Ba),q(n,"<",$a),q(n,">",Va),q(n,"&",Ha),q(n,"*",qa),q(n,"@",jr),q(n,"`",Ka),q(n,"^",Za),q(n,":",Di),q(n,",",Zp),q(n,"$",Ja),q(n,".",Fn),q(n,"=",Ga),q(n,"!",Jp),q(n,"-",pn),q(n,"%",Ko),q(n,"|",Qa),q(n,"+",Ya),q(n,"#",Xa),q(n,"?",Zo),q(n,'"',Gp),q(n,"/",zn),q(n,";",Qp),q(n,"~",Jo),q(n,"_",ec),q(n,"\\",Wa),q(n,"・",Mb);const r=tt(n,ir,Wp,{[Yh]:!0});tt(r,ir,r);const i=tt(r,rr,Tb,{[Uo]:!0}),s=tt(r,Do,Ab,{[Fo]:!0}),u=tt(n,rr,or,{[Xh]:!0});tt(u,ir,i),tt(u,rr,u),tt(i,ir,i),tt(i,rr,i);const a=tt(n,Do,np,{[ep]:!0});tt(a,rr),tt(a,ir,s),tt(a,Do,a),tt(s,ir,s),tt(s,rr),tt(s,Do,s);const c=q(n,rh,Kp,{[eh]:!0}),f=q(n,Yy,sp,{[eh]:!0}),p=tt(n,nh,sp,{[eh]:!0});q(n,ih,p),q(f,rh,c),q(f,ih,p),tt(f,nh,p),q(p,Yy),q(p,rh),tt(p,nh,p),q(p,ih,p);const m=tt(n,th,Db,{[_b]:!0});q(m,"#"),tt(m,th,m),q(m,bT,m);const y=q(m,vT);q(y,"#"),tt(y,th,m);const x=[[rr,u],[ir,i]],b=[[rr,null],[Do,a],[ir,s]];for(let v=0;v<Gl.length;v++)Lr(n,Gl[v],rp,or,x);for(let v=0;v<Ql.length;v++)Lr(n,Ql[v],ip,np,b);Mi(rp,{tld:!0,ascii:!0},e),Mi(ip,{utld:!0,alpha:!0},e),Lr(n,"file",ua,or,x),Lr(n,"mailto",ua,or,x),Lr(n,"http",vs,or,x),Lr(n,"https",vs,or,x),Lr(n,"ftp",vs,or,x),Lr(n,"ftps",vs,or,x),Mi(ua,{scheme:!0,ascii:!0},e),Mi(vs,{slashscheme:!0,ascii:!0},e),t=t.sort((v,w)=>v[0]>w[0]?1:-1);for(let v=0;v<t.length;v++){const w=t[v][0],A=t[v][1]?{[gT]:!0}:{[yT]:!0};w.indexOf("-")>=0?A[tp]=!0:rr.test(w)?ir.test(w)?A[Uo]=!0:A[Xh]=!0:A[Yh]=!0,Qy(n,w,w,A)}return Qy(n,"localhost",du,{ascii:!0}),n.jd=new Wt(tc),{start:n,tokens:Object.assign({groups:e},Nb)}}function Ob(t,e){const n=CT(e.replace(/[A-Z]/g,a=>a.toLowerCase())),r=n.length,i=[];let s=0,u=0;for(;u<r;){let a=t,c=null,f=0,p=null,m=-1,y=-1;for(;u<r&&(c=a.go(n[u]));)a=c,a.accepts()?(m=0,y=0,p=a):m>=0&&(m+=n[u].length,y++),f+=n[u].length,s+=n[u].length,u++;s-=m,u-=y,f-=m,i.push({t:p.t,v:e.slice(s-f,s),s:s-f,e:s})}return i}function CT(t){const e=[],n=t.length;let r=0;for(;r<n;){let i=t.charCodeAt(r),s,u=i<55296||i>56319||r+1===n||(s=t.charCodeAt(r+1))<56320||s>57343?t[r]:t.slice(r,r+2);e.push(u),r+=u.length}return e}function Lr(t,e,n,r,i){let s;const u=e.length;for(let a=0;a<u-1;a++){const c=e[a];t.j[c]?s=t.j[c]:(s=new Wt(r),s.jr=i.slice(),t.j[c]=s),t=s}return s=new Wt(n),s.jr=i.slice(),t.j[e[u-1]]=s,s}function Xy(t){const e=[],n=[];let r=0,i="0123456789";for(;r<t.length;){let s=0;for(;i.indexOf(t[r+s])>=0;)s++;if(s>0){e.push(n.join(""));for(let u=parseInt(t.substring(r,r+s),10);u>0;u--)n.pop();r+=s}else n.push(t[r]),r++}return e}const fu={defaultProtocol:"http",events:null,format:e2,formatHref:e2,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Yp(t,e=null){let n=Object.assign({},fu);t&&(n=Object.assign(n,t instanceof Yp?t.o:t));const r=n.ignoreTags,i=[];for(let s=0;s<r.length;s++)i.push(r[s].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=i}Yp.prototype={o:fu,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const r=e!=null;let i=this.o[t];return i&&(typeof i=="object"?(i=n.t in i?i[n.t]:fu[t],typeof i=="function"&&r&&(i=i(e,n))):typeof i=="function"&&r&&(i=i(e,n.t,n)),i)},getObj(t,e,n){let r=this.o[t];return typeof r=="function"&&e!=null&&(r=r(e,n.t,n)),r},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function e2(t){return t}function Rb(t,e){this.t="token",this.v=t,this.tk=e}Rb.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=fu.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),i=t.get("tagName",n,e),s=this.toFormattedString(t),u={},a=t.get("className",n,e),c=t.get("target",n,e),f=t.get("rel",n,e),p=t.getObj("attributes",n,e),m=t.getObj("events",n,e);return u.href=r,a&&(u.class=a),c&&(u.target=c),f&&(u.rel=f),p&&Object.assign(u,p),{tagName:i,attributes:u,content:s,eventListeners:m}}};function bc(t,e){class n extends Rb{constructor(i,s){super(i,s),this.t=t}}for(const r in e)n.prototype[r]=e[r];return n.t=t,n}const ST=bc("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),t2=bc("text"),ET=bc("nl"),Yl=bc("url",{isLink:!0,toHref(t=fu.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==du&&t[1].t===Di}}),hn=t=>new Wt(t);function _T({groups:t}){const e=t.domain.concat([Ha,qa,jr,Wa,Ka,Za,Ja,Ga,pn,Wp,Ko,Qa,Ya,Xa,zn,tc,Jo,ec]),n=[Ua,Di,Zp,Fn,Jp,Ko,Zo,Gp,Qp,Ra,Ia,qo,Wo,Da,Ma,Na,Oa,La,Pa,Fa,za,ja,Ba,$a,Va],r=[Ha,Ua,qa,Wa,Ka,Za,Ja,Ga,pn,qo,Wo,Ko,Qa,Ya,Xa,Zo,zn,tc,Jo,ec],i=hn(),s=q(i,Jo);ke(s,r,s),ke(s,t.domain,s);const u=hn(),a=hn(),c=hn();ke(i,t.domain,u),ke(i,t.scheme,a),ke(i,t.slashscheme,c),ke(u,r,s),ke(u,t.domain,u);const f=q(u,jr);q(s,jr,f),q(a,jr,f),q(c,jr,f);const p=q(s,Fn);ke(p,r,s),ke(p,t.domain,s);const m=hn();ke(f,t.domain,m),ke(m,t.domain,m);const y=q(m,Fn);ke(y,t.domain,m);const x=hn(ST);ke(y,t.tld,x),ke(y,t.utld,x),q(f,du,x);const b=q(m,pn);q(b,pn,b),ke(b,t.domain,m),ke(x,t.domain,m),q(x,Fn,y),q(x,pn,b);const v=q(u,pn),w=q(u,Fn);q(v,pn,v),ke(v,t.domain,u),ke(w,r,s),ke(w,t.domain,u);const S=hn(Yl);ke(w,t.tld,S),ke(w,t.utld,S),ke(S,t.domain,u),ke(S,r,s),q(S,Fn,w),q(S,pn,v),q(S,jr,f);const A=q(S,Di),R=hn(Yl);ke(A,t.numeric,R);const I=hn(Yl),P=hn();ke(I,e,I),ke(I,n,P),ke(P,e,I),ke(P,n,P),q(S,zn,I),q(R,zn,I);const F=q(a,Di),z=q(c,Di),Q=q(z,zn),ue=q(Q,zn);ke(a,t.domain,u),q(a,Fn,w),q(a,pn,v),ke(c,t.domain,u),q(c,Fn,w),q(c,pn,v),ke(F,t.domain,I),q(F,zn,I),q(F,Zo,I),ke(ue,t.domain,I),ke(ue,e,I),q(ue,zn,I);const Ce=[[qo,Wo],[Ma,Da],[Na,Oa],[Ra,Ia],[La,Pa],[Fa,za],[ja,Ba],[$a,Va]];for(let rt=0;rt<Ce.length;rt++){const[Je,Te]=Ce[rt],Se=q(I,Je);q(P,Je,Se);const ye=hn(Yl);ke(Se,e,ye);const Ge=hn();ke(Se,n,Ge),q(Se,Te,I),ke(ye,e,ye),ke(ye,n,Ge),ke(Ge,e,ye),ke(Ge,n,Ge),q(ye,Te,I),q(Ge,Te,I)}return q(i,du,S),q(i,Kp,ET),{start:i,tokens:Nb}}function TT(t,e,n){let r=n.length,i=0,s=[],u=[];for(;i<r;){let a=t,c=null,f=null,p=0,m=null,y=-1;for(;i<r&&!(c=a.go(n[i].t));)u.push(n[i++]);for(;i<r&&(f=c||a.go(n[i].t));)c=null,a=f,a.accepts()?(y=0,m=a):y>=0&&y++,i++,p++;if(y<0)i-=p,i<r&&(u.push(n[i]),i++);else{u.length>0&&(s.push(sh(t2,e,u)),u=[]),i-=y,p-=y;const x=m.t,b=n.slice(i-p,i);s.push(sh(x,e,b))}}return u.length>0&&s.push(sh(t2,e,u)),s}function sh(t,e,n){const r=n[0].s,i=n[n.length-1].e,s=e.slice(r,i);return new t(s,n)}const AT=typeof console<"u"&&console&&console.warn||(()=>{}),MT="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Ue={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function DT(){return Wt.groups={},Ue.scanner=null,Ue.parser=null,Ue.tokenQueue=[],Ue.pluginQueue=[],Ue.customSchemes=[],Ue.initialized=!1,Ue}function n2(t,e=!1){if(Ue.initialized&&AT(`linkifyjs: already initialized - will not register custom scheme "${t}" ${MT}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
356
- 1. Must only contain digits, lowercase ASCII letters or "-"
357
- 2. Cannot start or end with "-"
358
- 3. "-" cannot repeat`);Ue.customSchemes.push([t,e])}function NT(){Ue.scanner=wT(Ue.customSchemes);for(let t=0;t<Ue.tokenQueue.length;t++)Ue.tokenQueue[t][1]({scanner:Ue.scanner});Ue.parser=_T(Ue.scanner.tokens);for(let t=0;t<Ue.pluginQueue.length;t++)Ue.pluginQueue[t][1]({scanner:Ue.scanner,parser:Ue.parser});return Ue.initialized=!0,Ue}function Xp(t){return Ue.initialized||NT(),TT(Ue.parser.start,t,Ob(Ue.scanner.start,t))}Xp.scan=Ob;function Ib(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new Yp(n),i=Xp(t),s=[];for(let u=0;u<i.length;u++){const a=i[u];a.isLink&&(!e||a.t===e)&&r.check(a)&&s.push(a.toFormattedObject(r))}return s}var e0="[\0-   ᠎ -\u2029  ]",OT=new RegExp(e0),RT=new RegExp(`${e0}$`),IT=new RegExp(e0,"g");function LT(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function PT(t){return new qe({key:new dt("autolink"),appendTransaction:(e,n,r)=>{const i=e.some(f=>f.docChanged)&&!n.doc.eq(r.doc),s=e.some(f=>f.getMeta("preventAutolink"));if(!i||s)return;const{tr:u}=r,a=qk(n.doc,[...e]);if(jp(a).forEach(({newRange:f})=>{const p=I_(r.doc,f,x=>x.isTextblock);let m,y;if(p.length>1)m=p[0],y=r.doc.textBetween(m.pos,m.pos+m.node.nodeSize,void 0," ");else if(p.length){const x=r.doc.textBetween(f.from,f.to," "," ");if(!RT.test(x))return;m=p[0],y=r.doc.textBetween(m.pos,f.to,void 0," ")}if(m&&y){const x=y.split(OT).filter(Boolean);if(x.length<=0)return!1;const b=x[x.length-1],v=m.pos+y.lastIndexOf(b);if(!b)return!1;const w=Xp(b).map(S=>S.toObject(t.defaultProtocol));if(!LT(w))return!1;w.filter(S=>S.isLink).map(S=>({...S,from:v+S.start+1,to:v+S.end+1})).filter(S=>r.schema.marks.code?!r.doc.rangeHasMark(S.from,S.to,r.schema.marks.code):!0).filter(S=>t.validate(S.value)).filter(S=>t.shouldAutoLink(S.value)).forEach(S=>{Bp(S.from,S.to,r.doc).some(A=>A.mark.type===t.type)||u.addMark(S.from,S.to,t.type.create({href:S.href}))})}}),!!u.steps.length)return u}})}function FT(t){return new qe({key:new dt("handleClickLink"),props:{handleClick:(e,n,r)=>{var i,s;if(r.button!==0||!e.editable)return!1;let u=null;if(r.target instanceof HTMLAnchorElement)u=r.target;else{const c=r.target;if(!c)return!1;const f=t.editor.view.dom;u=c.closest("a"),u&&!f.contains(u)&&(u=null)}if(!u)return!1;let a=!1;if(t.enableClickSelection&&(a=t.editor.commands.extendMarkRange(t.type.name)),t.openOnClick){const c=Qk(e.state,t.type.name),f=(i=u.href)!=null?i:c.href,p=(s=u.target)!=null?s:c.target;f&&(window.open(f,p),a=!0)}return a}}})}var zT=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)$/,jT=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)/g;function Lb(t,e){let n=0;for(let r=e-1;r>=0&&t[r]==="\\";r-=1)n+=1;return n%2===1}function BT(t,e){let n=0,r=0;for(;r<e;){if(t[r]!=="`"){r+=1;continue}if(n===0&&Lb(t,r)){r+=1;continue}let i=0;for(;r<e&&t[r]==="`";)i+=1,r+=1;n===0?n=i:i===n&&(n=0)}return n>0}function Pb(t,e,n){var r,i;const[,s,u]=e;return(e.index?t[e.index-1]:void 0)==="!"||Lb(t,(r=e.index)!=null?r:0)||BT(t,(i=e.index)!=null?i:0)?!1:!!s.trim()&&n(u)}function Fb(t){var e,n;const[r,i,s,,u,a,c]=t,f=(e=u??a)!=null?e:c;return{index:(n=t.index)!=null?n:0,text:r,replaceWith:i,data:{href:s,title:f||null,markdown:!0}}}function $T(t,e){return t.index<e.index+e.text.length&&e.index<t.index+t.text.length}function zb(t){var e,n,r;return{href:(e=t.data)==null?void 0:e.href,title:(r=(n=t.data)==null?void 0:n.title)!=null?r:null}}function VT(t){const e=$i({find:n=>{const r=zT.exec(n);return!r||!Pb(n,r,t.isAllowedHref)?null:Fb(r)},type:t.type,getAttributes:zb});return new _u({find:e.find,handler:n=>{const r=e.handler(n);return r!==null&&n.state.tr.steps.length&&n.state.tr.setMeta("preventAutolink",!0),r}})}function HT(t){const e=ii({find:n=>{var r,i;const s=[];for(const a of n.matchAll(jT))Pb(n,a,t.isAllowedHref)&&s.push(Fb(a));const u=((i=(r=t.findPlainUrls)==null?void 0:r.call(t,n))!=null?i:[]).filter(a=>!s.some(c=>$T(c,a)));return[...s,...u]},type:t.type,getAttributes:zb});return new ib({find:e.find,handler:n=>{var r;const i=e.handler(n);return i!==null&&n.state.tr.steps.length&&((r=n.match.data)!=null&&r.markdown)&&n.state.tr.setMeta("preventAutolink",!0),i}})}function UT(t){return new qe({key:new dt("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{shouldAutoLink:i}=t,{state:s}=e,{selection:u}=s,{empty:a}=u;if(a)return!1;let c="";r.content.forEach(p=>{c+=p.textContent});const f=Ib(c,{defaultProtocol:t.defaultProtocol}).find(p=>p.isLink&&p.value===c);return!c||!f||i!==void 0&&!i(f.value)?!1:t.editor.commands.setMark(t.type,{href:f.href})}}})}function sr(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const i=typeof r=="string"?r:r.scheme;i&&n.push(i)}),!t||t.replace(IT,"").match(new RegExp(`^(?:(?:${n.map(r=>r.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")).join("|")}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`,"i"))}var qT=on.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(t=>{if(typeof t=="string"){n2(t);return}n2(t.scheme,t.optionalSlashes)})},onDestroy(){DT()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,markdownLinks:!1,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!sr(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>{const e=/^[a-z][a-z0-9+.-]*:\/\//i.test(t),n=/^[a-z][a-z0-9+.-]*:/i.test(t);if(e||n&&!t.includes("@"))return!0;const i=(t.includes("@")?t.split("@").pop():t).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(i)||!/\./.test(i))}}},addAttributes(){var t,e,n;return{href:{default:null,parseHTML(r){return r.getAttribute("href")}},target:{default:(t=this.options.HTMLAttributes.target)!=null?t:null},rel:{default:(e=this.options.HTMLAttributes.rel)!=null?e:null},class:{default:(n=this.options.HTMLAttributes.class)!=null?n:null},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!sr(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!sr(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",pt(this.options.HTMLAttributes,t),0]:["a",pt(this.options.HTMLAttributes,{...t,href:""}),0]},markdownTokenName:"link",parseMarkdown:(t,e)=>e.applyMark("link",e.parseInline(t.tokens||[]),{href:t.href,title:t.title||null}),renderMarkdown:(t,e)=>{var n,r,i,s;const u=(r=(n=t.attrs)==null?void 0:n.href)!=null?r:"",a=(s=(i=t.attrs)==null?void 0:i.title)!=null?s:"",c=e.renderChildren(t);return a?`[${c}](${u} "${a}")`:`[${c}](${u})`},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!sr(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:n}=t||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:r=>!!sr(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addInputRules(){return this.options.markdownLinks?[VT({type:this.type,isAllowedHref:t=>this.options.isAllowedUri(t,{defaultValidate:e=>!!sr(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})})]:[]},addPasteRules(){const t=e=>{const n=[];if(e){const{protocols:r,defaultProtocol:i}=this.options;Ib(e).filter(u=>u.isLink&&this.options.isAllowedUri(u.value,{defaultValidate:a=>!!sr(a,r),protocols:r,defaultProtocol:i})).forEach(u=>{this.options.shouldAutoLink(u.value)&&n.push({text:u.value,data:{href:u.href},index:u.start})})}return n};return this.options.markdownLinks?[HT({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:n=>!!sr(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}),findPlainUrls:t})]:[ii({find:t,type:this.type,getAttributes:e=>{var n;return{href:(n=e.data)==null?void 0:n.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(PT({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:i=>!!sr(i,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),t.push(FT({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(UT({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),t}}),WT=Object.defineProperty,KT=(t,e)=>{for(var n in e)WT(t,n,{get:e[n],enumerable:!0})},ZT="listItem",r2="textStyle",i2=/^\s*([-+*])\s$/,jb=Pe.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",pt(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>t.type!=="list"||t.ordered?[]:{type:"bulletList",content:t.items?e.parseChildren(t.items):[]},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
359
- `):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(ZT,this.editor.getAttributes(r2)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=Ls({find:i2,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Ls({find:i2,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(r2),editor:this.editor})),[t]}}),JT=(t,e,n)=>{const{selection:r}=t;if(!r.empty)return null;const{$from:i}=r;if(!i.parent.isTextblock||i.parentOffset!==i.parent.content.size)return null;let s=-1;for(let x=i.depth;x>0;x-=1)if(i.node(x).type.name===e){s=x;break}if(s<0)return null;const u=i.node(s),a=i.index(s);if(a+1>=u.childCount)return null;const c=u.child(a+1);if(!n.includes(c.type.name))return null;const f=t.schema.nodes[e];let p=!1;if(c.forEach(x=>{x.type===f&&x.childCount>1&&(p=!0)}),!p)return null;const m=t.doc.resolve(i.after()).nodeAfter;if(!m||!n.includes(m.type.name))return null;const y=[];return m.forEach(x=>{y.push(x)}),y.length===0?null:{listItemDepth:s,nestedList:m,nestedListPos:i.after(),insertPos:i.after(s),items:y}},GT=(t,e,n,r)=>{const i=JT(t,n,r);if(!i)return!1;const{selection:s}=t,{nestedList:u,nestedListPos:a,insertPos:c,items:f}=i,p=t.tr;p.delete(a,a+u.nodeSize);const m=p.mapping.map(c);return p.insert(m,j.from(f)),p.setSelection(s.map(p.doc,p.mapping)),e&&e(p),!0},QT=(t,e,n)=>GT(t.state,t.view.dispatch,e,n),Bb=(t,e)=>We.create({name:`${t}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){const n=()=>QT(this.editor,t,e);return{Delete:n,"Mod-Delete":n}}}),$b=[[1e3,"m"],[900,"cm"],[500,"d"],[400,"cd"],[100,"c"],[90,"xc"],[50,"l"],[40,"xl"],[10,"x"],[9,"ix"],[5,"v"],[4,"iv"],[1,"i"]],Xl="abcdefghijklmnopqrstuvwxyz",YT="[a-zA-Z]{1,2}",Vb=String.raw`\d+|[ivxlcdmIVXLCDM]+|${YT}`;function vc(t){let e=t,n="";for(const[r,i]of $b)for(;e>=r;)n+=i,e-=r;return n}function t0(t){return vc(t).toUpperCase()}function Hb(t){const e=t.toLowerCase();let n=0,r=0;for(;n<e.length;){let i=!1;for(const[s,u]of $b)if(e.startsWith(u,n)){r+=s,n+=u.length,i=!0;break}if(!i)return 0}return r}function XT(t){if(!/^[ivxlcdmIVXLCDM]+$/.test(t))return!1;const e=Hb(t);return e<=0?!1:(t===t.toLowerCase()?vc(e):t0(e))===t}function eA(t){const e=t.toLowerCase();if(e.length===1)return e.charCodeAt(0)-97+1;if(e.length===2){const n=e.charCodeAt(0)-97,r=e.charCodeAt(1)-97;return(n+1)*26+r+1}return 0}function nc(t){if(t<=26)return Xl[t-1];const e=Math.floor((t-1)/26)-1,n=(t-1)%26;return e<0?Xl[n]:Xl[e]+Xl[n]}function wc(t){if(!(!t||/^\d+$/.test(t))){if(XT(t))return t===t.toLowerCase()?"i":"I";if(/^[a-z]{1,2}$/.test(t))return"a";if(/^[A-Z]{1,2}$/.test(t))return"A"}}function n0(t){if(/^\d+$/.test(t))return parseInt(t,10);const e=wc(t);if(e==="i"||e==="I")return Hb(t);if(e==="a"||e==="A"){const r=eA(t);return r>0?r:1}const n=parseInt(t,10);return Number.isNaN(n)?1:n}function tA(t,e){if(t==="numeric")return String(e);switch(t){case"a":return nc(e);case"A":return nc(e).toUpperCase();case"i":return vc(e);case"I":return t0(e);default:return String(e)}}function nA(t){var e;if(t.length===0)return!1;const n=(e=wc(t[0]))!=null?e:"numeric",r=n0(t[0]);if(r<1)return!1;for(let i=0;i<t.length;i++){const s=tA(n,r+i);if(t[i]!==s)return!1}return!0}function rA(t){return{type:wc(t),start:n0(t)}}function iA(t){const{type:e,start:n}=rA(t),r={};return e&&(r.type=e),n!==1&&(r.start=n),r}function sA(t,e,n=". "){const r=e+1;if(!t||t==="1")return`${r}${n}`;switch(t){case"a":return`${nc(r)}${n}`;case"A":return`${nc(r).toUpperCase()}${n}`;case"i":return`${vc(r)}${n}`;case"I":return`${t0(r)}${n}`;default:return`${r}${n}`}}function oA(t){var e,n;const r=(e=t.tokens)==null?void 0:e[0];return!!(t.text&&((n=t.tokens)==null?void 0:n.length)===1&&(r==null?void 0:r.type)==="list"&&r.ordered&&r.raw===t.text)}function uA(t,e){return e.tokenizeInline?e.parseInline(e.tokenizeInline(t)):e.parseInline([{type:"text",raw:t,text:t}])}var Ub=Pe.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",pt(this.options.HTMLAttributes,t),0]},markdownTokenName:"list_item",parseMarkdown:(t,e)=>{var n;if(t.type!=="list_item")return[];const r=(n=e.parseBlockChildren)!=null?n:e.parseChildren;let i=[];if(t.tokens&&t.tokens.length>0){if(oA(t))return{type:"listItem",content:[{type:"paragraph",content:uA(t.text||"",e)}]};if(t.tokens.some(u=>u.type==="paragraph"))i=r(t.tokens);else{const u=t.tokens[0];if(u&&u.type==="text"&&u.tokens&&u.tokens.length>0){if(i=[{type:"paragraph",content:e.parseInline(u.tokens)}],t.tokens.length>1){const c=t.tokens.slice(1),f=r(c);i.push(...f)}}else i=r(t.tokens)}}return i.length===0&&(i=[{type:"paragraph",content:[]}]),{type:"listItem",content:i}},renderMarkdown:(t,e,n)=>Hp(t,e,r=>{var i,s,u,a;if(r.parentType==="bulletList")return"- ";if(r.parentType==="orderedList"){const c=((s=(i=r.meta)==null?void 0:i.parentAttrs)==null?void 0:s.start)||1,f=(a=(u=r.meta)==null?void 0:u.parentAttrs)==null?void 0:a.type,p=c-1+(r.index||0);return sA(f,p,". ")}return"- "},n),addExtensions(){return[Bb(this.name,[this.options.bulletListTypeName,this.options.orderedListTypeName])]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),lA={};KT(lA,{findListItemPos:()=>Cc,getNextListDepth:()=>r0,handleBackspace:()=>op,handleDelete:()=>up,hasListBefore:()=>qb,hasListItemAfter:()=>aA,hasListItemBefore:()=>cA,listItemHasSubList:()=>dA,nextListIsDeeper:()=>Wb,nextListIsHigher:()=>Kb});var Cc=(t,e)=>{const{$from:n}=e.selection,r=ct(t,e.schema);let i=null,s=n.depth,u=n.pos,a=null;for(;s>0&&a===null;)i=n.node(s),i.type===r?a=s:(s-=1,u-=1);return a===null?null:{$pos:e.doc.resolve(u),depth:a}},r0=(t,e)=>{const n=Cc(t,e);if(!n)return!1;const[,r]=q_(e,t,n.$pos.pos+4);return r},qb=(t,e,n)=>{const{$anchor:r}=t.selection,i=Math.max(0,r.pos-2),s=t.doc.resolve(i).node();return!(!s||!n.includes(s.type.name))},op=(t,e,n)=>{if(t.commands.undoInputRule())return!0;if(t.state.selection.from!==t.state.selection.to)return!1;if(!ri(t.state,e)&&qb(t.state,e,n)){const{$anchor:r}=t.state.selection,i=t.state.doc.resolve(r.before()-1),s=[];i.node().descendants((c,f)=>{c.type.name===e&&s.push({node:c,pos:f})});const u=s.at(-1);if(!u)return!1;const a=t.state.doc.resolve(i.start()+u.pos+1);return t.chain().cut({from:r.start()-1,to:r.end()+1},a.end()).joinForward().run()}return!ri(t.state,e)||!J_(t.state)?!1:t.chain().liftListItem(e).run()},Wb=(t,e)=>{const n=r0(t,e),r=Cc(t,e);return!r||!n?!1:n>r.depth},Kb=(t,e)=>{const n=r0(t,e),r=Cc(t,e);return!r||!n?!1:n<r.depth},up=(t,e)=>{if(!ri(t.state,e)||!Z_(t.state,e))return!1;const{selection:n}=t.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:Wb(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():Kb(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward()},aA=(t,e)=>{var n;const{$anchor:r}=e.selection,i=e.doc.resolve(r.pos-r.parentOffset-2);return!(i.index()===i.parent.childCount-1||((n=i.nodeAfter)==null?void 0:n.type.name)!==t)},cA=(t,e)=>{var n;const{$anchor:r}=e.selection,i=e.doc.resolve(r.pos-2);return!(i.index()===0||((n=i.nodeBefore)==null?void 0:n.type.name)!==t)},dA=(t,e,n)=>{if(!n)return!1;const r=ct(t,e.schema);let i=!1;return n.descendants(s=>{s.type===r&&(i=!0)}),i},Zb=We.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&up(t,n)&&(e=!0)}),e},"Mod-Delete":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&up(t,n)&&(e=!0)}),e},Backspace:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{t.state.schema.nodes[n]!==void 0&&op(t,n,r)&&(e=!0)}),e},"Mod-Backspace":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{t.state.schema.nodes[n]!==void 0&&op(t,n,r)&&(e=!0)}),e}}}}),lp=new RegExp(`^(\\s*)(${Vb})([.)])\\s+(.*)$`),fA=/^\s/,zo={heading:/^#{1,6}(?:\s|$)/,bulletItem:/^[-+*]\s+/,codeFence:/^(?:```|~~~)/,thematicBreak:/^(?:(?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})$/};function hA(t){return lp.test(t.trimStart())}function pA(t){const e=t.trimStart();return zo.bulletItem.test(e)||hA(e)||zo.heading.test(e)||zo.thematicBreak.test(e)&&!e.startsWith("-")||/^>\s?/.test(e)||zo.codeFence.test(e)}function mA(t){return Object.values(zo).some(e=>e.test(t))}function gA(t){const e=[],n=[];let r=!1;return t.forEach(i=>{if(r){n.push(i);return}if(i.trim()===""){r=!0,n.push(i);return}if(e.length>0&&pA(i)){r=!0,n.push(i);return}e.push(i)}),{paragraphLines:e,blockLines:n}}function yA(t){const e=[];let n=0,r=0;for(;n<t.length;){const i=t[n],s=i.match(lp);if(!s)break;const[,u,a,c,f]=s,p=u.length,m=parseInt(a,10),y=isNaN(m)?wc(a):void 0,x=isNaN(m)?n0(a):m,b=[f];let v=n+1;const w=[i];let S=!1;for(;v<t.length;){const A=t[v];if(A.match(lp))break;if(A.trim()==="")w.push(A),b.push(""),S=!0,v+=1;else if(A.match(fA)){const I=A.length-A.trimStart().length,P=p+a.length+1;w.push(A),b.push(A.slice(Math.min(I,P))),v+=1}else{if(S||mA(A))break;w.push(A),b.push(A),v+=1}}e.push({indent:p,number:x,type:y,content:b.join(`
360
- `).trim(),contentLines:b,raw:w.join(`
361
- `)}),r=v,n=v}return[e,r]}var xA=new RegExp(`^(${Vb})([.)])\\s+(.+)$`);function kA(t){const e=t.split(`
362
- `).filter(s=>s.trim().length>0);if(e.length===0)return null;const n=[];for(const s of e){const u=s.trim().match(xA);if(!u)return null;n.push({marker:u[1],content:u[3]})}const r=n.map(s=>s.marker);return nA(r)?{type:"orderedList",attrs:iA(n[0].marker),content:n.map(s=>({type:"listItem",content:[{type:"paragraph",content:[{type:"text",text:s.content}]}]}))}:null}function Jb(t,e,n){const r=[];let i=0;for(;i<t.length;){const s=t[i];if(s.indent===e){const{paragraphLines:u,blockLines:a}=gA(s.contentLines),c=u.join(`
363
- `).trim(),f=[];c&&f.push({type:"paragraph",raw:c,tokens:n.inlineTokens(c)});const p=a.join(`
364
- `).trim();if(p){const x=n.blockTokens(p);f.push(...x)}let m=i+1;const y=[];for(;m<t.length&&t[m].indent>e;)y.push(t[m]),m+=1;if(y.length>0){const x=Math.min(...y.map(v=>v.indent)),b=Jb(y,x,n);f.push({type:"list",ordered:!0,start:y[0].number,typeMarker:y[0].type,items:b,raw:y.map(v=>v.raw).join(`
365
- `)})}r.push({type:"list_item",raw:s.raw,tokens:f}),i=m}else i+=1}return r}function bA(t,e){return t.map(n=>{if(n.type!=="list_item")return e.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(...e.parseChildren([i]));else if(i.type==="text"&&i.tokens){const s=e.parseChildren([i]);r.push({type:"paragraph",content:s})}else{const s=e.parseChildren([i]);s.length>0&&r.push(...s)}}),{type:"listItem",content:r}})}var vA="listItem",s2="textStyle",o2=/^(\d+)\.\s$/;function u2(t){const e=t.match(/list-style-type\s*:\s*([^;]+)/i);if(!e)return null;switch(e[1].trim().toLowerCase()){case"upper-roman":return"I";case"lower-roman":return"i";case"upper-alpha":case"upper-latin":return"A";case"lower-alpha":case"lower-latin":return"a";default:return null}}var Gb=Pe.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>{const e=t.getAttribute("type");if(e)return e;const n=t.getAttribute("style");if(n){const i=u2(n);if(i)return i}const r=t.querySelector("li");if(r){const i=r.getAttribute("style");if(i){const s=u2(i);if(s)return s}}return null}}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,type:n,...r}=t,i=pt(this.options.HTMLAttributes,r);return e!==1&&(i.start=e),n&&n!=="1"&&(i.type=n),["ol",i,0]},markdownTokenName:"list",parseMarkdown:(t,e)=>{if(t.type!=="list"||!t.ordered)return[];const n=t.start||1,r=t.typeMarker,i=t.items?bA(t.items,e):[],s={};return n!==1&&(s.start=n),r&&(s.type=r),Object.keys(s).length>0?{type:"orderedList",attrs:s,content:i}:{type:"orderedList",content:i}},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
366
- `):"",markdownTokenizer:{name:"orderedList",level:"block",start:()=>-1,tokenize:(t,e,n)=>{var r,i;const s=t.split(`
367
- `),[u,a]=yA(s);if(u.length===0)return;const c=Jb(u,u[0].indent,n);if(c.length===0)return;const f=((r=u[0])==null?void 0:r.number)||1,p=(i=u[0])==null?void 0:i.type;return{type:"list",ordered:!0,start:f,typeMarker:p,items:c,raw:s.slice(0,a).join(`
368
- `)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(vA,this.editor.getAttributes(s2)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new qe({props:{handlePaste:(t,e)=>{var n,r;const i=(n=e.clipboardData)==null?void 0:n.getData("text/html");if(i!=null&&i.trim())return!1;const s=(r=e.clipboardData)==null?void 0:r.getData("text/plain");if(!s)return!1;const u=kA(s);if(!u)return!1;try{const a=t.state.schema.nodeFromJSON(u),c=t.state.tr.replaceSelectionWith(a);return t.dispatch(c),!0}catch{return!1}}}})]},addInputRules(){const t=(n,r)=>(!r.attrs.type||r.attrs.type==="1")&&r.childCount+r.attrs.start===+n[1];let e=Ls({find:o2,type:this.type,getAttributes:n=>({start:+n[1]}),joinPredicate:t});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Ls({find:o2,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:n=>({start:+n[1],...this.editor.getAttributes(s2)}),joinPredicate:t,editor:this.editor})),[e]}}),wA=/^\s*(\[([( |x])?\])\s$/,CA=Pe.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:t=>{const e=t.getAttribute("data-checked");return e===""||e==="true"},renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:t,HTMLAttributes:e}){return["li",pt(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(t,e)=>{const n=[];if(t.tokens&&t.tokens.length>0?n.push(e.createNode("paragraph",{},e.parseInline(t.tokens))):t.text?n.push(e.createNode("paragraph",{},[e.createNode("text",{text:t.text})])):n.push(e.createNode("paragraph",{},[])),t.nestedTokens&&t.nestedTokens.length>0){const r=e.parseChildren(t.nestedTokens);n.push(...r)}return e.createNode("taskItem",{checked:t.checked||!1},n)},renderMarkdown:(t,e)=>{var n;const i=`- [${(n=t.attrs)!=null&&n.checked?"x":" "}] `;return Hp(t,e,i)},addExtensions(){return this.options.nested?[Bb(this.name,[this.options.taskListTypeName])]:[]},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:n,editor:r})=>{const i=document.createElement("li"),s=document.createElement("label"),u=document.createElement("span"),a=document.createElement("input"),c=document.createElement("div"),f=m=>{var y,x;a.ariaLabel=((x=(y=this.options.a11y)==null?void 0:y.checkboxLabel)==null?void 0:x.call(y,m,a.checked))||`Task item checkbox for ${m.textContent||"empty task item"}`};f(t),s.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",m=>m.preventDefault()),a.addEventListener("change",m=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}const{checked:y}=m.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:x})=>{const b=n();if(typeof b!="number")return!1;const v=x.doc.nodeAt(b);return x.setNodeMarkup(b,void 0,{...v==null?void 0:v.attrs,checked:y}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,y)||(a.checked=!a.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([m,y])=>{i.setAttribute(m,y)}),i.dataset.checked=t.attrs.checked,a.checked=t.attrs.checked,s.append(a,u),i.append(s,c),Object.entries(e).forEach(([m,y])=>{i.setAttribute(m,y)});let p=new Set(Object.keys(e));return{dom:i,contentDOM:c,update:m=>{if(m.type!==this.type)return!1;i.dataset.checked=m.attrs.checked,a.checked=m.attrs.checked,f(m);const y=r.extensionManager.attributes,x=cu(m,y),b=new Set(Object.keys(x)),v=this.options.HTMLAttributes;return p.forEach(w=>{b.has(w)||(w in v?i.setAttribute(w,v[w]):i.removeAttribute(w))}),Object.entries(x).forEach(([w,S])=>{S==null?w in v?i.setAttribute(w,v[w]):i.removeAttribute(w):i.setAttribute(w,S)}),p=b,!0}}}},addInputRules(){return[Ls({find:wA,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),SA=Pe.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:t}){return["ul",pt(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},parseMarkdown:(t,e)=>e.createNode("taskList",{},e.parseChildren(t.items||[])),renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
369
- `):"",markdownTokenizer:{name:"taskList",level:"block",start(t){var e;const n=(e=t.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:e.index;return n!==void 0?n:-1},tokenize(t,e,n){const r=s=>{const u=Gh(s,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:a=>({indentLevel:a[1].length,mainContent:a[4],checked:a[3].toLowerCase()==="x"}),createToken:(a,c)=>({type:"taskItem",raw:"",mainContent:a.mainContent,indentLevel:a.indentLevel,checked:a.checked,text:a.mainContent,tokens:n.inlineTokens(a.mainContent),nestedTokens:c}),customNestedParser:r},n);if(u){const a={type:"taskList",raw:u.raw,items:u.items},c=s.slice(u.raw.length);return c.trim()?[a,...n.blockTokens(c)]:[a]}return n.blockTokens(s)},i=Gh(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:s=>({indentLevel:s[1].length,mainContent:s[4],checked:s[3].toLowerCase()==="x"}),createToken:(s,u)=>({type:"taskItem",raw:"",mainContent:s.mainContent,indentLevel:s.indentLevel,checked:s.checked,text:s.mainContent,tokens:n.inlineTokens(s.mainContent),nestedTokens:u}),customNestedParser:r},n);if(i)return{type:"taskList",raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});We.create({name:"listKit",addExtensions(){const t=[];return this.options.bulletList!==!1&&t.push(jb.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(Ub.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(Zb.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(Gb.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(CA.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(SA.configure(this.options.taskList)),t}});var ea="&nbsp;",oh=" ",EA=Pe.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",pt(this.options.HTMLAttributes,t),0]},parseMarkdown:(t,e)=>{const n=t.tokens||[];if(n.length===1&&n[0].type==="image")return e.parseChildren([n[0]]);const r=e.parseInline(n);return n.length===1&&n[0].type==="text"&&(n[0].raw===ea||n[0].text===ea||n[0].raw===oh||n[0].text===oh)&&r.length===1&&r[0].type==="text"&&(r[0].text===ea||r[0].text===oh)?e.createNode("paragraph",void 0,[]):e.createNode("paragraph",void 0,r)},renderMarkdown:(t,e,n)=>{var r,i;if(!t)return"";const s=Array.isArray(t.content)?t.content:[];if(s.length===0){const u=Array.isArray((r=n==null?void 0:n.previousNode)==null?void 0:r.content)?n.previousNode.content:[];return((i=n==null?void 0:n.previousNode)==null?void 0:i.type)==="paragraph"&&u.length===0?ea:""}return e.renderChildren(s)},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),_A=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,TA=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,AA=on.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",pt(this.options.HTMLAttributes,t),0]},markdownTokenName:"del",parseMarkdown:(t,e)=>e.applyMark("strike",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`~~${e.renderChildren(t)}~~`,addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[$i({find:_A,type:this.type})]},addPasteRules(){return[ii({find:TA,type:this.type})]}}),MA=Pe.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),DA=on.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",pt(this.options.HTMLAttributes,t),0]},parseMarkdown(t,e){return e.applyMark(this.name||"underline",e.parseInline(t.tokens||[]))},renderMarkdown(t,e){return`++${e.renderChildren(t)}++`},markdownTokenizer:{name:"underline",level:"inline",start(t){return t.indexOf("++")},tokenize(t,e,n){const i=/^(\+\+)([\s\S]+?)(\+\+)/.exec(t);if(!i)return;const s=i[2].trim();return{type:"underline",raw:i[0],text:s,tokens:n.inlineTokens(s)}}},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function NA(t={}){return new qe({view(e){return new OA(e,t)}})}class OA{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.lastDragEvent=null,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 s=u=>{this[i](u)};return e.dom.addEventListener(i,s),{name:i,handler:s}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){if(this.cursorPos!=null&&n.doc!=e.state.doc)if(this.lastDragEvent){let r=this.computeTarget(this.lastDragEvent);r==this.cursorPos?this.updateOverlay():this.setCursor(r)}else this.updateOverlay()}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r,i=this.editorView.dom,s=i.getBoundingClientRect(),u=s.width/i.offsetWidth,a=s.height/i.offsetHeight;if(n){let m=e.nodeBefore,y=e.nodeAfter;if(m||y){let x=this.editorView.nodeDOM(this.cursorPos-(m?m.nodeSize:0));if(x){let b=x.getBoundingClientRect(),v=m?b.bottom:b.top;m&&y&&(v=(v+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let w=this.width/2*a;r={left:b.left,right:b.right,top:v-w,bottom:v+w}}}}if(!r){let m=this.editorView.coordsAtPos(this.cursorPos),y=this.width/2*u;r={left:m.left-y,right:m.left+y,top:m.top,bottom:m.bottom}}let c=this.editorView.dom.offsetParent;this.element||(this.element=c.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 f,p;if(!c||c==document.body&&getComputedStyle(c).position=="static")f=-pageXOffset,p=-pageYOffset;else{let m=c.getBoundingClientRect(),y=m.width/c.offsetWidth,x=m.height/c.offsetHeight;f=m.left-c.scrollLeft*y,p=m.top-c.scrollTop*x}this.element.style.left=(r.left-f)/u+"px",this.element.style.top=(r.top-p)/a+"px",this.element.style.width=(r.right-r.left)/u+"px",this.element.style.height=(r.bottom-r.top)/a+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}computeTarget(e){let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,s=typeof i=="function"?i(this.editorView,n,e):i;if(!n||s)return null;let u=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=Ox(this.editorView.state.doc,u,this.editorView.dragging.slice);a!=null&&(u=a)}return u}dragover(e){if(!this.editorView.editable)return;this.lastDragEvent=e;let n=this.computeTarget(e);n!=null&&(this.setCursor(n),this.scheduleRemoval(5e3))}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class nt extends ge{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return nt.valid(r)?new nt(r):ge.near(r)}content(){return G.empty}eq(e){return e instanceof nt&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new nt(e.resolve(n.pos))}getBookmark(){return new i0(this.anchor)}static valid(e){let n=e.parent;if(n.inlineContent||!RA(e)||!IA(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&nt.valid(e))return e;let i=e.pos,s=null;for(let u=e.depth;;u--){let a=e.node(u);if(n>0?e.indexAfter(u)<a.childCount:e.index(u)>0){s=a.child(n>0?e.indexAfter(u):e.index(u)-1);break}else if(u==0)return null;i+=n;let c=e.doc.resolve(i);if(nt.valid(c))return c}for(;;){let u=n>0?s.firstChild:s.lastChild;if(!u){if(s.isAtom&&!s.isText&&!oe.isSelectable(s)){e=e.doc.resolve(i+s.nodeSize*n),r=!1;continue e}break}s=u,i+=n;let a=e.doc.resolve(i);if(nt.valid(a))return a}return null}}}nt.prototype.visible=!1;nt.findFrom=nt.findGapCursorFrom;ge.jsonID("gapcursor",nt);class i0{constructor(e){this.pos=e}map(e){return new i0(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return nt.valid(n)?new nt(n):ge.near(n)}}function Qb(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}function RA(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||Qb(i.type))return!0;if(i.inlineContent)return!1}}return!0}function IA(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||Qb(i.type))return!0;if(i.inlineContent)return!1}}return!0}function LA(){return new qe({props:{decorations:jA,createSelectionBetween(t,e,n){return e.pos==n.pos&&nt.valid(n)?new nt(n):null},handleClick:FA,handleKeyDown:PA,handleDOMEvents:{beforeinput:zA}}})}const PA=Pk({ArrowLeft:ta("horiz",-1),ArrowRight:ta("horiz",1),ArrowUp:ta("vert",-1),ArrowDown:ta("vert",1)});function ta(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,s){let u=r.selection,a=e>0?u.$to:u.$from,c=u.empty;if(u instanceof de){if(!s.endOfTextblock(n)||a.depth==0)return!1;c=!1,a=r.doc.resolve(e>0?a.after():a.before())}let f=nt.findGapCursorFrom(a,e,c);return f?(i&&i(r.tr.setSelection(new nt(f))),!0):!1}}function FA(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!nt.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&oe.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new nt(r))),!0)}function zA(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof nt))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=j.empty;for(let u=r.length-1;u>=0;u--)i=j.from(r[u].createAndFill(null,i));let s=t.state.tr.replace(n.pos,n.pos,new G(i,0,0));return s.setSelection(de.near(s.doc.resolve(n.pos+1))),t.dispatch(s),!1}function jA(t){if(!(t.selection instanceof nt))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Be.create(t.doc,[Ft.widget(t.selection.head,e,{key:"gapcursor"})])}var rc=200,vt=function(){};vt.prototype.append=function(e){return e.length?(e=vt.from(e),!this.length&&e||e.length<rc&&this.leafAppend(e)||this.length<rc&&e.leafPrepend(this)||this.appendInner(e)):this};vt.prototype.prepend=function(e){return e.length?vt.from(e).append(this):this};vt.prototype.appendInner=function(e){return new BA(this,e)};vt.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?vt.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};vt.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};vt.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)};vt.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(s,u){return i.push(e(s,u))},n,r),i};vt.from=function(e){return e instanceof vt?e:e&&e.length?new Yb(e):vt.empty};var Yb=(function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,s){return i==0&&s==this.length?this:new e(this.values.slice(i,s))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,s,u,a){for(var c=s;c<u;c++)if(i(this.values[c],a+c)===!1)return!1},e.prototype.forEachInvertedInner=function(i,s,u,a){for(var c=s-1;c>=u;c--)if(i(this.values[c],a+c)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=rc)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=rc)return new e(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e})(vt);vt.empty=new Yb([]);var BA=(function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,s,u){var a=this.left.length;if(i<a&&this.left.forEachInner(r,i,Math.min(s,a),u)===!1||s>a&&this.right.forEachInner(r,Math.max(i-a,0),Math.min(this.length,s)-a,u+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,s,u){var a=this.left.length;if(i>a&&this.right.forEachInvertedInner(r,i-a,Math.max(s,a)-a,u+a)===!1||s<a&&this.left.forEachInvertedInner(r,Math.min(i,a),s,u)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var s=this.left.length;return i<=s?this.left.slice(r,i):r>=s?this.right.slice(r-s,i-s):this.left.slice(r,s).append(this.right.slice(0,i-s))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e})(vt);const $A=500;class Tn{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,s;n&&(i=this.remapping(r,this.items.length),s=i.maps.length);let u=e.tr,a,c,f=[],p=[];return this.items.forEach((m,y)=>{if(!m.step){i||(i=this.remapping(r,y+1),s=i.maps.length),s--,p.push(m);return}if(i){p.push(new jn(m.map));let x=m.step.map(i.slice(s)),b;x&&u.maybeStep(x).doc&&(b=u.mapping.maps[u.mapping.maps.length-1],f.push(new jn(b,void 0,void 0,f.length+p.length))),s--,b&&i.appendMap(b,s)}else u.maybeStep(m.step);if(m.selection)return a=i?m.selection.map(i.slice(s)):m.selection,c=new Tn(this.items.slice(0,r).append(p.reverse().concat(f)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:u,selection:a}}addTransform(e,n,r,i){let s=[],u=this.eventCount,a=this.items,c=!i&&a.length?a.get(a.length-1):null;for(let p=0;p<e.steps.length;p++){let m=e.steps[p].invert(e.docs[p]),y=new jn(e.mapping.maps[p],m,n),x;(x=c&&c.merge(y))&&(y=x,p?s.pop():a=a.slice(0,a.length-1)),s.push(y),n&&(u++,n=void 0),i||(c=y)}let f=u-r.depth;return f>HA&&(a=VA(a,f),u-=f),new Tn(a.append(s),u)}remapping(e,n){let r=new su;return this.items.forEach((i,s)=>{let u=i.mirrorOffset!=null&&s-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,u)},e,n),r}addMaps(e){return this.eventCount==0?this:new Tn(this.items.append(e.map(n=>new jn(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),s=e.mapping,u=e.steps.length,a=this.eventCount;this.items.forEach(y=>{y.selection&&a--},i);let c=n;this.items.forEach(y=>{let x=s.getMirror(--c);if(x==null)return;u=Math.min(u,x);let b=s.maps[x];if(y.step){let v=e.steps[x].invert(e.docs[x]),w=y.selection&&y.selection.map(s.slice(c+1,x));w&&a++,r.push(new jn(b,v,w))}else r.push(new jn(b))},i);let f=[];for(let y=n;y<u;y++)f.push(new jn(s.maps[y]));let p=this.items.slice(0,i).append(f).append(r),m=new Tn(p,a);return m.emptyItemCount()>$A&&(m=m.compress(this.items.length-r.length)),m}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],s=0;return this.items.forEach((u,a)=>{if(a>=e)i.push(u),u.selection&&s++;else if(u.step){let c=u.step.map(n.slice(r)),f=c&&c.getMap();if(r--,f&&n.appendMap(f,r),c){let p=u.selection&&u.selection.map(n.slice(r));p&&s++;let m=new jn(f.invert(),c,p),y,x=i.length-1;(y=i.length&&i[x].merge(m))?i[x]=y:i.push(m)}}else u.map&&r--},this.items.length,0),new Tn(vt.from(i.reverse()),s)}}Tn.empty=new Tn(vt.empty,0);function VA(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}class jn{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new jn(n.getMap().invert(),n,this.selection)}}}class Br{constructor(e,n,r,i,s){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=s}}const HA=20;function UA(t,e,n,r){let i=n.getMeta(Li),s;if(i)return i.historyState;n.getMeta(KA)&&(t=new Br(t.done,t.undone,null,0,-1));let u=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(u&&u.getMeta(Li))return u.getMeta(Li).redo?new Br(t.done.addTransform(n,void 0,r,la(e)),t.undone,l2(n.mapping.maps),t.prevTime,t.prevComposition):new Br(t.done,t.undone.addTransform(n,void 0,r,la(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(u&&u.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),c=t.prevTime==0||!u&&t.prevComposition!=a&&(t.prevTime<(n.time||0)-r.newGroupDelay||!qA(n,t.prevRanges)),f=u?uh(t.prevRanges,n.mapping):l2(n.mapping.maps);return new Br(t.done.addTransform(n,c?e.selection.getBookmark():void 0,r,la(e)),Tn.empty,f,n.time,a??t.prevComposition)}else return(s=n.getMeta("rebased"))?new Br(t.done.rebased(n,s),t.undone.rebased(n,s),uh(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Br(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),uh(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function qA(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let s=0;s<e.length;s+=2)r<=e[s+1]&&i>=e[s]&&(n=!0)}),n}function l2(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,i,s,u)=>e.push(s,u));return e}function uh(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let i=e.map(t[r],1),s=e.map(t[r+1],-1);i<=s&&n.push(i,s)}return n}function WA(t,e,n){let r=la(e),i=Li.get(e).spec.config,s=(n?t.undone:t.done).popEvent(e,r);if(!s)return null;let u=s.selection.resolve(s.transform.doc),a=(n?t.done:t.undone).addTransform(s.transform,e.selection.getBookmark(),i,r),c=new Br(n?a:s.remaining,n?s.remaining:a,null,0,-1);return s.transform.setSelection(u).setMeta(Li,{redo:n,historyState:c})}let lh=!1,a2=null;function la(t){let e=t.plugins;if(a2!=e){lh=!1,a2=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){lh=!0;break}}return lh}const Li=new dt("history"),KA=new dt("closeHistory");function ZA(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new qe({key:Li,state:{init(){return new Br(Tn.empty,Tn.empty,null,0,-1)},apply(e,n,r){return UA(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,i=r=="historyUndo"?ev:r=="historyRedo"?tv:null;return!i||!e.editable?!1:(n.preventDefault(),i(e.state,e.dispatch))}}}})}function Xb(t,e){return(n,r)=>{let i=Li.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let s=WA(i,n,t);s&&r(e?s.scrollIntoView():s)}return!0}}const ev=Xb(!1,!0),tv=Xb(!0,!0);We.create({name:"characterCount",addOptions(){return{limit:null,autoTrim:!0,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc;if(((t==null?void 0:t.mode)||this.options.mode)==="textSize"){const r=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(r)}return e.nodeSize},this.storage.words=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc,n=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let t=!1;return[new qe({key:new dt("characterCount"),appendTransaction:(e,n,r)=>{if(t)return;const i=this.options.limit,s=this.options.autoTrim;if(i==null||i===0||s===!1){t=!0;return}const u=this.storage.characters({node:r.doc});if(u>i){const a=u-i,c=0,f=a;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);const p=r.tr.deleteRange(c,f);return t=!0,p}t=!0},filterTransaction:(e,n)=>{const r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;const i=this.storage.characters({node:n.doc}),s=this.storage.characters({node:e.doc});if(s<=r||i>r&&s>r&&s<=i)return!0;if(i>r&&s>r&&s>i||!e.getMeta("paste"))return!1;const a=e.selection.$head.pos,c=s-r,f=a-c,p=a;return e.deleteRange(f,p),!(this.storage.characters({node:e.doc})>r)}})]}});var JA=We.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[NA(this.options)]}});We.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new qe({key:new dt("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:i}=e,s=[];if(!n||!r)return Be.create(t,[]);let u=0;this.options.mode==="deepest"&&t.descendants((c,f)=>{if(c.isText)return;if(!(i>=f&&i<=f+c.nodeSize-1))return!1;u+=1});let a=0;return t.descendants((c,f)=>{if(c.isText||!(i>=f&&i<=f+c.nodeSize-1))return!1;if(a+=1,this.options.mode==="deepest"&&u-a>0||this.options.mode==="shallowest"&&a>1)return this.options.mode==="deepest";s.push(Ft.node(f,f+c.nodeSize,{class:this.options.className}))}),Be.create(t,s)}}})]}});var GA=We.create({name:"gapCursor",addProseMirrorPlugins(){return[LA()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=Oe(se(t,"allowGapCursor",n)))!=null?e:null}}}),nv="placeholder",c2=new dt("tiptap__placeholder");function rv(t){const{editor:e,placeholder:n,dataAttribute:r,pos:i,node:s,isEmptyDoc:u,hasAnchor:a,classes:{emptyNode:c,emptyEditor:f}}=t,p=[c];return u&&p.push(f),Ft.node(i,i+s.nodeSize,{class:p.join(" "),[r]:typeof n=="function"?n({editor:e,node:s,pos:i,hasAnchor:a}):n})}function iv(t,e){return typeof t=="function"?t(e):t}function sv({editor:t,options:e,dataAttribute:n,doc:r,selection:i,from:s,to:u}){const{anchor:a}=i,c=[],f=t.isEmpty;return r.nodesBetween(s,u,(p,m)=>{const y=a>=m&&a<=m+p.nodeSize,x=!p.isLeaf&&Eu(p);return p.type.isTextblock&&(y||!e.showOnlyCurrent)&&x&&c.push(rv({editor:t,isEmptyDoc:f,dataAttribute:n,hasAnchor:y,placeholder:e.placeholder,classes:{emptyEditor:e.emptyEditorClass,emptyNode:iv(e.emptyNodeClass,{editor:t,node:p,pos:m,hasAnchor:y})},node:p,pos:m})),e.includeChildren}),c}function ov({editor:t,options:e,dataAttribute:n,doc:r,selection:i}){if(!(t.isEditable||!e.showOnlyWhenEditable))return null;const{anchor:u}=i,a=[],c=t.isEmpty;if(e.showOnlyCurrent&&!e.includeChildren){const p=r.resolve(u),m=p.depth>0?p.node(1):p.nodeAfter,y=p.depth>0?p.before(1):u;if(m&&m.type.isTextblock&&Eu(m)){const x=u>=y&&u<=y+m.nodeSize;a.push(rv({editor:t,isEmptyDoc:c,dataAttribute:n,hasAnchor:x,placeholder:e.placeholder,classes:{emptyEditor:e.emptyEditorClass,emptyNode:iv(e.emptyNodeClass,{editor:t,node:m,pos:y,hasAnchor:x})},node:m,pos:y}))}}else a.push(...sv({editor:t,options:e,dataAttribute:n,doc:r,selection:i,from:0,to:r.content.size}));return Be.create(r,a)}function Go(t,e){var n;const r=t.resolve(e);if(r.depth===0){const u=(n=r.nodeAfter)!=null?n:r.nodeBefore;if(!u)return{from:e,to:e};const a=r.nodeAfter?e:e-u.nodeSize;return{from:a,to:a+u.nodeSize}}const i=r.before(1),s=r.node(1);return{from:i,to:i+s.nodeSize}}function Qo(t,e){return{from:Math.max(0,e.from-1),to:Math.min(t.content.size,e.to-1)}}function QA(t,e,n){const r=[];return t.forEach((i,s)=>{const u=s,a=u+i.nodeSize,c=u+1,f=a+1;c<n&&f>e&&r.push({from:u,to:a})}),r}function YA(t){if(t.length===0)return[];const e=[...t].sort((r,i)=>r.from-i.from),n=[{...e[0]}];for(let r=1;r<e.length;r+=1){const i=n[n.length-1],s=e[r];s.from<=i.to?i.to=Math.max(i.to,s.to):n.push({...s})}return n}function XA(t,e){const n=QA(t,e.from,e.to);return n.push(Qo(t,Go(t,e.from))),e.to>e.from?n.push(Qo(t,Go(t,Math.min(e.to,t.content.size+1)-1))):e.from<t.content.size+1&&n.push(Qo(t,Go(t,Math.min(e.from+1,t.content.size)))),n}function eM(t,e,n){const r=[];if(t.docChanged){const i=jp(t);for(const s of i)r.push(...XA(n.doc,s.newRange))}return t.selectionSet&&(r.push(Qo(n.doc,Go(n.doc,t.mapping.map(e.selection.anchor)))),r.push(Qo(n.doc,Go(n.doc,n.selection.anchor)))),YA(r)}function tM(t,e,n){const r=Math.max(0,Math.min(t,n.content.size)),i=Math.max(r,Math.min(e,n.content.size));return{from:r,to:i}}function nM({decorations:t,ranges:e,editor:n,options:r,dataAttribute:i,doc:s,selection:u}){let a=t;for(const c of e){const{from:f,to:p}=tM(c.from,c.to,s),m=a.find(f,p).filter(x=>x.from>=f&&x.to<=p);m.length&&(a=a.remove(m));const y=sv({editor:n,options:r,dataAttribute:i,doc:s,selection:u,from:f,to:p});y.length&&(a=a.add(s,y))}return a}function rM({editor:t,options:e,dataAttribute:n}){return{init(r,i){const s=ov({editor:t,options:e,dataAttribute:n,doc:i.doc,selection:i.selection});return s??Be.empty},apply(r,i,s,u){if(!r.docChanged&&!r.selectionSet)return i;const a=i.map(r.mapping,r.doc),c=eM(r,s,u);return nM({decorations:a,ranges:c,editor:t,options:e,dataAttribute:n,doc:u.doc,selection:u.selection})}}}function iM(t){return t.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}function sM({editor:t,options:e}){const n=e.dataAttribute?`data-${iM(e.dataAttribute)}`:`data-${nv}`,r=e.showOnlyCurrent&&!e.includeChildren;return new qe({key:c2,...r?{}:{state:rM({editor:t,options:e,dataAttribute:n})},props:{decorations:r?({doc:i,selection:s})=>ov({editor:t,options:e,dataAttribute:n,doc:i,selection:s}):i=>{var s;return e.showOnlyWhenEditable&&!t.isEditable?Be.empty:(s=c2.getState(i))!=null?s:Be.empty}}})}We.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:nv,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[sM({editor:this.editor,options:this.options})]}});function ap(t,e){return!t.selection.empty&&!Yk(t.selection)&&e.isEditable}function oM(t,e){return ap(t,e)&&!e.isFocused&&!e.view.dragging}function uM(){var t;(t=window.getSelection())==null||t.removeAllRanges()}function lM(t){t.focus()}We.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:t,options:e}=this;return[new qe({key:new dt("selection"),props:{decorations(n){return oM(n,t)?Be.create(n.doc,[Ft.inline(n.selection.from,n.selection.to,{class:e.className})]):null},handleDOMEvents:{blur(n){return ap(n.state,t)&&uM(),!1},focus(n){return ap(n.state,t)&&requestAnimationFrame(()=>{!t.isDestroyed&&n.hasFocus()&&lM(n)}),!1}}}})]}});var aM="skipTrailingNode";function d2({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||(e==null?void 0:e.type)===t}var cM=We.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var t;const e=new dt(this.name),n=this.options.node||((t=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:t.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,i])=>i).filter(i=>(this.options.notAfter||[]).concat(n).includes(i.name));return[new qe({key:e,appendTransaction:(i,s,u)=>{const{doc:a,tr:c,schema:f}=u,p=e.getState(u),m=a.content.size,y=f.nodes[n];if(!i.some(x=>x.getMeta(aM))&&p)return c.insert(m,y.create())},state:{init:(i,s)=>{const u=s.tr.doc.lastChild;return!d2({node:u,types:r})},apply:(i,s)=>{if(!i.docChanged||i.getMeta("__uniqueIDTransaction"))return s;const u=i.doc.lastChild;return!d2({node:u,types:r})}}})]}}),dM=We.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>ev(t,e),redo:()=>({state:t,dispatch:e})=>tv(t,e)}},addProseMirrorPlugins(){return[ZA(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()}}}),fM=We.create({name:"starterKit",addExtensions(){var t,e,n,r;const i=[];return this.options.bold!==!1&&i.push(Y5.configure(this.options.bold)),this.options.blockquote!==!1&&i.push(K5.configure(this.options.blockquote)),this.options.bulletList!==!1&&i.push(jb.configure(this.options.bulletList)),this.options.code!==!1&&i.push(tT.configure(this.options.code)),this.options.codeBlock!==!1&&i.push(iT.configure(this.options.codeBlock)),this.options.document!==!1&&i.push(sT.configure(this.options.document)),this.options.dropcursor!==!1&&i.push(JA.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&i.push(GA.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&i.push(oT.configure(this.options.hardBreak)),this.options.heading!==!1&&i.push(uT.configure(this.options.heading)),this.options.undoRedo!==!1&&i.push(dM.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&i.push(lT.configure(this.options.horizontalRule)),this.options.italic!==!1&&i.push(hT.configure(this.options.italic)),this.options.listItem!==!1&&i.push(Ub.configure(this.options.listItem)),this.options.listKeymap!==!1&&i.push(Zb.configure((t=this.options)==null?void 0:t.listKeymap)),this.options.link!==!1&&i.push(qT.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&i.push(Gb.configure(this.options.orderedList)),this.options.paragraph!==!1&&i.push(EA.configure(this.options.paragraph)),this.options.strike!==!1&&i.push(AA.configure(this.options.strike)),this.options.text!==!1&&i.push(MA.configure(this.options.text)),this.options.underline!==!1&&i.push(DA.configure((n=this.options)==null?void 0:n.underline)),this.options.trailingNode!==!1&&i.push(cM.configure((r=this.options)==null?void 0:r.trailingNode)),i}}),hM=fM;const f2={};function pM(t){let e=f2[t];if(e)return e;e=f2[t]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);e.push(r)}for(let n=0;n<t.length;n++){const r=t.charCodeAt(n);e[r]="%"+("0"+r.toString(16).toUpperCase()).slice(-2)}return e}function Ps(t,e){typeof e!="string"&&(e=Ps.defaultChars);const n=pM(e);return t.replace(/(%[a-f0-9]{2})+/gi,function(r){let i="";for(let s=0,u=r.length;s<u;s+=3){const a=parseInt(r.slice(s+1,s+3),16);if(a<128){i+=n[a];continue}if((a&224)===192&&s+3<u){const c=parseInt(r.slice(s+4,s+6),16);if((c&192)===128){const f=a<<6&1984|c&63;f<128?i+="��":i+=String.fromCharCode(f),s+=3;continue}}if((a&240)===224&&s+6<u){const c=parseInt(r.slice(s+4,s+6),16),f=parseInt(r.slice(s+7,s+9),16);if((c&192)===128&&(f&192)===128){const p=a<<12&61440|c<<6&4032|f&63;p<2048||p>=55296&&p<=57343?i+="���":i+=String.fromCharCode(p),s+=6;continue}}if((a&248)===240&&s+9<u){const c=parseInt(r.slice(s+4,s+6),16),f=parseInt(r.slice(s+7,s+9),16),p=parseInt(r.slice(s+10,s+12),16);if((c&192)===128&&(f&192)===128&&(p&192)===128){let m=a<<18&1835008|c<<12&258048|f<<6&4032|p&63;m<65536||m>1114111?i+="����":(m-=65536,i+=String.fromCharCode(55296+(m>>10),56320+(m&1023))),s+=9;continue}}i+="�"}return i})}Ps.defaultChars=";/?:@&=+$,#";Ps.componentChars="";const h2={};function mM(t){let e=h2[t];if(e)return e;e=h2[t]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);/^[0-9a-z]$/i.test(r)?e.push(r):e.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<t.length;n++)e[t.charCodeAt(n)]=t[n];return e}function Tu(t,e,n){typeof e!="string"&&(n=e,e=Tu.defaultChars),typeof n>"u"&&(n=!0);const r=mM(e);let i="";for(let s=0,u=t.length;s<u;s++){const a=t.charCodeAt(s);if(n&&a===37&&s+2<u&&/^[0-9a-f]{2}$/i.test(t.slice(s+1,s+3))){i+=t.slice(s,s+3),s+=2;continue}if(a<128){i+=r[a];continue}if(a>=55296&&a<=57343){if(a>=55296&&a<=56319&&s+1<u){const c=t.charCodeAt(s+1);if(c>=56320&&c<=57343){i+=encodeURIComponent(t[s]+t[s+1]),s++;continue}}i+="%EF%BF%BD";continue}i+=encodeURIComponent(t[s])}return i}Tu.defaultChars=";/?:@&=+$,-_.!~*'()#";Tu.componentChars="-_.!~*'()";function s0(t){let e="";return e+=t.protocol||"",e+=t.slashes?"//":"",e+=t.auth?t.auth+"@":"",t.hostname&&t.hostname.indexOf(":")!==-1?e+="["+t.hostname+"]":e+=t.hostname||"",e+=t.port?":"+t.port:"",e+=t.pathname||"",e+=t.search||"",e+=t.hash||"",e}function ic(){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 gM=/^([a-z0-9.+-]+:)/i,yM=/:[0-9]*$/,xM=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,kM=["<",">",'"',"`"," ","\r",`
370
- `," "],bM=["{","}","|","\\","^","`"].concat(kM),vM=["'"].concat(bM),p2=["%","/","?",";","#"].concat(vM),m2=["/","?","#"],wM=255,g2=/^[+a-z0-9A-Z_-]{0,63}$/,CM=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,y2={javascript:!0,"javascript:":!0},x2={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function o0(t,e){if(t&&t instanceof ic)return t;const n=new ic;return n.parse(t,e),n}ic.prototype.parse=function(t,e){let n,r,i,s=t;if(s=s.trim(),!e&&t.split("#").length===1){const f=xM.exec(s);if(f)return this.pathname=f[1],f[2]&&(this.search=f[2]),this}let u=gM.exec(s);if(u&&(u=u[0],n=u.toLowerCase(),this.protocol=u,s=s.substr(u.length)),(e||u||s.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i=s.substr(0,2)==="//",i&&!(u&&y2[u])&&(s=s.substr(2),this.slashes=!0)),!y2[u]&&(i||u&&!x2[u])){let f=-1;for(let b=0;b<m2.length;b++)r=s.indexOf(m2[b]),r!==-1&&(f===-1||r<f)&&(f=r);let p,m;f===-1?m=s.lastIndexOf("@"):m=s.lastIndexOf("@",f),m!==-1&&(p=s.slice(0,m),s=s.slice(m+1),this.auth=p),f=-1;for(let b=0;b<p2.length;b++)r=s.indexOf(p2[b]),r!==-1&&(f===-1||r<f)&&(f=r);f===-1&&(f=s.length),s[f-1]===":"&&f--;const y=s.slice(0,f);s=s.slice(f),this.parseHost(y),this.hostname=this.hostname||"";const x=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!x){const b=this.hostname.split(/\./);for(let v=0,w=b.length;v<w;v++){const S=b[v];if(S&&!S.match(g2)){let A="";for(let R=0,I=S.length;R<I;R++)S.charCodeAt(R)>127?A+="x":A+=S[R];if(!A.match(g2)){const R=b.slice(0,v),I=b.slice(v+1),P=S.match(CM);P&&(R.push(P[1]),I.unshift(P[2])),I.length&&(s=I.join(".")+s),this.hostname=R.join(".");break}}}}this.hostname.length>wM&&(this.hostname=""),x&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const a=s.indexOf("#");a!==-1&&(this.hash=s.substr(a),s=s.slice(0,a));const c=s.indexOf("?");return c!==-1&&(this.search=s.substr(c),s=s.slice(0,c)),s&&(this.pathname=s),x2[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};ic.prototype.parseHost=function(t){let e=yM.exec(t);e&&(e=e[0],e!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};const SM=Object.freeze(Object.defineProperty({__proto__:null,decode:Ps,encode:Tu,format:s0,parse:o0},Symbol.toStringTag,{value:"Module"})),uv=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,lv=/[\0-\x1F\x7F-\x9F]/,EM=/[\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]/,u0=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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]/,av=/[\$\+<->\^`\|~\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]/,cv=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,_M=Object.freeze(Object.defineProperty({__proto__:null,Any:uv,Cc:lv,Cf:EM,P:u0,S:av,Z:cv},Symbol.toStringTag,{value:"Module"})),TM=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(t=>t.charCodeAt(0))),AM=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(t=>t.charCodeAt(0)));var ah;const MM=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]]),DM=(ah=String.fromCodePoint)!==null&&ah!==void 0?ah:function(t){let e="";return t>65535&&(t-=65536,e+=String.fromCharCode(t>>>10&1023|55296),t=56320|t&1023),e+=String.fromCharCode(t),e};function NM(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=MM.get(t))!==null&&e!==void 0?e:t}var kt;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(kt||(kt={}));const OM=32;var Wr;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(Wr||(Wr={}));function cp(t){return t>=kt.ZERO&&t<=kt.NINE}function RM(t){return t>=kt.UPPER_A&&t<=kt.UPPER_F||t>=kt.LOWER_A&&t<=kt.LOWER_F}function IM(t){return t>=kt.UPPER_A&&t<=kt.UPPER_Z||t>=kt.LOWER_A&&t<=kt.LOWER_Z||cp(t)}function LM(t){return t===kt.EQUALS||IM(t)}var xt;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(xt||(xt={}));var lr;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(lr||(lr={}));class PM{constructor(e,n,r){this.decodeTree=e,this.emitCodePoint=n,this.errors=r,this.state=xt.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=lr.Strict}startEntity(e){this.decodeMode=e,this.state=xt.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case xt.EntityStart:return e.charCodeAt(n)===kt.NUM?(this.state=xt.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=xt.NamedEntity,this.stateNamedEntity(e,n));case xt.NumericStart:return this.stateNumericStart(e,n);case xt.NumericDecimal:return this.stateNumericDecimal(e,n);case xt.NumericHex:return this.stateNumericHex(e,n);case xt.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|OM)===kt.LOWER_X?(this.state=xt.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=xt.NumericDecimal,this.stateNumericDecimal(e,n))}addToNumericResult(e,n,r,i){if(n!==r){const s=r-n;this.result=this.result*Math.pow(i,s)+parseInt(e.substr(n,s),i),this.consumed+=s}}stateNumericHex(e,n){const r=n;for(;n<e.length;){const i=e.charCodeAt(n);if(cp(i)||RM(i))n+=1;else return this.addToNumericResult(e,r,n,16),this.emitNumericEntity(i,3)}return this.addToNumericResult(e,r,n,16),-1}stateNumericDecimal(e,n){const r=n;for(;n<e.length;){const i=e.charCodeAt(n);if(cp(i))n+=1;else return this.addToNumericResult(e,r,n,10),this.emitNumericEntity(i,2)}return this.addToNumericResult(e,r,n,10),-1}emitNumericEntity(e,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===kt.SEMI)this.consumed+=1;else if(this.decodeMode===lr.Strict)return 0;return this.emitCodePoint(NM(this.result),this.consumed),this.errors&&(e!==kt.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,n){const{decodeTree:r}=this;let i=r[this.treeIndex],s=(i&Wr.VALUE_LENGTH)>>14;for(;n<e.length;n++,this.excess++){const u=e.charCodeAt(n);if(this.treeIndex=FM(r,i,this.treeIndex+Math.max(1,s),u),this.treeIndex<0)return this.result===0||this.decodeMode===lr.Attribute&&(s===0||LM(u))?0:this.emitNotTerminatedNamedEntity();if(i=r[this.treeIndex],s=(i&Wr.VALUE_LENGTH)>>14,s!==0){if(u===kt.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==lr.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:n,decodeTree:r}=this,i=(r[n]&Wr.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[e]&~Wr.VALUE_LENGTH:i[e+1],r),n===3&&this.emitCodePoint(i[e+2],r),r}end(){var e;switch(this.state){case xt.NamedEntity:return this.result!==0&&(this.decodeMode!==lr.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case xt.NumericDecimal:return this.emitNumericEntity(0,2);case xt.NumericHex:return this.emitNumericEntity(0,3);case xt.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case xt.EntityStart:return 0}}}function dv(t){let e="";const n=new PM(t,r=>e+=DM(r));return function(i,s){let u=0,a=0;for(;(a=i.indexOf("&",a))>=0;){e+=i.slice(u,a),n.startEntity(s);const f=n.write(i,a+1);if(f<0){u=a+n.end();break}u=a+f,a=f===0?u+1:u}const c=e+i.slice(u);return e="",c}}function FM(t,e,n,r){const i=(e&Wr.BRANCH_LENGTH)>>7,s=e&Wr.JUMP_TABLE;if(i===0)return s!==0&&r===s?n:-1;if(s){const c=r-s;return c<0||c>=i?-1:t[n+c]-1}let u=n,a=u+i-1;for(;u<=a;){const c=u+a>>>1,f=t[c];if(f<r)u=c+1;else if(f>r)a=c-1;else return t[c+i]}return-1}const fv=dv(TM);dv(AM);function zM(t,e=lr.Legacy){return fv(t,e)}function jM(t){return fv(t,lr.Strict)}function BM(t){return Object.prototype.toString.call(t)}function l0(t){return BM(t)==="[object String]"}const $M=Object.prototype.hasOwnProperty;function VM(t,e){return $M.call(t,e)}function Sc(t){return Array.prototype.slice.call(arguments,1).forEach(function(n){if(n){if(typeof n!="object")throw new TypeError(n+"must be object");Object.keys(n).forEach(function(r){t[r]=n[r]})}}),t}function hv(t,e,n){return[].concat(t.slice(0,e),n,t.slice(e+1))}function a0(t){return!(t>=55296&&t<=57343||t>=64976&&t<=65007||(t&65535)===65535||(t&65535)===65534||t>=0&&t<=8||t===11||t>=14&&t<=31||t>=127&&t<=159||t>1114111)}function hu(t){if(t>65535){t-=65536;const e=55296+(t>>10),n=56320+(t&1023);return String.fromCharCode(e,n)}return String.fromCharCode(t)}const pv=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,HM=/&([a-z#][a-z0-9]{1,31});/gi,UM=new RegExp(pv.source+"|"+HM.source,"gi"),qM=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function WM(t,e){if(e.charCodeAt(0)===35&&qM.test(e)){const r=e[1].toLowerCase()==="x"?parseInt(e.slice(2),16):parseInt(e.slice(1),10);return a0(r)?hu(r):t}const n=zM(t);return n!==t?n:t}function KM(t){return t.indexOf("\\")<0?t:t.replace(pv,"$1")}function Fs(t){return t.indexOf("\\")<0&&t.indexOf("&")<0?t:t.replace(UM,function(e,n,r){return n||WM(e,r)})}const ZM=/[&<>"]/,JM=/[&<>"]/g,GM={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function QM(t){return GM[t]}function si(t){return ZM.test(t)?t.replace(JM,QM):t}const YM=/[.?*+^$[\]\\(){}|-]/g;function XM(t){return t.replace(YM,"\\$&")}function $e(t){switch(t){case 9:case 32:return!0}return!1}function pu(t){if(t>=8192&&t<=8202)return!0;switch(t){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function mv(t){return u0.test(t)||av.test(t)}function mu(t){return mv(hu(t))}function gu(t){switch(t){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function Ec(t){return t=t.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(t=t.replace(/ẞ/g,"ß")),t.toLowerCase().toUpperCase()}function k2(t){return t===32||t===9||t===10||t===13}function _c(t){let e=0;for(;e<t.length&&k2(t.charCodeAt(e));e++);let n=t.length-1;for(;n>=e&&k2(t.charCodeAt(n));n--);return t.slice(e,n+1)}const eD={mdurl:SM,ucmicro:_M},tD=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:hv,asciiTrim:_c,assign:Sc,escapeHtml:si,escapeRE:XM,fromCodePoint:hu,has:VM,isMdAsciiPunct:gu,isPunctChar:mv,isPunctCharCode:mu,isSpace:$e,isString:l0,isValidEntityCode:a0,isWhiteSpace:pu,lib:eD,normalizeReference:Ec,unescapeAll:Fs,unescapeMd:KM},Symbol.toStringTag,{value:"Module"}));function nD(t,e,n){let r,i,s,u;const a=t.posMax,c=t.pos;for(t.pos=e+1,r=1;t.pos<a;){if(s=t.src.charCodeAt(t.pos),s===93&&(r--,r===0)){i=!0;break}if(u=t.pos,t.md.inline.skipToken(t),s===91){if(u===t.pos-1)r++;else if(n)return t.pos=c,-1}}let f=-1;return i&&(f=t.pos),t.pos=c,f}function rD(t,e,n){let r,i=e;const s={ok:!1,pos:0,str:""};if(t.charCodeAt(i)===60){for(i++;i<n;){if(r=t.charCodeAt(i),r===10||r===60)return s;if(r===62)return s.pos=i+1,s.str=Fs(t.slice(e+1,i)),s.ok=!0,s;if(r===92&&i+1<n){i+=2;continue}i++}return s}let u=0;for(;i<n&&(r=t.charCodeAt(i),!(r===32||r<32||r===127));){if(r===92&&i+1<n){if(t.charCodeAt(i+1)===32)break;i+=2;continue}if(r===40&&(u++,u>32))return s;if(r===41){if(u===0)break;u--}i++}return e===i||u!==0||(s.str=Fs(t.slice(e,i)),s.pos=i,s.ok=!0),s}function iD(t,e,n,r){let i,s=e;const u={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(r)u.str=r.str,u.marker=r.marker;else{if(s>=n)return u;let a=t.charCodeAt(s);if(a!==34&&a!==39&&a!==40)return u;e++,s++,a===40&&(a=41),u.marker=a}for(;s<n;){if(i=t.charCodeAt(s),i===u.marker)return u.pos=s+1,u.str+=Fs(t.slice(e,s)),u.ok=!0,u;if(i===40&&u.marker===41)return u;i===92&&s+1<n&&s++,s++}return u.can_continue=!0,u.str+=Fs(t.slice(e,s)),u}const sD=Object.freeze(Object.defineProperty({__proto__:null,parseLinkDestination:rD,parseLinkLabel:nD,parseLinkTitle:iD},Symbol.toStringTag,{value:"Module"})),qn={};qn.code_inline=function(t,e,n,r,i){const s=t[e];return"<code"+i.renderAttrs(s)+">"+si(s.content)+"</code>"};qn.code_block=function(t,e,n,r,i){const s=t[e];return"<pre"+i.renderAttrs(s)+"><code>"+si(t[e].content)+`</code></pre>
371
- `};qn.fence=function(t,e,n,r,i){const s=t[e],u=s.info?Fs(s.info).trim():"";let a="",c="";if(u){const p=u.split(/(\s+)/g);a=p[0],c=p.slice(2).join("")}let f;if(n.highlight?f=n.highlight(s.content,a,c)||si(s.content):f=si(s.content),f.indexOf("<pre")===0)return f+`
372
- `;if(u){const p=s.attrIndex("class"),m=s.attrs?s.attrs.slice():[];p<0?m.push(["class",n.langPrefix+a]):(m[p]=m[p].slice(),m[p][1]+=" "+n.langPrefix+a);const y={attrs:m};return`<pre><code${i.renderAttrs(y)}>${f}</code></pre>
373
- `}return`<pre><code${i.renderAttrs(s)}>${f}</code></pre>
374
- `};qn.image=function(t,e,n,r,i){const s=t[e];return s.attrs[s.attrIndex("alt")][1]=i.renderInlineAsText(s.children,n,r),i.renderToken(t,e,n)};qn.hardbreak=function(t,e,n){return n.xhtmlOut?`<br />
375
- `:`<br>
376
- `};qn.softbreak=function(t,e,n){return n.breaks?n.xhtmlOut?`<br />
377
- `:`<br>
378
- `:`
379
- `};qn.text=function(t,e){return si(t[e].content)};qn.html_block=function(t,e){return t[e].content};qn.html_inline=function(t,e){return t[e].content};function js(){this.rules=Sc({},qn)}js.prototype.renderAttrs=function(e){let n,r,i;if(!e.attrs)return"";for(i="",n=0,r=e.attrs.length;n<r;n++)i+=" "+si(e.attrs[n][0])+'="'+si(e.attrs[n][1])+'"';return i};js.prototype.renderToken=function(e,n,r){const i=e[n];let s="";if(i.hidden)return"";i.block&&i.nesting!==-1&&n&&e[n-1].hidden&&(s+=`
380
- `),s+=(i.nesting===-1?"</":"<")+i.tag,s+=this.renderAttrs(i),i.nesting===0&&r.xhtmlOut&&(s+=" /");let u=!1;if(i.block&&(u=!0,i.nesting===1&&n+1<e.length)){const a=e[n+1];(a.type==="inline"||a.hidden||a.nesting===-1&&a.tag===i.tag)&&(u=!1)}return s+=u?`>
381
- `:">",s};js.prototype.renderInline=function(t,e,n){let r="";const i=this.rules;for(let s=0,u=t.length;s<u;s++){const a=t[s].type;typeof i[a]<"u"?r+=i[a](t,s,e,n,this):r+=this.renderToken(t,s,e)}return r};js.prototype.renderInlineAsText=function(t,e,n){let r="";for(let i=0,s=t.length;i<s;i++)switch(t[i].type){case"text":r+=t[i].content;break;case"image":r+=this.renderInlineAsText(t[i].children,e,n);break;case"html_inline":case"html_block":r+=t[i].content;break;case"softbreak":case"hardbreak":r+=`
382
- `;break}return r};js.prototype.render=function(t,e,n){let r="";const i=this.rules;for(let s=0,u=t.length;s<u;s++){const a=t[s].type;a==="inline"?r+=this.renderInline(t[s].children,e,n):typeof i[a]<"u"?r+=i[a](t,s,e,n,this):r+=this.renderToken(t,s,e,n)}return r};function Zt(){this.__rules__=[],this.__cache__=null}Zt.prototype.__find__=function(t){for(let e=0;e<this.__rules__.length;e++)if(this.__rules__[e].name===t)return e;return-1};Zt.prototype.__compile__=function(){const t=this,e=[""];t.__rules__.forEach(function(n){n.enabled&&n.alt.forEach(function(r){e.indexOf(r)<0&&e.push(r)})}),t.__cache__={},e.forEach(function(n){t.__cache__[n]=[],t.__rules__.forEach(function(r){r.enabled&&(n&&r.alt.indexOf(n)<0||t.__cache__[n].push(r.fn))})})};Zt.prototype.at=function(t,e,n){const r=this.__find__(t),i=n||{};if(r===-1)throw new Error("Parser rule not found: "+t);this.__rules__[r].fn=e,this.__rules__[r].alt=i.alt||[],this.__cache__=null};Zt.prototype.before=function(t,e,n,r){const i=this.__find__(t),s=r||{};if(i===-1)throw new Error("Parser rule not found: "+t);this.__rules__.splice(i,0,{name:e,enabled:!0,fn:n,alt:s.alt||[]}),this.__cache__=null};Zt.prototype.after=function(t,e,n,r){const i=this.__find__(t),s=r||{};if(i===-1)throw new Error("Parser rule not found: "+t);this.__rules__.splice(i+1,0,{name:e,enabled:!0,fn:n,alt:s.alt||[]}),this.__cache__=null};Zt.prototype.push=function(t,e,n){const r=n||{};this.__rules__.push({name:t,enabled:!0,fn:e,alt:r.alt||[]}),this.__cache__=null};Zt.prototype.enable=function(t,e){Array.isArray(t)||(t=[t]);const n=[];return t.forEach(function(r){const i=this.__find__(r);if(i<0){if(e)return;throw new Error("Rules manager: invalid rule name "+r)}this.__rules__[i].enabled=!0,n.push(r)},this),this.__cache__=null,n};Zt.prototype.enableOnly=function(t,e){Array.isArray(t)||(t=[t]),this.__rules__.forEach(function(n){n.enabled=!1}),this.enable(t,e)};Zt.prototype.disable=function(t,e){Array.isArray(t)||(t=[t]);const n=[];return t.forEach(function(r){const i=this.__find__(r);if(i<0){if(e)return;throw new Error("Rules manager: invalid rule name "+r)}this.__rules__[i].enabled=!1,n.push(r)},this),this.__cache__=null,n};Zt.prototype.getRules=function(t){return this.__cache__===null&&this.__compile__(),this.__cache__[t]||[]};function Dn(t,e,n){this.type=t,this.tag=e,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}Dn.prototype.attrIndex=function(e){if(!this.attrs)return-1;const n=this.attrs;for(let r=0,i=n.length;r<i;r++)if(n[r][0]===e)return r;return-1};Dn.prototype.attrPush=function(e){this.attrs?this.attrs.push(e):this.attrs=[e]};Dn.prototype.attrSet=function(e,n){const r=this.attrIndex(e),i=[e,n];r<0?this.attrPush(i):this.attrs[r]=i};Dn.prototype.attrGet=function(e){const n=this.attrIndex(e);let r=null;return n>=0&&(r=this.attrs[n][1]),r};Dn.prototype.attrJoin=function(e,n){const r=this.attrIndex(e);r<0?this.attrPush([e,n]):this.attrs[r][1]=this.attrs[r][1]+" "+n};function gv(t,e,n){this.src=t,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=e}gv.prototype.Token=Dn;const oD=/\r\n?|\n/g,uD=/\0/g;function lD(t){let e;e=t.src.replace(oD,`
383
- `),e=e.replace(uD,"�"),t.src=e}function aD(t){let e;t.inlineMode?(e=new t.Token("inline","",0),e.content=t.src,e.map=[0,1],e.children=[],t.tokens.push(e)):t.md.block.parse(t.src,t.md,t.env,t.tokens)}function cD(t){const e=t.tokens;for(let n=0,r=e.length;n<r;n++){const i=e[n];i.type==="inline"&&t.md.inline.parse(i.content,t.md,t.env,i.children)}}function dD(t){return/^<a[>\s]/i.test(t)}function fD(t){return/^<\/a\s*>/i.test(t)}function hD(t){const e=t.tokens;if(t.md.options.linkify)for(let n=0,r=e.length;n<r;n++){if(e[n].type!=="inline"||!t.md.linkify.pretest(e[n].content))continue;let i=e[n].children,s=0;for(let u=i.length-1;u>=0;u--){const a=i[u];if(a.type==="link_close"){for(u--;i[u].level!==a.level&&i[u].type!=="link_open";)u--;continue}if(a.type==="html_inline"&&(dD(a.content)&&s>0&&s--,fD(a.content)&&s++),!(s>0)&&a.type==="text"&&t.md.linkify.test(a.content)){const c=a.content;let f=t.md.linkify.match(c);const p=[];let m=a.level,y=0;f.length>0&&f[0].index===0&&u>0&&i[u-1].type==="text_special"&&(f=f.slice(1));for(let x=0;x<f.length;x++){const b=f[x].url,v=t.md.normalizeLink(b);if(!t.md.validateLink(v))continue;let w=f[x].text;f[x].schema?f[x].schema==="mailto:"&&!/^mailto:/i.test(w)?w=t.md.normalizeLinkText("mailto:"+w).replace(/^mailto:/,""):w=t.md.normalizeLinkText(w):w=t.md.normalizeLinkText("http://"+w).replace(/^http:\/\//,"");const S=f[x].index;if(S>y){const P=new t.Token("text","",0);P.content=c.slice(y,S),P.level=m,p.push(P)}const A=new t.Token("link_open","a",1);A.attrs=[["href",v]],A.level=m++,A.markup="linkify",A.info="auto",p.push(A);const R=new t.Token("text","",0);R.content=w,R.level=m,p.push(R);const I=new t.Token("link_close","a",-1);I.level=--m,I.markup="linkify",I.info="auto",p.push(I),y=f[x].lastIndex}if(y<c.length){const x=new t.Token("text","",0);x.content=c.slice(y),x.level=m,p.push(x)}e[n].children=i=hv(i,u,p)}}}}const yv=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,pD=/\((c|tm|r)\)/i,mD=/\((c|tm|r)\)/ig,gD={c:"©",r:"®",tm:"™"};function yD(t,e){return gD[e.toLowerCase()]}function xD(t){let e=0;for(let n=t.length-1;n>=0;n--){const r=t[n];r.type==="text"&&!e&&(r.content=r.content.replace(mD,yD)),r.type==="link_open"&&r.info==="auto"&&e--,r.type==="link_close"&&r.info==="auto"&&e++}}function kD(t){let e=0;for(let n=t.length-1;n>=0;n--){const r=t[n];r.type==="text"&&!e&&yv.test(r.content)&&(r.content=r.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),r.type==="link_open"&&r.info==="auto"&&e--,r.type==="link_close"&&r.info==="auto"&&e++}}function bD(t){let e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)t.tokens[e].type==="inline"&&(pD.test(t.tokens[e].content)&&xD(t.tokens[e].children),yv.test(t.tokens[e].content)&&kD(t.tokens[e].children))}const vD=/['"]/,b2=/['"]/g,v2="’";function na(t,e,n,r){t[e]||(t[e]=[]),t[e].push({pos:n,ch:r})}function wD(t,e){let n="",r=0;e.sort((i,s)=>i.pos-s.pos);for(let i=0;i<e.length;i++){const s=e[i];n+=t.slice(r,s.pos)+s.ch,r=s.pos+1}return n+t.slice(r)}function CD(t,e){let n;const r=[],i={};for(let s=0;s<t.length;s++){const u=t[s],a=t[s].level;for(n=r.length-1;n>=0&&!(r[n].level<=a);n--);if(r.length=n+1,u.type!=="text")continue;const c=u.content;let f=0;const p=c.length;e:for(;f<p;){b2.lastIndex=f;const m=b2.exec(c);if(!m)break;let y=!0,x=!0;f=m.index+1;const b=m[0]==="'";let v=32;if(m.index-1>=0)v=c.charCodeAt(m.index-1);else for(n=s-1;n>=0&&!(t[n].type==="softbreak"||t[n].type==="hardbreak");n--)if(t[n].content){v=t[n].content.charCodeAt(t[n].content.length-1);break}let w=32;if(f<p)w=c.charCodeAt(f);else for(n=s+1;n<t.length&&!(t[n].type==="softbreak"||t[n].type==="hardbreak");n++)if(t[n].content){w=t[n].content.charCodeAt(0);break}const S=gu(v)||mu(v),A=gu(w)||mu(w),R=pu(v),I=pu(w);if(I?y=!1:A&&(R||S||(y=!1)),R?x=!1:S&&(I||A||(x=!1)),w===34&&m[0]==='"'&&v>=48&&v<=57&&(x=y=!1),y&&x&&(y=S,x=A),!y&&!x){b&&na(i,s,m.index,v2);continue}if(x)for(n=r.length-1;n>=0;n--){let P=r[n];if(r[n].level<a)break;if(P.single===b&&r[n].level===a){P=r[n];let F,z;b?(F=e.md.options.quotes[2],z=e.md.options.quotes[3]):(F=e.md.options.quotes[0],z=e.md.options.quotes[1]),na(i,s,m.index,z),na(i,P.token,P.pos,F),r.length=n;continue e}}y?r.push({token:s,pos:m.index,single:b,level:a}):x&&b&&na(i,s,m.index,v2)}}Object.keys(i).forEach(function(s){t[s].content=wD(t[s].content,i[s])})}function SD(t){if(t.md.options.typographer)for(let e=t.tokens.length-1;e>=0;e--)t.tokens[e].type!=="inline"||!vD.test(t.tokens[e].content)||CD(t.tokens[e].children,t)}function ED(t){let e,n;const r=t.tokens,i=r.length;for(let s=0;s<i;s++){if(r[s].type!=="inline")continue;const u=r[s].children,a=u.length;for(e=0;e<a;e++)u[e].type==="text_special"&&(u[e].type="text");for(e=n=0;e<a;e++)u[e].type==="text"&&e+1<a&&u[e+1].type==="text"?u[e+1].content=u[e].content+u[e+1].content:(e!==n&&(u[n]=u[e]),n++);e!==n&&(u.length=n)}}const ch=[["normalize",lD],["block",aD],["inline",cD],["linkify",hD],["replacements",bD],["smartquotes",SD],["text_join",ED]];function c0(){this.ruler=new Zt;for(let t=0;t<ch.length;t++)this.ruler.push(ch[t][0],ch[t][1])}c0.prototype.process=function(t){const e=this.ruler.getRules("");for(let n=0,r=e.length;n<r;n++)e[n](t)};c0.prototype.State=gv;function Wn(t,e,n,r){this.src=t,this.md=e,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 s=0,u=0,a=0,c=0,f=i.length,p=!1;u<f;u++){const m=i.charCodeAt(u);if(!p)if($e(m)){a++,m===9?c+=4-c%4:c++;continue}else p=!0;(m===10||u===f-1)&&(m!==10&&u++,this.bMarks.push(s),this.eMarks.push(u),this.tShift.push(a),this.sCount.push(c),this.bsCount.push(0),p=!1,a=0,c=0,s=u+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}Wn.prototype.push=function(t,e,n){const r=new Dn(t,e,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r};Wn.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]};Wn.prototype.skipEmptyLines=function(e){for(let n=this.lineMax;e<n&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e};Wn.prototype.skipSpaces=function(e){for(let n=this.src.length;e<n;e++){const r=this.src.charCodeAt(e);if(!$e(r))break}return e};Wn.prototype.skipSpacesBack=function(e,n){if(e<=n)return e;for(;e>n;)if(!$e(this.src.charCodeAt(--e)))return e+1;return e};Wn.prototype.skipChars=function(e,n){for(let r=this.src.length;e<r&&this.src.charCodeAt(e)===n;e++);return e};Wn.prototype.skipCharsBack=function(e,n,r){if(e<=r)return e;for(;e>r;)if(n!==this.src.charCodeAt(--e))return e+1;return e};Wn.prototype.getLines=function(e,n,r,i){if(e>=n)return"";const s=new Array(n-e);for(let u=0,a=e;a<n;a++,u++){let c=0;const f=this.bMarks[a];let p=f,m;for(a+1<n||i?m=this.eMarks[a]+1:m=this.eMarks[a];p<m&&c<r;){const y=this.src.charCodeAt(p);if($e(y))y===9?c+=4-(c+this.bsCount[a])%4:c++;else if(p-f<this.tShift[a])c++;else break;p++}c>r?s[u]=new Array(c-r+1).join(" ")+this.src.slice(p,m):s[u]=this.src.slice(p,m)}return s.join("")};Wn.prototype.Token=Dn;const _D=65536;function dh(t,e){const n=t.bMarks[e]+t.tShift[e],r=t.eMarks[e];return t.src.slice(n,r)}function w2(t){const e=[],n=t.length;let r=0,i=t.charCodeAt(r),s=!1,u=0,a="";for(;r<n;)i===124&&(s?(a+=t.substring(u,r-1),u=r):(e.push(a+t.substring(u,r)),a="",u=r+1)),s=i===92,r++,i=t.charCodeAt(r);return e.push(a+t.substring(u)),e}function TD(t,e,n,r){if(e+2>n)return!1;let i=e+1;if(t.sCount[i]<t.blkIndent||t.sCount[i]-t.blkIndent>=4)return!1;let s=t.bMarks[i]+t.tShift[i];if(s>=t.eMarks[i])return!1;const u=t.src.charCodeAt(s++);if(u!==124&&u!==45&&u!==58||s>=t.eMarks[i])return!1;const a=t.src.charCodeAt(s++);if(a!==124&&a!==45&&a!==58&&!$e(a)||u===45&&$e(a))return!1;for(;s<t.eMarks[i];){const I=t.src.charCodeAt(s);if(I!==124&&I!==45&&I!==58&&!$e(I))return!1;s++}let c=dh(t,e+1),f=c.split("|");const p=[];for(let I=0;I<f.length;I++){const P=f[I].trim();if(!P){if(I===0||I===f.length-1)continue;return!1}if(!/^:?-+:?$/.test(P))return!1;P.charCodeAt(P.length-1)===58?p.push(P.charCodeAt(0)===58?"center":"right"):P.charCodeAt(0)===58?p.push("left"):p.push("")}if(c=dh(t,e).trim(),c.indexOf("|")===-1||t.sCount[e]-t.blkIndent>=4)return!1;f=w2(c),f.length&&f[0]===""&&f.shift(),f.length&&f[f.length-1]===""&&f.pop();const m=f.length;if(m===0||m!==p.length)return!1;if(r)return!0;const y=t.parentType;t.parentType="table";const x=t.md.block.ruler.getRules("blockquote"),b=t.push("table_open","table",1),v=[e,0];b.map=v;const w=t.push("thead_open","thead",1);w.map=[e,e+1];const S=t.push("tr_open","tr",1);S.map=[e,e+1];for(let I=0;I<f.length;I++){const P=t.push("th_open","th",1);p[I]&&(P.attrs=[["style","text-align:"+p[I]]]);const F=t.push("inline","",0);F.content=f[I].trim(),F.children=[],t.push("th_close","th",-1)}t.push("tr_close","tr",-1),t.push("thead_close","thead",-1);let A,R=0;for(i=e+2;i<n&&!(t.sCount[i]<t.blkIndent);i++){let I=!1;for(let F=0,z=x.length;F<z;F++)if(x[F](t,i,n,!0)){I=!0;break}if(I||(c=dh(t,i).trim(),!c)||t.sCount[i]-t.blkIndent>=4||(f=w2(c),f.length&&f[0]===""&&f.shift(),f.length&&f[f.length-1]===""&&f.pop(),R+=m-f.length,R>_D))break;if(i===e+2){const F=t.push("tbody_open","tbody",1);F.map=A=[e+2,0]}const P=t.push("tr_open","tr",1);P.map=[i,i+1];for(let F=0;F<m;F++){const z=t.push("td_open","td",1);p[F]&&(z.attrs=[["style","text-align:"+p[F]]]);const Q=t.push("inline","",0);Q.content=f[F]?f[F].trim():"",Q.children=[],t.push("td_close","td",-1)}t.push("tr_close","tr",-1)}return A&&(t.push("tbody_close","tbody",-1),A[1]=i),t.push("table_close","table",-1),v[1]=i,t.parentType=y,t.line=i,!0}function AD(t,e,n){if(t.sCount[e]-t.blkIndent<4)return!1;let r=e+1,i=r;for(;r<n;){if(t.isEmpty(r)){r++;continue}if(t.sCount[r]-t.blkIndent>=4){r++,i=r;continue}break}t.line=i;const s=t.push("code_block","code",0);return s.content=t.getLines(e,i,4+t.blkIndent,!1)+`
384
- `,s.map=[e,t.line],!0}function MD(t,e,n,r){let i=t.bMarks[e]+t.tShift[e],s=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||i+3>s)return!1;const u=t.src.charCodeAt(i);if(u!==126&&u!==96)return!1;let a=i;i=t.skipChars(i,u);let c=i-a;if(c<3)return!1;const f=t.src.slice(a,i),p=t.src.slice(i,s);if(u===96&&p.indexOf(String.fromCharCode(u))>=0)return!1;if(r)return!0;let m=e,y=!1;for(;m++,!(m>=n||(i=a=t.bMarks[m]+t.tShift[m],s=t.eMarks[m],i<s&&t.sCount[m]<t.blkIndent));)if(t.src.charCodeAt(i)===u&&!(t.sCount[m]-t.blkIndent>=4)&&(i=t.skipChars(i,u),!(i-a<c)&&(i=t.skipSpaces(i),!(i<s)))){y=!0;break}c=t.sCount[e],t.line=m+(y?1:0);const x=t.push("fence","code",0);return x.info=p,x.content=t.getLines(e+1,m,c,!0),x.markup=f,x.map=[e,t.line],!0}function DD(t,e,n,r){let i=t.bMarks[e]+t.tShift[e],s=t.eMarks[e];const u=t.lineMax;if(t.sCount[e]-t.blkIndent>=4||t.src.charCodeAt(i)!==62)return!1;if(r)return!0;const a=[],c=[],f=[],p=[],m=t.md.block.ruler.getRules("blockquote"),y=t.parentType;t.parentType="blockquote";let x=!1,b;for(b=e;b<n;b++){const R=t.sCount[b]<t.blkIndent;if(i=t.bMarks[b]+t.tShift[b],s=t.eMarks[b],i>=s)break;if(t.src.charCodeAt(i++)===62&&!R){let P=t.sCount[b]+1,F,z;t.src.charCodeAt(i)===32?(i++,P++,z=!1,F=!0):t.src.charCodeAt(i)===9?(F=!0,(t.bsCount[b]+P)%4===3?(i++,P++,z=!1):z=!0):F=!1;let Q=P;for(a.push(t.bMarks[b]),t.bMarks[b]=i;i<s;){const ue=t.src.charCodeAt(i);if($e(ue))ue===9?Q+=4-(Q+t.bsCount[b]+(z?1:0))%4:Q++;else break;i++}x=i>=s,c.push(t.bsCount[b]),t.bsCount[b]=t.sCount[b]+1+(F?1:0),f.push(t.sCount[b]),t.sCount[b]=Q-P,p.push(t.tShift[b]),t.tShift[b]=i-t.bMarks[b];continue}if(x)break;let I=!1;for(let P=0,F=m.length;P<F;P++)if(m[P](t,b,n,!0)){I=!0;break}if(I){t.lineMax=b,t.blkIndent!==0&&(a.push(t.bMarks[b]),c.push(t.bsCount[b]),p.push(t.tShift[b]),f.push(t.sCount[b]),t.sCount[b]-=t.blkIndent);break}a.push(t.bMarks[b]),c.push(t.bsCount[b]),p.push(t.tShift[b]),f.push(t.sCount[b]),t.sCount[b]=-1}const v=t.blkIndent;t.blkIndent=0;const w=t.push("blockquote_open","blockquote",1);w.markup=">";const S=[e,0];w.map=S,t.md.block.tokenize(t,e,b);const A=t.push("blockquote_close","blockquote",-1);A.markup=">",t.lineMax=u,t.parentType=y,S[1]=t.line;for(let R=0;R<p.length;R++)t.bMarks[R+e]=a[R],t.tShift[R+e]=p[R],t.sCount[R+e]=f[R],t.bsCount[R+e]=c[R];return t.blkIndent=v,!0}function ND(t,e,n,r){const i=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;let s=t.bMarks[e]+t.tShift[e];const u=t.src.charCodeAt(s++);if(u!==42&&u!==45&&u!==95)return!1;let a=1;for(;s<i;){const f=t.src.charCodeAt(s++);if(f!==u&&!$e(f))return!1;f===u&&a++}if(a<3)return!1;if(r)return!0;t.line=e+1;const c=t.push("hr","hr",0);return c.map=[e,t.line],c.markup=Array(a+1).join(String.fromCharCode(u)),!0}function C2(t,e){const n=t.eMarks[e];let r=t.bMarks[e]+t.tShift[e];const i=t.src.charCodeAt(r++);if(i!==42&&i!==45&&i!==43)return-1;if(r<n){const s=t.src.charCodeAt(r);if(!$e(s))return-1}return r}function S2(t,e){const n=t.bMarks[e]+t.tShift[e],r=t.eMarks[e];let i=n;if(i+1>=r)return-1;let s=t.src.charCodeAt(i++);if(s<48||s>57)return-1;for(;;){if(i>=r)return-1;if(s=t.src.charCodeAt(i++),s>=48&&s<=57){if(i-n>=10)return-1;continue}if(s===41||s===46)break;return-1}return i<r&&(s=t.src.charCodeAt(i),!$e(s))?-1:i}function OD(t,e){const n=t.level+2;for(let r=e+2,i=t.tokens.length-2;r<i;r++)t.tokens[r].level===n&&t.tokens[r].type==="paragraph_open"&&(t.tokens[r+2].hidden=!0,t.tokens[r].hidden=!0,r+=2)}function RD(t,e,n,r){let i,s,u,a,c=e,f=!0;if(t.sCount[c]-t.blkIndent>=4||t.listIndent>=0&&t.sCount[c]-t.listIndent>=4&&t.sCount[c]<t.blkIndent)return!1;let p=!1;r&&t.parentType==="paragraph"&&t.sCount[c]>=t.blkIndent&&(p=!0);let m,y,x;if((x=S2(t,c))>=0){if(m=!0,u=t.bMarks[c]+t.tShift[c],y=Number(t.src.slice(u,x-1)),p&&y!==1)return!1}else if((x=C2(t,c))>=0)m=!1;else return!1;if(p&&t.skipSpaces(x)>=t.eMarks[c])return!1;if(r)return!0;const b=t.src.charCodeAt(x-1),v=t.tokens.length;m?(a=t.push("ordered_list_open","ol",1),y!==1&&(a.attrs=[["start",y]])):a=t.push("bullet_list_open","ul",1);const w=[c,0];a.map=w,a.markup=String.fromCharCode(b);let S=!1;const A=t.md.block.ruler.getRules("list"),R=t.parentType;for(t.parentType="list";c<n;){s=x,i=t.eMarks[c];const I=t.sCount[c]+x-(t.bMarks[c]+t.tShift[c]);let P=I;for(;s<i;){const ye=t.src.charCodeAt(s);if(ye===9)P+=4-(P+t.bsCount[c])%4;else if(ye===32)P++;else break;s++}const F=s;let z;F>=i?z=1:z=P-I,z>4&&(z=1);const Q=I+z;a=t.push("list_item_open","li",1),a.markup=String.fromCharCode(b);const ue=[c,0];a.map=ue,m&&(a.info=t.src.slice(u,x-1));const Ce=t.tight,rt=t.tShift[c],Je=t.sCount[c],Te=t.listIndent;if(t.listIndent=t.blkIndent,t.blkIndent=Q,t.tight=!0,t.tShift[c]=F-t.bMarks[c],t.sCount[c]=P,F>=i&&t.isEmpty(c+1)?t.line=Math.min(t.line+2,n):t.md.block.tokenize(t,c,n,!0),(!t.tight||S)&&(f=!1),S=t.line-c>1&&t.isEmpty(t.line-1),t.blkIndent=t.listIndent,t.listIndent=Te,t.tShift[c]=rt,t.sCount[c]=Je,t.tight=Ce,a=t.push("list_item_close","li",-1),a.markup=String.fromCharCode(b),c=t.line,ue[1]=c,c>=n||t.sCount[c]<t.blkIndent||t.sCount[c]-t.blkIndent>=4)break;let Se=!1;for(let ye=0,Ge=A.length;ye<Ge;ye++)if(A[ye](t,c,n,!0)){Se=!0;break}if(Se)break;if(m){if(x=S2(t,c),x<0)break;u=t.bMarks[c]+t.tShift[c]}else if(x=C2(t,c),x<0)break;if(b!==t.src.charCodeAt(x-1))break}return m?a=t.push("ordered_list_close","ol",-1):a=t.push("bullet_list_close","ul",-1),a.markup=String.fromCharCode(b),w[1]=c,t.line=c,t.parentType=R,f&&OD(t,v),!0}function ID(t,e,n,r){let i=t.bMarks[e]+t.tShift[e],s=t.eMarks[e],u=e+1;if(t.sCount[e]-t.blkIndent>=4||t.src.charCodeAt(i)!==91)return!1;function a(A){const R=t.lineMax;if(A>=R||t.isEmpty(A))return null;let I=!1;if(t.sCount[A]-t.blkIndent>3&&(I=!0),t.sCount[A]<0&&(I=!0),!I){const z=t.md.block.ruler.getRules("reference"),Q=t.parentType;t.parentType="reference";let ue=!1;for(let Ce=0,rt=z.length;Ce<rt;Ce++)if(z[Ce](t,A,R,!0)){ue=!0;break}if(t.parentType=Q,ue)return null}const P=t.bMarks[A]+t.tShift[A],F=t.eMarks[A];return t.src.slice(P,F+1)}let c=t.src.slice(i,s+1);s=c.length;let f=-1;for(i=1;i<s;i++){const A=c.charCodeAt(i);if(A===91)return!1;if(A===93){f=i;break}else if(A===10){const R=a(u);R!==null&&(c+=R,s=c.length,u++)}else if(A===92&&(i++,i<s&&c.charCodeAt(i)===10)){const R=a(u);R!==null&&(c+=R,s=c.length,u++)}}if(f<0||c.charCodeAt(f+1)!==58)return!1;for(i=f+2;i<s;i++){const A=c.charCodeAt(i);if(A===10){const R=a(u);R!==null&&(c+=R,s=c.length,u++)}else if(!$e(A))break}const p=t.md.helpers.parseLinkDestination(c,i,s);if(!p.ok)return!1;const m=t.md.normalizeLink(p.str);if(!t.md.validateLink(m))return!1;i=p.pos;const y=i,x=u,b=i;for(;i<s;i++){const A=c.charCodeAt(i);if(A===10){const R=a(u);R!==null&&(c+=R,s=c.length,u++)}else if(!$e(A))break}let v=t.md.helpers.parseLinkTitle(c,i,s);for(;v.can_continue;){const A=a(u);if(A===null)break;c+=A,i=s,s=c.length,u++,v=t.md.helpers.parseLinkTitle(c,i,s,v)}let w;for(i<s&&b!==i&&v.ok?(w=v.str,i=v.pos):(w="",i=y,u=x);i<s;){const A=c.charCodeAt(i);if(!$e(A))break;i++}if(i<s&&c.charCodeAt(i)!==10&&w)for(w="",i=y,u=x;i<s;){const A=c.charCodeAt(i);if(!$e(A))break;i++}if(i<s&&c.charCodeAt(i)!==10)return!1;const S=Ec(c.slice(1,f));return S?(r||(typeof t.env.references>"u"&&(t.env.references={}),typeof t.env.references[S]>"u"&&(t.env.references[S]={title:w,href:m}),t.line=u),!0):!1}const LD=["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"],PD="[a-zA-Z_:][a-zA-Z0-9:._-]*",FD="[^\"'=<>`\\x00-\\x20]+",zD="'[^']*'",jD='"[^"]*"',BD="(?:"+FD+"|"+zD+"|"+jD+")",$D="(?:\\s+"+PD+"(?:\\s*=\\s*"+BD+")?)",xv="<[A-Za-z][A-Za-z0-9\\-]*"+$D+"*\\s*\\/?>",kv="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",VD="<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->",HD="<[?][\\s\\S]*?[?]>",UD="<![A-Za-z][^>]*>",qD="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",WD=new RegExp("^(?:"+xv+"|"+kv+"|"+VD+"|"+HD+"|"+UD+"|"+qD+")"),KD=new RegExp("^(?:"+xv+"|"+kv+")"),Ci=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+LD.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(KD.source+"\\s*$"),/^$/,!1]];function ZD(t,e,n,r){let i=t.bMarks[e]+t.tShift[e],s=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||!t.md.options.html||t.src.charCodeAt(i)!==60)return!1;let u=t.src.slice(i,s),a=0;for(;a<Ci.length&&!Ci[a][0].test(u);a++);if(a===Ci.length)return!1;if(r)return Ci[a][2];let c=e+1;const f=Ci[a][1].test("");if(!Ci[a][1].test(u)){for(;c<n&&!(t.sCount[c]<t.blkIndent&&(f||!t.isEmpty(c)));c++)if(i=t.bMarks[c]+t.tShift[c],s=t.eMarks[c],u=t.src.slice(i,s),Ci[a][1].test(u)){u.length!==0&&c++;break}}t.line=c;const p=t.push("html_block","",0);return p.map=[e,c],p.content=t.getLines(e,c,t.blkIndent,!0),!0}function JD(t,e,n,r){let i=t.bMarks[e]+t.tShift[e],s=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;let u=t.src.charCodeAt(i);if(u!==35||i>=s)return!1;let a=1;for(u=t.src.charCodeAt(++i);u===35&&i<s&&a<=6;)a++,u=t.src.charCodeAt(++i);if(a>6||i<s&&!$e(u))return!1;if(r)return!0;s=t.skipSpacesBack(s,i);const c=t.skipCharsBack(s,35,i);c>i&&$e(t.src.charCodeAt(c-1))&&(s=c),t.line=e+1;const f=t.push("heading_open","h"+String(a),1);f.markup="########".slice(0,a),f.map=[e,t.line];const p=t.push("inline","",0);p.content=_c(t.src.slice(i,s)),p.map=[e,t.line],p.children=[];const m=t.push("heading_close","h"+String(a),-1);return m.markup="########".slice(0,a),!0}function GD(t,e,n){const r=t.md.block.ruler.getRules("paragraph");if(t.sCount[e]-t.blkIndent>=4)return!1;const i=t.parentType;t.parentType="paragraph";let s=0,u,a=e+1;for(;a<n&&!t.isEmpty(a);a++){if(t.sCount[a]-t.blkIndent>3)continue;if(t.sCount[a]>=t.blkIndent){let x=t.bMarks[a]+t.tShift[a];const b=t.eMarks[a];if(x<b&&(u=t.src.charCodeAt(x),(u===45||u===61)&&(x=t.skipChars(x,u),x=t.skipSpaces(x),x>=b))){s=u===61?1:2;break}}if(t.sCount[a]<0)continue;let y=!1;for(let x=0,b=r.length;x<b;x++)if(r[x](t,a,n,!0)){y=!0;break}if(y)break}if(!s)return t.parentType=i,!1;const c=_c(t.getLines(e,a,t.blkIndent,!1));t.line=a+1;const f=t.push("heading_open","h"+String(s),1);f.markup=String.fromCharCode(u),f.map=[e,t.line];const p=t.push("inline","",0);p.content=c,p.map=[e,t.line-1],p.children=[];const m=t.push("heading_close","h"+String(s),-1);return m.markup=String.fromCharCode(u),t.parentType=i,!0}function QD(t,e,n){const r=t.md.block.ruler.getRules("paragraph"),i=t.parentType;let s=e+1;for(t.parentType="paragraph";s<n&&!t.isEmpty(s);s++){if(t.sCount[s]-t.blkIndent>3||t.sCount[s]<0)continue;let f=!1;for(let p=0,m=r.length;p<m;p++)if(r[p](t,s,n,!0)){f=!0;break}if(f)break}const u=_c(t.getLines(e,s,t.blkIndent,!1));t.line=s;const a=t.push("paragraph_open","p",1);a.map=[e,t.line];const c=t.push("inline","",0);return c.content=u,c.map=[e,t.line],c.children=[],t.push("paragraph_close","p",-1),t.parentType=i,!0}const ra=[["table",TD,["paragraph","reference"]],["code",AD],["fence",MD,["paragraph","reference","blockquote","list"]],["blockquote",DD,["paragraph","reference","blockquote","list"]],["hr",ND,["paragraph","reference","blockquote","list"]],["list",RD,["paragraph","reference","blockquote"]],["reference",ID],["html_block",ZD,["paragraph","reference","blockquote"]],["heading",JD,["paragraph","reference","blockquote"]],["lheading",GD],["paragraph",QD]];function Tc(){this.ruler=new Zt;for(let t=0;t<ra.length;t++)this.ruler.push(ra[t][0],ra[t][1],{alt:(ra[t][2]||[]).slice()})}Tc.prototype.tokenize=function(t,e,n){const r=this.ruler.getRules(""),i=r.length,s=t.md.options.maxNesting;let u=e,a=!1;for(;u<n&&(t.line=u=t.skipEmptyLines(u),!(u>=n||t.sCount[u]<t.blkIndent));){if(t.level>=s){t.line=n;break}const c=t.line;let f=!1;for(let p=0;p<i;p++)if(f=r[p](t,u,n,!1),f){if(c>=t.line)throw new Error("block rule didn't increment state.line");break}if(!f)throw new Error("none of the block rules matched");t.tight=!a,t.isEmpty(t.line-1)&&(a=!0),u=t.line,u<n&&t.isEmpty(u)&&(a=!0,u++,t.line=u)}};Tc.prototype.parse=function(t,e,n,r){if(!t)return;const i=new this.State(t,e,n,r);this.tokenize(i,i.line,i.lineMax)};Tc.prototype.State=Wn;function Au(t,e,n,r){this.src=t,this.env=n,this.md=e,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}Au.prototype.pushPending=function(){const t=new Dn("text","",0);return t.content=this.pending,t.level=this.pendingLevel,this.tokens.push(t),this.pending="",t};Au.prototype.push=function(t,e,n){this.pending&&this.pushPending();const r=new Dn(t,e,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};Au.prototype.scanDelims=function(t,e){const n=this.posMax,r=this.src.charCodeAt(t);let i;if(t===0)i=32;else if(t===1)i=this.src.charCodeAt(0),(i&63488)===55296&&(i=65533);else if(i=this.src.charCodeAt(t-1),(i&64512)===56320){const w=this.src.charCodeAt(t-2);i=(w&64512)===55296?65536+(w-55296<<10)+(i-56320):65533}else(i&64512)===55296&&(i=65533);let s=t;for(;s<n&&this.src.charCodeAt(s)===r;)s++;const u=s-t;let a=s<n?this.src.charCodeAt(s):32;if((a&64512)===55296){const w=this.src.charCodeAt(s+1);a=(w&64512)===56320?65536+(a-55296<<10)+(w-56320):65533}else(a&64512)===56320&&(a=65533);const c=gu(i)||mu(i),f=gu(a)||mu(a),p=pu(i),m=pu(a),y=!m&&(!f||p||c),x=!p&&(!c||m||f);return{can_open:y&&(e||!x||c),can_close:x&&(e||!y||f),length:u}};Au.prototype.Token=Dn;function YD(t){switch(t){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 XD(t,e){let n=t.pos;for(;n<t.posMax&&!YD(t.src.charCodeAt(n));)n++;return n===t.pos?!1:(e||(t.pending+=t.src.slice(t.pos,n)),t.pos=n,!0)}const eN=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function tN(t,e){if(!t.md.options.linkify||t.linkLevel>0)return!1;const n=t.pos,r=t.posMax;if(n+3>r||t.src.charCodeAt(n)!==58||t.src.charCodeAt(n+1)!==47||t.src.charCodeAt(n+2)!==47)return!1;const i=t.pending.match(eN);if(!i)return!1;const s=i[1],u=t.md.linkify.matchAtStart(t.src.slice(n-s.length));if(!u)return!1;let a=u.url;if(a.length<=s.length)return!1;let c=a.length;for(;c>0&&a.charCodeAt(c-1)===42;)c--;c!==a.length&&(a=a.slice(0,c));const f=t.md.normalizeLink(a);if(!t.md.validateLink(f))return!1;if(!e){t.pending=t.pending.slice(0,-s.length);const p=t.push("link_open","a",1);p.attrs=[["href",f]],p.markup="linkify",p.info="auto";const m=t.push("text","",0);m.content=t.md.normalizeLinkText(a);const y=t.push("link_close","a",-1);y.markup="linkify",y.info="auto"}return t.pos+=a.length-s.length,!0}function nN(t,e){let n=t.pos;if(t.src.charCodeAt(n)!==10)return!1;const r=t.pending.length-1,i=t.posMax;if(!e)if(r>=0&&t.pending.charCodeAt(r)===32)if(r>=1&&t.pending.charCodeAt(r-1)===32){let s=r-1;for(;s>=1&&t.pending.charCodeAt(s-1)===32;)s--;t.pending=t.pending.slice(0,s),t.push("hardbreak","br",0)}else t.pending=t.pending.slice(0,-1),t.push("softbreak","br",0);else t.push("softbreak","br",0);for(n++;n<i&&$e(t.src.charCodeAt(n));)n++;return t.pos=n,!0}const d0=[];for(let t=0;t<256;t++)d0.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(t){d0[t.charCodeAt(0)]=1});function rN(t,e){let n=t.pos;const r=t.posMax;if(t.src.charCodeAt(n)!==92||(n++,n>=r))return!1;let i=t.src.charCodeAt(n);if(i===10){for(e||t.push("hardbreak","br",0),n++;n<r&&(i=t.src.charCodeAt(n),!!$e(i));)n++;return t.pos=n,!0}if(i===32){if(!e){const a=t.push("text_special","",0);a.content="\\",a.markup="\\",a.info="escape"}return t.pos=n,!0}let s=t.src[n];if(i>=55296&&i<=56319&&n+1<r){const a=t.src.charCodeAt(n+1);a>=56320&&a<=57343&&(s+=t.src[n+1],n++)}const u="\\"+s;if(!e){const a=t.push("text_special","",0);i<256&&d0[i]!==0?a.content=s:a.content=u,a.markup=u,a.info="escape"}return t.pos=n+1,!0}function iN(t,e){let n=t.pos;if(t.src.charCodeAt(n)!==96)return!1;const i=n;n++;const s=t.posMax;for(;n<s&&t.src.charCodeAt(n)===96;)n++;const u=t.src.slice(i,n),a=u.length;if(t.backticksScanned&&(t.backticks[a]||0)<=i)return e||(t.pending+=u),t.pos+=a,!0;let c=n,f;for(;(f=t.src.indexOf("`",c))!==-1;){for(c=f+1;c<s&&t.src.charCodeAt(c)===96;)c++;const p=c-f;if(p===a){if(!e){const m=t.push("code_inline","code",0);m.markup=u,m.content=t.src.slice(n,f).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return t.pos=c,!0}t.backticks[p]=f}return t.backticksScanned=!0,e||(t.pending+=u),t.pos+=a,!0}function sN(t,e){const n=t.pos,r=t.src.charCodeAt(n);if(e||r!==126)return!1;const i=t.scanDelims(t.pos,!0);let s=i.length;const u=String.fromCharCode(r);if(s<2)return!1;let a;s%2&&(a=t.push("text","",0),a.content=u,s--);for(let c=0;c<s;c+=2)a=t.push("text","",0),a.content=u+u,t.delimiters.push({marker:r,length:0,token:t.tokens.length-1,end:-1,open:i.can_open,close:i.can_close});return t.pos+=i.length,!0}function E2(t,e){let n;const r=[],i=e.length;for(let s=0;s<i;s++){const u=e[s];if(u.marker!==126||u.end===-1)continue;const a=e[u.end];n=t.tokens[u.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=t.tokens[a.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",t.tokens[a.token-1].type==="text"&&t.tokens[a.token-1].content==="~"&&r.push(a.token-1)}for(;r.length;){const s=r.pop();let u=s+1;for(;u<t.tokens.length&&t.tokens[u].type==="s_close";)u++;u--,s!==u&&(n=t.tokens[u],t.tokens[u]=t.tokens[s],t.tokens[s]=n)}}function oN(t){const e=t.tokens_meta,n=t.tokens_meta.length;E2(t,t.delimiters);for(let r=0;r<n;r++)e[r]&&e[r].delimiters&&E2(t,e[r].delimiters)}const bv={tokenize:sN,postProcess:oN};function uN(t,e){const n=t.pos,r=t.src.charCodeAt(n);if(e||r!==95&&r!==42)return!1;const i=t.scanDelims(t.pos,r===42);for(let s=0;s<i.length;s++){const u=t.push("text","",0);u.content=String.fromCharCode(r),t.delimiters.push({marker:r,length:i.length,token:t.tokens.length-1,end:-1,open:i.can_open,close:i.can_close})}return t.pos+=i.length,!0}function _2(t,e){const n=e.length;for(let r=n-1;r>=0;r--){const i=e[r];if(i.marker!==95&&i.marker!==42||i.end===-1)continue;const s=e[i.end],u=r>0&&e[r-1].end===i.end+1&&e[r-1].marker===i.marker&&e[r-1].token===i.token-1&&e[i.end+1].token===s.token+1,a=String.fromCharCode(i.marker),c=t.tokens[i.token];c.type=u?"strong_open":"em_open",c.tag=u?"strong":"em",c.nesting=1,c.markup=u?a+a:a,c.content="";const f=t.tokens[s.token];f.type=u?"strong_close":"em_close",f.tag=u?"strong":"em",f.nesting=-1,f.markup=u?a+a:a,f.content="",u&&(t.tokens[e[r-1].token].content="",t.tokens[e[i.end+1].token].content="",r--)}}function lN(t){const e=t.tokens_meta,n=t.tokens_meta.length;_2(t,t.delimiters);for(let r=0;r<n;r++)e[r]&&e[r].delimiters&&_2(t,e[r].delimiters)}const vv={tokenize:uN,postProcess:lN};function aN(t,e){let n,r,i,s,u="",a="",c=t.pos,f=!0;if(t.src.charCodeAt(t.pos)!==91)return!1;const p=t.pos,m=t.posMax,y=t.pos+1,x=t.md.helpers.parseLinkLabel(t,t.pos,!0);if(x<0)return!1;let b=x+1;if(b<m&&t.src.charCodeAt(b)===40){for(f=!1,b++;b<m&&(n=t.src.charCodeAt(b),!(!$e(n)&&n!==10));b++);if(b>=m)return!1;if(c=b,i=t.md.helpers.parseLinkDestination(t.src,b,t.posMax),i.ok){for(u=t.md.normalizeLink(i.str),t.md.validateLink(u)?b=i.pos:u="",c=b;b<m&&(n=t.src.charCodeAt(b),!(!$e(n)&&n!==10));b++);if(i=t.md.helpers.parseLinkTitle(t.src,b,t.posMax),b<m&&c!==b&&i.ok)for(a=i.str,b=i.pos;b<m&&(n=t.src.charCodeAt(b),!(!$e(n)&&n!==10));b++);}(b>=m||t.src.charCodeAt(b)!==41)&&(f=!0),b++}if(f){if(typeof t.env.references>"u")return!1;if(b<m&&t.src.charCodeAt(b)===91?(c=b+1,b=t.md.helpers.parseLinkLabel(t,b),b>=0?r=t.src.slice(c,b++):b=x+1):b=x+1,r||(r=t.src.slice(y,x)),s=t.env.references[Ec(r)],!s)return t.pos=p,!1;u=s.href,a=s.title}if(!e){t.pos=y,t.posMax=x;const v=t.push("link_open","a",1),w=[["href",u]];v.attrs=w,a&&w.push(["title",a]),t.linkLevel++,t.md.inline.tokenize(t),t.linkLevel--,t.push("link_close","a",-1)}return t.pos=b,t.posMax=m,!0}function cN(t,e){let n,r,i,s,u,a,c,f,p="";const m=t.pos,y=t.posMax;if(t.src.charCodeAt(t.pos)!==33||t.src.charCodeAt(t.pos+1)!==91)return!1;const x=t.pos+2,b=t.md.helpers.parseLinkLabel(t,t.pos+1,!1);if(b<0)return!1;if(s=b+1,s<y&&t.src.charCodeAt(s)===40){for(s++;s<y&&(n=t.src.charCodeAt(s),!(!$e(n)&&n!==10));s++);if(s>=y)return!1;for(f=s,a=t.md.helpers.parseLinkDestination(t.src,s,t.posMax),a.ok&&(p=t.md.normalizeLink(a.str),t.md.validateLink(p)?s=a.pos:p=""),f=s;s<y&&(n=t.src.charCodeAt(s),!(!$e(n)&&n!==10));s++);if(a=t.md.helpers.parseLinkTitle(t.src,s,t.posMax),s<y&&f!==s&&a.ok)for(c=a.str,s=a.pos;s<y&&(n=t.src.charCodeAt(s),!(!$e(n)&&n!==10));s++);else c="";if(s>=y||t.src.charCodeAt(s)!==41)return t.pos=m,!1;s++}else{if(typeof t.env.references>"u")return!1;if(s<y&&t.src.charCodeAt(s)===91?(f=s+1,s=t.md.helpers.parseLinkLabel(t,s),s>=0?i=t.src.slice(f,s++):s=b+1):s=b+1,i||(i=t.src.slice(x,b)),u=t.env.references[Ec(i)],!u)return t.pos=m,!1;p=u.href,c=u.title}if(!e){r=t.src.slice(x,b);const v=[];t.md.inline.parse(r,t.md,t.env,v);const w=t.push("image","img",0),S=[["src",p],["alt",""]];w.attrs=S,w.children=v,w.content=r,c&&S.push(["title",c])}return t.pos=s,t.posMax=y,!0}const dN=/^([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])?)*)$/,fN=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function hN(t,e){let n=t.pos;if(t.src.charCodeAt(n)!==60)return!1;const r=t.pos,i=t.posMax;for(;;){if(++n>=i)return!1;const u=t.src.charCodeAt(n);if(u===60)return!1;if(u===62)break}const s=t.src.slice(r+1,n);if(fN.test(s)){const u=t.md.normalizeLink(s);if(!t.md.validateLink(u))return!1;if(!e){const a=t.push("link_open","a",1);a.attrs=[["href",u]],a.markup="autolink",a.info="auto";const c=t.push("text","",0);c.content=t.md.normalizeLinkText(s);const f=t.push("link_close","a",-1);f.markup="autolink",f.info="auto"}return t.pos+=s.length+2,!0}if(dN.test(s)){const u=t.md.normalizeLink("mailto:"+s);if(!t.md.validateLink(u))return!1;if(!e){const a=t.push("link_open","a",1);a.attrs=[["href",u]],a.markup="autolink",a.info="auto";const c=t.push("text","",0);c.content=t.md.normalizeLinkText(s);const f=t.push("link_close","a",-1);f.markup="autolink",f.info="auto"}return t.pos+=s.length+2,!0}return!1}function pN(t){return/^<a[>\s]/i.test(t)}function mN(t){return/^<\/a\s*>/i.test(t)}function gN(t){const e=t|32;return e>=97&&e<=122}function yN(t,e){if(!t.md.options.html)return!1;const n=t.posMax,r=t.pos;if(t.src.charCodeAt(r)!==60||r+2>=n)return!1;const i=t.src.charCodeAt(r+1);if(i!==33&&i!==63&&i!==47&&!gN(i))return!1;const s=t.src.slice(r).match(WD);if(!s)return!1;if(!e){const u=t.push("html_inline","",0);u.content=s[0],pN(u.content)&&t.linkLevel++,mN(u.content)&&t.linkLevel--}return t.pos+=s[0].length,!0}const xN=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,kN=/^&([a-z][a-z0-9]{1,31});/i;function bN(t,e){const n=t.pos,r=t.posMax;if(t.src.charCodeAt(n)!==38||n+1>=r)return!1;if(t.src.charCodeAt(n+1)===35){const s=t.src.slice(n).match(xN);if(s){if(!e){const u=s[1][0].toLowerCase()==="x"?parseInt(s[1].slice(1),16):parseInt(s[1],10),a=t.push("text_special","",0);a.content=a0(u)?hu(u):hu(65533),a.markup=s[0],a.info="entity"}return t.pos+=s[0].length,!0}}else{const s=t.src.slice(n).match(kN);if(s){const u=jM(s[0]);if(u!==s[0]){if(!e){const a=t.push("text_special","",0);a.content=u,a.markup=s[0],a.info="entity"}return t.pos+=s[0].length,!0}}}return!1}function T2(t){const e={},n=t.length;if(!n)return;let r=0,i=-2;const s=[];for(let u=0;u<n;u++){const a=t[u];if(s.push(0),(t[r].marker!==a.marker||i!==a.token-1)&&(r=u),i=a.token,a.length=a.length||0,!a.close)continue;e.hasOwnProperty(a.marker)||(e[a.marker]=[-1,-1,-1,-1,-1,-1]);const c=e[a.marker][(a.open?3:0)+a.length%3];let f=r-s[r]-1,p=f;for(;f>c;f-=s[f]+1){const m=t[f];if(m.marker===a.marker&&m.open&&m.end<0){let y=!1;if((m.close||a.open)&&(m.length+a.length)%3===0&&(m.length%3!==0||a.length%3!==0)&&(y=!0),!y){const x=f>0&&!t[f-1].open?s[f-1]+1:0;s[u]=u-f+x,s[f]=x,a.open=!1,m.end=u,m.close=!1,p=-1,i=-2;break}}}p!==-1&&(e[a.marker][(a.open?3:0)+(a.length||0)%3]=p)}}function vN(t){const e=t.tokens_meta,n=t.tokens_meta.length;T2(t.delimiters);for(let r=0;r<n;r++)e[r]&&e[r].delimiters&&T2(e[r].delimiters)}function wN(t){let e,n,r=0;const i=t.tokens,s=t.tokens.length;for(e=n=0;e<s;e++)i[e].nesting<0&&r--,i[e].level=r,i[e].nesting>0&&r++,i[e].type==="text"&&e+1<s&&i[e+1].type==="text"?i[e+1].content=i[e].content+i[e+1].content:(e!==n&&(i[n]=i[e]),n++);e!==n&&(i.length=n)}const fh=[["text",XD],["linkify",tN],["newline",nN],["escape",rN],["backticks",iN],["strikethrough",bv.tokenize],["emphasis",vv.tokenize],["link",aN],["image",cN],["autolink",hN],["html_inline",yN],["entity",bN]],hh=[["balance_pairs",vN],["strikethrough",bv.postProcess],["emphasis",vv.postProcess],["fragments_join",wN]];function Mu(){this.ruler=new Zt;for(let t=0;t<fh.length;t++)this.ruler.push(fh[t][0],fh[t][1]);this.ruler2=new Zt;for(let t=0;t<hh.length;t++)this.ruler2.push(hh[t][0],hh[t][1])}Mu.prototype.skipToken=function(t){const e=t.pos,n=this.ruler.getRules(""),r=n.length,i=t.md.options.maxNesting,s=t.cache;if(typeof s[e]<"u"){t.pos=s[e];return}let u=!1;if(t.level<i){for(let a=0;a<r;a++)if(t.level++,u=n[a](t,!0),t.level--,u){if(e>=t.pos)throw new Error("inline rule didn't increment state.pos");break}}else t.pos=t.posMax;u||t.pos++,s[e]=t.pos};Mu.prototype.tokenize=function(t){const e=this.ruler.getRules(""),n=e.length,r=t.posMax,i=t.md.options.maxNesting;for(;t.pos<r;){const s=t.pos;let u=!1;if(t.level<i){for(let a=0;a<n;a++)if(u=e[a](t,!1),u){if(s>=t.pos)throw new Error("inline rule didn't increment state.pos");break}}if(u){if(t.pos>=r)break;continue}t.pending+=t.src[t.pos++]}t.pending&&t.pushPending()};Mu.prototype.parse=function(t,e,n,r){const i=new this.State(t,e,n,r);this.tokenize(i);const s=this.ruler2.getRules(""),u=s.length;for(let a=0;a<u;a++)s[a](i)};Mu.prototype.State=Au;function CN(t){const e={};t=t||{},e.src_Any=uv.source,e.src_Cc=lv.source,e.src_Z=cv.source,e.src_P=u0.source,e.src_ZPCc=[e.src_Z,e.src_P,e.src_Cc].join("|"),e.src_ZCc=[e.src_Z,e.src_Cc].join("|");const n="[><|]";return e.src_pseudo_letter=`(?:(?!${n}|${e.src_ZPCc})${e.src_Any})`,e.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]?)",e.src_auth=`(?:(?:(?!${e.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`,e.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",e.src_host_terminator=`(?=$|${n}|${e.src_ZPCc})(?!${t["---"]?"-(?!--)|":"-|"}_|:\\d|\\.-|\\.(?!$|${e.src_ZPCc}))`,e.src_path=`(?:[/?#](?:(?!${e.src_ZCc}|${n}|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!${e.src_ZCc}|\\]).)*\\]|\\((?:(?!${e.src_ZCc}|[)]).)*\\)|\\{(?:(?!${e.src_ZCc}|[}]).)*\\}|\\"(?:(?!${e.src_ZCc}|["]).)+\\"|\\'(?:(?!${e.src_ZCc}|[']).)+\\'|\\'(?=${e.src_pseudo_letter}|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!${e.src_ZCc}|[.]|$)|`+(t["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+`,(?!${e.src_ZCc}|$)|;(?!${e.src_ZCc}|$)|\\!+(?!${e.src_ZCc}|[!]|$)|\\?(?!${e.src_ZCc}|[?]|$))+|\\/)?`,e.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]{0,63}',e.src_xn="xn--[a-z0-9\\-]{1,59}",e.src_domain_root="(?:"+e.src_xn+`|${e.src_pseudo_letter}{1,63})`,e.src_domain="(?:"+e.src_xn+`|(?:${e.src_pseudo_letter})|(?:${e.src_pseudo_letter}(?:-|${e.src_pseudo_letter}){0,61}${e.src_pseudo_letter}))`,e.src_host=`(?:(?:(?:(?:${e.src_domain})\\.)*${e.src_domain}))`,e.tpl_host_fuzzy="(?:"+e.src_ip4+`|(?:(?:(?:${e.src_domain})\\.)+(?:%TLDS%)))`,e.tpl_host_no_ip_fuzzy=`(?:(?:(?:${e.src_domain})\\.)+(?:%TLDS%))`,e.src_host_strict=e.src_host+e.src_host_terminator,e.tpl_host_fuzzy_strict=e.tpl_host_fuzzy+e.src_host_terminator,e.src_host_port_strict=e.src_host+e.src_port+e.src_host_terminator,e.tpl_host_port_fuzzy_strict=e.tpl_host_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_port_no_ip_fuzzy_strict=e.tpl_host_no_ip_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_fuzzy_test=`localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:${e.src_ZPCc}|>|$))`,e.tpl_email_fuzzy=`(^|${n}|"|\\(|${e.src_ZCc})(${e.src_email_name}@${e.tpl_host_fuzzy_strict})`,e.tpl_link_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`||]|${e.src_ZPCc}))((?![$+<=>^\`||])${e.tpl_host_port_fuzzy_strict}${e.src_path})`,e.tpl_link_no_ip_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`||]|${e.src_ZPCc}))((?![$+<=>^\`||])${e.tpl_host_port_no_ip_fuzzy_strict}${e.src_path})`,e}function dp(t){return Array.prototype.slice.call(arguments,1).forEach(function(n){n&&Object.keys(n).forEach(function(r){t[r]=n[r]})}),t}function Ac(t){return Object.prototype.toString.call(t)}function SN(t){return Ac(t)==="[object String]"}function EN(t){return Ac(t)==="[object Object]"}function _N(t){return Ac(t)==="[object RegExp]"}function A2(t){return Ac(t)==="[object Function]"}function TN(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const wv={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function AN(t){return Object.keys(t||{}).reduce(function(e,n){return e||wv.hasOwnProperty(n)},!1)}const MN={"http:":{validate:function(t,e,n){const r=t.slice(e);return n.re.http||(n.re.http=new RegExp(`^\\/\\/${n.re.src_auth}${n.re.src_host_port_strict}${n.re.src_path}`,"i")),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(t,e,n){const r=t.slice(e);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+`(?:localhost|(?:(?:${n.re.src_domain})\\.)+${n.re.src_domain_root})`+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(r)?e>=3&&t[e-3]===":"||e>=3&&t[e-3]==="/"?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(t,e,n){const r=t.slice(e);return n.re.mailto||(n.re.mailto=new RegExp(`^${n.re.src_email_name}@${n.re.src_host_strict}`,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},DN="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]",NN="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function ON(t){return function(e,n){const r=e.slice(n);return t.test(r)?r.match(t)[0].length:0}}function M2(){return function(t,e){e.normalize(t)}}function sc(t){const e=t.re=CN(t.__opts__),n=t.__tlds__.slice();t.onCompile(),t.__tlds_replaced__||n.push(DN),n.push(e.src_xn),e.src_tlds=n.join("|");function r(a){return a.replace("%TLDS%",e.src_tlds)}e.email_fuzzy=RegExp(r(e.tpl_email_fuzzy),"i"),e.email_fuzzy_global=RegExp(r(e.tpl_email_fuzzy),"ig"),e.link_fuzzy=RegExp(r(e.tpl_link_fuzzy),"i"),e.link_fuzzy_global=RegExp(r(e.tpl_link_fuzzy),"ig"),e.link_no_ip_fuzzy=RegExp(r(e.tpl_link_no_ip_fuzzy),"i"),e.link_no_ip_fuzzy_global=RegExp(r(e.tpl_link_no_ip_fuzzy),"ig"),e.host_fuzzy_test=RegExp(r(e.tpl_host_fuzzy_test),"i");const i=[];t.__compiled__={};function s(a,c){throw new Error(`(LinkifyIt) Invalid schema "${a}": ${c}`)}Object.keys(t.__schemas__).forEach(function(a){const c=t.__schemas__[a];if(c===null)return;const f={validate:null,link:null};if(t.__compiled__[a]=f,EN(c)){_N(c.validate)?f.validate=ON(c.validate):A2(c.validate)?f.validate=c.validate:s(a,c),A2(c.normalize)?f.normalize=c.normalize:c.normalize?s(a,c):f.normalize=M2();return}if(SN(c)){i.push(a);return}s(a,c)}),i.forEach(function(a){t.__compiled__[t.__schemas__[a]]&&(t.__compiled__[a].validate=t.__compiled__[t.__schemas__[a]].validate,t.__compiled__[a].normalize=t.__compiled__[t.__schemas__[a]].normalize)}),t.__compiled__[""]={validate:null,normalize:M2()};const u=Object.keys(t.__compiled__).filter(function(a){return a.length>0&&t.__compiled__[a]}).map(TN).join("|");t.re.schema_test=RegExp(`(^|(?!_)(?:[><|]|${e.src_ZPCc}))(${u})`,"i"),t.re.schema_search=RegExp(`(^|(?!_)(?:[><|]|${e.src_ZPCc}))(${u})`,"ig"),t.re.schema_at_start=RegExp(`^${t.re.schema_search.source}`,"i"),t.re.pretest=RegExp(`(${t.re.schema_test.source})|(${t.re.host_fuzzy_test.source})|@`,"i")}function Cv(t,e,n,r){const i=t.slice(n,r);this.schema=e.toLowerCase(),this.index=n,this.lastIndex=r,this.raw=i,this.text=i,this.url=i}function sn(t,e){if(!(this instanceof sn))return new sn(t,e);e||AN(t)&&(e=t,t={}),this.__opts__=dp({},wv,e),this.__schemas__=dp({},MN,t),this.__compiled__={},this.__tlds__=NN,this.__tlds_replaced__=!1,this.re={},sc(this)}sn.prototype.add=function(e,n){return this.__schemas__[e]=n,sc(this),this};sn.prototype.set=function(e){return this.__opts__=dp(this.__opts__,e),this};sn.prototype.test=function(e){if(!e.length)return!1;let n,r;if(this.re.schema_test.test(e)){for(r=this.re.schema_search,r.lastIndex=0;(n=r.exec(e))!==null;)if(this.testSchemaAt(e,n[2],r.lastIndex))return!0}return!!(this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&e.search(this.re.host_fuzzy_test)>=0&&e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy)!==null||this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&e.indexOf("@")>=0&&e.match(this.re.email_fuzzy)!==null)};sn.prototype.pretest=function(e){return this.re.pretest.test(e)};sn.prototype.testSchemaAt=function(e,n,r){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(e,r,this):0};sn.prototype.match=function(e){const n=[],r=[],i=[],s=[];let u,a,c;function f(y,x){return y?x?y.index!==x.index?y.index<x.index?y:x:y.lastIndex>=x.lastIndex?y:x:y:x}if(!e.length)return null;if(this.re.schema_test.test(e))for(c=this.re.schema_search,c.lastIndex=0;(u=c.exec(e))!==null;)a=this.testSchemaAt(e,u[2],c.lastIndex),a&&r.push({schema:u[2],index:u.index+u[1].length,lastIndex:u.index+u[0].length+a});if(this.__opts__.fuzzyLink&&this.__compiled__["http:"])for(c=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,c.lastIndex=0;(u=c.exec(e))!==null;)i.push({schema:"",index:u.index+u[1].length,lastIndex:u.index+u[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"])for(c=this.re.email_fuzzy_global,c.lastIndex=0;(u=c.exec(e))!==null;)s.push({schema:"mailto:",index:u.index+u[1].length,lastIndex:u.index+u[0].length});const p=[0,0,0];let m=0;for(;;){const y=[r[p[0]],s[p[1]],i[p[2]]],x=f(f(y[0],y[1]),y[2]);if(!x)break;if(x===y[0]?p[0]++:x===y[1]?p[1]++:p[2]++,x.index<m)continue;const b=new Cv(e,x.schema,x.index,x.lastIndex);this.__compiled__[b.schema].normalize(b,this),n.push(b),m=x.lastIndex}return n.length?n:null};sn.prototype.matchAtStart=function(e){if(!e.length)return null;const n=this.re.schema_at_start.exec(e);if(!n)return null;const r=this.testSchemaAt(e,n[2],n[0].length);if(!r)return null;const i=new Cv(e,n[2],n.index+n[1].length,n.index+n[0].length+r);return this.__compiled__[i.schema].normalize(i,this),i};sn.prototype.tlds=function(e,n){return e=Array.isArray(e)?e:[e],n?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(r,i,s){return r!==s[i-1]}).reverse(),sc(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,sc(this),this)};sn.prototype.normalize=function(e){e.schema||(e.url=`http://${e.url}`),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:${e.url}`)};sn.prototype.onCompile=function(){};const Cs=2147483647,$n=36,f0=1,yu=26,RN=38,IN=700,Sv=72,Ev=128,_v="-",LN=/^xn--/,PN=/[^\0-\x7F]/,FN=/[\x2E\u3002\uFF0E\uFF61]/g,zN={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},ph=$n-f0,Vn=Math.floor,mh=String.fromCharCode;function $r(t){throw new RangeError(zN[t])}function jN(t,e){const n=[];let r=t.length;for(;r--;)n[r]=e(t[r]);return n}function Tv(t,e){const n=t.split("@");let r="";n.length>1&&(r=n[0]+"@",t=n[1]),t=t.replace(FN,".");const i=t.split("."),s=jN(i,e).join(".");return r+s}function Av(t){const e=[];let n=0;const r=t.length;for(;n<r;){const i=t.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){const s=t.charCodeAt(n++);(s&64512)==56320?e.push(((i&1023)<<10)+(s&1023)+65536):(e.push(i),n--)}else e.push(i)}return e}const BN=t=>String.fromCodePoint(...t),$N=function(t){return t>=48&&t<58?26+(t-48):t>=65&&t<91?t-65:t>=97&&t<123?t-97:$n},D2=function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},Mv=function(t,e,n){let r=0;for(t=n?Vn(t/IN):t>>1,t+=Vn(t/e);t>ph*yu>>1;r+=$n)t=Vn(t/ph);return Vn(r+(ph+1)*t/(t+RN))},Dv=function(t){const e=[],n=t.length;let r=0,i=Ev,s=Sv,u=t.lastIndexOf(_v);u<0&&(u=0);for(let a=0;a<u;++a)t.charCodeAt(a)>=128&&$r("not-basic"),e.push(t.charCodeAt(a));for(let a=u>0?u+1:0;a<n;){const c=r;for(let p=1,m=$n;;m+=$n){a>=n&&$r("invalid-input");const y=$N(t.charCodeAt(a++));y>=$n&&$r("invalid-input"),y>Vn((Cs-r)/p)&&$r("overflow"),r+=y*p;const x=m<=s?f0:m>=s+yu?yu:m-s;if(y<x)break;const b=$n-x;p>Vn(Cs/b)&&$r("overflow"),p*=b}const f=e.length+1;s=Mv(r-c,f,c==0),Vn(r/f)>Cs-i&&$r("overflow"),i+=Vn(r/f),r%=f,e.splice(r++,0,i)}return String.fromCodePoint(...e)},Nv=function(t){const e=[];t=Av(t);const n=t.length;let r=Ev,i=0,s=Sv;for(const c of t)c<128&&e.push(mh(c));const u=e.length;let a=u;for(u&&e.push(_v);a<n;){let c=Cs;for(const p of t)p>=r&&p<c&&(c=p);const f=a+1;c-r>Vn((Cs-i)/f)&&$r("overflow"),i+=(c-r)*f,r=c;for(const p of t)if(p<r&&++i>Cs&&$r("overflow"),p===r){let m=i;for(let y=$n;;y+=$n){const x=y<=s?f0:y>=s+yu?yu:y-s;if(m<x)break;const b=m-x,v=$n-x;e.push(mh(D2(x+b%v,0))),m=Vn(b/v)}e.push(mh(D2(m,0))),s=Mv(i,f,a===u),i=0,++a}++i,++r}return e.join("")},VN=function(t){return Tv(t,function(e){return LN.test(e)?Dv(e.slice(4).toLowerCase()):e})},HN=function(t){return Tv(t,function(e){return PN.test(e)?"xn--"+Nv(e):e})},Ov={version:"2.3.1",ucs2:{decode:Av,encode:BN},decode:Dv,encode:Nv,toASCII:HN,toUnicode:VN},UN={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},qN={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"]}}},WN={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"]}}},KN={default:UN,zero:qN,commonmark:WN},ZN=/^(vbscript|javascript|file|data):/,JN=/^data:image\/(gif|png|jpeg|webp);/;function GN(t){const e=t.trim().toLowerCase();return ZN.test(e)?JN.test(e):!0}const Rv=["http:","https:","mailto:"];function QN(t){const e=o0(t,!0);if(e.hostname&&(!e.protocol||Rv.indexOf(e.protocol)>=0))try{e.hostname=Ov.toASCII(e.hostname)}catch{}return Tu(s0(e))}function YN(t){const e=o0(t,!0);if(e.hostname&&(!e.protocol||Rv.indexOf(e.protocol)>=0))try{e.hostname=Ov.toUnicode(e.hostname)}catch{}return Ps(s0(e),Ps.defaultChars+"%")}function Jt(t,e){if(!(this instanceof Jt))return new Jt(t,e);e||l0(t)||(e=t||{},t="default"),this.inline=new Mu,this.block=new Tc,this.core=new c0,this.renderer=new js,this.linkify=new sn,this.validateLink=GN,this.normalizeLink=QN,this.normalizeLinkText=YN,this.utils=tD,this.helpers=Sc({},sD),this.options={},this.configure(t),e&&this.set(e)}Jt.prototype.set=function(t){return Sc(this.options,t),this};Jt.prototype.configure=function(t){const e=this;if(l0(t)){const n=t;if(t=KN[n],!t)throw new Error('Wrong `markdown-it` preset "'+n+'", check name')}if(!t)throw new Error("Wrong `markdown-it` preset, can't be empty");return t.options&&e.set(t.options),t.components&&Object.keys(t.components).forEach(function(n){t.components[n].rules&&e[n].ruler.enableOnly(t.components[n].rules),t.components[n].rules2&&e[n].ruler2.enableOnly(t.components[n].rules2)}),this};Jt.prototype.enable=function(t,e){let n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(i){n=n.concat(this[i].ruler.enable(t,!0))},this),n=n.concat(this.inline.ruler2.enable(t,!0));const r=t.filter(function(i){return n.indexOf(i)<0});if(r.length&&!e)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this};Jt.prototype.disable=function(t,e){let n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(i){n=n.concat(this[i].ruler.disable(t,!0))},this),n=n.concat(this.inline.ruler2.disable(t,!0));const r=t.filter(function(i){return n.indexOf(i)<0});if(r.length&&!e)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this};Jt.prototype.use=function(t){const e=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,e),this};Jt.prototype.parse=function(t,e){if(typeof t!="string")throw new Error("Input data should be a String");const n=new this.core.State(t,this,e);return this.core.process(n),n.tokens};Jt.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)};Jt.prototype.parseInline=function(t,e){const n=new this.core.State(t,this,e);return n.inlineMode=!0,this.core.process(n),n.tokens};Jt.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)};const XN=new yp({nodes:{doc:{content:"block+"},paragraph:{content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM(){return["p",0]}},blockquote:{content:"block+",group:"block",parseDOM:[{tag:"blockquote"}],toDOM(){return["blockquote",0]}},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM(){return["div",["hr"]]}},heading:{attrs:{level:{default:1}},content:"(text | image)*",group:"block",defining:!0,parseDOM:[{tag:"h1",attrs:{level:1}},{tag:"h2",attrs:{level:2}},{tag:"h3",attrs:{level:3}},{tag:"h4",attrs:{level:4}},{tag:"h5",attrs:{level:5}},{tag:"h6",attrs:{level:6}}],toDOM(t){return["h"+t.attrs.level,0]}},code_block:{content:"text*",group:"block",code:!0,defining:!0,marks:"",attrs:{params:{default:""}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:t=>({params:t.getAttribute("data-params")||""})}],toDOM(t){return["pre",t.attrs.params?{"data-params":t.attrs.params}:{},["code",0]]}},ordered_list:{content:"list_item+",group:"block",attrs:{order:{default:1},tight:{default:!1}},parseDOM:[{tag:"ol",getAttrs(t){return{order:t.hasAttribute("start")?+t.getAttribute("start"):1,tight:t.hasAttribute("data-tight")}}}],toDOM(t){return["ol",{start:t.attrs.order==1?null:t.attrs.order,"data-tight":t.attrs.tight?"true":null},0]}},bullet_list:{content:"list_item+",group:"block",attrs:{tight:{default:!1}},parseDOM:[{tag:"ul",getAttrs:t=>({tight:t.hasAttribute("data-tight")})}],toDOM(t){return["ul",{"data-tight":t.attrs.tight?"true":null},0]}},list_item:{content:"block+",defining:!0,parseDOM:[{tag:"li"}],toDOM(){return["li",0]}},text:{group:"inline"},image:{inline:!0,attrs:{src:{},alt:{default:null},title:{default:null}},group:"inline",draggable:!0,parseDOM:[{tag:"img[src]",getAttrs(t){return{src:t.getAttribute("src"),title:t.getAttribute("title"),alt:t.getAttribute("alt")}}}],toDOM(t){return["img",t.attrs]}},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM(){return["br"]}}},marks:{em:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"},{style:"font-style=normal",clearMark:t=>t.type.name=="em"}],toDOM(){return["em"]}},strong:{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name=="strong"},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}],toDOM(){return["strong"]}},link:{attrs:{href:{},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs(t){return{href:t.getAttribute("href"),title:t.getAttribute("title")}}}],toDOM(t){return["a",t.attrs]}},code:{code:!0,parseDOM:[{tag:"code"}],toDOM(){return["code"]}}}});function e9(t,e){if(t.isText&&e.isText&&Re.sameSet(t.marks,e.marks))return t.withText(t.text+e.text)}class t9{constructor(e,n){this.schema=e,this.tokenHandlers=n,this.stack=[{type:e.topNodeType,attrs:null,content:[],marks:Re.none}]}top(){return this.stack[this.stack.length-1]}push(e){this.stack.length&&this.top().content.push(e)}addText(e){if(!e)return;let n=this.top(),r=n.content,i=r[r.length-1],s=this.schema.text(e,n.marks),u;i&&(u=e9(i,s))?r[r.length-1]=u:r.push(s)}openMark(e){let n=this.top();n.marks=e.addToSet(n.marks)}closeMark(e){let n=this.top();n.marks=e.removeFromSet(n.marks)}parseTokens(e){for(let n=0;n<e.length;n++){let r=e[n],i=this.tokenHandlers[r.type];if(!i)throw new Error("Token type `"+r.type+"` not supported by Markdown parser");i(this,r,e,n)}}addNode(e,n,r){let i=this.top(),s=e.createAndFill(n,r,i?i.marks:[]);return s?(this.push(s),s):null}openNode(e,n){this.stack.push({type:e,attrs:n,content:[],marks:Re.none})}closeNode(){let e=this.stack.pop();return this.addNode(e.type,e.attrs,e.content)}}function No(t,e,n,r){return t.getAttrs?t.getAttrs(e,n,r):t.attrs instanceof Function?t.attrs(e):t.attrs}function gh(t,e){return t.noCloseToken||e=="code_inline"||e=="code_block"||e=="fence"}function N2(t){return t[t.length-1]==`
385
- `?t.slice(0,t.length-1):t}function yh(){}function n9(t,e){let n=Object.create(null);for(let r in e){let i=e[r];if(i.block){let s=t.nodeType(i.block);gh(i,r)?n[r]=(u,a,c,f)=>{u.openNode(s,No(i,a,c,f)),u.addText(N2(a.content)),u.closeNode()}:(n[r+"_open"]=(u,a,c,f)=>u.openNode(s,No(i,a,c,f)),n[r+"_close"]=u=>u.closeNode())}else if(i.node){let s=t.nodeType(i.node);n[r]=(u,a,c,f)=>u.addNode(s,No(i,a,c,f))}else if(i.mark){let s=t.marks[i.mark];gh(i,r)?n[r]=(u,a,c,f)=>{u.openMark(s.create(No(i,a,c,f))),u.addText(N2(a.content)),u.closeMark(s)}:(n[r+"_open"]=(u,a,c,f)=>u.openMark(s.create(No(i,a,c,f))),n[r+"_close"]=u=>u.closeMark(s))}else if(i.ignore)gh(i,r)?n[r]=yh:(n[r+"_open"]=yh,n[r+"_close"]=yh);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 r9=class{constructor(e,n,r){this.schema=e,this.tokenizer=n,this.tokens=r,this.tokenHandlers=n9(e,r)}parse(e,n={}){let r=new t9(this.schema,this.tokenHandlers),i;r.parseTokens(this.tokenizer.parse(e,n));do i=r.closeNode();while(r.stack.length);return i||this.schema.topNodeType.createAndFill()}};function O2(t,e){for(;++e<t.length;)if(t[e].type!="list_item_open")return t[e].hidden;return!1}new r9(XN,Jt("commonmark",{html:!1}),{blockquote:{block:"blockquote"},paragraph:{block:"paragraph"},list_item:{block:"list_item"},bullet_list:{block:"bullet_list",getAttrs:(t,e,n)=>({tight:O2(e,n)})},ordered_list:{block:"ordered_list",getAttrs:(t,e,n)=>({order:+t.attrGet("start")||1,tight:O2(e,n)})},heading:{block:"heading",getAttrs:t=>({level:+t.tag.slice(1)})},code_block:{block:"code_block",noCloseToken:!0},fence:{block:"code_block",getAttrs:t=>({params:t.info||""}),noCloseToken:!0},hr:{node:"horizontal_rule"},image:{node:"image",getAttrs:t=>({src:t.attrGet("src"),title:t.attrGet("title")||null,alt:t.children[0]&&t.children[0].content||null})},hardbreak:{node:"hard_break"},em:{mark:"em"},strong:{mark:"strong"},link:{mark:"link",getAttrs:t=>({href:t.attrGet("href"),title:t.attrGet("title")||null})},code_inline:{mark:"code",noCloseToken:!0}});const i9={open:"",close:"",mixable:!0};let s9=class{constructor(e,n,r={}){this.nodes=e,this.marks=n,this.options=r}serialize(e,n={}){n=Object.assign({},this.options,n);let r=new Iv(this.nodes,this.marks,n);return r.renderContent(e),r.out}};const Kn=new s9({blockquote(t,e){t.wrapBlock("> ",null,e,()=>t.renderContent(e))},code_block(t,e){const n=e.textContent.match(/`{3,}/gm),r=n?n.sort().slice(-1)[0]+"`":"```";t.write(r+(e.attrs.params||"")+`
386
- `),t.text(e.textContent,!1),t.write(`
387
- `),t.write(r),t.closeBlock(e)},heading(t,e){t.write(t.repeat("#",e.attrs.level)+" "),t.renderInline(e,!1),t.closeBlock(e)},horizontal_rule(t,e){t.write(e.attrs.markup||"---"),t.closeBlock(e)},bullet_list(t,e){t.renderList(e," ",()=>(e.attrs.bullet||"*")+" ")},ordered_list(t,e){var n;let r=(n=e.attrs.order)!==null&&n!==void 0?n:1,i=String(r+e.childCount-1).length,s=t.repeat(" ",i+2);t.renderList(e,s,u=>{let a=String(r+u);return t.repeat(" ",i-a.length)+a+". "})},list_item(t,e){t.renderContent(e)},paragraph(t,e){t.renderInline(e),t.closeBlock(e)},image(t,e){t.write("!["+t.esc(e.attrs.alt||"")+"]("+e.attrs.src.replace(/[\(\)]/g,"\\$&")+(e.attrs.title?' "'+e.attrs.title.replace(/"/g,'\\"')+'"':"")+")")},hard_break(t,e,n,r){for(let i=r+1;i<n.childCount;i++)if(n.child(i).type!=e.type){t.write(`\\
388
- `);return}},text(t,e){t.text(e.text,!t.inAutolink)}},{em:{open:"*",close:"*",mixable:!0,expelEnclosingWhitespace:!0},strong:{open:"**",close:"**",mixable:!0,expelEnclosingWhitespace:!0},link:{open(t,e,n,r){return t.inAutolink=o9(e,n,r),t.inAutolink?"<":"["},close(t,e,n,r){let{inAutolink:i}=t;return t.inAutolink=void 0,i?">":"]("+e.attrs.href.replace(/[\(\)"]/g,"\\$&")+(e.attrs.title?` "${e.attrs.title.replace(/"/g,'\\"')}"`:"")+")"},mixable:!0},code:{open(t,e,n,r){return R2(n.child(r),-1)},close(t,e,n,r){return R2(n.child(r-1),1)},escape:!1}});function R2(t,e){let n=/`+/g,r,i=0;if(t.isText)for(;r=n.exec(t.text);)i=Math.max(i,r[0].length);let s=i>0&&e>0?" `":"`";for(let u=0;u<i;u++)s+="`";return i>0&&e<0&&(s+=" "),s}function o9(t,e,n){if(t.attrs.title||!/^\w+:/.test(t.attrs.href))return!1;let r=e.child(n);return!r.isText||r.text!=t.attrs.href||r.marks[r.marks.length-1]!=t?!1:n==e.childCount-1||!t.isInSet(e.child(n+1).marks)}let Iv=class{constructor(e,n,r){this.nodes=e,this.marks=n,this.options=r,this.delim="",this.out="",this.closed=null,this.inAutolink=void 0,this.atBlockStart=!1,this.inTightList=!1,typeof this.options.tightLists>"u"&&(this.options.tightLists=!1),typeof this.options.hardBreakNodeName>"u"&&(this.options.hardBreakNodeName="hard_break")}flushClose(e=2){if(this.closed){if(this.atBlank()||(this.out+=`
389
- `),e>1){let n=this.delim,r=/\s+$/.exec(n);r&&(n=n.slice(0,n.length-r[0].length));for(let i=1;i<e;i++)this.out+=n+`
390
- `}this.closed=null}}getMark(e){let n=this.marks[e];if(!n){if(this.options.strict!==!1)throw new Error(`Mark type \`${e}\` not supported by Markdown renderer`);n=i9}return n}wrapBlock(e,n,r,i){let s=this.delim;this.write(n??e),this.delim+=e,i(),this.delim=s,this.closeBlock(r)}atBlank(){return/(^|\n)$/.test(this.out)}ensureNewLine(){this.atBlank()||(this.out+=`
391
- `)}write(e){this.flushClose(),this.delim&&this.atBlank()&&(this.out+=this.delim),e&&(this.out+=e)}closeBlock(e){this.closed=e}text(e,n=!0){let r=e.split(`
392
- `);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+=`
393
- `)}render(e,n,r){if(this.nodes[e.type.name])this.nodes[e.type.name](this,e,n,r);else{if(this.options.strict!==!1)throw new Error("Token type `"+e.type.name+"` not supported by Markdown renderer");e.type.isLeaf||(e.type.inlineContent?this.renderInline(e):this.renderContent(e),e.isBlock&&this.closeBlock(e))}}renderContent(e){e.forEach((n,r,i)=>this.render(n,e,i))}renderInline(e,n=!0){this.atBlockStart=n;let r=[],i="",s=(u,a,c)=>{let f=u?u.marks:[];u&&u.type.name===this.options.hardBreakNodeName&&(f=f.filter(v=>{if(c+1==e.childCount)return!1;let w=e.child(c+1);return v.isInSet(w.marks)&&(!w.isText||/\S/.test(w.text))}));let p=i;if(i="",u&&u.isText&&f.some(v=>{let w=this.getMark(v.type.name);return w&&w.expelEnclosingWhitespace&&!v.isInSet(r)})){let[v,w,S]=/^(\s*)(.*)$/m.exec(u.text);w&&(p+=w,u=S?u.withText(S):null,u||(f=r))}if(u&&u.isText&&f.some(v=>{let w=this.getMark(v.type.name);return w&&w.expelEnclosingWhitespace&&!this.isMarkAhead(e,c+1,v)})){let[v,w,S]=/^(.*?)(\s*)$/m.exec(u.text);S&&(i=S,u=w?u.withText(w):null,u||(f=r))}let m=f.length?f[f.length-1]:null,y=m&&this.getMark(m.type.name).escape===!1,x=f.length-(y?1:0);e:for(let v=0;v<x;v++){let w=f[v];if(!this.getMark(w.type.name).mixable)break;for(let S=0;S<r.length;S++){let A=r[S];if(!this.getMark(A.type.name).mixable)break;if(w.eq(A)){v>S?f=f.slice(0,S).concat(w).concat(f.slice(S,v)).concat(f.slice(v+1,x)):S>v&&(f=f.slice(0,v).concat(f.slice(v+1,S)).concat(w).concat(f.slice(S,x)));continue e}}}let b=0;for(;b<Math.min(r.length,x)&&f[b].eq(r[b]);)++b;for(;b<r.length;)this.text(this.markString(r.pop(),!1,e,c),!1);if(p&&this.text(p),u){for(;r.length<x;){let v=f[r.length];r.push(v),this.text(this.markString(v,!0,e,c),!1),this.atBlockStart=!1}y&&u.isText?this.text(this.markString(m,!0,e,c)+u.text+this.markString(m,!1,e,c+1),!1):this.render(u,e,c),this.atBlockStart=!1}u!=null&&u.isText&&u.nodeSize>0&&(this.atBlockStart=!1)};e.forEach(s),s(null,0,e.childCount),this.atBlockStart=!1}renderList(e,n,r){this.closed&&this.closed.type==e.type?this.flushClose(3):this.inTightList&&this.flushClose(1);let i=typeof e.attrs.tight<"u"?e.attrs.tight:this.options.tightLists,s=this.inTightList;this.inTightList=i,e.forEach((u,a,c)=>{c&&i&&this.flushClose(1),this.wrapBlock(n,r(c),e,()=>this.render(u,e,c))}),this.inTightList=s}esc(e,n=!1){return e=e.replace(/[`*\\~\[\]_]/g,(r,i)=>r=="_"&&i>0&&i+1<e.length&&e[i-1].match(/\w/)&&e[i+1].match(/\w/)?r:"\\"+r),n&&(e=e.replace(/^(\+[ ]|[\-*>])/,"\\$&").replace(/^(\s*)(#{1,6})(\s|$)/,"$1\\$2$3").replace(/^(\s*\d+)\.\s/,"$1\\. ")),this.options.escapeExtraCharacters&&(e=e.replace(this.options.escapeExtraCharacters,"\\$&")),e}quote(e){let n=e.indexOf('"')==-1?'""':e.indexOf("'")==-1?"''":"()";return n[0]+e+n[1]}repeat(e,n){let r="";for(let i=0;i<n;i++)r+=e;return r}markString(e,n,r,i){let s=this.getMark(e.type.name),u=n?s.open:s.close;return typeof u=="string"?u:u(this,e,r,i)}getEnclosingWhitespace(e){return{leading:(e.match(/^(\s+)/)||[void 0])[0],trailing:(e.match(/(\s+)$/)||[void 0])[0]}}isMarkAhead(e,n,r){for(;;n++){if(n>=e.childCount)return!1;let i=e.child(n);if(i.type.name!=this.options.hardBreakNodeName)return r.isInSet(i.marks);n++}}};var xh,I2;function u9(){if(I2)return xh;I2=1;var t=!0,e=!1,n=!1;xh=function(v,w){w&&(t=!w.enabled,e=!!w.label,n=!!w.labelAfter),v.core.ruler.after("inline","github-task-lists",function(S){for(var A=S.tokens,R=2;R<A.length;R++)s(A,R)&&(u(A[R],S.Token),r(A[R-2],"class","task-list-item"+(t?"":" enabled")),r(A[i(A,R-2)],"class","contains-task-list"))})};function r(v,w,S){var A=v.attrIndex(w),R=[w,S];A<0?v.attrPush(R):v.attrs[A]=R}function i(v,w){for(var S=v[w].level-1,A=w-1;A>=0;A--)if(v[A].level===S)return A;return-1}function s(v,w){return m(v[w])&&y(v[w-1])&&x(v[w-2])&&b(v[w])}function u(v,w){if(v.children.unshift(a(v,w)),v.children[1].content=v.children[1].content.slice(3),v.content=v.content.slice(3),e)if(n){v.children.pop();var S="task-item-"+Math.ceil(Math.random()*(1e4*1e3)-1e3);v.children[0].content=v.children[0].content.slice(0,-1)+' id="'+S+'">',v.children.push(p(v.content,S,w))}else v.children.unshift(c(w)),v.children.push(f(w))}function a(v,w){var S=new w("html_inline","",0),A=t?' disabled="" ':"";return v.content.indexOf("[ ] ")===0?S.content='<input class="task-list-item-checkbox"'+A+'type="checkbox">':(v.content.indexOf("[x] ")===0||v.content.indexOf("[X] ")===0)&&(S.content='<input class="task-list-item-checkbox" checked=""'+A+'type="checkbox">'),S}function c(v){var w=new v("html_inline","",0);return w.content="<label>",w}function f(v){var w=new v("html_inline","",0);return w.content="</label>",w}function p(v,w,S){var A=new S("html_inline","",0);return A.content='<label class="task-list-item-label" for="'+w+'">'+v+"</label>",A.attrs=[{for:w}],A}function m(v){return v.type==="inline"}function y(v){return v.type==="paragraph_open"}function x(v){return v.type==="list_item_open"}function b(v){return v.content.indexOf("[ ] ")===0||v.content.indexOf("[x] ")===0||v.content.indexOf("[X] ")===0}return xh}var l9=u9();const a9=hp(l9);var c9=Object.defineProperty,d9=(t,e,n)=>e in t?c9(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,oc=(t,e,n)=>(d9(t,typeof e!="symbol"?e+"":e,n),n);const f9=We.create({name:"markdownTightLists",addOptions:()=>({tight:!0,tightClass:"tight",listTypes:["bulletList","orderedList"]}),addGlobalAttributes(){return[{types:this.options.listTypes,attributes:{tight:{default:this.options.tight,parseHTML:t=>t.getAttribute("data-tight")==="true"||!t.querySelector("p"),renderHTML:t=>({class:t.tight?this.options.tightClass:null,"data-tight":t.tight?"true":null})}}}]},addCommands(){var t=this;return{toggleTight:function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return n=>{let{editor:r,commands:i}=n;function s(u){if(!r.isActive(u))return!1;const a=r.getAttributes(u);return i.updateAttributes(u,{tight:e??!(a!=null&&a.tight)})}return t.options.listTypes.some(u=>s(u))}}}}}),L2=Jt();function Lv(t,e){return L2.inline.State.prototype.scanDelims.call({src:t,posMax:t.length}),new L2.inline.State(t,null,null,[]).scanDelims(e,!0)}function Pv(t,e,n,r){let i=t.substring(0,n)+t.substring(n+e.length);return i=i.substring(0,n+r)+e+i.substring(n+r),i}function h9(t,e,n,r){let i=n,s=t;for(;i<r&&!Lv(s,i).can_open;)s=Pv(s,e,i,1),i++;return{text:s,from:i,to:r}}function p9(t,e,n,r){let i=r,s=t;for(;i>n&&!Lv(s,i).can_close;)s=Pv(s,e,i,-1),i--;return{text:s,from:n,to:i}}function m9(t,e,n,r){let i={text:t,from:n,to:r};return i=h9(i.text,e,i.from,i.to),i=p9(i.text,e,i.from,i.to),i.to-i.from<e.length+1&&(i.text=i.text.substring(0,i.from)+i.text.substring(i.to+e.length)),i.text}class g9 extends Iv{constructor(e,n,r){super(e,n,r??{}),oc(this,"inTable",!1),this.inlines=[]}render(e,n,r){super.render(e,n,r);const i=this.inlines[this.inlines.length-1];if(i!=null&&i.start&&i!==null&&i!==void 0&&i.end){const{delimiter:s,start:u,end:a}=this.normalizeInline(i);this.out=m9(this.out,s,u,a),this.inlines.pop()}}markString(e,n,r,i){const s=this.marks[e.type.name];if(s.expelEnclosingWhitespace)if(n)this.inlines.push({start:this.out.length,delimiter:s.open});else{const u=this.inlines.pop();this.inlines.push({...u,end:this.out.length})}return super.markString(e,n,r,i)}normalizeInline(e){let{start:n,end:r}=e;for(;this.out.charAt(n).match(/\s/);)n++;return{...e,start:n}}}const Fv=on.create({name:"markdownHTMLMark",addStorage(){return{markdown:{serialize:{open(t,e){var n,r;return this.editor.storage.markdown.options.html?(n=(r=P2(e))===null||r===void 0?void 0:r[0])!==null&&n!==void 0?n:"":(console.warn(`Tiptap Markdown: "${e.type.name}" mark is only available in html mode`),"")},close(t,e){var n,r;return this.editor.storage.markdown.options.html&&(n=(r=P2(e))===null||r===void 0?void 0:r[1])!==null&&n!==void 0?n:""}},parse:{}}}}});function P2(t){const e=t.type.schema,n=e.text(" ",[t]),i=Su(j.from(n),e).match(/^(<.*?>) (<\/.*?>)$/);return i?[i[1],i[2]]:null}function h0(t){const e=`<body>${t}</body>`;return new window.DOMParser().parseFromString(e,"text/html").body}function y9(t){return t==null?void 0:t.replace(/</g,"&lt;").replace(/>/g,"&gt;")}function x9(t){const e=t.parentElement,n=e.cloneNode();for(;e.firstChild&&e.firstChild!==t;)n.appendChild(e.firstChild);n.childNodes.length>0&&e.parentElement.insertBefore(n,e),e.parentElement.insertBefore(t,e),e.childNodes.length===0&&e.remove()}function k9(t){const e=t.parentNode;for(;t.firstChild;)e.insertBefore(t.firstChild,t);e.removeChild(t)}const Mc=Pe.create({name:"markdownHTMLNode",addStorage(){return{markdown:{serialize(t,e,n){this.editor.storage.markdown.options.html?t.write(b9(e,n)):(console.warn(`Tiptap Markdown: "${e.type.name}" node is only available in html mode`),t.write(`[${e.type.name}]`)),e.isBlock&&t.closeBlock(e)},parse:{}}}}});function b9(t,e){const n=t.type.schema,r=Su(j.from(t),n);return t.isBlock&&(e instanceof j||e.type.name===n.topNodeType.name)?v9(r):r}function v9(t){const n=h0(t).firstElementChild;return n.innerHTML=n.innerHTML.trim()?`
394
- ${n.innerHTML}
395
- `:`
396
- `,n.outerHTML}const w9=Pe.create({name:"blockquote"}),C9=w9.extend({addStorage(){return{markdown:{serialize:Kn.nodes.blockquote,parse:{}}}}}),S9=Pe.create({name:"bulletList"}),zv=S9.extend({addStorage(){return{markdown:{serialize(t,e){return t.renderList(e," ",()=>(this.editor.storage.markdown.options.bulletListMarker||"-")+" ")},parse:{}}}}}),E9=Pe.create({name:"codeBlock"}),_9=E9.extend({addStorage(){return{markdown:{serialize(t,e){t.write("```"+(e.attrs.language||"")+`
397
- `),t.text(e.textContent,!1),t.ensureNewLine(),t.write("```"),t.closeBlock(e)},parse:{setup(t){var e;t.set({langPrefix:(e=this.options.languageClassPrefix)!==null&&e!==void 0?e:"language-"})},updateDOM(t){t.innerHTML=t.innerHTML.replace(/\n<\/code><\/pre>/g,"</code></pre>")}}}}}}),T9=Pe.create({name:"hardBreak"}),jv=T9.extend({addStorage(){return{markdown:{serialize(t,e,n,r){for(let i=r+1;i<n.childCount;i++)if(n.child(i).type!=e.type){t.write(t.inTable?Mc.storage.markdown.serialize.call(this,t,e,n):`\\
398
- `);return}},parse:{}}}}}),A9=Pe.create({name:"heading"}),M9=A9.extend({addStorage(){return{markdown:{serialize:Kn.nodes.heading,parse:{}}}}}),D9=Pe.create({name:"horizontalRule"}),N9=D9.extend({addStorage(){return{markdown:{serialize:Kn.nodes.horizontal_rule,parse:{}}}}}),O9=Pe.create({name:"image"}),R9=O9.extend({addStorage(){return{markdown:{serialize:Kn.nodes.image,parse:{}}}}}),I9=Pe.create({name:"listItem"}),L9=I9.extend({addStorage(){return{markdown:{serialize:Kn.nodes.list_item,parse:{}}}}}),P9=Pe.create({name:"orderedList"});function F9(t,e,n){let r=0;for(;n-r>0&&e.child(n-r-1).type.name===t.type.name;r++);return r}const z9=P9.extend({addStorage(){return{markdown:{serialize(t,e,n,r){const i=e.attrs.start||1,s=String(i+e.childCount-1).length,u=t.repeat(" ",s+2),c=F9(e,n,r)%2?") ":". ";t.renderList(e,u,f=>{const p=String(i+f);return t.repeat(" ",s-p.length)+p+c})},parse:{}}}}}),j9=Pe.create({name:"paragraph"}),B9=j9.extend({addStorage(){return{markdown:{serialize:Kn.nodes.paragraph,parse:{}}}}});function kh(t){var e,n;return(e=t==null||(n=t.content)===null||n===void 0?void 0:n.content)!==null&&e!==void 0?e:[]}const $9=Pe.create({name:"table"}),V9=$9.extend({addStorage(){return{markdown:{serialize(t,e,n){if(!H9(e)){Mc.storage.markdown.serialize.call(this,t,e,n);return}t.inTable=!0,e.forEach((r,i,s)=>{if(t.write("| "),r.forEach((u,a,c)=>{c&&t.write(" | ");const f=u.firstChild;f.textContent.trim()&&t.renderInline(f)}),t.write(" |"),t.ensureNewLine(),!s){const u=Array.from({length:r.childCount}).map(()=>"---").join(" | ");t.write(`| ${u} |`),t.ensureNewLine()}}),t.closeBlock(e),t.inTable=!1},parse:{}}}}});function F2(t){return t.attrs.colspan>1||t.attrs.rowspan>1}function H9(t){const e=kh(t),n=e[0],r=e.slice(1);return!(kh(n).some(i=>i.type.name!=="tableHeader"||F2(i)||i.childCount>1)||r.some(i=>kh(i).some(s=>s.type.name==="tableHeader"||F2(s)||s.childCount>1)))}const U9=Pe.create({name:"taskItem"}),q9=U9.extend({addStorage(){return{markdown:{serialize(t,e){const n=e.attrs.checked?"[x]":"[ ]";t.write(`${n} `),t.renderContent(e)},parse:{updateDOM(t){[...t.querySelectorAll(".task-list-item")].forEach(e=>{const n=e.querySelector("input");e.setAttribute("data-type","taskItem"),n&&(e.setAttribute("data-checked",n.checked),n.remove())})}}}}}}),W9=Pe.create({name:"taskList"}),K9=W9.extend({addStorage(){return{markdown:{serialize:zv.storage.markdown.serialize,parse:{setup(t){t.use(a9)},updateDOM(t){[...t.querySelectorAll(".contains-task-list")].forEach(e=>{e.setAttribute("data-type","taskList")})}}}}}}),Z9=Pe.create({name:"text"}),J9=Z9.extend({addStorage(){return{markdown:{serialize(t,e){t.text(y9(e.text))},parse:{}}}}}),G9=on.create({name:"bold"}),Q9=G9.extend({addStorage(){return{markdown:{serialize:Kn.marks.strong,parse:{}}}}}),Y9=on.create({name:"code"}),X9=Y9.extend({addStorage(){return{markdown:{serialize:Kn.marks.code,parse:{}}}}}),eO=on.create({name:"italic"}),tO=eO.extend({addStorage(){return{markdown:{serialize:Kn.marks.em,parse:{}}}}}),nO=on.create({name:"link"}),rO=nO.extend({addStorage(){return{markdown:{serialize:Kn.marks.link,parse:{}}}}}),iO=on.create({name:"strike"}),sO=iO.extend({addStorage(){return{markdown:{serialize:{open:"~~",close:"~~",expelEnclosingWhitespace:!0},parse:{}}}}}),oO=[C9,zv,_9,jv,M9,N9,Mc,R9,L9,z9,B9,V9,q9,K9,J9,Q9,X9,Fv,tO,rO,sO];function uc(t){var e,n;const r=(e=t.storage)===null||e===void 0?void 0:e.markdown,i=(n=oO.find(s=>s.name===t.name))===null||n===void 0?void 0:n.storage.markdown;return r||i?{...i,...r}:null}class uO{constructor(e){oc(this,"editor",null),this.editor=e}serialize(e){const n=new g9(this.nodes,this.marks,{hardBreakNodeName:jv.name});return n.renderContent(e),n.out}get nodes(){var e;return{...Object.fromEntries(Object.keys(this.editor.schema.nodes).map(n=>[n,this.serializeNode(Mc)])),...Object.fromEntries((e=this.editor.extensionManager.extensions.filter(n=>n.type==="node"&&this.serializeNode(n)).map(n=>[n.name,this.serializeNode(n)]))!==null&&e!==void 0?e:[])}}get marks(){var e;return{...Object.fromEntries(Object.keys(this.editor.schema.marks).map(n=>[n,this.serializeMark(Fv)])),...Object.fromEntries((e=this.editor.extensionManager.extensions.filter(n=>n.type==="mark"&&this.serializeMark(n)).map(n=>[n.name,this.serializeMark(n)]))!==null&&e!==void 0?e:[])}}serializeNode(e){var n;return(n=uc(e))===null||n===void 0||(n=n.serialize)===null||n===void 0?void 0:n.bind({editor:this.editor,options:e.options})}serializeMark(e){var n;const r=(n=uc(e))===null||n===void 0?void 0:n.serialize;return r?{...r,open:typeof r.open=="function"?r.open.bind({editor:this.editor,options:e.options}):r.open,close:typeof r.close=="function"?r.close.bind({editor:this.editor,options:e.options}):r.close}:null}}class lO{constructor(e,n){oc(this,"editor",null),oc(this,"md",null);let{html:r,linkify:i,breaks:s}=n;this.editor=e,this.md=this.withPatchedRenderer(Jt({html:r,linkify:i,breaks:s}))}parse(e){let{inline:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(typeof e=="string"){this.editor.extensionManager.extensions.forEach(s=>{var u;return(u=uc(s))===null||u===void 0||(u=u.parse)===null||u===void 0||(u=u.setup)===null||u===void 0?void 0:u.call({editor:this.editor,options:s.options},this.md)});const r=this.md.render(e),i=h0(r);return this.editor.extensionManager.extensions.forEach(s=>{var u;return(u=uc(s))===null||u===void 0||(u=u.parse)===null||u===void 0||(u=u.updateDOM)===null||u===void 0?void 0:u.call({editor:this.editor,options:s.options},i)}),this.normalizeDOM(i,{inline:n,content:e}),i.innerHTML}return e}normalizeDOM(e,n){let{inline:r,content:i}=n;return this.normalizeBlocks(e),e.querySelectorAll("*").forEach(s=>{var u;((u=s.nextSibling)===null||u===void 0?void 0:u.nodeType)===Node.TEXT_NODE&&!s.closest("pre")&&(s.nextSibling.textContent=s.nextSibling.textContent.replace(/^\n/,""))}),r&&this.normalizeInline(e,i),e}normalizeBlocks(e){const r=Object.values(this.editor.schema.nodes).filter(i=>i.isBlock).map(i=>{var s;return(s=i.spec.parseDOM)===null||s===void 0?void 0:s.map(u=>u.tag)}).flat().filter(Boolean).join(",");r&&[...e.querySelectorAll(r)].forEach(i=>{i.parentElement.matches("p")&&x9(i)})}normalizeInline(e,n){var r;if((r=e.firstElementChild)!==null&&r!==void 0&&r.matches("p")){var i,s,u,a;const c=e.firstElementChild,{nextElementSibling:f}=c,p=(i=(s=n.match(/^\s+/))===null||s===void 0?void 0:s[0])!==null&&i!==void 0?i:"",m=f?"":(u=(a=n.match(/\s+$/))===null||a===void 0?void 0:a[0])!==null&&u!==void 0?u:"";if(n.match(/^\n\n/)){c.innerHTML=`${c.innerHTML}${m}`;return}k9(c),e.innerHTML=`${p}${e.innerHTML}${m}`}}withPatchedRenderer(e){const n=r=>function(){const i=r(...arguments);return i===`
399
- `?i:i[i.length-1]===`
400
- `?i.slice(0,-1):i};return e.renderer.rules.hardbreak=n(e.renderer.rules.hardbreak),e.renderer.rules.softbreak=n(e.renderer.rules.softbreak),e.renderer.rules.fence=n(e.renderer.rules.fence),e.renderer.rules.code_block=n(e.renderer.rules.code_block),e.renderer.renderToken=n(e.renderer.renderToken.bind(e.renderer)),e}}const aO=We.create({name:"markdownClipboard",addOptions(){return{transformPastedText:!1,transformCopiedText:!1}},addProseMirrorPlugins(){return[new qe({key:new dt("markdownClipboard"),props:{clipboardTextParser:(t,e,n)=>{if(n||!this.options.transformPastedText)return null;const r=this.editor.storage.markdown.parser.parse(t,{inline:!0});return dr.fromSchema(this.editor.schema).parseSlice(h0(r),{preserveWhitespace:!0,context:e})},clipboardTextSerializer:t=>this.options.transformCopiedText?this.editor.storage.markdown.serializer.serialize(t.content):null}})]}}),cO=We.create({name:"markdown",priority:50,addOptions(){return{html:!0,tightLists:!0,tightListClass:"tight",bulletListMarker:"-",linkify:!1,breaks:!1,transformPastedText:!1,transformCopiedText:!1}},addCommands(){const t=sb.Commands.config.addCommands();return{setContent:(e,n)=>r=>t.setContent(r.editor.storage.markdown.parser.parse(e),n)(r),insertContentAt:(e,n,r)=>i=>t.insertContentAt(e,i.editor.storage.markdown.parser.parse(n,{inline:!0}),r)(i)}},onBeforeCreate(){this.editor.storage.markdown={options:{...this.options},parser:new lO(this.editor,this.options),serializer:new uO(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[f9.configure({tight:this.options.tightLists,tightClass:this.options.tightListClass}),aO.configure({transformPastedText:this.options.transformPastedText,transformCopiedText:this.options.transformCopiedText})]}});function dO({value:t,onChange:e}){const n=$5({extensions:[hM,cO],content:t||"",onUpdate:({editor:r})=>{const i=r.storage;e(i.markdown.getMarkdown())},editorProps:{attributes:{class:"tiptap min-h-40 px-4 py-3 text-sm text-slate-800 outline-none"}}});return n?_.jsxs("div",{className:"overflow-hidden rounded-lg border border-slate-200 bg-white shadow-sm focus-within:border-indigo-400 focus-within:ring-2 focus-within:ring-indigo-100",children:[_.jsxs("div",{className:"flex flex-wrap items-center gap-0.5 border-b border-slate-100 bg-slate-50/60 px-2 py-1.5",children:[_.jsx(Pn,{editor:n,on:"bold",cmd:r=>r.toggleBold(),title:"Kalın",children:_.jsx(HC,{className:"h-4 w-4"})}),_.jsx(Pn,{editor:n,on:"italic",cmd:r=>r.toggleItalic(),title:"İtalik",children:_.jsx(l6,{className:"h-4 w-4"})}),_.jsx(bh,{}),_.jsx(Pn,{editor:n,on:"heading",attrs:{level:2},cmd:r=>r.toggleHeading({level:2}),title:"Başlık 2",children:_.jsx(r6,{className:"h-4 w-4"})}),_.jsx(Pn,{editor:n,on:"heading",attrs:{level:3},cmd:r=>r.toggleHeading({level:3}),title:"Başlık 3",children:_.jsx(s6,{className:"h-4 w-4"})}),_.jsx(bh,{}),_.jsx(Pn,{editor:n,on:"bulletList",cmd:r=>r.toggleBulletList(),title:"Madde listesi",children:_.jsx(ex,{className:"h-4 w-4"})}),_.jsx(Pn,{editor:n,on:"orderedList",cmd:r=>r.toggleOrderedList(),title:"Sıralı liste",children:_.jsx(f6,{className:"h-4 w-4"})}),_.jsx(Pn,{editor:n,on:"blockquote",cmd:r=>r.toggleBlockquote(),title:"Alıntı",children:_.jsx(g6,{className:"h-4 w-4"})}),_.jsx(Pn,{editor:n,on:"codeBlock",cmd:r=>r.toggleCodeBlock(),title:"Kod",children:_.jsx(JC,{className:"h-4 w-4"})}),_.jsx(bh,{}),_.jsx(Pn,{editor:n,cmd:r=>r.undo(),title:"Geri al",children:_.jsx(M6,{className:"h-4 w-4"})}),_.jsx(Pn,{editor:n,cmd:r=>r.redo(),title:"Yinele",children:_.jsx(x6,{className:"h-4 w-4"})})]}),_.jsx(bb,{editor:n})]}):null}function Pn({editor:t,on:e,attrs:n,cmd:r,title:i,children:s}){const u=e?t.isActive(e,n):!1;return _.jsx("button",{type:"button",title:i,onClick:()=>r(t.chain().focus()).run(),className:`flex h-8 w-8 items-center justify-center rounded-md transition ${u?"bg-indigo-100 text-indigo-700":"text-slate-500 hover:bg-slate-200/60"}`,children:s})}function bh(){return _.jsx("span",{className:"mx-1 h-5 w-px bg-slate-200"})}async function ai(t){if(!t.ok)throw new Error(`İstek başarısız: ${t.status}`);return t}async function z2(){return(await ai(await fetch("/api/_schema"))).json()}async function fO(t){const e=await fetch("/api/_schema",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(!e.ok){const n=await e.json().catch(()=>({}));throw new Error(n.error??`Şema kaydedilemedi: ${e.status}`)}}async function Bv(t){return(await(await ai(await fetch(`/api/${encodeURIComponent(t)}`))).json()).items}async function hO(t){return(await Bv(t)).map(e=>e.slug)}async function j2(t,e){const n=await fetch(`/api/${encodeURIComponent(t)}/${encodeURIComponent(e)}`);return n.status===404?null:(await ai(n),n.json())}async function pO(t,e,n){return(await(await ai(await fetch(`/api/${encodeURIComponent(t)}/${encodeURIComponent(e)}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(n)}))).json()).slug}async function mO(t,e){await ai(await fetch(`/api/${encodeURIComponent(t)}/${encodeURIComponent(e)}`,{method:"DELETE"}))}async function gO(t,e){return(await(await ai(await fetch("/api/_media",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({dataBase64:t,filename:e})}))).json()).path}async function yO(t){return(await ai(await fetch(`/api/_singleton/${encodeURIComponent(t)}`))).json()}async function xO(t,e){await ai(await fetch(`/api/_singleton/${encodeURIComponent(t)}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(e)}))}const $v=[{type:"text",label:"Metin",desc:"Tek satır metin",icon:T6},{type:"richtext",label:"Zengin metin",desc:"Markdown içerik",icon:XC},{type:"number",label:"Sayı",desc:"Sayısal değer",icon:t6},{type:"boolean",label:"Evet / Hayır",desc:"Doğru veya yanlış",icon:S6},{type:"date",label:"Tarih",desc:"Takvim tarihi",icon:qC},{type:"select",label:"Seçim",desc:"Sabit seçenekler listesi",icon:ex},{type:"relation",label:"İlişki",desc:"Başka koleksiyona bağla",icon:c6},{type:"image",label:"Görsel",desc:"Resim URL veya yolu",icon:X2}],Vv=Object.fromEntries($v.map(t=>[t.type,t]));function B2(t){return JSON.parse(JSON.stringify(t))}function vh(t,e){let n=1;for(;e.includes(`${t}${n}`);)n+=1;return`${t}${n}`}function fp(t,e,n){const r=e+n;if(r<0||r>=t.length)return;const[i]=t.splice(e,1);t.splice(r,0,i)}function kO({schema:t,onSaved:e}){const[n,r]=ce.useState(()=>B2(t)),[i,s]=ce.useState(!1),[u,a]=ce.useState(null),[c,f]=ce.useState(null),p=n.collections.map(b=>b.name),m=b=>r(v=>{const w=B2(v);return b(w),w}),y=b=>{c&&(m(v=>{const S=(c.kind==="collection"?v.collections:v.singletons)[c.ci];if(S)if(c.fi===null){const A=vh("alan",S.fields.map(R=>R.key));S.fields.push({key:A,label:"",type:b})}else{const A=S.fields[c.fi];if(!A)return;A.type=b,b!=="select"&&(A.options=void 0),b!=="relation"&&(A.to=void 0)}}),f(null))},x=async()=>{a(null),s(!0);try{await fO(n),e()}catch(b){a(b.message)}finally{s(!1)}};return _.jsxs("div",{className:"flex h-full flex-col",children:[_.jsxs("header",{className:"flex items-center justify-between border-b border-slate-200 bg-white px-8 py-4",children:[_.jsxs("div",{children:[_.jsx("h1",{className:"text-lg font-semibold text-slate-900",children:"Şema"}),_.jsx("p",{className:"text-sm text-slate-500",children:"Koleksiyonlarını ve alanlarını tasarla."})]}),_.jsxs("button",{type:"button",onClick:x,disabled:i,className:"inline-flex items-center gap-2 rounded-lg bg-indigo-600 px-4 py-2 text-sm font-medium text-white shadow-sm transition hover:bg-indigo-700 disabled:opacity-50",children:[_.jsx(KC,{className:"h-4 w-4"}),i?"Kaydediliyor…":"Şemayı kaydet"]})]}),_.jsxs("div",{className:"flex-1 overflow-y-auto px-8 py-6",children:[u&&_.jsx("p",{className:"mb-5 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700",children:u}),_.jsxs("div",{className:"mx-auto max-w-3xl space-y-10",children:[_.jsx($2,{title:"Koleksiyonlar",hint:"Çok kayıtlı içerik (yazılar, ürünler…)",onAdd:()=>m(b=>{const v=vh("koleksiyon",b.collections.map(w=>w.name));b.collections.push({name:v,label:"Yeni koleksiyon",path:v,fields:[]})}),children:n.collections.map((b,v)=>_.jsx(V2,{container:b,kind:"collection",collectionNames:p,onChange:w=>m(S=>w(S.collections[v])),onRemove:()=>m(w=>w.collections.splice(v,1)),onMove:w=>m(S=>fp(S.collections,v,w)),onAddField:()=>f({kind:"collection",ci:v,fi:null}),onChangeType:w=>f({kind:"collection",ci:v,fi:w})},v))}),_.jsx($2,{title:"Tekil",hint:"Tek kayıt (site ayarları, profil…)",onAdd:()=>m(b=>{const v=vh("tekil",b.singletons.map(w=>w.name));b.singletons.push({name:v,label:"Yeni tekil",path:`${v}.json`,fields:[]})}),children:n.singletons.map((b,v)=>_.jsx(V2,{container:b,kind:"singleton",collectionNames:p,onChange:w=>m(S=>w(S.singletons[v])),onRemove:()=>m(w=>w.singletons.splice(v,1)),onMove:w=>m(S=>fp(S.singletons,v,w)),onAddField:()=>f({kind:"singleton",ci:v,fi:null}),onChangeType:w=>f({kind:"singleton",ci:v,fi:w})},v))})]})]}),c&&_.jsx(vO,{onPick:y,onClose:()=>f(null)})]})}function $2({title:t,hint:e,onAdd:n,children:r}){return _.jsxs("section",{children:[_.jsxs("div",{className:"mb-3 flex items-end justify-between",children:[_.jsxs("div",{children:[_.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wide text-slate-500",children:t}),_.jsx("p",{className:"text-xs text-slate-400",children:e})]}),_.jsxs("button",{type:"button",onClick:n,className:"inline-flex items-center gap-1.5 rounded-lg border border-slate-200 bg-white px-3 py-1.5 text-sm font-medium text-slate-700 shadow-sm transition hover:border-indigo-300 hover:text-indigo-600",children:[_.jsx(gp,{className:"h-4 w-4"})," Ekle"]})]}),_.jsx("div",{className:"space-y-3",children:r})]})}function V2({container:t,kind:e,collectionNames:n,onChange:r,onRemove:i,onMove:s,onAddField:u,onChangeType:a}){const c=f=>{const p=mp(f);r(m=>{m.name=p,m.path=e==="collection"?p:`${p}.json`})};return _.jsxs("div",{className:"overflow-hidden rounded-xl border border-slate-200 bg-white shadow-sm",children:[_.jsxs("div",{className:"flex items-center gap-3 border-b border-slate-100 bg-slate-50/60 px-4 py-3",children:[_.jsx("input",{className:"flex-1 rounded-md bg-transparent px-1 py-0.5 text-base font-semibold text-slate-900 outline-none focus:bg-white focus:ring-2 focus:ring-indigo-100",value:t.label??"",placeholder:"Koleksiyon adı",onChange:f=>r(p=>{p.label=f.target.value})}),_.jsx("input",{className:"w-40 rounded-md border border-transparent px-2 py-1 font-mono text-xs text-indigo-600 outline-none hover:border-slate-200 focus:border-indigo-300 focus:bg-white",value:t.name,placeholder:"api-adi",onChange:f=>c(f.target.value)}),_.jsx(Ss,{title:"Yukarı",onClick:()=>s(-1),children:_.jsx(Y2,{className:"h-4 w-4"})}),_.jsx(Ss,{title:"Aşağı",onClick:()=>s(1),children:_.jsx(Q2,{className:"h-4 w-4"})}),_.jsx(Ss,{title:"Sil",danger:!0,onClick:i,children:_.jsx(tx,{className:"h-4 w-4"})})]}),_.jsxs("div",{className:"divide-y divide-slate-100",children:[t.fields.length===0&&_.jsx("p",{className:"px-4 py-6 text-center text-sm text-slate-400",children:"Henüz alan yok."}),t.fields.map((f,p)=>_.jsx(bO,{field:f,collectionNames:n,onChange:m=>r(y=>m(y.fields[p])),onRemove:()=>r(m=>m.fields.splice(p,1)),onMove:m=>r(y=>fp(y.fields,p,m)),onChangeType:()=>a(p)},p))]}),_.jsxs("button",{type:"button",onClick:u,className:"flex w-full items-center justify-center gap-1.5 border-t border-slate-100 px-4 py-2.5 text-sm font-medium text-indigo-600 transition hover:bg-indigo-50",children:[_.jsx(gp,{className:"h-4 w-4"})," Alan ekle"]})]})}function bO({field:t,collectionNames:e,onChange:n,onRemove:r,onMove:i,onChangeType:s}){const a=Vv[t.type].icon;return _.jsxs("div",{className:"group px-4 py-3",children:[_.jsxs("div",{className:"flex items-center gap-3",children:[_.jsx("button",{type:"button",onClick:s,title:"Tipi değiştir",className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-indigo-50 text-indigo-600 transition hover:bg-indigo-100",children:_.jsx(a,{className:"h-4 w-4"})}),_.jsx("input",{className:"flex-1 rounded-md px-1 py-0.5 text-sm font-medium text-slate-800 outline-none focus:bg-slate-50 focus:ring-2 focus:ring-indigo-100",value:t.label??"",placeholder:"Alan adı",onChange:c=>n(f=>{f.label=c.target.value})}),_.jsx("input",{className:"w-32 rounded-md border border-transparent px-2 py-1 font-mono text-xs text-slate-400 outline-none hover:border-slate-200 focus:border-indigo-300 focus:text-slate-700",value:t.key,placeholder:"anahtar",onChange:c=>n(f=>{f.key=mp(c.target.value)})}),_.jsx("button",{type:"button",onClick:()=>n(c=>{c.required=!c.required}),className:`rounded-full px-2.5 py-1 text-xs font-medium transition ${t.required?"bg-amber-100 text-amber-700":"bg-slate-100 text-slate-400 hover:text-slate-600"}`,children:"zorunlu"}),_.jsxs("div",{className:"flex items-center gap-0.5 opacity-0 transition group-hover:opacity-100",children:[_.jsx(Ss,{title:"Yukarı",onClick:()=>i(-1),children:_.jsx(Y2,{className:"h-4 w-4"})}),_.jsx(Ss,{title:"Aşağı",onClick:()=>i(1),children:_.jsx(Q2,{className:"h-4 w-4"})}),_.jsx(Ss,{title:"Sil",danger:!0,onClick:r,children:_.jsx(nx,{className:"h-4 w-4"})})]})]}),t.type==="select"&&_.jsx("input",{className:"mt-2 ml-12 block w-[calc(100%-3rem)] rounded-lg border border-slate-200 px-3 py-1.5 text-sm outline-none focus:border-indigo-400 focus:ring-2 focus:ring-indigo-100",value:(t.options??[]).join(", "),placeholder:"seçenekler (virgülle ayır)",onChange:c=>n(f=>{f.options=c.target.value.split(",").map(p=>p.trim()).filter(Boolean)})}),t.type==="relation"&&_.jsxs("select",{className:"mt-2 ml-12 block w-[calc(100%-3rem)] rounded-lg border border-slate-200 px-3 py-1.5 text-sm outline-none focus:border-indigo-400 focus:ring-2 focus:ring-indigo-100",value:t.to??"",onChange:c=>n(f=>{f.to=c.target.value}),children:[_.jsx("option",{value:"",children:"hedef koleksiyon seç…"}),e.map(c=>_.jsx("option",{value:c,children:c},c))]})]})}function vO({onPick:t,onClose:e}){return _.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-slate-900/40 p-4",onClick:e,onKeyDown:n=>n.key==="Escape"&&e(),role:"presentation",children:_.jsxs("div",{className:"w-full max-w-lg rounded-2xl bg-white p-5 shadow-xl",onClick:n=>n.stopPropagation(),onKeyDown:n=>n.stopPropagation(),role:"presentation",children:[_.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[_.jsx("h3",{className:"text-sm font-semibold text-slate-900",children:"Alan tipi seç"}),_.jsx("button",{type:"button",onClick:e,className:"flex h-7 w-7 items-center justify-center rounded-md text-slate-400 hover:bg-slate-100 hover:text-slate-700",children:_.jsx(nx,{className:"h-4 w-4"})})]}),_.jsx("div",{className:"grid grid-cols-2 gap-2.5",children:$v.map(({type:n,label:r,desc:i,icon:s})=>_.jsxs("button",{type:"button",onClick:()=>t(n),className:"flex items-start gap-3 rounded-xl border border-slate-200 p-3 text-left transition hover:border-indigo-400 hover:bg-indigo-50",children:[_.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-indigo-50 text-indigo-600",children:_.jsx(s,{className:"h-4 w-4"})}),_.jsxs("span",{children:[_.jsx("span",{className:"block text-sm font-medium text-slate-800",children:r}),_.jsx("span",{className:"block text-xs text-slate-400",children:i})]})]},n))})]})})}function Ss({children:t,title:e,danger:n,onClick:r}){return _.jsx("button",{type:"button",title:e,onClick:r,className:`flex h-8 w-8 items-center justify-center rounded-md text-slate-400 transition hover:bg-slate-100 ${n?"hover:text-red-600":"hover:text-slate-700"}`,children:t})}function wO(){const[t,e]=ce.useState(null),[n,r]=ce.useState(null),[i,s]=ce.useState(null),u=ce.useCallback(async()=>{const a=await z2();return e(a),a},[]);return ce.useEffect(()=>{z2().then(a=>{e(a),a.collections.length===0&&a.singletons.length===0&&s({kind:"schema"})}).catch(()=>r("Şema yüklenemedi. `justjson serve` çalışıyor mu?"))},[]),n?_.jsx(Kr,{children:n}):t?_.jsxs("div",{className:"flex h-full",children:[_.jsx(CO,{schema:t,selection:i,onSelect:s}),_.jsx("main",{className:"flex-1 overflow-hidden bg-slate-50",children:_.jsx(SO,{schema:t,selection:i,onSelect:s,onReload:u})})]}):_.jsx(Kr,{children:"Yükleniyor…"})}function Kr({children:t}){return _.jsx("div",{className:"flex h-full items-center justify-center text-sm text-slate-500",children:t})}function CO({schema:t,selection:e,onSelect:n}){const r=i=>e?e.kind==="collection"?e.name===i:e.kind==="entry"||e.kind==="newEntry"?e.collection===i:!1:!1;return _.jsxs("aside",{className:"flex w-60 shrink-0 flex-col border-r border-slate-200 bg-white",children:[_.jsxs("div",{className:"px-5 py-4 text-lg font-bold tracking-tight text-slate-900",children:["Just",_.jsx("span",{className:"text-indigo-600",children:"JSON"})]}),_.jsxs("nav",{className:"flex-1 space-y-0.5 overflow-y-auto px-3 pb-4",children:[_.jsx(wh,{icon:_.jsx(w6,{className:"h-4 w-4"}),active:(e==null?void 0:e.kind)==="schema",onClick:()=>n({kind:"schema"}),children:"Şema"}),t.collections.length>0&&_.jsx(H2,{children:"Koleksiyonlar"}),t.collections.map(i=>_.jsx(wh,{active:r(i.name),onClick:()=>n({kind:"collection",name:i.name}),children:i.label??i.name},i.name)),t.singletons.length>0&&_.jsx(H2,{children:"Tekil"}),t.singletons.map(i=>_.jsx(wh,{icon:_.jsx(QC,{className:"h-4 w-4"}),active:(e==null?void 0:e.kind)==="singleton"&&e.name===i.name,onClick:()=>n({kind:"singleton",name:i.name}),children:i.label??i.name},i.name))]})]})}function H2({children:t}){return _.jsx("p",{className:"px-3 pt-4 pb-1 text-xs font-semibold uppercase tracking-wide text-slate-400",children:t})}function wh({children:t,icon:e,active:n,onClick:r}){return _.jsxs("button",{type:"button",onClick:r,className:`flex w-full items-center gap-2 rounded-lg px-3 py-2 text-sm transition ${n?"bg-indigo-50 font-medium text-indigo-700":"text-slate-600 hover:bg-slate-100"}`,children:[e,_.jsx("span",{className:"truncate",children:t})]})}function SO({schema:t,selection:e,onSelect:n,onReload:r}){if(!e)return _.jsx(Kr,{children:"Soldan bir koleksiyon seç."});if(e.kind==="schema")return _.jsx(kO,{schema:t,onSaved:()=>void r()});if(e.kind==="collection"){const s=t.collections.find(u=>u.name===e.name);return s?_.jsx(_O,{collection:s,onOpen:u=>n({kind:"entry",collection:s.name,slug:u}),onNew:()=>n({kind:"newEntry",collection:s.name})}):_.jsx(Kr,{children:"Koleksiyon yok."})}if(e.kind==="entry"||e.kind==="newEntry"){const s=t.collections.find(a=>a.name===e.collection);if(!s)return _.jsx(Kr,{children:"Koleksiyon yok."});const u=e.kind==="entry"?e.slug:null;return _.jsx(TO,{collection:s,slug:u,onSaved:a=>n({kind:"entry",collection:s.name,slug:a}),onDeleted:()=>n({kind:"collection",name:s.name})},`${s.name}/${u??"new"}`)}const i=t.singletons.find(s=>s.name===e.name);return i?_.jsx(AO,{singleton:i},i.name):_.jsx(Kr,{children:"Tekil yok."})}function p0({children:t}){return _.jsx("div",{className:"mx-auto h-full max-w-3xl overflow-y-auto px-8 py-6",children:t})}function m0({title:t,crumb:e,actions:n}){return _.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[_.jsxs("h1",{className:"text-xl font-semibold text-slate-900",children:[t,e&&_.jsxs("span",{className:"ml-2 font-normal text-slate-400",children:["/ ",e]})]}),n&&_.jsx("div",{className:"flex items-center gap-2",children:n})]})}function g0({children:t,onClick:e,disabled:n}){return _.jsx("button",{type:"button",onClick:e,disabled:n,className:"inline-flex items-center gap-2 rounded-lg bg-indigo-600 px-4 py-2 text-sm font-medium text-white shadow-sm transition hover:bg-indigo-700 disabled:opacity-50",children:t})}function EO(t){return t?new Intl.DateTimeFormat("tr-TR",{day:"numeric",month:"short",year:"numeric"}).format(new Date(t)):"—"}function _O({collection:t,onOpen:e,onNew:n}){const[r,i]=ce.useState(null),[s,u]=ce.useState("");ce.useEffect(()=>{Bv(t.name).then(i)},[t.name]);const a=s.trim().toLowerCase(),c=r==null?void 0:r.filter(f=>f.title.toLowerCase().includes(a)||f.slug.includes(a));return _.jsxs(p0,{children:[_.jsx(m0,{title:t.label??t.name,actions:_.jsxs(g0,{onClick:n,children:[_.jsx(gp,{className:"h-4 w-4"})," Yeni kayıt"]})}),r&&r.length>0&&_.jsxs("div",{className:"mb-4 flex items-center gap-2 rounded-lg border border-slate-200 bg-white px-3 py-2 shadow-sm",children:[_.jsx(b6,{className:"h-4 w-4 text-slate-400"}),_.jsx("input",{className:"flex-1 bg-transparent text-sm outline-none placeholder:text-slate-400",placeholder:"Ara…",value:s,onChange:f=>u(f.target.value)}),_.jsxs("span",{className:"text-xs text-slate-400",children:[(c==null?void 0:c.length)??0," kayıt"]})]}),r===null&&_.jsx("p",{className:"text-sm text-slate-400",children:"Yükleniyor…"}),(r==null?void 0:r.length)===0&&_.jsxs("div",{className:"rounded-xl border border-dashed border-slate-300 bg-white px-6 py-14 text-center",children:[_.jsx("p",{className:"text-sm text-slate-500",children:"Henüz kayıt yok."}),_.jsx("button",{type:"button",onClick:n,className:"mt-3 text-sm font-medium text-indigo-600 hover:underline",children:"İlk kaydı oluştur →"})]}),c&&r&&r.length>0&&_.jsx("div",{className:"overflow-hidden rounded-xl border border-slate-200 bg-white shadow-sm",children:_.jsxs("table",{className:"w-full text-left text-sm",children:[_.jsx("thead",{children:_.jsxs("tr",{className:"border-b border-slate-100 text-xs uppercase tracking-wide text-slate-400",children:[_.jsx("th",{className:"px-4 py-2.5 font-medium",children:"Başlık"}),_.jsx("th",{className:"px-4 py-2.5 font-medium",children:"Slug"}),_.jsx("th",{className:"px-4 py-2.5 text-right font-medium",children:"Güncellendi"})]})}),_.jsx("tbody",{className:"divide-y divide-slate-50",children:c.map(f=>_.jsxs("tr",{tabIndex:0,onClick:()=>e(f.slug),onKeyDown:p=>p.key==="Enter"&&e(f.slug),className:"cursor-pointer transition hover:bg-indigo-50/40 focus:bg-indigo-50 focus:outline-none",children:[_.jsx("td",{className:"px-4 py-3 font-medium text-slate-800",children:f.title}),_.jsx("td",{className:"px-4 py-3 font-mono text-xs text-slate-400",children:f.slug}),_.jsx("td",{className:"px-4 py-3 text-right text-xs text-slate-400",children:EO(f.updatedAt)})]},f.slug))})]})})]})}function Hv(t){const[e,n]=ce.useState({}),[r,i]=ce.useState(!0);return ce.useEffect(()=>{let s=!0;return t().then(u=>{s&&(n(u??{}),i(!1))}),()=>{s=!1}},[]),{data:e,setData:n,loading:r}}function TO({collection:t,slug:e,onSaved:n,onDeleted:r}){const i=e===null,s=ce.useCallback(()=>i?Promise.resolve({}):j2(t.name,e),[t.name,e,i]),{data:u,setData:a,loading:c}=Hv(s),[f,p]=ce.useState(""),[m,y]=ce.useState(!1),[x,b]=ce.useState(null),v=(I,P)=>a(F=>{const z={...F};return P===""||P===void 0?delete z[I]:z[I]=P,z}),w=ce.useMemo(()=>J2(t.fields,u),[u,t.fields]),S=i?mp(f||String(u.title??"icerik")):e,A=async()=>{b(null),y(!0);try{if(i&&await j2(t.name,S)){b(`"${S}" zaten var — farklı bir slug seç.`);return}n(await pO(t.name,S,u))}finally{y(!1)}},R=async()=>{i||(await mO(t.name,e),r())};return c?_.jsx(Kr,{children:"Yükleniyor…"}):_.jsxs(p0,{children:[_.jsx(m0,{title:t.label??t.name,crumb:i?"yeni":e,actions:_.jsxs(_.Fragment,{children:[!i&&_.jsxs("button",{type:"button",onClick:R,className:"inline-flex items-center gap-1.5 rounded-lg border border-red-200 px-3 py-2 text-sm font-medium text-red-600 transition hover:bg-red-50",children:[_.jsx(tx,{className:"h-4 w-4"})," Sil"]}),_.jsx(g0,{onClick:A,disabled:m||!w.ok,children:m?"Kaydediliyor…":"Kaydet"})]})}),x&&_.jsx("p",{className:"mb-4 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700",children:x}),i&&_.jsx(qv,{label:"dosya adı (slug)",hint:S,children:_.jsx(Kv,{value:f,onChange:I=>p(I),placeholder:"otomatik"})}),_.jsx("div",{className:"space-y-5",children:t.fields.map(I=>_.jsx(Wv,{field:I,value:u[I.key],onChange:v},I.key))}),_.jsx(Uv,{result:w})]})}function AO({singleton:t}){const e=ce.useCallback(()=>yO(t.name),[t.name]),{data:n,setData:r,loading:i}=Hv(e),[s,u]=ce.useState(!1),a=(p,m)=>r(y=>{const x={...y};return m===""||m===void 0?delete x[p]:x[p]=m,x}),c=ce.useMemo(()=>J2(t.fields,n),[n,t.fields]),f=async()=>{u(!0);try{await xO(t.name,n)}finally{u(!1)}};return i?_.jsx(Kr,{children:"Yükleniyor…"}):_.jsxs(p0,{children:[_.jsx(m0,{title:t.label??t.name,actions:_.jsx(g0,{onClick:f,disabled:s||!c.ok,children:s?"Kaydediliyor…":"Kaydet"})}),_.jsx("div",{className:"space-y-5",children:t.fields.map(p=>_.jsx(Wv,{field:p,value:n[p.key],onChange:a},p.key))}),_.jsx(Uv,{result:c})]})}function Uv({result:t}){return t.issues.length===0?null:_.jsx("div",{className:"mt-6 space-y-2",children:t.issues.map(e=>_.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-slate-200 bg-white px-3 py-2 text-sm",children:[_.jsx("span",{className:"font-mono text-slate-700",children:e.key}),_.jsx("span",{className:`rounded-full px-2 py-0.5 text-xs font-medium ${e.level==="error"?"bg-red-100 text-red-600":"bg-amber-100 text-amber-700"}`,children:e.level==="error"?"hata":"uyarı"}),_.jsx("span",{className:"text-slate-500",children:e.message})]},`${e.key}-${e.message}`))})}function qv({label:t,required:e,type:n,hint:r,children:i}){var u;const s=n?(u=Vv[n])==null?void 0:u.icon:null;return _.jsxs("div",{children:[_.jsxs("div",{className:"mb-1.5 flex items-center gap-2 text-sm",children:[s&&_.jsx(s,{className:"h-3.5 w-3.5 text-slate-400"}),_.jsx("span",{className:"font-medium text-slate-700",children:t}),e&&_.jsx("span",{className:"text-red-500",children:"*"}),r&&_.jsx("span",{className:"ml-auto font-mono text-xs text-indigo-500",children:r})]}),i]})}function Wv({field:t,value:e,onChange:n}){return _.jsx(qv,{label:t.label??t.key,required:t.required,type:t.type,children:_.jsx(MO,{field:t,value:e,onChange:n})})}const aa="w-full rounded-lg border border-slate-200 bg-white px-3 py-2 text-sm text-slate-800 shadow-sm outline-none transition focus:border-indigo-400 focus:ring-2 focus:ring-indigo-100";function Kv({value:t,onChange:e,placeholder:n,type:r="text"}){return _.jsx("input",{type:r,className:aa,value:t,placeholder:n,onChange:i=>e(i.target.value)})}function MO({field:t,value:e,onChange:n}){const r=t.key;switch(t.type){case"richtext":return _.jsx(dO,{value:e??"",onChange:i=>n(r,i)});case"number":return _.jsx("input",{type:"number",className:aa,value:e===void 0?"":String(e),onChange:i=>n(r,i.target.value===""?"":Number(i.target.value))});case"boolean":return _.jsx("button",{type:"button",onClick:()=>n(r,!e),className:`relative h-6 w-11 rounded-full transition ${e?"bg-indigo-600":"bg-slate-300"}`,children:_.jsx("span",{className:`absolute top-0.5 h-5 w-5 rounded-full bg-white shadow transition ${e?"left-[22px]":"left-0.5"}`})});case"date":return _.jsx("input",{type:"date",className:aa,value:e??"",onChange:i=>n(r,i.target.value)});case"select":return _.jsxs("select",{className:aa,value:e??"",onChange:i=>n(r,i.target.value),children:[_.jsx("option",{value:"",children:"—"}),(t.options??[]).map(i=>_.jsx("option",{value:i,children:i},i))]});case"relation":return _.jsx(DO,{field:t,value:e,onChange:n});case"image":return _.jsx(OO,{value:e,onChange:i=>n(r,i)});default:return _.jsx(Kv,{value:e??"",onChange:i=>n(r,i)})}}function DO({field:t,value:e,onChange:n}){const[r,i]=ce.useState([]),s=Array.isArray(e)?e:[];ce.useEffect(()=>{t.to&&hO(t.to).then(i).catch(()=>i([]))},[t.to]);const u=a=>{const c=s.includes(a)?s.filter(f=>f!==a):[...s,a];n(t.key,c.length?c:"")};return r.length===0?_.jsxs("p",{className:"text-sm text-slate-400",children:["“",t.to,"” içinde kayıt yok."]}):_.jsx("div",{className:"flex flex-wrap gap-2",children:r.map(a=>{const c=s.includes(a);return _.jsx("button",{type:"button",onClick:()=>u(a),className:`rounded-full px-3 py-1 font-mono text-xs transition ${c?"bg-indigo-600 text-white":"border border-slate-200 bg-white text-slate-500 hover:border-indigo-300"}`,children:a},a)})})}async function NO(t,e=1600){const n=await createImageBitmap(t),r=Math.min(1,e/n.width),i=Math.round(n.width*r),s=Math.round(n.height*r),u=document.createElement("canvas");u.width=i,u.height=s;const a=u.getContext("2d");if(!a)throw new Error("canvas yok");a.drawImage(n,0,0,i,s);const c=await new Promise(m=>u.toBlob(m,"image/webp",.85));if(!c)throw new Error("dönüştürülemedi");const f=new Uint8Array(await c.arrayBuffer());let p="";for(const m of f)p+=String.fromCharCode(m);return btoa(p)}function OO({value:t,onChange:e}){const[n,r]=ce.useState(!1),i=typeof t=="string"?t:"",s=i?`/media/${i.split("/").pop()}`:null,u=async a=>{r(!0);try{e(await gO(await NO(a),a.name))}finally{r(!1)}};return _.jsxs("div",{className:"flex items-center gap-4",children:[_.jsx("div",{className:"flex h-24 w-24 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-slate-200 bg-slate-50",children:s?_.jsx("img",{src:s,alt:"",className:"h-full w-full object-cover"}):_.jsx(X2,{className:"h-6 w-6 text-slate-300"})}),_.jsxs("div",{className:"space-y-1.5",children:[_.jsxs("label",{className:"inline-flex cursor-pointer items-center gap-2 rounded-lg border border-slate-200 bg-white px-3 py-1.5 text-sm font-medium text-slate-700 shadow-sm transition hover:border-indigo-300",children:[_.jsx(N6,{className:"h-4 w-4"}),n?"Yükleniyor…":"Görsel yükle",_.jsx("input",{type:"file",accept:"image/*",hidden:!0,onChange:a=>{var f;const c=(f=a.target.files)==null?void 0:f[0];c&&u(c)}})]}),i&&_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("span",{className:"font-mono text-xs text-slate-400",children:i}),_.jsx("button",{type:"button",onClick:()=>e(""),className:"text-xs text-slate-400 hover:text-red-600",children:"kaldır"})]})]})]})}const Zv=document.getElementById("root");if(!Zv)throw new Error("root yok");Yw.createRoot(Zv).render(_.jsx(ce.StrictMode,{children:_.jsx(wO,{})}));